summaryrefslogtreecommitdiffstats
path: root/lib/libm/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Reduce libm's exports and make internal calls go direct.guenther2016-09-12161-356/+324
| | | | | | All dependencies on libc are now via reserved/standardized names. ok kettenis@ millert@ deraadt@
* Per fpclassify(3): isinff(), isnanf(), finite(), and finitef() are deprecatedguenther2016-09-126-13/+13
| | | | | | in favor of isinf(), isnan(), and isfinite(). ok tb@ martynas@
* Use fe*() routines from <fenv.h> instead of fp*() routines from <ieeefp.h>guenther2016-09-121-10/+11
| | | | ok tb@ martynas@
* Fix wrong answer if the imaginary part is zero.shadchin2015-12-183-3/+9
| | | | | | NetBSD also turn off this piece of code. ok tb@
* Fix behavior csqrt, should beshadchin2015-12-183-6/+6
| | | | | | | | | | | csqrt(conj(z)) == conj(csqrt(z)) Before csqrt(-4.0 + -0.0i) = 0.0 + 2.0j but should be csqrt(-4.0 + -0.0i) = 0.0 - 2.0j ok tb@, also discussed with daniel@
* From FreeBSD 23397:shadchin2015-11-061-7/+7
| | | | | | | | | | | | | Fixed wrong magic numbers in scaling. hypotf() was very broken for large 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 ok miod@
* Avoid left-shifting a negative integer, which is undefined. Replacenaddy2015-08-201-3/+3
| | | | | it with the intended value, in a defined way. From FreeBSD (Dimitry Andric). ok miod@ deraadt@ kettenis@
* fix a case where ceill() returns 1.0L: in the x86 extended precision formatnaddy2015-08-121-1/+1
| | | | | the fraction part has no implicit bit ok deraadt@
* Make exponents of x and y signed and fix esx and esymartynas2015-07-191-4/+5
| | | | | | | comparisons. The offending input in gfortran's round_4.f90 was nextafterl(0.10000000000000000000135525271560688L, -INFINITY) which caused an ulp addition rather than subtraction. Reported by John Marino @ DragonFlyBSD.
* Adapt previous to extended-precision, and fix single-precision constants.martynas2015-07-161-2/+2
|
* Signs of cacosh/cacoshf were not always correct (e.g., -1.1 -1.1i),martynas2015-07-162-4/+4
| | | | | | as found by fortran regression tests. Also added some complex regression tests for cacosh, casinh, catanh. Reported by John Marino @ DragonFlyBSD.
* Fix logic botch causing warnings with Clang. Reported by dhill, matchesmiod2015-01-222-12/+12
| | | | similar changes in FreeBSD a few years ago.
* Possibly uninitialized variable. From Clang via dhill.miod2015-01-221-1/+1
|
* Missing $OpenBSD$'s.krw2015-01-201-0/+1
| | | | ok deraadt@
* Switch from <sys/endian.h> or <machine/endian.h> to the new,guenther2014-07-213-8/+6
| | | | | | being-standardized <endian.h> ok deraadt@ millert@ beck@
* Extended precision floating-point numbers have an explicit integer part bit.kettenis2014-06-051-11/+10
| | | | | | | Correctly account for this bit, otherwise we'll get the wrong result for some inputs. ok martynas@, daniel@
* Make sure STRICT_ASSIGN handles double as well. From FreeBSD, where thekettenis2014-06-021-2/+2
| | | | | | | | | | commit messages that fixes this says: "it was intentionally left broken as an optimization". right! ok martynas@, daniel@
* Make floor round to integral value less than x, when x is tiny.martynas2014-02-112-6/+8
| | | | Reported by dcoppa@, thanks! OK kettenis@, dcoppa@.
* unsigned char casts for ctype macrosderaadt2013-11-221-3/+3
| | | | ok martynas
* Trick the compiler that volatile temporary is used while raisingmartynas2013-11-123-0/+12
| | | | the underflow.
* Declare __p1evll and __polevll protos in math_private.h instead ofmartynas2013-11-1210-27/+30
| | | | redeclaring each time in ld{80,128}. Pointed out by theo.
* Add parentheses around comparison in operand of ^. Pointed out by theo.martynas2013-11-122-10/+10
|
* Add explicit braces to avoid ambiguous else. Pointed out by theo.martynas2013-11-1210-18/+27
|
* tgamma(+-0) == +-Infkettenis2013-08-051-1/+3
| | | | ok martynas@
* Fix a couple of corner cases in the implementation of pow(3) to make itkettenis2013-08-023-9/+15
| | | | | | | | | | | compatible with C99. Most notably: - 1**y == 1, even if y is NaN - (-1)**+-Inf == 1 and adjust the cephes testsuite to test for the right thing here. ok martynas@
* test LDBL_MANT_DIG == DBL_MANT_DIG instead of hardcoding 53.espie2013-07-0369-171/+171
| | | | | | -> test becomes meaningful on vax No actual change, no bump okay martynas@
* Switch libc and libm to use strong aliases rather than weak aliasesmartynas2013-03-2871-107/+107
| | | | | | | | | | | where appropriate. Among other things makes the symbols consistent across all architectures (notably where ldbl mantissa is 53 bits). While at it, kill unused LINTLIBRARY/PROTOLIB1 cruft which was there to trick lint into recording the right prototypes for aliased functions. Most of the work done at the awesome n2k13 hackathon. Agreed by kettenis@, guenther@, matthew@.
* Get rid of the very ugly lint workarounds: LINTLIBRARY, PROTOLIB,martynas2013-01-1374-524/+33
| | | | and a few empty files for lint to chew on.
* Remove excessive sys/cdefs.h inclusionderaadt2012-12-0584-175/+37
| | | | ok guenther millert kettenis
* Fix ranges in the method description.martynas2012-08-191-5/+5
|
* At some point we've switched to the VFP floating-point--unlike FPAmartynas2011-07-261-3/+3
| | | | | | | | | it actually stores floats in natural-endian--therefore the existing checks became wrong. Take into account __VFP_FP__, effectively bringing back the old behavior. This way it will work now, and in the future when some of our platforms are switched to FPA, where it's much faster.
* __arm32__ -> __arm__, since our new compiler isn't defining themartynas2011-07-261-4/+4
| | | | former anymore. OK miod@.
* Make huge constants actually long, so they don't overflow and becomemartynas2011-07-252-26/+26
| | | | infinite.
* - Make constants const.martynas2011-07-2014-50/+50
| | | | | | - Fix aliasing issue in s_frexpf.c; spotted by gcc. Many other ones were fixed in NetBSD long ago, but this one was forgotten. It looks like recently they fixed it too.
* For intermediate computations use single or extended counterpartsmartynas2011-07-2016-50/+49
| | | | where appropriate, to avoid precision loss.
* Typo.martynas2011-07-191-1/+1
|
* Make the zero condition properly raise the exception and return.martynas2011-07-091-1/+2
|
* Don't reimplement the same thing twice. OK matthew@.martynas2011-07-091-30/+1
|
* Remove the stupid commented out fabs(3), frexp(3), and modf(3)martynas2011-07-083-187/+0
| | | | | entries and unused implementations. It is clear that this situation won't change.
* Revert (leaving the complex math part alone). Some stuff is dependingmartynas2011-07-082-2/+0
| | | | | on this historical behavior; so we're stuck in this stupid situation. No cookie for me.
* Finalize work on complex math routines, now that we have themartynas2011-07-0844-23/+1805
| | | | extended-precision support. Mostly from Cephes.
* Move fabs(3), frexp(3), and modf(3) to libm--nothing has been usingmartynas2011-07-082-0/+2
| | | | them in libc for a very long time. OK guenther@.
* signbitl -> signbit.martynas2011-07-082-4/+4
|
* Finalize work on the math library. It's time to do this monstermartynas2011-07-0697-45/+11067
| | | | | | | | | | | | | | | | | | commit, and deal with problems (if any) in tree. Note that this adds the following functions. Ports with hacks might need adjustments. nexttoward(3), fma(3), nexttowardf(3), fmaf(3), acoshl(3), asinhl(3), atanhl(3), coshl(3), sinhl(3), tanhl(3), expl(3), expm1l(3), logl(3), log10l(3), log1pl(3), log2l(3), modfl(3), cbrtl(3), hypotl(3), powl(3), erfl(3), erfcl(3), lgammal(3), tgammal(3), ceill(3), floorl(3), lrintl(3), llrintl(3), roundl(3), lroundl(3), llroundl(3), truncl(3), fmodl(3), remainderl(3), remquol(3), nextafterl(3), nexttowardl(3), fmal(3). With this commit, our library implements all functionality required by C99. Documentation bits will follow.
* - Take into account padding for the IEEE extended shape types. Itmartynas2011-07-041-37/+183
| | | | | | | | should be 96-bits on 32-bit architectures, and 128-bits on 64-bit architectures. - Add abstract macros to operate on long doubles by words. To be used soon.
* For tiny x, tanhf = x*(one+x). GCC (at -O2) optimized this intomartynas2011-07-021-0/+2
| | | | | x+x*x, as a result sign got lost for the zero inputs. Explicitly return in this case, similarly like has been done in tanh.
* Call the single, not double-precision version of copysign for themartynas2011-05-311-2/+2
| | | | float arguments.
* For tiny x, tanh = x*(one+x). GCC (at -O2) optimized this intomartynas2011-05-301-2/+4
| | | | | x+x*x, as a result sign got lost for the input of -0. Explicitly return negative zero in this case. Found by Cephes.
* Trick lint into recording the right prototypes in the llib-lm.lnmartynas2011-05-3018-76/+166
| | | | | | | database on platforms without extended-precision floating-point support. Seems like a reasonable approach to millert@.
* Store -1 into signgam in case of a special value of -0.martynas2011-05-282-2/+10
|