summaryrefslogtreecommitdiffstats
path: root/lib/libm/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix ilogb(3) implementation. The results have to match FP_ILOGB0 andkettenis2020-11-075-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@
* Fix declaration of S1 by swapping misplaced ',' and ';'.tb2019-10-301-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
* repair confusing "} if" indentation as suggested by deraadt@naddy2019-04-012-2/+4
|
* Remove FBSDID.kevlo2019-03-152-8/+2
| | | | ok deraadt@
* Gah, rintl() is used internally, so add a macro for the fourth possiblity,guenther2018-03-121-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@
* Make the binding of rintl, significand, and significandf consistentlyguenther2018-03-121-1/+1
| | | | | | 'weak' in the static libm.a ok deraadt@
* Fix build of sincosl on machines where long double == doubleguenther2018-03-121-1/+2
| | | | ok deraadt@
* Implement sicos(3), sincosf(3) and sincosl(3). These functions are commonkettenis2018-03-107-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@
* Nuke whitespace foolish enough to expose itself during the greatkrw2017-01-2114-28/+28
| | | | "warning:" rectification.
* Implement gcc suggestion of extra parentheses. No functional change.krw2017-01-201-2/+2
| | | | ok guenther@
* 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.