acadia-newlib/newlib/libc
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
..
argz ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
ctype Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
errno makedoc: make errors visible 2017-12-07 11:54:11 +00:00
iconv libc/iconv: find_alias was mis-computing remaining alias table length 2020-07-10 10:51:43 +02:00
include Fix warnings when building for msp430-elf 2020-09-03 12:55:32 +02:00
locale loadlocale: don't casecmp digits 2020-09-04 14:21:10 +02:00
machine arm: Fix fenv support 2020-07-29 06:58:17 +02:00
misc Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
posix Cygwin: posix_spawn: add Cygwin-specific code fixing process synchronisation 2020-08-03 12:41:44 +02:00
reent ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
search Fix warnings when building for msp430-elf 2020-09-03 12:55:32 +02:00
signal Fix newlib functions perror()/psignal() not to use writev(). 2018-07-05 15:33:49 -04:00
ssp AMD GCN Port contributed by Andrew Stubbs <ams@codesourcery.com> 2019-01-15 10:48:08 -05:00
stdio Fix warnings when building for msp430-elf 2020-09-03 12:55:32 +02:00
stdio64 Use remove-advertising-clause script to edit BSD licenses 2020-01-29 19:03:31 +01:00
stdlib Fix warnings when building for msp430-elf 2020-09-03 12:55:32 +02:00
string Locale modifier "@cjksingle" to enforce single-width CJK width. 2020-02-18 11:35:42 +01:00
sys libm: Fix 'gamma' and 'gammaf' functions. Clean up other gamma code. [v2] 2020-09-04 21:27:11 +02:00
syscalls ansification: remove _HAVE_STDC 2018-01-17 11:47:30 -06:00
time newlib: strftime: fix over-enthusiastic fix from 0283642f35 2018-08-08 23:59:34 +02:00
unix Fix comparison between two character arrays 2018-07-30 09:36:49 +02:00
xdr xdr_private.h needs sys/types.h for u_char 2018-09-06 14:10:42 +02:00
Makefile.am ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
Makefile.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
aclocal.m4 Fix up errors in regenerated files for 2.3.0 release. 2016-01-04 12:57:31 -05:00
configure Bump up newlib release to 3.3.0 2020-01-21 15:17:43 -05:00
configure.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
libc.in.xml ssp: add documentation 2017-11-29 11:25:45 -06:00
libc.texinfo ssp: add documentation 2017-11-29 11:25:45 -06:00
saber Remove matherr, and SVID and X/Open math library configurations 2019-01-23 10:46:24 +01:00
sys.tex Don't include stdio64 functions in reentrant syscalls menu when not bulding stdio64. 2015-08-03 09:54:33 +01:00