summaryrefslogtreecommitdiffstats
path: root/lib/libm/src
AgeCommit message (Collapse)AuthorFilesLines
2020-11-07Fix ilogb(3) implementation. The results have to match FP_ILOGB0 andkettenis5-85/+110
FP_ILOGBNAN which isn't the case for the amd64 and i386 assembly versions. Drop these in favour of C implementations. Als reimplement ilogbl(3) by providing separate ld80 and ld128 implementations that replace the existing implementation which may hit an infinite loop when built for quad-precision long double. ok patrick@, gkoehler@
2019-10-30Fix declaration of S1 by swapping misplaced ',' and ';'.tb1-2/+2
This is inside !(defined(__amd64__) || defined(__i386__)), while the file is only used on those two architectures. "Free commit! No strings attached! No hidden tricks!" from miod
2019-04-01repair confusing "} if" indentation as suggested by deraadt@naddy2-2/+4
2019-03-15Remove FBSDID.kevlo2-8/+2
ok deraadt@
2018-03-12Gah, rintl() is used internally, so add a macro for the fourth possiblity,guenther1-1/+1
a cloning a non-standard, long double function which _is_ used from the matching plain double function build failured pointed out by deraadt@
2018-03-12Make the binding of rintl, significand, and significandf consistentlyguenther1-1/+1
'weak' in the static libm.a ok deraadt@
2018-03-12Fix build of sincosl on machines where long double == doubleguenther1-1/+2
ok deraadt@
2018-03-10Implement sicos(3), sincosf(3) and sincosl(3). These functions are commonkettenis7-0/+539
extensions and modern compilers (such as clang) will use them to optimize separate calculations of sine and cosine. ok tom@, patrick@, deraadt@, jmc@
2017-01-21Nuke whitespace foolish enough to expose itself during the greatkrw14-28/+28
"warning:" rectification.
2017-01-20Implement gcc suggestion of extra parentheses. No functional change.krw1-2/+2
ok guenther@
2016-09-12Reduce libm's exports and make internal calls go direct.guenther161-356/+324
All dependencies on libc are now via reserved/standardized names. ok kettenis@ millert@ deraadt@
2016-09-12Per fpclassify(3): isinff(), isnanf(), finite(), and finitef() are deprecatedguenther6-13/+13
in favor of isinf(), isnan(), and isfinite(). ok tb@ martynas@
2016-09-12Use fe*() routines from <fenv.h> instead of fp*() routines from <ieeefp.h>guenther1-10/+11
ok tb@ martynas@
2015-12-18Fix wrong answer if the imaginary part is zero.shadchin3-3/+9
NetBSD also turn off this piece of code. ok tb@
2015-12-18Fix behavior csqrt, should beshadchin3-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@
2015-11-06From FreeBSD 23397:shadchin1-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@
2015-08-20Avoid left-shifting a negative integer, which is undefined. Replacenaddy1-3/+3
it with the intended value, in a defined way. From FreeBSD (Dimitry Andric). ok miod@ deraadt@ kettenis@
2015-08-12fix a case where ceill() returns 1.0L: in the x86 extended precision formatnaddy1-1/+1
the fraction part has no implicit bit ok deraadt@
2015-07-19Make exponents of x and y signed and fix esx and esymartynas1-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.
2015-07-16Adapt previous to extended-precision, and fix single-precision constants.martynas1-2/+2
2015-07-16Signs of cacosh/cacoshf were not always correct (e.g., -1.1 -1.1i),martynas2-4/+4
as found by fortran regression tests. Also added some complex regression tests for cacosh, casinh, catanh. Reported by John Marino @ DragonFlyBSD.
2015-01-22Fix logic botch causing warnings with Clang. Reported by dhill, matchesmiod2-12/+12
similar changes in FreeBSD a few years ago.
2015-01-22Possibly uninitialized variable. From Clang via dhill.miod1-1/+1
2015-01-20Missing $OpenBSD$'s.krw1-0/+1
ok deraadt@
2014-07-21Switch from <sys/endian.h> or <machine/endian.h> to the new,guenther3-8/+6
being-standardized <endian.h> ok deraadt@ millert@ beck@
2014-06-05Extended precision floating-point numbers have an explicit integer part bit.kettenis1-11/+10
Correctly account for this bit, otherwise we'll get the wrong result for some inputs. ok martynas@, daniel@
2014-06-02Make sure STRICT_ASSIGN handles double as well. From FreeBSD, where thekettenis1-2/+2
commit messages that fixes this says: "it was intentionally left broken as an optimization". right! ok martynas@, daniel@
2014-02-11Make floor round to integral value less than x, when x is tiny.martynas2-6/+8
Reported by dcoppa@, thanks! OK kettenis@, dcoppa@.
2013-11-22unsigned char casts for ctype macrosderaadt1-3/+3
ok martynas
2013-11-12Trick the compiler that volatile temporary is used while raisingmartynas3-0/+12
the underflow.
2013-11-12Declare __p1evll and __polevll protos in math_private.h instead ofmartynas10-27/+30
redeclaring each time in ld{80,128}. Pointed out by theo.
2013-11-12Add parentheses around comparison in operand of ^. Pointed out by theo.martynas2-10/+10
2013-11-12Add explicit braces to avoid ambiguous else. Pointed out by theo.martynas10-18/+27
2013-08-05tgamma(+-0) == +-Infkettenis1-1/+3
ok martynas@
2013-08-02Fix a couple of corner cases in the implementation of pow(3) to make itkettenis3-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@
2013-07-03test LDBL_MANT_DIG == DBL_MANT_DIG instead of hardcoding 53.espie69-171/+171
-> test becomes meaningful on vax No actual change, no bump okay martynas@
2013-03-28Switch libc and libm to use strong aliases rather than weak aliasesmartynas71-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@.
2013-01-13Get rid of the very ugly lint workarounds: LINTLIBRARY, PROTOLIB,martynas74-524/+33
and a few empty files for lint to chew on.
2012-12-05Remove excessive sys/cdefs.h inclusionderaadt84-175/+37
ok guenther millert kettenis
2012-08-19Fix ranges in the method description.martynas1-5/+5
2011-07-26At some point we've switched to the VFP floating-point--unlike FPAmartynas1-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.
2011-07-26__arm32__ -> __arm__, since our new compiler isn't defining themartynas1-4/+4
former anymore. OK miod@.
2011-07-25Make huge constants actually long, so they don't overflow and becomemartynas2-26/+26
infinite.
2011-07-20- Make constants const.martynas14-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.
2011-07-20For intermediate computations use single or extended counterpartsmartynas16-50/+49
where appropriate, to avoid precision loss.
2011-07-19Typo.martynas1-1/+1
2011-07-09Make the zero condition properly raise the exception and return.martynas1-1/+2
2011-07-09Don't reimplement the same thing twice. OK matthew@.martynas1-30/+1
2011-07-08Remove the stupid commented out fabs(3), frexp(3), and modf(3)martynas3-187/+0
entries and unused implementations. It is clear that this situation won't change.
2011-07-08Revert (leaving the complex math part alone). Some stuff is dependingmartynas2-2/+0
on this historical behavior; so we're stuck in this stupid situation. No cookie for me.