Changeset 900 for trunk/test/trig.cpp
 Timestamp:
 Sep 4, 2011, 2:28:56 PM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/test/trig.cpp
r899 r900 94 94 } 95 95 96 for (int i = 10000 ; i < 10000; i++)96 for (int i = 100000; i < 100000; i++) 97 97 { 98 double f = (double)i * (1.0 / 1000 .0);98 double f = (double)i * (1.0 / 10000.0); 99 99 double a = __builtin_tan(f); 100 100 double b = lol_tan(f); 101 CPPUNIT_ASSERT(fabs(a  b) <= fabs(a) * 1e11); 101 if (fabs(a) > 1e4) 102 CPPUNIT_ASSERT(fabs(a  b) <= fabs(a) * fabs(a) * 1e11); 103 else if (fabs(a) > 1.0) 104 CPPUNIT_ASSERT(fabs(a  b) <= fabs(a) * 1e11); 105 else 106 CPPUNIT_ASSERT(fabs(a  b) <= fabs(f) * 1e11); 102 107 } 103 108 … … 107 112 double a = __builtin_tan(f); 108 113 double b = lol_tan(f); 109 CPPUNIT_ASSERT(fabs(a  b) <= fabs(a) * 1e11); 114 if (fabs(a) > 1e4) 115 CPPUNIT_ASSERT(fabs(a  b) <= fabs(a) * fabs(a) * 1e11); 116 else if (fabs(a) > 1.0) 117 CPPUNIT_ASSERT(fabs(a  b) <= fabs(a) * 1e11); 118 else 119 CPPUNIT_ASSERT(fabs(a  b) <= fabs(f) * 1e11); 110 120 } 111 121 }
Note: See TracChangeset
for help on using the changeset viewer.