Description
- The Julia docs state that
airy(k,x)
returns the k'th derivative of the Airy function Ai(x). Looking at the code in math.jl, one sees thatairy(k,x)
is a utility function used to implement the four Airy functions provided by Julia. In particular:
airyai(x) = airy(0,x)
airyaiprime(x) = airy(1,x)
airybi(x) = airy(2,x)
airybiprime(x) = airy(3,x)
0, 1, 2, and 3 are the only valid values that the first argument of airy(k,x)
can take. I suggest that airy(k,x)
not be exported to the global name space and that it be removed from the documentation.
2. Depending on the value of k, airy(k,x)
calls one of the Amos collection routines ZAIRY
or ZBIRY
via a ccall
to the openlibm_extras
library using the symbol :zairy_
or :zbiry_
. Both calls specify that there are 8 arguments to the subroutines. However, the Fortran signatures of these two Amos routines read as follows:
SUBROUTINE ZAIRY(ZR, ZI, ID, KODE, AIR, AII, NZ, IERR)
SUBROUTINE ZBIRY(ZR, ZI, ID, KODE, BIR, BII, IERR)
Since ZBIRY
has only 7 arguments, it appears to me that the ccall
to :zbiry_
should be corrected to specify only 7 arguments.
I am currently working on Issue #4172, and I had planned on modifying the Airy function routines as well as the complex-argument Bessel function routines to check the underflow and error flags returned by the Amos routines. So it seems logical that I should also address the two items listed above in this issue. But before touching the code for airy(k,x)
I would like to request some help in understanding why it was globally declared and defined inside of a let block that also defines variables ai and ae, which IIUC are local to the let block. However, similarly named variables are defined and used in exactly the same way outside of this let block. Could someone ( @staticfloat,perhaps) enlighten me on the purpose of this let block, so I don't accidentally break something I don't understand?