86 – Minor loss of precision in std.math.tgamma

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 86 - Minor loss of precision in std.math.tgamma
Summary: Minor loss of precision in std.math.tgamma
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P4 minor
Assignee: Walter Bright
URL: digitalmars.com digitalmars.D.bugs:6898
Keywords:
Depends on:
Blocks:
Reported: 2006年04月04日 14:09 UTC by Don
Modified: 2014年02月15日 13:28 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2006年04月04日 14:09:49 UTC
Here's a test point where the value of gamma is known exactly.
The implementation of tgamma in dsource:mathextra:etcgamma passes this test. But when this code was put into the DMC libraries, it somehow lost some precision in the translation. About 6 bits are wrong. (Further evidence that it's easier to write correct math code in D than in C++ !)
The bug does not exist in lgamma.
----
import std.math;
const real SQRT_PI = 1.77245385090551602729816748334114518279754945612238L;
void main() {
assert(tgamma(0.5L) == SQRT_PI);
}
Comment 1 Walter Bright 2006年04月11日 01:33:10 UTC
Fixed 0.153


AltStyle によって変換されたページ (->オリジナル) /