freebsd-dev/lib/msun
Bruce Evans e95cc9b700 Fix tgamma() on some special args:
(1) tgamma(-Inf) returned +Inf and failed to raise any exception, but
    should always have raised an exception, and should behave like
    tgamma(negative integer).
(2) tgamma(negative integer) returned +Inf and raised divide-by-zero,
    but should return NaN and raise "invalid" on any IEEEish system.
(3) About half of the 2**52 negative intgers between -2**53 and -2**52
    were misclassified as non-integers by using floor(x + 0.5) to round
    to nearest, so tgamma(x) was wrong (+-0 instead of +Inf and now NaN)
    on these args.  The floor() expression is hard to use since rounding
    of (x + 0.5) may give x or x + 1, depending on |x| and the current
    rounding mode.  The fixed version uses ceil(x) to classify x before
    operating on x and ends up being more efficient since ceil(x) is
    needed anyway.
(4) On at least the problematic args in (3), tgamma() raised a spurious
    inexact.
(5) tgamma(large positive) raised divide-by-zero but should raise overflow.
(6) tgamma(+Inf) raised divide-by-zero but should not raise any exception.
(7) Raise inexact for tiny |x| in a way that has some chance of not being
    optimized away.

The fix for (5) and (6), and probably for (2), also prevents -O optimizing
away the exception.

PR:		112180 (2)
Standards:	Annex F in C99 (IEC 60559 binding) requires (1), (2) and (6).
2007-05-02 15:24:49 +00:00
..
amd64 Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
arm Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
bsdsrc Fix tgamma() on some special args: 2007-05-02 15:24:49 +00:00
i387 Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
ia64 Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
man Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
powerpc Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
sparc64 Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
src Implement modfl(). 2007-01-07 07:54:21 +00:00
Makefile Implement modfl(). 2007-01-07 07:54:21 +00:00
Symbol.map Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00