Bug [1954846] bessel_i(1/2,0) -> divide by zero error



You comment is right.

The return of infinities was introduced in April 1008. At that time it seems to
me very natural to return the known infinities and to get the correct limits.

So, if it is desired I would remove the return of infinities from the Bessel
code. Might it be possible to introduce to Maxima the correct handling of
infinities, so we can define the singularities of functions more completly?

For your example of tan(%pi/2) I obsered the following:

(%i23) sin(%pi/2);
(%o23) 1
(%i24) cos(%pi/2);
(%o24) 0
(%i25) tan(%pi/2);
(%o25) tan(%pi/2)             ; we get a noun

(%i27) sin(%pi/2),numer;
(%o27) 1.0
(%i28) cos(%pi/2),numer;
(%o28) 6.1230317691118863E-17 ; nearby zero
(%i29) tan(%pi/2),numer;
(%o29) 1.6331778728383844E+16 ; a result!

So, in calculation with tan(%pi/2) we could get problems in further calculations
too. Perhaps we could find a lot of examples which show that the singularities
of the functions are not very carefully implemented.

Dieter Kaiser

-----Urspr?ngliche Nachricht-----
Von: macrakis at gmail.com [mailto:macrakis at gmail.com] Im Auftrag von Stavros
Macrakis
Gesendet: Samstag, 5. Juli 2008 01:45
An: Dieter Kaiser
Cc: maxima at math.utexas.edu
Betreff: Re: [Maxima] Bug [1954846] bessel_i(1/2,0) -> divide by zero error

Thanks for working on the numerical evaluation of Bessel functions.

I see that you are returning "infinity" at singularities.  This is not
correct in Maxima, because (unfortunately) Maxima does not simplify
expressions involving infinity correctly.  For example,
infinity-infinity => 0 and infinity/infinity => 1.  Thus, to avoid
incorrect calculations, it is important to give an error rather than
returning a value in these cases.  This is what is done for, e.g.
tan(%pi/2). You might think that we could use IEEE infinities, but
there, too, there are problems, as the various Maxima/Lisp
combinations do not in general handle IEEE infinities correctly.

            -s