summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/e_hypotf.c
Commit message (Collapse)AuthorAgeFilesLines
* Use fabs[f]() instead of bit fiddling for setting absolute values.bde2008-03-301-2/+2
| | | | | | | | | | | This makes little difference in float precision, but in double precision gives a speedup of about 30% on amd64 (A64 CPU) and i386 (A64). This depends on fabs[f]() being inline and efficient. The bit fiddling (or any use of SET_HIGH_WORD(), which libm does too much because it was best on old 32-bit machines) always causes packing overheads and sometimes causes stalls in the packing, since it operates on only part of a variable in the double precision case. It apparently did cause stalls in a critical path here.
* Use the expression fabs(x+0.0)-fabs(y+0.0) instead ofbde2008-03-301-1/+1
| | | | | | | | fabs(x+0.0)+fabs(y+0.0) when mixing NaNs. This improves consistency of the result by making it harder for the compiler to reorder the operands. (FP addition is not necessarily commutative because the order of operands makes a difference on some machines iff the operands are both NaNs.)
* Fix a missing mask in a hi+lo decomposition. Thus bug made the extrabde2008-03-301-1/+1
| | | | | | precision in software useless, so hypotf() had some errors in the 1-2 ulp range unless there is extra precision in hardware (as happens on i386).
* Use the expression fabs(x+0.0)+fabs(y+0.0) instad of a+b (where a isbde2008-02-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | |x| or |y| and b is |y| or |x|) when mixing NaN arg(s). hypot*() had its own foot shooting for mixing NaNs -- it swaps the args so that |x| in bits is largest, but does this before quieting signaling NaNs, so on amd64 (where the result of adding NaNs depends on the order) it gets inconsistent results if setting the quiet bit makes a difference, just like a similar ia64 and i387 hardware comparison. The usual fix (see e_powf.c 1.13 for more details) of mixing using (a+0.0)+-(b+0.0) doesn't work on amd64 if the args are swapped (since the rder makes a difference with SSE). Fortunately, the original args are unchanged and don't need to be swapped when we let the hardware decide the mixing after quieting them, but we need to take their absolute value. hypotf() doesn't seem to have any real bugs masked by this non-bug. On amd64, its maximum error in 2^32 trials on amd64 is now 0.8422 ulps, and on i386 the maximum error is unchanged and about the same, except with certain CFLAGS it magically drops to 0.5 (perfect rounding). Convert to __FBSDID().
* Fix formatting, this is hard to explain, so I'll show one example.alfred2002-05-281-1/+2
| | | | | | | | | | - float ynf(int n, float x) /* wrapper ynf */ +float +ynf(int n, float x) /* wrapper ynf */ This is because the __STDC__ stuff was indented. Reviewed by: md5
* Assume __STDC__, remove non-__STDC__ code.alfred2002-05-281-5/+0
| | | | Reviewed by: md5
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Use __ieee754_sqrt() instead of sqrt() internally. Similarly for thebde1997-03-091-3/+3
| | | | | | float versions. Using sqrt() was inefficient. Obtained from: NetBSD
* Fixed wrong magic numbers in scaling. hypotf() was very broken for largebde1997-03-051-8/+8
| | | | | | | | | | and small values: hypotf(2.3819765e+38, 2.0416943e+38) was NaN instead of 3.1372484e+38 hypotf(-3.4028235e+38, 3.3886450e+38) was NaN instead of Inf hypotf(-2.8025969e-45, -2.8025969e-45) was 0 instead of 4.2038954e-45 Found by: ucbtest
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Remove trailing whitespace.rgrimes1995-05-301-3/+3
|
* J.T. Conklin's latest version of the Sun math library.jkh1994-08-191-0/+87
-- Begin comments from J.T. Conklin: The most significant improvement is the addition of "float" versions of the math functions that take float arguments, return floats, and do all operations in floating point. This doesn't help (performance) much on the i386, but they are still nice to have. The float versions were orginally done by Cygnus' Ian Taylor when fdlibm was integrated into the libm we support for embedded systems. I gave Ian a copy of my libm as a starting point since I had already fixed a lot of bugs & problems in Sun's original code. After he was done, I cleaned it up a bit and integrated the changes back into my libm. -- End comments Reviewed by: jkh Submitted by: jtc
OpenPOWER on IntegriCloud