summaryrefslogtreecommitdiffstats
path: root/lib/msun/src
Commit message (Collapse)AuthorAgeFilesLines
* On ARM EABI double precision floating point values are stored in theandrew2013-09-071-1/+1
| | | | | | endian the CPU is in, i.e. little-endian on most ARM cores. This allows ARMv4 and ARMv5 boards to boot with the ARM EABI.
* Add stub implementations of the missing C++11 math functions.theraven2013-09-061-0/+69
| | | | | | | | | | These are weak and so can be replaced by other versions in applications that choose to do so, and will give a linker warning when used so that applications that rely on the extra precision can avoid them. Note that since the C/C++ specs only guarantee that long double has precision equal to double, code that actually relies on these functions having greater precision is unportable at best and broken at worst.
* * Whitespace.kargl2013-08-281-1/+1
|
* * s_erf.c:kargl2013-08-272-99/+71
| | | | | | | | | | | | | | | | | | | | | | . Use integer literal constants instead of double literal constants. * s_erff.c: . Use integer literal constants instead of casting double literal constants to float. . Update the threshold values from those carried over from erf() to values appropriate for float. . New sets of polynomial coefficients for the rational approximations. These coefficients have little, but positive, effect on the maximum error in ULP in the four intervals, but do improve the overall speed of execution. . Remove redundant GET_FLOAT_WORD(ix,x) as hx already contained the contents that is packed into ix. . Update the mask that is used to zero-out lower-order bits in x in the intervals [1.25, 2.857143] and [2.857143, 12]. In tests on amd64, this change improves the maximum error in ULP from 6.27739 and 63.8095 to 3.16774 and 2.92095 on these intervals for erffc(). Reviewed by: bde
* Restore the longer form of the _Generic. The short form does not work in C++.theraven2013-07-291-2/+11
|
* Reenable the isnan(double) / isinf(double) declarations when targeting C89 + ↵theraven2013-07-291-0/+15
| | | | SUSv2 mode.
* Cleaner support for type qualifiers.theraven2013-07-131-11/+2
| | | | Submitted by: Pasi Parviainen
* Ensure that the _Generic() macro in math.h works with qualified types.theraven2013-07-131-17/+26
| | | | tgmath.h contains the same bugs and so should be fixed in the same way.
* Fix the build with C++ where __builtin_types_compatible_p is not allowed.theraven2013-07-121-2/+3
|
* Fix some typoes in math.h cleanup.theraven2013-07-111-3/+3
|
* Cleanups to math.h that prevent namespace conflicts with C++.theraven2013-07-111-28/+49
| | | | | Reviewed by: bde MFC after: 3 days
* Make the order of operations for lib/msun more clear.eadler2013-06-242-2/+2
| | | | | | | Tested with md5 sum of object code Reported by: swildner@DragonFlyBSD.org Submitted by: bde
* Add implementations of acoshl(), asinhl(), and atanhl(). This is adas2013-06-107-3/+275
| | | | merge of the work done by bde and myself.
* Style fixes.das2013-06-053-48/+51
| | | | Submitted by: bde
* ld80 and ld128 implementations of expm1l(). This code started lifekargl2013-06-032-1/+5
| | | | | | | | | | | | | | as a fairly faithful implementation of the algorithm found in PTP Tang, "Table-driven implementation of the Expm1 function in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 18, 211-222 (1992). Over the last 18-24 months, the code has under gone significant optimization and testing. Reviewed by: bde Obtained from: bde (most of the optimizations)
* Add logl, log2l, log10l, and log1pl.das2013-06-036-4/+316
| | | | Submitted by: bde
* I'm happy to finally commit stephen@'s implementations of cacos,das2013-05-302-0/+1031
| | | | | | | | cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@ for working on these. Submitted by: stephen@ Reviewed by: bde
* Fix some regressions caused by the switch from gcc to clang. The fixesdas2013-05-2717-22/+47
| | | | | | | | | | are workarounds for various symptoms of the problem described in clang bugs 3929, 8100, 8241, 10409, and 12958. The regression tests did their job: they failed, someone brought it up on the mailing lists, and then the issue got ignored for 6 months. Oops. There may still be some regressions for functions we don't have test coverage for yet.
* Only define isnan, isnanf, __isnan and __isnanf in libc.so, not indim2012-11-101-3/+4
| | | | | | | | | | | libc.a and libc_p.a. In addition, define isnan in libm.a and libm_p.a, but not in libm.so. This makes it possible to statically link executables using both isnan and isnanf with libc and libm. Tested by: kargl MFC after: 1 week
* Fix typo; s/ouput/outputkevlo2012-11-071-1/+1
|
* Revert r241756imp2012-10-221-62/+0
|
* Revert r241755imp2012-10-221-51/+0
|
* Document the method used to compute expf. Taken from exp, withimp2012-10-191-0/+62
| | | | changes to reflect differences in computation between the two.
* Document the methods used to compute logf. Taken and edited from theimp2012-10-191-0/+51
| | | | | double version, with adaptations for the differences between it and the float version.
* * src/math_private.h:kargl2012-09-291-5/+9
| | | | | | | | | | | | | | | . Change the API for the LD80C by removing the explicit passing of the sign bit. The sign can be determined from the last parameter of the macro. . On i386, load long double by bit manipulations to work around at least a gcc compiler issue. On non-i386 ld80 architectures, use a simple assignment. * ld80/s_expl.c: . Update the only consumer of LD80C. Submitted by: bde Approved by: das (mentor)
* * Use ENTERI() and RETURNI() to toggle the rounding precision ifkargl2012-09-223-6/+21
| | | | | | | | | necessary, so that cosl(), sinl() and tanl() work on i386 even for naive callers. Suggested by: bde Reviewed by: bde Approved by: das (mentor)
* * Make STRICT_ALIGN() work for doubles as well as for floats. Thiskargl2012-09-221-2/+2
| | | | | | | | | | | | | | | only affects i386. The double case was intentionally left broken as an optimization, but we are getting closer to supporting applications and/or kernels that change the (FreeBSD i386) default rounding precision from FP_PD to FP_PE and never change it back, and this requires the STRICT_ALIGN()s that were added to support FP_PE to actually work in all precisions. * Remove an extraneous semicolon at the end of a macro that was supposed to be function-like. Submitted by: bde Approved by: das (mentor)
* Add __always_inline to __ieee754_rem_pio2() and __ieee754_rem_pio2f(),dim2012-08-112-2/+2
| | | | | | | since some older versions of gcc refuse to inline these otherwise. Requested by: bde MFC after: 1 week
* Change a few extern inline functions in libm to static inline, sincedim2012-08-116-28/+23
| | | | | | | | | | | they need to refer to static constants, which C99 does not allow for extern inline functions. While here, change a comment in e_rem_pio2f.c to mention the correct number of bits. Reviewed by: bde MFC after: 1 week
* ieeefp.h is only needed on i386 class hardware.kargl2012-07-301-0/+2
| | | | | Submitted by: bde Approved by: das (pre-approved)
* Whitespace.kargl2012-07-301-1/+0
| | | | | Submitted by: bde Approved by: das (pre-approved)
* Replace code that toggles between 53 and 64 bits on i386kargl2012-07-261-19/+4
| | | | | | | | class hardware with the ENTERI and RETURNI macros, which are now available in math_private.h. Suggested by: bde Approved by: das (mentor)
* Compute the exponential of x for Intel 80-bit format and IEEE 128-bitkargl2012-07-233-1/+46
| | | | | | | | | | | | | format. These implementations are based on PTP Tang, "Table-driven implementation of the exponential function in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15, 144-157 (1989). PR: standards/152415 Submitted by: kargl Reviewed by: bde, das Approved by: das (mentor)
* Allow inclusion of libc++ <cmath> to work after including math.htheraven2012-05-271-43/+36
| | | | | | Submitted by: Yamaya Takashi Reviewed by: das MFC after: 1 week
* I stopped using my middle name years ago.des2012-04-251-1/+1
|
* Fix a bug in remquo{,f,l}, in which the quotient didn't always have thedas2012-04-073-5/+8
| | | | | | | | | | | | | | | correct sign when the remainder was 0. Fix a separate bug in remquo alone, in which the remainder and quotient were both off by a bit in certain cases involving subnormal remainders. The bugs affected all platforms except amd64 and i386, on which the routines are implemented in assembly. PR: 166463 Submitted by: Ilya Burylov MFC after: 2 weeks
* Fix a small nit noted by bde: exp_x should be of type float, not double.das2012-01-201-1/+1
|
* Add an implementation of fenv.h intended for platforms that lack an FPU anddas2012-01-161-0/+184
| | | | | | | use softfloat. Thanks to Ian Lepore for testing and debugging this patch. The fenv regression tests pass (at least for Ian's arm chip) with this change.
* Convert files to UTF-8 and add some copyright markers where missing.uqs2012-01-071-1/+1
|
* Expose the unimplemented libm functions in the math.h header. This allows ↵theraven2011-11-121-13/+13
| | | | | | | C++'s <cmath> to work without the compiler complaining that the C++ versions are calling implicitly-declared functions. You will still get a linker error when they are called. OpenBSD 5.0 claims to fully implement the C99 <math.h> stuff, so might be worth investigating... Reviewed by: das Approved by: dim (mentor)
* Fix a regression introduced in r226371: When the high part of x*ydas2011-10-212-6/+6
| | | | | exactly cancels with z, return the low part of x*y instead of discarding it.
* Fix a corner case: tan(large + Inf i) == NaN + NaN i.das2011-10-212-0/+10
|
* Improved handling of large x in ccosh{,f}():das2011-10-214-15/+83
| | | | | | | | | - Handle cases where exp(x) would overflow, but ccosh(x) ~= exp(x) / 2 shouldn't. - Use the ccosh(x) ~= exp(x) / 2 approximation to simplify the calculation when x is large. Similarly for csinh(). Also fixed the return value of csinh(-Inf +- 0i).
* Use __ldexp_exp() to simplify things and improve accuracy for x neardas2011-10-214-27/+10
| | | | the overflow threshold.
* The cexp() and {,c}{cos,sin}h functions all need to be able to computedas2011-10-215-32/+209
| | | | | | | | | | | exp(x) scaled down by some factor, and the challenge is doing this accurately when exp(x) would overflow. This change replaces all of the tricks we've been using with common __ldexp_exp() and __ldexp_cexp() routines that handle all the scaling. bde plans to improve on this further by moving the guts of exp() into k_exp.c and handling the scaling in a more direct manner. But the current approach is simple and adequate for now.
* Use STRICT_ASSIGN() to ensure that the compiler doesn't screw thingsdas2011-10-214-5/+13
| | | | | | up by storing x in a wider type than it's supposed to. Submitted by: bde
* Per IEEE754r, pow(1, y) is 1 even if y is NaN, and pow(-1, +-Inf) is 1.das2011-10-212-2/+8
| | | | MFC after: 2 weeks
* Add c{cos,sin,tan}{,h}{,f} functions. This is joint work withdas2011-10-176-0/+671
| | | | bde and kargl.
* Optimize the case of pure imaginary arguments. Calls like this aredas2011-10-162-2/+9
| | | | | | common, e.g., in DFT implementations. Discussed with: bde, kargl
* Move the macros GET_LDBL_EXPSIGN() and SET_LDBL_EXPSIGN() intodas2011-10-162-15/+19
| | | | math_private.h, so they can be used elsewhere in the math library.
OpenPOWER on IntegriCloud