From a067cc6b7fc7ab8a41a575642e60b8b1a96213e9 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Sat, 21 May 2016 04:28:57 +0200 Subject: [PATCH] Test program no longer needs a tolerance. Also add more tests. Tests all boundary values for all three functions, for exact values. The inexact test is no longer necessary. --- testfuncs.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/testfuncs.py b/testfuncs.py index c4bdc34..2bd8c09 100644 --- a/testfuncs.py +++ b/testfuncs.py @@ -831,8 +831,10 @@ def do_tests(): test('llCos(1000000.)', F('0x1.DF9DFAp-1')) test('llCos(1000000000.)', F('0x1.ACFF8Cp-1')) test('llCos(-1000000000.)', F('0x1.ACFF8Cp-1')) - #test('llCos(F("0x.FFFFFFp+63"))', F('-0x1.F4E122p-1')) # alas, doesn't match - test('abs(llCos(F("0x.FFFFFFp+63")) - F("-0x1.F4E122p-1")) < 0.003', True) # workaround + test('llCos(F("0x1.FFFFFEp+62"))', F('-0x1.F4E122p-1')) + test('llCos(F("-0x1.FFFFFEp+62"))', F('-0x1.F4E122p-1')) + test('llCos(F("0x1p63"))', F('0x1p63')) + test('llCos(F("-0x1p63"))', F('-0x1p63')) test('llSin(NaN)', NaN) test('llSin(Infinity)', Indet) test('llSin(-Infinity)', Indet) @@ -842,13 +844,19 @@ def do_tests(): test('llSin(1000000000.)', F('0x1.1778CAp-1')) test('llSin(-1000000000.)', F('-0x1.1778CAp-1')) test('llSin(F32(1e38))', F32(1e38)) - #test('llSin(F("0x.FFFFFFp+63"))', F('0x1.A8862Cp-3')) # alas, doesn't match - test('abs(llSin(F("0x.FFFFFFp+63")) - F("0x1.A8862Cp-3")) < 0.012', True) # workaround + test('llSin(F("0x1.FFFFFEp+62"))', F('0x1.A8862Cp-3')) + test('llSin(F("-0x1.FFFFFEp+62"))', F('-0x1.A8862Cp-3')) + test('llSin(F("0x1p63"))', F('0x1p63')) + test('llSin(F("-0x1p63"))', F('-0x1p63')) test('llTan(F32(1e38))', F32(1e38)) test('llTan(F32(4e38))', Indet) test('llTan(F32(math.pi))', F('0x1.777A5Cp-24')) test('llTan(F32(math.pi*.5))', -22877332.) test('llTan(F("0x1.921FB4p0"))', 13245402.) + test('llTan(F("0x1.FFFFFEp62"))', F('-0x1.B1F30Ep-3')) + test('llTan(F("-0x1.FFFFFEp62"))', F('0x1.B1F30Ep-3')) + test('llTan(F("0x1p63"))', F('0x1p63')) + test('llTan(F("-0x1p63"))', F('-0x1p63')) test('llAsin(2.0)', NaN) test('llAcos(2.0)', NaN) test('llAtan2(0.0, 0.0)', 0.0)