Short-circuit return on zero input in cyl_bessel_y()#71
Short-circuit return on zero input in cyl_bessel_y()#71WarrenWeckesser wants to merge 4 commits intoscipy:mainfrom
Conversation
|
Edit: Moved comment to the top. |
|
@fbourgey, if you are interested in working on a "high value" issue, you could take a look at the failures of the CI Windows job. This PR is the beginning of an investigation of some of those failures. My opening comment briefly explains what this PR is. What I found is that it appears that the code has different behaviors for a floating point input when that input is an even or odd integer. This hack attempts to handle that in a new block of code for the special case. Instead of this hack, it would be better to (a) verify that my (incomplete) understanding of the problem is close to correct, and (b) figure out why the existing implementation fails on Windows, and fix that. I hope it turns out to be a trivial fix, but I didn't dig deep enough to find it. |
|
@WarrenWeckesser, happy to investigate this. However, I do not have access to a Windows... so this is going to be difficult. |
|
@fbourgey, no problem. As you've found, there are plenty of other issues to work on in scipy & xsf. |
Over in #69, there were about 30 failures of the
cyl_bessel_y()tests in the Windows CI job. This lineappears 30 times in the log, and in each case the
zinput is 0. Apparently the culprit is somewhere in here:xsf/include/xsf/bessel.h
Lines 963 to 970 in 33768a0
In this PR, I avoid that code by handling
z=0+0jentirely in the first if-statemet where it checks forz = 0+0j. With this change, I don't see any of thosecyl_bessel_y()test failures (but there are many others, so the Windows job still fails overall).This change is not thoroughly checked, and is probably not the most elegant way to implement the calculation. I'm sure I'm duplicating functionality that should be in that code shown above, so I'm leaving this in draft status. I think this gets close to the correct behavior, so it might be useful for further investigation and debugging. Ideally the specific problem in the above code that occurs on Windows would be identified and fixed, and this PR closed without merging.