Hi, recently, I came across the following repo, which states that the accuracy of scipy's (scaled) Bessel functions is worse compared to the original Fortran implementation from Amos: https://github.com/elgar328/complex-bessel-test. This really surprised me, since I was under the impression that the implementation here is a simple translation of the original AMOS code. First, I expected this to be due to some translation error (similar to #92, #93). But I reproduced the results for scipy 1.12. Looking closer at the implementation, e.g., of BESY, I found that its missing the corrections from Amos' 1995 paper (https://dl.acm.org/doi/abs/10.1145/212066.212078). This can be seen in the docstring, where the most recent REVISION DATE is 890801 (due to the corrections from https://dl.acm.org/doi/10.1145/98267.98299) instead of 930101. There, e.g., the computation of the Bessel functions of the 2nd kind Y has been improved.
To further narrow down the changes, I tried to diff the FORTRAN code originally contained in scipy with the corrected version (can be found in https://github.com/elgar328/complex-bessel-test). However, it seems like scipy did not use the original AMOS code (published at https://dl.acm.org/doi/abs/10.1145/7921.214331). Looking further, it also isn't the version from slatec (https://www.netlib.org/slatec/src/besy.f) or the FORTRAN 90 version (toms644.zip from this page https://jblevins.org/mirror/amiller/#toms). I suppose the LICENSE of the original implementation isn't compatible to scipy? But where did the original version included in scipy come from (added in 2001 by scipy/scipy@52c64a9)? Does this code actually have a compatible license? And why doesn't it include the corrections from 1993?
Thanks in advance,
Jan
Hi, recently, I came across the following repo, which states that the accuracy of scipy's (scaled) Bessel functions is worse compared to the original Fortran implementation from Amos: https://github.com/elgar328/complex-bessel-test. This really surprised me, since I was under the impression that the implementation here is a simple translation of the original AMOS code. First, I expected this to be due to some translation error (similar to #92, #93). But I reproduced the results for scipy 1.12. Looking closer at the implementation, e.g., of
BESY, I found that its missing the corrections from Amos' 1995 paper (https://dl.acm.org/doi/abs/10.1145/212066.212078). This can be seen in the docstring, where the most recentREVISION DATEis890801(due to the corrections from https://dl.acm.org/doi/10.1145/98267.98299) instead of930101. There, e.g., the computation of the Bessel functions of the 2nd kindYhas been improved.To further narrow down the changes, I tried to diff the FORTRAN code originally contained in scipy with the corrected version (can be found in https://github.com/elgar328/complex-bessel-test). However, it seems like scipy did not use the original AMOS code (published at https://dl.acm.org/doi/abs/10.1145/7921.214331). Looking further, it also isn't the version from slatec (https://www.netlib.org/slatec/src/besy.f) or the FORTRAN 90 version (toms644.zip from this page https://jblevins.org/mirror/amiller/#toms). I suppose the LICENSE of the original implementation isn't compatible to scipy? But where did the original version included in scipy come from (added in 2001 by scipy/scipy@52c64a9)? Does this code actually have a compatible license? And why doesn't it include the corrections from 1993?
Thanks in advance,
Jan