acadia-newlib/newlib/libc/sys
Keith Packard via Newlib 1f8e5847df libm: Fix 'gamma' and 'gammaf' functions. Clean up other gamma code. [v2]
The current gamma, gamma_r, gammaf and gammaf_r functions return
|gamma(x)| instead of ln(|gamma(x)|) due to a change made back in 2002
to the __ieee754_gamma_r implementation. This patch fixes that, making
all of these functions map too their lgamma equivalents.

To fix the underlying bug, the __ieee754_gamma functions have been
changed to return gamma(x), removing the _r variants as those are no
longer necessary. Their names have been changed to __ieee754_tgamma to
avoid potential confusion from users.

Now that the __ieee754_tgamma functions return the correctly signed
value, the tgamma functions have been modified to use them.

libm.a now exposes the following gamma functions:

    ln(|gamma(x)|):

	__ieee754_lgamma_r
	__ieee754_lgammaf_r

	lgamma
	lgamma_r
	gamma
	gamma_r

	lgammaf
	lgammaf_r
	gammaf
	gammaf_r

	lgammal	(on machines where long double is double)

    gamma(x):

	__ieee754_tgamma
	__ieee754_tgammaf
	tgamma
	tgammaf
	tgammal (on machines where long double is double)

Additional aliases for any of the above functions can be added if
necessary; in particular, I'm not sure if we need to include
__ieee754_gamma*_r functions (which would return ln(|(gamma(x)|).

Signed-off-by: Keith Packard <keithp@keithp.com>

----

v2:
	Switch commit message to ASCII
2020-09-04 21:27:11 +02:00
..
a29khif Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
amdgcn Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
arm Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
d10v Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
decstation Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
epiphany Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
h8300hms Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
h8500hms Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
linux libm: Fix 'gamma' and 'gammaf' functions. Clean up other gamma code. [v2] 2020-09-04 21:27:11 +02:00
m88kbug Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
mmixware Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
netware Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
or1k Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
phoenix Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
rdos Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
rtems RTEMS: Include missing header and fix stub 2020-03-13 13:51:20 -05:00
sh Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
sparc64 Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
sun4 Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
sysmec Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
sysnec810 Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
sysnecv850 Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
sysvi386 Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
sysvnecv70 Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
tic80 Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
tirtos Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
w65 Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
z8ksim Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
Makefile.am
Makefile.in
aclocal.m4
configure Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
configure.in AMD GCN Port contributed by Andrew Stubbs <ams@codesourcery.com> 2019-01-15 10:48:08 -05:00