public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] libm: Clean up gamma functions
@ 2020-08-26 17:03 Keith Packard
  2020-08-26 17:03 ` [PATCH 1/3] libm: Fix sign value returned from __ieee754_lgamma*_r(-0) Keith Packard
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Keith Packard @ 2020-08-26 17:03 UTC (permalink / raw)
  To: newlib

This  series  cleans   up  some  API  oddities   and  inaccuracies  in
errno/exception reporting  from the  various gamma  related functions.
With this series applied, newlib now  matches the POSIX spec (and glibc)
for  tgamma/lgamma  functions. I've  left  the  'gamma' functions  BSD
compatible (tgamma instead of lgamma) to avoid changing the API.

[PATCH 1/3] libm: Fix sign value returned from __ieee754_lgamma*_r(-0)

	Following the C spec, gamma(-0) should be -INFINITY rather than
	+INFINITY, so the *signgamp value in lgamma should be -1
	rather than +1 for this case.

[PATCH 2/3] libm: Remove __ieee754_gamma_r variants

	Back in 2002, a patch changed the various gamma functions so
	that the returned abs(gamma) instead of the ln of gamma. This
	left the _r variants in place, with their extra parameter to
	return the sign of the resulting value. This doesn't make any
	sense to me and looks like it was just a mistake. I've changed
	the __ieee754_gamma functions to apply the sign value locally
	and eliminated the gamma_r versions as those are no longer useful.

[PATCH 3/3] libm: Adjust errno/exception values for gamma/lgamma

	There's a pretty detailed discussion in the commit message
	here, the short version is that tgamma and lgamma are
	specified with different errno/exception behaviour for
	one class of inputs (negative integers).


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2020-09-04 16:19 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 17:03 [PATCH 0/3] libm: Clean up gamma functions Keith Packard
2020-08-26 17:03 ` [PATCH 1/3] libm: Fix sign value returned from __ieee754_lgamma*_r(-0) Keith Packard
2020-08-26 17:03 ` [PATCH 2/3] libm: Remove __ieee754_gamma_r variants Keith Packard
2020-08-26 18:20   ` Corinna Vinschen
2020-08-26 19:10     ` Keith Packard
2020-08-27  7:24       ` Corinna Vinschen
2020-08-27 17:05         ` Keith Packard
2020-08-28  8:19           ` Corinna Vinschen
2020-08-28  8:34             ` Corinna Vinschen
2020-09-01 16:33               ` Fabian Schriever
2020-09-01 17:23                 ` Keith Packard
2020-09-02  8:03                   ` Corinna Vinschen
2020-09-02 20:37                     ` Keith Packard
2020-09-03  8:04                       ` Corinna Vinschen
2020-09-03 15:59                         ` Brian Inglis
2020-09-03 21:25                           ` Keith Packard
2020-09-03 22:09                             ` Brian Inglis
2020-09-04  0:01                               ` Keith Packard
2020-09-04  0:27                                 ` Brian Inglis
2020-09-04  1:37                                   ` Keith Packard
2020-09-04 13:03                                     ` Corinna Vinschen
2020-09-04 16:19                                       ` Keith Packard
2020-08-26 17:03 ` [PATCH 3/3] libm: Adjust errno/exception values for gamma/lgamma Keith Packard
     [not found]   ` <SN5P110MB0383012287522E8285674CAB9A550@SN5P110MB0383.NAMP110.PROD.OUTLOOK.COM>
2020-08-27 17:55     ` Fw: " C Howland
2020-08-27 19:28       ` Brian Inglis
     [not found] ` <SN5P110MB0383186ECD9B028A4B0E2ECC9A550@SN5P110MB0383.NAMP110.PROD.OUTLOOK.COM>
2020-08-27 17:43   ` Fw: [PATCH 0/3] libm: Clean up gamma functions C Howland
2020-08-27 23:59     ` Keith Packard
2020-08-28  2:03       ` Brian Inglis
2020-08-28  3:13         ` Keith Packard
2020-08-28  3:51           ` Brian Inglis
2020-08-28 17:13             ` Keith Packard
2020-08-28 18:29           ` Joseph Myers
2020-08-28 19:32             ` Keith Packard
2020-08-28 19:53               ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).