| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fix frexpl() declaration to not include the field name.
|
|
|
|
|
|
|
| |
In libm's exp2(3), avoid left-shifting a negative integer, which is
undefined. Replace it with the intended value, in a defined way.
Reviewed by: bde
|
|
|
|
|
|
|
|
| |
r275819, r276176, r278154, r278160, r278339, r279127, r279240, r279491,
r279493, r279856, r283032, r284423, r284426, r284427, r284428
Merge changes to libm from the past 9 months. This includes improvements
to the Bessel functions and adds the C99 function lgammal.
|
|
|
|
|
|
|
|
|
| |
msun: use previously ignored "in" value.
This fixes evaluation of exceptional values in scalblnl().
While here, simplify the code as suggested by Bruce Evans.
Reported by: clang static analyzer
|
|
|
|
|
|
|
|
|
|
|
| |
r268589 r268590 r268593 r268597 r269758 r270845 r270847 r270893 r270932
r270947 r271147
Merge libm work by kargl, bde and das from the past few months.
Besides optimisations and small bug fixes this includes new implementations
for C99 functions expl, coshl, sinhl, tanhl, erfl and erfcl.
Approved by: re (kib)
|
|
|
|
|
|
|
|
|
| |
Update the hard-float version of the fenv functions to use the VFP unit.
Any other floating-point unit is unsupported on ARM.
Use __fenv_static for all static inline functions.
Correctly shift the mask when masking/unmasking exceptions.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
. 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
|
| |
|
|
|
|
| |
SUSv2 mode.
|
|
|
|
| |
Submitted by: Pasi Parviainen
|
|
|
|
| |
tgmath.h contains the same bugs and so should be fixed in the same way.
|
| |
|
| |
|
|
|
|
|
| |
Reviewed by: bde
MFC after: 3 days
|
|
|
|
|
|
|
| |
Tested with md5 sum of object code
Reported by: swildner@DragonFlyBSD.org
Submitted by: bde
|
|
|
|
| |
merge of the work done by bde and myself.
|
|
|
|
| |
Submitted by: bde
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
| |
Submitted by: bde
|
|
|
|
|
|
|
|
| |
cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@
for working on these.
Submitted by: stephen@
Reviewed by: bde
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
| |
changes to reflect differences in computation between the two.
|
|
|
|
|
| |
double version, with adaptations for the differences between it and
the float version.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
. 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)
|
|
|
|
|
|
|
|
|
| |
necessary, so that cosl(), sinl() and tanl() work on i386 even
for naive callers.
Suggested by: bde
Reviewed by: bde
Approved by: das (mentor)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
| |
since some older versions of gcc refuse to inline these otherwise.
Requested by: bde
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Submitted by: bde
Approved by: das (pre-approved)
|
|
|
|
|
| |
Submitted by: bde
Approved by: das (pre-approved)
|
|
|
|
|
|
|
|
| |
class hardware with the ENTERI and RETURNI macros, which
are now available in math_private.h.
Suggested by: bde
Approved by: das (mentor)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
| |
Submitted by: Yamaya Takashi
Reviewed by: das
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
| |
exactly cancels with z, return the low part of x*y instead of
discarding it.
|
| |
|
|
|
|
|
|
|
|
|
| |
- 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).
|
|
|
|
| |
the overflow threshold.
|