--- - branch: MAIN date: Wed Nov 7 03:59:37 UTC 2018 files: - new: '1.11' old: '1.10' path: src/tests/lib/libm/t_acos.c pathrev: src/tests/lib/libm/t_acos.c@1.11 type: modified - new: '1.4' old: '1.3' path: src/tests/lib/libm/t_asin.c pathrev: src/tests/lib/libm/t_asin.c@1.4 type: modified - new: '1.4' old: '1.3' path: src/tests/lib/libm/t_cbrt.c pathrev: src/tests/lib/libm/t_cbrt.c@1.4 type: modified - new: '1.5' old: '1.4' path: src/tests/lib/libm/t_cos.c pathrev: src/tests/lib/libm/t_cos.c@1.5 type: modified - new: '1.5' old: '1.4' path: src/tests/lib/libm/t_sin.c pathrev: src/tests/lib/libm/t_sin.c@1.5 type: modified - new: '1.7' old: '1.6' path: src/tests/lib/libm/t_cosh.c pathrev: src/tests/lib/libm/t_cosh.c@1.7 type: modified - new: '1.7' old: '1.6' path: src/tests/lib/libm/t_libm.h pathrev: src/tests/lib/libm/t_libm.h@1.7 type: modified - new: '1.7' old: '1.6' path: src/tests/lib/libm/t_sinh.c pathrev: src/tests/lib/libm/t_sinh.c@1.7 type: modified - new: '1.9' old: '1.8' path: src/tests/lib/libm/t_exp.c pathrev: src/tests/lib/libm/t_exp.c@1.9 type: modified - new: '1.17' old: '1.16' path: src/tests/lib/libm/t_ldexp.c pathrev: src/tests/lib/libm/t_ldexp.c@1.17 type: modified - new: '1.14' old: '1.13' path: src/tests/lib/libm/t_log.c pathrev: src/tests/lib/libm/t_log.c@1.14 type: modified - new: '1.16' old: '1.15' path: src/tests/lib/libm/t_scalbn.c pathrev: src/tests/lib/libm/t_scalbn.c@1.16 type: modified - new: '1.8' old: '1.7' path: src/tests/lib/libm/t_sqrt.c pathrev: src/tests/lib/libm/t_sqrt.c@1.8 type: modified - new: '1.6' old: '1.5' path: src/tests/lib/libm/t_tan.c pathrev: src/tests/lib/libm/t_tan.c@1.6 type: modified id: 20181107T035937Z.6fa50a2cc57a418b6008c7eceda7fa010c4a3b35 log: | Fix up libm tests. - 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. module: src subject: 'CVS commit: src/tests/lib/libm' unixtime: '1541563177' user: riastradh