Bug 216866 - math tgammal(3) uses a poor algorithm due to clang kludge
Summary: math tgammal(3) uses a poor algorithm due to clang kludge
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Mark Murray
URL: https://reviews.freebsd.org/D33444
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-06 19:56 UTC by sgk
Modified: 2021-12-15 18:42 UTC (History)
3 users (show)

See Also:


Attachments
diff for tgamma() (25.34 KB, patch)
2021-12-13 20:56 UTC, Steve Kargl
no flags Details | Diff
description of patch1.diff (2.18 KB, text/plain)
2021-12-13 20:57 UTC, Steve Kargl
no flags Details
implementation of ld80 tgammal(x) (28.15 KB, patch)
2021-12-14 05:20 UTC, Steve Kargl
no flags Details | Diff
description for patch2.diff (584 bytes, text/plain)
2021-12-14 05:21 UTC, Steve Kargl
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description sgk 2017-02-06 19:56:30 UTC
The algorithm used by FreeBSD libm for tgammal severely reduces both
its precision and domain.  See msun/src/imprecise.c.
Comment 1 Steve Kargl freebsd_committer freebsd_triage 2021-12-13 02:43:37 UTC
Well, it's taken me a few years, but I finally have fixed
the theraven@freebsd.org's questionalble mapping of tgammal(x)
to tgamma(x) on at least Intel 80-bit long double targets.
Watch this space.  Patches will be arriving shortly.
Comment 2 Mark Murray freebsd_committer freebsd_triage 2021-12-13 09:03:05 UTC
I have an interest in tgamma(3), so I'll take this for committing. Thanks, Steve!
Comment 3 Steve Kargl freebsd_committer freebsd_triage 2021-12-13 20:56:12 UTC
Created attachment 230088 [details]
diff for tgamma()

This is the diff to tgamma(x) (the double function) that I did while reverse engineering the algorithms to write tgammal(x) (the long double function).
Comment 4 Steve Kargl freebsd_committer freebsd_triage 2021-12-13 20:57:20 UTC
Created attachment 230089 [details]
description of patch1.diff

Here's a brief list of changes.
Comment 5 Steve Kargl freebsd_committer freebsd_triage 2021-12-14 05:20:44 UTC
Created attachment 230101 [details]
implementation of ld80 tgammal(x)

This is the patch that implements ld80 tgammal(x).  It should be applied after patch1.diff.
Comment 6 Steve Kargl freebsd_committer freebsd_triage 2021-12-14 05:21:31 UTC
Created attachment 230102 [details]
description for patch2.diff

This is brief description of patch2.diff.
Comment 7 Mark Murray freebsd_committer freebsd_triage 2021-12-15 18:42:42 UTC
Patches accepted, thank you!
https://reviews.freebsd.org/D33444