Skip to content

Commit

Permalink
Merge pull request #63 from thewilsonator/master
Browse files Browse the repository at this point in the history
Fix precision for std.math
  • Loading branch information
9il authored Apr 30, 2020
2 parents fcff98d + a86543c commit a62271d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/scid/internal/calculus/integrate_qk.d
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Result!Real qk(GaussKronrod rule, Func, Real = ReturnType!Func)

Real error = abs((kronrodResult - gaussResult) * halfLength);
if (fVariance != 0 && error != 0)
error = fVariance * fmin(1, (200*error/fVariance)^^1.5);
error = fVariance * fmin(T(1.0), (200*error/fVariance)^^T(1.5));
if (absResult > Real.min_normal/(50 * Real.epsilon))
error = fmax(Real.epsilon * 50 * absResult, error);

Expand Down
2 changes: 1 addition & 1 deletion source/scid/internal/calculus/integrate_qng.d
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Result!Real qng(Func, Real = ReturnType!Func)
{
T error = estimate;
if (variance != 0 && error != 0)
error = variance * fmin(1, (200*error/variance)^^1.5);
error = variance * fmin(T(1.0), (200*error/variance)^^T(1.5));
if (absResult > T.min_normal/(50*T.epsilon))
error = fmax(error, 50*T.epsilon*absResult);
return error;
Expand Down

0 comments on commit a62271d

Please sign in to comment.