replace isComplex(x) with isComplex(result)
axkr opened this issue · 3 comments
axkr commented
Line 314 in 5ca4e14
Should the pattern
if ( isComplex(x) ) return result;
be replaced with
if ( isComplex(result) ) return result;
in the functions cosIntegral, coshIntegral, sinIntegral, sinhIntegral
?
paulmasson commented
No: result
is always complex because of the intermediate logarithms of negative numbers. For real input the imaginary part is zero and should be discarded.
axkr commented
See this case for negative numbers
paulmasson commented
My bad: cosIntegral
and coshIntegral
are both complex for negative real arguments. Fixed in cd9d18e. Let me know if you find other problematic cases, otherwise closing again.