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
..
2017-12-07 11:54:11 +00:00
2008-11-19 20:56:22 +00:00
2020-09-04 21:27:11 +02:00
2017-12-07 11:54:11 +00:00
2017-12-07 11:54:11 +00:00
2020-01-29 19:03:31 +01:00
2017-12-07 11:54:11 +00:00
2020-01-21 15:17:43 -05:00
2020-01-29 19:03:31 +01:00
2020-01-29 19:03:31 +01:00
2020-01-29 19:03:31 +01:00
2012-12-20 21:10:27 +00:00
2002-07-29 17:40:10 +00:00
2006-02-16 21:25:45 +00:00
2002-07-15 20:16:32 +00:00
2002-08-17 05:19:18 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 21:13:32 +00:00
2002-07-15 20:16:32 +00:00
2002-05-28 22:26:36 +00:00
2002-06-27 20:09:26 +00:00
2002-06-27 20:09:26 +00:00
2002-06-27 20:09:26 +00:00
2002-07-25 17:59:48 +00:00
2020-01-21 15:17:43 -05:00
2010-02-24 21:00:08 +00:00
2002-07-25 18:41:15 +00:00
2002-07-25 18:41:15 +00:00
2002-04-04 22:41:11 +00:00
2018-01-17 11:47:26 -06:00
2002-07-25 20:09:20 +00:00
2002-05-17 23:39:39 +00:00
2002-08-23 01:56:05 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-07-24 20:38:32 +00:00
2002-07-24 20:38:32 +00:00
2002-07-24 20:38:32 +00:00
2002-08-26 18:56:09 +00:00
2002-07-26 21:44:34 +00:00
2002-07-26 21:44:34 +00:00
2002-05-17 23:39:39 +00:00
2002-06-21 18:29:23 +00:00
2017-12-01 03:41:52 -06:00
2003-05-28 22:04:40 +00:00
2002-06-24 21:46:06 +00:00
2018-01-17 11:47:19 -06:00
2002-08-29 23:53:06 +00:00
2002-08-29 23:53:06 +00:00
2018-01-17 11:47:26 -06:00
2002-05-17 23:39:39 +00:00
2002-07-19 23:21:43 +00:00
2002-07-26 21:44:34 +00:00
2002-06-27 20:09:26 +00:00
2002-08-26 18:56:09 +00:00
2008-11-28 17:15:47 +00:00
2002-07-24 20:38:32 +00:00
2008-11-28 17:15:47 +00:00
2006-03-29 21:50:52 +00:00
2002-06-19 22:17:33 +00:00
2008-01-03 22:33:37 +00:00
2002-05-30 20:51:03 +00:00
2002-07-25 17:59:48 +00:00
2014-08-01 15:44:51 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-07-20 01:03:08 +00:00
2002-04-03 22:46:21 +00:00
2011-05-04 11:26:22 +00:00
2012-12-20 21:10:27 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2003-06-20 23:57:48 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2003-06-20 23:57:48 +00:00
2002-07-15 20:16:32 +00:00
2006-07-31 22:21:24 +00:00
2002-07-24 20:38:32 +00:00
2003-06-20 23:57:48 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-06-19 22:17:33 +00:00
2003-06-27 21:25:19 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-06-19 22:17:33 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2002-06-21 18:29:23 +00:00
2002-08-23 01:56:05 +00:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2002-08-26 18:56:09 +00:00
2002-08-23 01:56:05 +00:00
2002-08-23 01:56:05 +00:00
2002-07-15 20:16:32 +00:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2002-05-17 23:39:39 +00:00
2020-01-29 19:03:31 +01:00
2002-07-15 20:16:32 +00:00
2002-07-15 20:16:32 +00:00
2013-11-19 17:32:24 +00:00
2002-05-24 23:44:39 +00:00
2002-08-26 18:56:09 +00:00
2020-01-29 19:03:31 +01:00
2002-08-26 18:56:09 +00:00
2002-04-03 22:46:21 +00:00
2002-05-24 18:50:29 +00:00
2003-05-28 22:04:40 +00:00
2002-06-25 18:05:31 +00:00
2002-07-19 23:21:43 +00:00
2014-12-18 20:30:11 +00:00
2008-05-22 21:30:28 +00:00
2002-05-22 20:26:28 +00:00
2002-05-22 20:26:28 +00:00
2002-08-26 18:56:09 +00:00
2002-05-31 20:18:59 +00:00
2002-05-17 23:39:39 +00:00
2002-05-31 20:18:59 +00:00
2002-05-30 20:51:03 +00:00
2002-05-31 20:18:59 +00:00
2002-05-30 20:51:03 +00:00
2002-04-03 22:46:21 +00:00
2002-05-17 23:39:39 +00:00
2002-04-03 22:46:21 +00:00
2002-04-03 22:46:21 +00:00
2002-07-24 20:38:32 +00:00
2013-11-22 01:17:42 +00:00
2002-06-05 20:58:59 +00:00
2002-07-26 21:44:34 +00:00
2002-06-27 20:09:26 +00:00
2002-05-24 18:50:29 +00:00
2002-04-03 22:46:21 +00:00
2002-05-17 23:39:39 +00:00
2002-05-17 23:39:39 +00:00
2002-05-28 22:26:36 +00:00
2002-08-26 18:56:09 +00:00
2002-07-15 20:16:32 +00:00
2002-06-21 18:29:23 +00:00
2002-07-25 17:59:48 +00:00
2002-04-03 22:46:21 +00:00
2002-07-04 22:51:08 +00:00
2002-07-15 20:16:32 +00:00
2002-07-26 21:44:34 +00:00
2002-07-26 21:44:34 +00:00
2002-08-26 18:56:09 +00:00