summaryrefslogtreecommitdiff
path: root/tests/lib/libm
AgeCommit message (Collapse)Author
2022-08-27Add sincos{,f,l} from FreeBSDchristos
2020-08-25Only expect the fmod test case to fail when using qemu's TCG CPU emulation,gson
and not under hardware virtualization such as qemu -accel nvmm.
2020-06-25Reference PRs consistently.jruoho
2020-06-21fix build of t_cabsl from t_cabsl.cxxlukem
t_cabsl source is in t_cabsl.cxx not t_cabsl.cc - the latter is what bsd.tests.mk defaults to. This only broke after my commit of share/mk/bsd.dep.mk rev 1.85 but I don't know why it didn't cause a problem previously.
2019-05-27Print result of function we tested (sinf),maya
not of function we didn't test (sin). no need to print 17 digits for a float. from Riastradh.
2019-05-27on i386 with FLT_EVAL_METHOD=2, the computation inside cosf was done inmaya
binary80 arithmetic and never rounded to binary32 at the end, so it appeared farther from the correctly rounded result in binary32 than expected. Force binary32 using volatile float. PR lib/54232: lib/libm/t_cos:cosf_angles regression on i386 From Riastradh.
2019-04-26Add a test case for signbit.maya
(paranoia prior to a libm change)
2019-04-25Expand to cover long double somewhat.maya
The given data is for double, so use DBL_EPSILON and don't expect better results.
2019-04-25Fix typo in 'exceptions'kamil
2019-01-30Clean up terminology: modern arm CPUs do properly implement IEEE 754martin
floating point exceptions - but some (actually all currently know ones) do not implement sending traps when these exceptions are raised. Pointed out by Peter Maydell.
2019-01-23There are aarch64 Cortex cpus that do not trap on some floating pointmartin
exceptions - so apply the arm handling for aarch64 as well.
2018-11-15cbrtl_powl is xfail only if long double has more bits than double.riastradh
2018-11-10Print the input to cosf on failure too.riastradh
2018-11-07Disable x87 implementations of sin, cos, tan.riastradh
The x87 hardware uses a bad approximation to pi for argument reduction, and consequently yields bad answers for inputs near pi or pi/2. Tweak one tanf test whose doubly rounded output is a little too far from the correct answer on the doubly rounded input.
2018-11-07Fix up libm tests.riastradh
- Fix up last few digits of a lot of known-answer tests. Confirmed with GNU mpfr to 200 bits of precision and cross-checked with whatever libm Ubuntu ships with. - Test relative error, not absolute error. - Set bounds in terms of *_EPSILON, not magic numbers. *_EPSILON is twice the largest relative error of a correctly rounded operation, and equal to the largest relative error of an operation with up to 1ulp error. Most of the operations we're testing are not correctly rounded, but they ought to be no more than 1ulp away. For the few cases where that's not a priori clear (like comparing cbrt and pow(x, 1/3)), use twice *_EPSILON to allow some leeway. - Write the success condition positively as error <= eps. This comes out false if the result is a NaN, meaning failure. In contrast, if we write error > eps for the _failure_ condition, then if the result is a NaN, it will also come out false, but meaning success, which is not what we want. - Fix the trigonometric test cases near bad spots. sin(pi - d) for nonzero d is not zero; it is d + O(d^3). pi is not a floating-point number, so these results should be approximately the nonzero error of our approximation to pi. Likewise with cos(pi/2 - d) and tan(pi + d). (Yes, I know the sin _function_ is ill-conditioned near pi so you shouldn't pass approximate inputs near there, but that's separate from whether a sin _implementation_ gives an answer that is wrong by quintillions of ulps.) Since on x86 (i386 and amd64 alike) we currently use x87 hardware trigonometric instructions, which are bad, these are marked xfail on x86 for now until we switch to software implementations (coming soon to a repository near you). - Use %.8g, %.17g, %.35g to print float, double, long double in failures. This should be enough to identify the problematic outputs and/or reproduce the computation, even if long double is binary128 with 115 bits of precision. If there are any new libm test failures after this, tell me what architecture you're on and send me the atf output and I'll try to figure it out.
2018-11-07Build libm tests with -fno-builtin.riastradh
This way they test libm, not whatever the compiler does. We should _also_ have automatic integration tests for what the compiler does, as a separate thing.
2018-06-20Add test case for PR lib/50646.maya
Make sure that cabsl (aka __c99_cabsl) is usable from C++.
2018-06-14for consistency, print the statement that is true in the error case.maya
also add missing closing paren
2018-06-14Test for FE_INVALID in a way that works for powerpc too.maya
powerpc seems to return FE_INVALID | FE_VXSOFT rather than just FE_INVALID. XXX need extra careful reading of standards
2018-06-04Blindly add __TEST_FENV in the hope of fixing the vax build.maya
(So we can include fenv.h, and then not use it - we ifdef vax out for OS-portability reasons.)
2018-06-03Test and clear exception around scalbn calls.maya
Second part of PR bin/51834. ifdef out vax to avoid netbsd-specific macros.
2017-09-03Fix verb form.wiz
2017-09-03Use a global double to stop GCC from optimizing the test awaymaya
Better diagnostic messages More familiar test for 'even number'
2017-08-30Add a short case for the alpha test failuremaya
Now I see it's down to the choice of -mfp-trap-mode (n works, su/sui/u don't)
2017-08-30use PRIu64 to print uint64_t, don't print sizeofmaya
fixes build. sorry, built tested an older version for 32bit.
2017-08-30Add test case for alpha's MPFR config test failuremaya
This assert fires with -mieee, but not without it.
2017-08-21don't skip nexttoward for aarch64 and mips64christos
2017-08-20fix build (missing nexttoward on mips64 and aarch64)christos
2017-08-17Add test cases for nextafter() and nexttoward(). At the moment nohe
corner cases are tested, and the test cases are little more than a verification that the functions are present in the implementation.
2017-08-11Re-enable the test for nearbyint(), now that all ports (save vax,he
which has a separate #if section here) should have nearbyint().
2017-07-25Revert previous as it breaks at least sparc and hpcsh builds.uwe
nearbyint() is not included in libm on all platforms.
2017-07-24Add a test checking nearbyint(), using the same table as used byhe
the existing lrint() test.
2017-07-24Swap around the two last args to the check for expected fegetround(),he
so the error message makes sense.
2017-01-20use isinf instead of isinff. this doesn't introduce a functional change -maya
isinf works for float as well, and is more portable. from Ngie Cooper in PR bin/51838
2017-01-13also terminate 2 other statements properlyagc
2017-01-13terminate the statement properlyagc
2017-01-13PR/51839: Ngie Cooper: reset errno to 0 before calling scalbn*christos
2017-01-13PR/51837: Ngie Cooper: add limits.h for INT_MAXchristos
2016-12-20define __TEST_FENV in the makefile for t_fe_roundmaya
should fix vax build (it doesn't have fenv.h)
2016-12-20use labs for absolute value of longmaya
should fix arm build
2016-12-19add test for fesetround/fegetround that uses lrint (and tests it a bunch).maya
It doesn't fail on amd64.
2016-09-20print what went wrong.christos
2016-08-31Add failing test for casinhmaya
2016-08-27do the long double tests if we have long double.christos
2016-08-26forgot to protect an ilogblchristos
2016-08-25Add a failing case for t_ldexpmaya
ldexp(2.0, INT_MAX) should be HUGE_VAL, not 0
2016-08-25don't skip the entire test iteration if exp2=SKIP, only the secondmaya
application of the function this doesn't introduce new failures on amd64
2016-08-24fix test; clearing the exception does not return the old exception bitmask.christos
2016-08-24fix long doublechristos
2016-08-23portability fixeschristos