Opened 9 years ago
Closed 9 years ago
#9512 closed Bugs (fixed)
trivial bug: sign change for negative values in bessel_i1
| Reported by: | Owned by: | John Maddock | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | math |
| Version: | Boost 1.55.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
The function bessel_i1() in boost/math/special_functions/detail/bessel_i1.hpp ends with the following code:
if (x < 0) { value *= -value; // odd function } return value;
Instead of taking the square root, only the sign of value should be changed:
if (x < 0) { value *= -1; // odd function } return value;
Note:
See TracTickets
for help on using tickets.

Some investigation shows that that is dead code: negative x is handled by the caller of that function. I've removed the offending code and added an assert for x >= 0 instead. Fixed in Git develop.