New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
airy(k,x) documentation and implementation #4915
Comments
See: http://docs.julialang.org/en/latest/manual/variables-and-scoping/
|
Let's add some more tests that detect this issue. |
@ViralBShah , thanks for the pointers and explanation. I see the utility of this construction--it beats making the temporary arrays local by declaring them inside the function definition, where they would have to be allocated every time the function is executed. I'll take a stab at the modifications I outlined above and submit the initial pull request as a work-in-progress. |
Thanks @simonp0420 for spotting the zbiry issue.
|
@nolta Ah, it never occurred to me to compare to Matlab's calling convention. I'm almost done with the changes, which to date include eliminating the global function |
Yeah, probably best to leave |
Will do. Also, while I’m modifying the manual to document the new optional arguments, I’ll fix up the description of From: Mike Nolta [mailto:notifications@github.com] Yeah, probably best to leave airy(k,x) in for now. — |
Fixed by commit 870dd27 |
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:0, 1, 2, and 3 are the only valid values that the first argument of
airy(k,x)
can take. I suggest thatairy(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 routinesZAIRY
orZBIRY
via accall
to theopenlibm_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:Since
ZBIRY
has only 7 arguments, it appears to me that theccall
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?The text was updated successfully, but these errors were encountered: