Skip to content
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

BUG: Fix incorrect brackets in cephes hyperg.h #20745

Merged
merged 1 commit into from
May 19, 2024

Conversation

steppi
Copy link
Contributor

@steppi steppi commented May 19, 2024

Reference issue

This is fixes one of the warnings mentioned in #20740, but would not be sufficient to close that issue.

What does this implement/fix?

This PR fixes some incorrect bracketing in hy1f1a in scipy/special/special/cephes/hyperg.h. While translating cephes into C++, in some places I added brackets in one line if blocks which omitted them, but in this case I added the opening bracket but not the closing bracket. I've simply removed this extraneous opening bracket to bring the code to it's original state.

Additional information

The cephes implementation of hyp1f1 is not well tested because we use Boost for the hyp1f1 ufunc. The cephes hyp1f1 is only used in orthogonal_eval.pxd in the function eval_genlaguerre. I briefly tried to find a test case for eval_genlaguerre which would hit the control path without a return value, but couldn't find one. I think it's fine not to include a test case; one can compare this PR to the original cephes code.

if (asum == INFINITY || asum == -INFINITY)
/* infinity */
acanc = 0;
acanc *= 30.0; /* fudge factor, since error of asymptotic formula
* often seems this much larger than advertised */
adone:
*err = acanc;
return (asum);
}

Thanks @fancidev for bringing this to our attention in #20740

@steppi steppi requested a review from person142 as a code owner May 19, 2024 04:09
@github-actions github-actions bot added scipy.special C/C++ Items related to the internal C/C++ code base defect A clear bug or issue that prevents SciPy from being installed or used as expected labels May 19, 2024
@j-bowhay j-bowhay added this to the 1.14.0 milestone May 19, 2024
@j-bowhay j-bowhay merged commit 6352640 into scipy:main May 19, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C/C++ Items related to the internal C/C++ code base defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.special
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants