mirror of
https://github.com/boostorg/math.git
synced 2026-01-28 19:32:08 +00:00
Fix for tgamma(x) where x < 0 and denorm.
This commit is contained in:
@@ -245,7 +245,7 @@ T lgamma_imp(T z, const Policy& pol, const Lanczos& l, int* sign = 0)
|
||||
if (0 == z)
|
||||
return policies::raise_pole_error<T>(function, "Evaluation of lgamma at %1%.", z, pol);
|
||||
if (fabs(z) < 1 / tools::max_value<T>())
|
||||
result = -log(z);
|
||||
result = -log(fabs(z));
|
||||
else
|
||||
result = log(fabs(1 / z - constants::euler<T>()));
|
||||
if (z < 0)
|
||||
|
||||
Reference in New Issue
Block a user