overflow and underflow function returns



When designing possible overflow detection
prior to calling quadpack in a wrapper package,
I have the problem that bessel functions don't
have the same overflow return as core math
functions like exp.
------------------------------------

(%i1) float(exp(700));
(%o1)                       1.0142320547350045E+304

(%i2) float(exp(800));
(%o2)                       1..#INF00e+000E+2289560


(%i3) float(bessel_j(1,%i*700));
(%o3)                     1.5285003902339006E+302 %i

(%i4) float(bessel_j(1,%i*800));
zbesj ierr = 2
(%o4)                                 0.0
--------------------------------------------------
I can try trapping normal function overflow by
looking for the typical 1..#INF  start of the return
result, but if I look at bessel function overflow
having 0.0 return, this won't work for *underflow*
returns from exp (for example) which normally
can be ignored.
--------------------------------

(%i5) float(exp(-700));
(%o5)                       9.8596765437597708E-305

(%i6) float(exp(-800));
(%o6)                                 0.0
--------------------------------------------------
My problem is that overflow checks need to work
for an arbitrary integrand, with or without bessel
functions.


Ted Woollett