Skip to content

Commit ff91276

Browse files
committed
igamma_inv query on double_fp_backend
1 parent c5d3666 commit ff91276

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/boost/math/special_functions/detail/igamma_inverse.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ struct gamma_p_inverse_func
390390
f2 = -f2;
391391
}
392392

393-
return boost::math::make_tuple(static_cast<T>(f - p), f1, f2);
393+
const T rela_diff_or_diff { (fabs(1 - p / f) <= 4 * tools::epsilon<T>()) ? T { 0 } : static_cast<T>(f - p) };
394+
395+
return boost::math::make_tuple(rela_diff_or_diff, f1, f2);
394396
}
395397
private:
396398
T a, p;

0 commit comments

Comments
 (0)