From f7aa31b41faee25823bb38b7ca53b104cf53debd Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 11 Mar 2016 10:25:06 -0500 Subject: [PATCH] Remove over-specified tests Except for a small set of expected input/output pairs, both ES5 and ES2015 define the expected return value of these methods in terms of an "implementation-dependent approximation." This makes it inappropriate to enforce expectations for specific values, even if expressed imprecisely. --- test/built-ins/Math/E/S15.8.1.1_A1.js | 16 -- test/built-ins/Math/LN10/S15.8.1.2_A1.js | 16 -- test/built-ins/Math/LN2/S15.8.1.3_A1.js | 16 -- test/built-ins/Math/LOG10E/S15.8.1.5_A1.js | 16 -- test/built-ins/Math/LOG2E/S15.8.1.4_A1.js | 16 -- test/built-ins/Math/PI/S15.8.1.6_A1.js | 16 -- test/built-ins/Math/SQRT1_2/S15.8.1.7_A1.js | 16 -- test/built-ins/Math/SQRT2/S15.8.1.8_A1.js | 16 -- test/built-ins/Math/acos/S15.8.2.2_A5.js | 166 ------------- test/built-ins/Math/asin/S15.8.2.3_A6.js | 165 ------------- test/built-ins/Math/atan/S15.8.2.4_A6.js | 165 ------------- test/built-ins/Math/atan2/S15.8.2.5_A10.js | 20 -- test/built-ins/Math/atan2/S15.8.2.5_A11.js | 28 --- test/built-ins/Math/atan2/S15.8.2.5_A12.js | 30 --- test/built-ins/Math/atan2/S15.8.2.5_A13.js | 30 --- test/built-ins/Math/atan2/S15.8.2.5_A15.js | 29 --- test/built-ins/Math/atan2/S15.8.2.5_A17.js | 29 --- test/built-ins/Math/atan2/S15.8.2.5_A18.js | 33 --- test/built-ins/Math/atan2/S15.8.2.5_A19.js | 34 --- test/built-ins/Math/atan2/S15.8.2.5_A2.js | 30 --- test/built-ins/Math/atan2/S15.8.2.5_A20.js | 23 -- test/built-ins/Math/atan2/S15.8.2.5_A21.js | 23 -- test/built-ins/Math/atan2/S15.8.2.5_A22.js | 23 -- test/built-ins/Math/atan2/S15.8.2.5_A23.js | 23 -- test/built-ins/Math/atan2/S15.8.2.5_A24.js | 231 ------------------ test/built-ins/Math/atan2/S15.8.2.5_A3.js | 30 --- test/built-ins/Math/atan2/S15.8.2.5_A6.js | 22 -- test/built-ins/Math/atan2/S15.8.2.5_A7.js | 30 --- test/built-ins/Math/cos/S15.8.2.7_A6.js | 47 ---- test/built-ins/Math/cos/S15.8.2.7_A7.js | 162 ------------ test/built-ins/Math/exp/S15.8.2.8_A6.js | 164 ------------- .../Math/hypot/Math.hypot_Success.js | 10 - test/built-ins/Math/log/S15.8.2.10_A6.js | 163 ------------ .../Math/pow/applying-the-exp-operator_A24.js | 227 ----------------- test/built-ins/Math/sin/S15.8.2.16_A6.js | 47 ---- test/built-ins/Math/sin/S15.8.2.16_A7.js | 165 ------------- test/built-ins/Math/sqrt/S15.8.2.17_A6.js | 163 ------------ test/built-ins/Math/tan/S15.8.2.18_A6.js | 47 ---- test/built-ins/Math/tan/S15.8.2.18_A7.js | 167 ------------- .../Number/MAX_VALUE/S15.7.3.2_A1.js | 16 -- test/built-ins/Number/S9.3_A4.1_T1.js | 10 - .../expressions/addition/S9.3_A4.1_T2.js | 10 - .../applying-the-exp-operator_A24.js | 225 ----------------- 43 files changed, 2915 deletions(-) delete mode 100644 test/built-ins/Math/E/S15.8.1.1_A1.js delete mode 100644 test/built-ins/Math/LN10/S15.8.1.2_A1.js delete mode 100644 test/built-ins/Math/LN2/S15.8.1.3_A1.js delete mode 100644 test/built-ins/Math/LOG10E/S15.8.1.5_A1.js delete mode 100644 test/built-ins/Math/LOG2E/S15.8.1.4_A1.js delete mode 100644 test/built-ins/Math/PI/S15.8.1.6_A1.js delete mode 100644 test/built-ins/Math/SQRT1_2/S15.8.1.7_A1.js delete mode 100644 test/built-ins/Math/SQRT2/S15.8.1.8_A1.js delete mode 100644 test/built-ins/Math/acos/S15.8.2.2_A5.js delete mode 100644 test/built-ins/Math/asin/S15.8.2.3_A6.js delete mode 100644 test/built-ins/Math/atan/S15.8.2.4_A6.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A10.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A11.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A12.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A13.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A15.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A17.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A18.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A19.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A2.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A20.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A21.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A22.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A23.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A24.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A3.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A6.js delete mode 100644 test/built-ins/Math/atan2/S15.8.2.5_A7.js delete mode 100644 test/built-ins/Math/cos/S15.8.2.7_A6.js delete mode 100644 test/built-ins/Math/cos/S15.8.2.7_A7.js delete mode 100644 test/built-ins/Math/exp/S15.8.2.8_A6.js delete mode 100644 test/built-ins/Math/hypot/Math.hypot_Success.js delete mode 100644 test/built-ins/Math/log/S15.8.2.10_A6.js delete mode 100644 test/built-ins/Math/pow/applying-the-exp-operator_A24.js delete mode 100644 test/built-ins/Math/sin/S15.8.2.16_A6.js delete mode 100644 test/built-ins/Math/sin/S15.8.2.16_A7.js delete mode 100644 test/built-ins/Math/sqrt/S15.8.2.17_A6.js delete mode 100644 test/built-ins/Math/tan/S15.8.2.18_A6.js delete mode 100644 test/built-ins/Math/tan/S15.8.2.18_A7.js delete mode 100644 test/built-ins/Number/MAX_VALUE/S15.7.3.2_A1.js delete mode 100644 test/language/expressions/exponentiation/applying-the-exp-operator_A24.js diff --git a/test/built-ins/Math/E/S15.8.1.1_A1.js b/test/built-ins/Math/E/S15.8.1.1_A1.js deleted file mode 100644 index 319e78a130..0000000000 --- a/test/built-ins/Math/E/S15.8.1.1_A1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Math.E is approximately 2.7182818284590452354 -es5id: 15.8.1.1_A1 -description: Comparing Math.E with 2.7182818284590452354 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -if (!isEqual(Math.E, 2.7182818284590452354)) { - $ERROR('#1: \'Math.E is not approximately equal to 2.7182818284590452354\''); -} diff --git a/test/built-ins/Math/LN10/S15.8.1.2_A1.js b/test/built-ins/Math/LN10/S15.8.1.2_A1.js deleted file mode 100644 index a9cafbb304..0000000000 --- a/test/built-ins/Math/LN10/S15.8.1.2_A1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Math.LN10 is approximately 2.302585092994046 -es5id: 15.8.1.2_A1 -description: Comparing Math.LN10 with 2.302585092994046 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -if (!isEqual(Math.LN10, 2.302585092994046)) { - $ERROR('#1: \'Math.LN10 is not approximately equal to 2.302585092994046\''); -} diff --git a/test/built-ins/Math/LN2/S15.8.1.3_A1.js b/test/built-ins/Math/LN2/S15.8.1.3_A1.js deleted file mode 100644 index 2f491085ef..0000000000 --- a/test/built-ins/Math/LN2/S15.8.1.3_A1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Math.LN2 is approximately 0.6931471805599453 -es5id: 15.8.1.3_A1 -description: Comparing Math.LN2 with 0.6931471805599453 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -if (!isEqual(Math.LN2, 0.6931471805599453)) { - $ERROR('#1: \'Math.LN2 is not approximately equal to 0.6931471805599453\''); -} diff --git a/test/built-ins/Math/LOG10E/S15.8.1.5_A1.js b/test/built-ins/Math/LOG10E/S15.8.1.5_A1.js deleted file mode 100644 index 81b4d6aea8..0000000000 --- a/test/built-ins/Math/LOG10E/S15.8.1.5_A1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Math.LOG10E is approximately 0.4342944819032518 -es5id: 15.8.1.5_A1 -description: Comparing Math.LOG10E with 0.4342944819032518 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -if (!isEqual(Math.LOG10E, 0.4342944819032518)) { - $ERROR('#1: \'Math.LOG10E is not approximatley equal to 0.4342944819032518\''); -} diff --git a/test/built-ins/Math/LOG2E/S15.8.1.4_A1.js b/test/built-ins/Math/LOG2E/S15.8.1.4_A1.js deleted file mode 100644 index 0e2998bdec..0000000000 --- a/test/built-ins/Math/LOG2E/S15.8.1.4_A1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Math.LOG2E is approximately 1.4426950408889634 -es5id: 15.8.1.4_A1 -description: Comparing Math.LOG2E with 1.4426950408889634 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -if (!isEqual(Math.LOG2E, 1.4426950408889634)) { - $ERROR('#1: \'Math.LOG2E is not approximatley equal to 1.4426950408889634\''); -} diff --git a/test/built-ins/Math/PI/S15.8.1.6_A1.js b/test/built-ins/Math/PI/S15.8.1.6_A1.js deleted file mode 100644 index 6ded61a2ae..0000000000 --- a/test/built-ins/Math/PI/S15.8.1.6_A1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Math.PI is approximately 3.1415926535897932 -es5id: 15.8.1.6_A1 -description: Comparing Math.PI with 3.1415926535897932 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -if (!isEqual(Math.PI, 3.1415926535897932)) { - $ERROR('#1: \'Math.PI is not approximatley equal to 3.1415926535897932\''); -} diff --git a/test/built-ins/Math/SQRT1_2/S15.8.1.7_A1.js b/test/built-ins/Math/SQRT1_2/S15.8.1.7_A1.js deleted file mode 100644 index b6879572dd..0000000000 --- a/test/built-ins/Math/SQRT1_2/S15.8.1.7_A1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Math.SQRT1_2 is approximately 0.7071067811865476 -es5id: 15.8.1.7_A1 -description: Comparing Math.SQRT1_2 with 0.7071067811865476 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -if (!isEqual(Math.SQRT1_2, 0.7071067811865476)) { - $ERROR('#1: \'Math.SQRT1_2 is not approximatley equal to 0.7071067811865476\''); -} diff --git a/test/built-ins/Math/SQRT2/S15.8.1.8_A1.js b/test/built-ins/Math/SQRT2/S15.8.1.8_A1.js deleted file mode 100644 index 171b676586..0000000000 --- a/test/built-ins/Math/SQRT2/S15.8.1.8_A1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Math.SQRT2 is approximately 1.4142135623730951 -es5id: 15.8.1.8_A1 -description: Comparing Math.SQRT2 with 1.4142135623730951 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -if (!isEqual(Math.SQRT2, 1.4142135623730951)) { - $ERROR('#1: \'Math.SQRT2 is not approximatley equal to 1.4142135623730951\''); -} diff --git a/test/built-ins/Math/acos/S15.8.2.2_A5.js b/test/built-ins/Math/acos/S15.8.2.2_A5.js deleted file mode 100644 index 161e6369ec..0000000000 --- a/test/built-ins/Math/acos/S15.8.2.2_A5.js +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - Math.acos, recommended that implementations use the approximation - algorithms for IEEE 754 arithmetic contained in fdlibm -es5id: 15.8.2.2_A5 -description: > - Checking if Math.acos is approximately equals to its mathematical - values on the set of 64 argument values; all the sample values is - calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var vnum = 64; -var x = new Array(); -x[0] = -1.00000000000000000000; -x[1] = -0.96825396825396826000; -x[2] = -0.93650793650793651000; -x[3] = -0.90476190476190477000; -x[4] = -0.87301587301587302000; -x[5] = -0.84126984126984128000; -x[6] = -0.80952380952380953000; -x[7] = -0.77777777777777779000; -x[8] = -0.74603174603174605000; -x[9] = -0.71428571428571430000; -x[10] = -0.68253968253968256000; -x[11] = -0.65079365079365081000; -x[12] = -0.61904761904761907000; -x[13] = -0.58730158730158732000; -x[14] = -0.55555555555555558000; -x[15] = -0.52380952380952384000; -x[16] = -0.49206349206349209000; -x[17] = -0.46031746031746035000; -x[18] = -0.42857142857142860000; -x[19] = -0.39682539682539686000; -x[20] = -0.36507936507936511000; -x[21] = -0.33333333333333337000; -x[22] = -0.30158730158730163000; -x[23] = -0.26984126984126988000; -x[24] = -0.23809523809523814000; -x[25] = -0.20634920634920639000; -x[26] = -0.17460317460317465000; -x[27] = -0.14285714285714290000; -x[28] = -0.11111111111111116000; -x[29] = -0.07936507936507941600; -x[30] = -0.04761904761904767200; -x[31] = -0.01587301587301592800; -x[32] = 0.01587301587301581700; -x[33] = 0.04761904761904767200; -x[34] = 0.07936507936507930500; -x[35] = 0.11111111111111116000; -x[36] = 0.14285714285714279000; -x[37] = 0.17460317460317465000; -x[38] = 0.20634920634920628000; -x[39] = 0.23809523809523814000; -x[40] = 0.26984126984126977000; -x[41] = 0.30158730158730163000; -x[42] = 0.33333333333333326000; -x[43] = 0.36507936507936511000; -x[44] = 0.39682539682539675000; -x[45] = 0.42857142857142860000; -x[46] = 0.46031746031746024000; -x[47] = 0.49206349206349209000; -x[48] = 0.52380952380952372000; -x[49] = 0.55555555555555558000; -x[50] = 0.58730158730158721000; -x[51] = 0.61904761904761907000; -x[52] = 0.65079365079365070000; -x[53] = 0.68253968253968256000; -x[54] = 0.71428571428571419000; -x[55] = 0.74603174603174605000; -x[56] = 0.77777777777777768000; -x[57] = 0.80952380952380953000; -x[58] = 0.84126984126984117000; -x[59] = 0.87301587301587302000; -x[60] = 0.90476190476190466000; -x[61] = 0.93650793650793651000; -x[62] = 0.96825396825396814000; -x[63] = 1.00000000000000000000; - - - - -var y = new Array(); -y[0] = 3.14159265358979310000; -y[1] = 2.88894492730522990000; -y[2] = 2.78333143507717650000; -y[3] = 2.70161669879887430000; -y[4] = 2.63214880477790030000; -y[5] = 2.57042415502425570000; -y[6] = 2.51413688066660250000; -y[7] = 2.46191883468154950000; -y[8] = 2.41287920284638750000; -y[9] = 2.36639928027943200000; -y[10] = 2.32202832592153240000; -y[11] = 2.27942559835728040000; -y[12] = 2.23832577143072960000; -y[13] = 2.19851714445280910000; -y[14] = 2.15982729701117070000; -y[15] = 2.12211329592677920000; -y[16] = 2.08525480235608330000; -y[17] = 2.04914909144415440000; -y[18] = 2.01370737086853560000; -y[19] = 1.97885200409617520000; -y[20] = 1.94451437773781040000; -y[21] = 1.91063323624901860000; -y[22] = 1.87715336135181590000; -y[23] = 1.84402450933553450000; -y[24] = 1.81120054356415610000; -y[25] = 1.77863871614824330000; -y[26] = 1.74629906437061930000; -y[27] = 1.71414389570026190000; -y[28] = 1.68213734113586070000; -y[29] = 1.65024496088003380000; -y[30] = 1.61843338941929970000; -y[31] = 1.58667000928485250000; -y[32] = 1.55492264430494110000; -y[33] = 1.52315926417049340000; -y[34] = 1.49134769270975950000; -y[35] = 1.45945531245393270000; -y[36] = 1.42744875788953140000; -y[37] = 1.39529358921917380000; -y[38] = 1.36295393744155000000; -y[39] = 1.33039211002563730000; -y[40] = 1.29756814425425880000; -y[41] = 1.26443929223797750000; -y[42] = 1.23095941734077470000; -y[43] = 1.19707827585198270000; -y[44] = 1.16274064949361830000; -y[45] = 1.12788528272125750000; -y[46] = 1.09244356214563900000; -y[47] = 1.05633785123370980000; -y[48] = 1.01947935766301390000; -y[49] = 0.98176535657862274000; -y[50] = 0.94307550913698401000; -y[51] = 0.90326688215906359000; -y[52] = 0.86216705523251280000; -y[53] = 0.81956432766826082000; -y[54] = 0.77519337331036142000; -y[55] = 0.72871345074340554000; -y[56] = 0.67967381890824408000; -y[57] = 0.62745577292319077000; -y[58] = 0.57116849856553775000; -y[59] = 0.50944384881189297000; -y[60] = 0.43997595479091917000; -y[61] = 0.35826121851261677000; -y[62] = 0.25264772628456394000; -y[63] = 0.00000000000000000000; - - - - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.acos(x[i]); - if (!isEqual(val, y[i])) - { - $ERROR("\nx = " + x[i] + "\nlibc.acos(x) = " + y[i] + "\nMath.acos(x) = " + Math.acos(x[i]) + "\nMath.abs(libc.acos(x) - Math.acos(x)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Math/asin/S15.8.2.3_A6.js b/test/built-ins/Math/asin/S15.8.2.3_A6.js deleted file mode 100644 index bab794386f..0000000000 --- a/test/built-ins/Math/asin/S15.8.2.3_A6.js +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - Math.asin, recommended that implementations use the approximation - algorithms for IEEE 754 arithmetic contained in fdlibm -es5id: 15.8.2.3_A6 -description: > - Checking if Math.asin is approximately equals to its mathematical - values on the set of 64 argument values; all the sample values is - calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var vnum = 64; -var x = new Array(); -x[0] = -1.00000000000000000000; -x[1] = -0.96825396825396826000; -x[2] = -0.93650793650793651000; -x[3] = -0.90476190476190477000; -x[4] = -0.87301587301587302000; -x[5] = -0.84126984126984128000; -x[6] = -0.80952380952380953000; -x[7] = -0.77777777777777779000; -x[8] = -0.74603174603174605000; -x[9] = -0.71428571428571430000; -x[10] = -0.68253968253968256000; -x[11] = -0.65079365079365081000; -x[12] = -0.61904761904761907000; -x[13] = -0.58730158730158732000; -x[14] = -0.55555555555555558000; -x[15] = -0.52380952380952384000; -x[16] = -0.49206349206349209000; -x[17] = -0.46031746031746035000; -x[18] = -0.42857142857142860000; -x[19] = -0.39682539682539686000; -x[20] = -0.36507936507936511000; -x[21] = -0.33333333333333337000; -x[22] = -0.30158730158730163000; -x[23] = -0.26984126984126988000; -x[24] = -0.23809523809523814000; -x[25] = -0.20634920634920639000; -x[26] = -0.17460317460317465000; -x[27] = -0.14285714285714290000; -x[28] = -0.11111111111111116000; -x[29] = -0.07936507936507941600; -x[30] = -0.04761904761904767200; -x[31] = -0.01587301587301592800; -x[32] = 0.01587301587301581700; -x[33] = 0.04761904761904767200; -x[34] = 0.07936507936507930500; -x[35] = 0.11111111111111116000; -x[36] = 0.14285714285714279000; -x[37] = 0.17460317460317465000; -x[38] = 0.20634920634920628000; -x[39] = 0.23809523809523814000; -x[40] = 0.26984126984126977000; -x[41] = 0.30158730158730163000; -x[42] = 0.33333333333333326000; -x[43] = 0.36507936507936511000; -x[44] = 0.39682539682539675000; -x[45] = 0.42857142857142860000; -x[46] = 0.46031746031746024000; -x[47] = 0.49206349206349209000; -x[48] = 0.52380952380952372000; -x[49] = 0.55555555555555558000; -x[50] = 0.58730158730158721000; -x[51] = 0.61904761904761907000; -x[52] = 0.65079365079365070000; -x[53] = 0.68253968253968256000; -x[54] = 0.71428571428571419000; -x[55] = 0.74603174603174605000; -x[56] = 0.77777777777777768000; -x[57] = 0.80952380952380953000; -x[58] = 0.84126984126984117000; -x[59] = 0.87301587301587302000; -x[60] = 0.90476190476190466000; -x[61] = 0.93650793650793651000; -x[62] = 0.96825396825396814000; -x[63] = 1.00000000000000000000; - - - - -var y = new Array(); -y[0] = -1.57079632679489660000; -y[1] = -1.31814860051033310000; -y[2] = -1.21253510828227990000; -y[3] = -1.13082037200397780000; -y[4] = -1.06135247798300370000; -y[5] = -0.99962782822935903000; -y[6] = -0.94334055387170590000; -y[7] = -0.89112250788665281000; -y[8] = -0.84208287605149101000; -y[9] = -0.79560295348453536000; -y[10] = -0.75123199912663585000; -y[11] = -0.70862927156238398000; -y[12] = -0.66752944463583297000; -y[13] = -0.62772081765791266000; -y[14] = -0.58903097021627393000; -y[15] = -0.55131696913188277000; -y[16] = -0.51445847556118673000; -y[17] = -0.47835276464925774000; -y[18] = -0.44291104407363896000; -y[19] = -0.40805567730127851000; -y[20] = -0.37371805094291394000; -y[21] = -0.33983690945412198000; -y[22] = -0.30635703455691915000; -y[23] = -0.27322818254063785000; -y[24] = -0.24040421676925938000; -y[25] = -0.20784238935334678000; -y[26] = -0.17550273757572274000; -y[27] = -0.14334756890536540000; -y[28] = -0.11134101434096394000; -y[29] = -0.07944863408513722100; -y[30] = -0.04763706262440318300; -y[31] = -0.01587368248995573600; -y[32] = 0.01587368248995562500; -y[33] = 0.04763706262440318300; -y[34] = 0.07944863408513711000; -y[35] = 0.11134101434096394000; -y[36] = 0.14334756890536529000; -y[37] = 0.17550273757572274000; -y[38] = 0.20784238935334667000; -y[39] = 0.24040421676925938000; -y[40] = 0.27322818254063774000; -y[41] = 0.30635703455691915000; -y[42] = 0.33983690945412187000; -y[43] = 0.37371805094291394000; -y[44] = 0.40805567730127840000; -y[45] = 0.44291104407363896000; -y[46] = 0.47835276464925758000; -y[47] = 0.51445847556118673000; -y[48] = 0.55131696913188266000; -y[49] = 0.58903097021627393000; -y[50] = 0.62772081765791254000; -y[51] = 0.66752944463583297000; -y[52] = 0.70862927156238387000; -y[53] = 0.75123199912663585000; -y[54] = 0.79560295348453514000; -y[55] = 0.84208287605149101000; -y[56] = 0.89112250788665259000; -y[57] = 0.94334055387170590000; -y[58] = 0.99962782822935881000; -y[59] = 1.06135247798300370000; -y[60] = 1.13082037200397760000; -y[61] = 1.21253510828227990000; -y[62] = 1.31814860051033270000; -y[63] = 1.57079632679489660000; - - - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.asin(x[i]); - if (!isEqual(val, y[i])) - { - $ERROR("\nx = " + x[i] + "\nlibc.asin(x) = " + y[i] + "\nMath.asin(x) = " + Math.asin(x[i]) + "\nMath.abs(libc.asin(x) - Math.asin(x)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Math/atan/S15.8.2.4_A6.js b/test/built-ins/Math/atan/S15.8.2.4_A6.js deleted file mode 100644 index dfaf983b22..0000000000 --- a/test/built-ins/Math/atan/S15.8.2.4_A6.js +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - Math.atan, recommended that implementations use the approximation - algorithms for IEEE 754 arithmetic contained in fdlibm -es5id: 15.8.2.4_A6 -description: > - Checking if Math.atan is approximately equals to its mathematical - values on the set of 64 argument values; all the sample values is - calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var vnum = 64; -var x = new Array(); -x[0] = -16.00000000000000000000; -x[1] = -15.49206349206349200000; -x[2] = -14.98412698412698400000; -x[3] = -14.47619047619047600000; -x[4] = -13.96825396825396800000; -x[5] = -13.46031746031746000000; -x[6] = -12.95238095238095300000; -x[7] = -12.44444444444444500000; -x[8] = -11.93650793650793700000; -x[9] = -11.42857142857142900000; -x[10] = -10.92063492063492100000; -x[11] = -10.41269841269841300000; -x[12] = -9.90476190476190510000; -x[13] = -9.39682539682539720000; -x[14] = -8.88888888888888930000; -x[15] = -8.38095238095238140000; -x[16] = -7.87301587301587350000; -x[17] = -7.36507936507936560000; -x[18] = -6.85714285714285770000; -x[19] = -6.34920634920634970000; -x[20] = -5.84126984126984180000; -x[21] = -5.33333333333333390000; -x[22] = -4.82539682539682600000; -x[23] = -4.31746031746031810000; -x[24] = -3.80952380952381020000; -x[25] = -3.30158730158730230000; -x[26] = -2.79365079365079440000; -x[27] = -2.28571428571428650000; -x[28] = -1.77777777777777860000; -x[29] = -1.26984126984127070000; -x[30] = -0.76190476190476275000; -x[31] = -0.25396825396825484000; -x[32] = 0.25396825396825307000; -x[33] = 0.76190476190476275000; -x[34] = 1.26984126984126890000; -x[35] = 1.77777777777777860000; -x[36] = 2.28571428571428470000; -x[37] = 2.79365079365079440000; -x[38] = 3.30158730158730050000; -x[39] = 3.80952380952381020000; -x[40] = 4.31746031746031630000; -x[41] = 4.82539682539682600000; -x[42] = 5.33333333333333210000; -x[43] = 5.84126984126984180000; -x[44] = 6.34920634920634800000; -x[45] = 6.85714285714285770000; -x[46] = 7.36507936507936380000; -x[47] = 7.87301587301587350000; -x[48] = 8.38095238095237960000; -x[49] = 8.88888888888888930000; -x[50] = 9.39682539682539540000; -x[51] = 9.90476190476190510000; -x[52] = 10.41269841269841100000; -x[53] = 10.92063492063492100000; -x[54] = 11.42857142857142700000; -x[55] = 11.93650793650793700000; -x[56] = 12.44444444444444300000; -x[57] = 12.95238095238095300000; -x[58] = 13.46031746031745900000; -x[59] = 13.96825396825396800000; -x[60] = 14.47619047619047400000; -x[61] = 14.98412698412698400000; -x[62] = 15.49206349206349000000; -x[63] = 16.00000000000000000000; - - - -var y = new Array(); -y[0] = -1.50837751679893930000; -y[1] = -1.50633657314382670000; -y[2] = -1.50415785436419310000; -y[3] = -1.50182694519358660000; -y[4] = -1.49932735026103090000; -y[5] = -1.49664010557682300000; -y[6] = -1.49374329974393950000; -y[7] = -1.49061147949358030000; -y[8] = -1.48721490565349580000; -y[9] = -1.48351861384543530000; -y[10] = -1.47948121756761840000; -y[11] = -1.47505336756015580000; -y[12] = -1.47017574693777100000; -y[13] = -1.46477643093971600000; -y[14] = -1.45876736436890870000; -y[15] = -1.45203959426707030000; -y[16] = -1.44445671565255360000; -y[17] = -1.43584570229039390000; -y[18] = -1.42598382855595760000; -y[19] = -1.41457960835077490000; -y[20] = -1.40124433129607070000; -y[21] = -1.38544837679920190000; -y[22] = -1.36645204745321510000; -y[23] = -1.34319210978762000000; -y[24] = -1.31408799636151090000; -y[25] = -1.27669520176831860000; -y[26] = -1.22705270315911450000; -y[27] = -1.15838588519750950000; -y[28] = -1.05840686648415900000; -y[29] = -0.90372394590298166000; -y[30] = -0.65107672144448037000; -y[31] = -0.24870998909352368000; -y[32] = 0.24870998909352202000; -y[33] = 0.65107672144448037000; -y[34] = 0.90372394590298100000; -y[35] = 1.05840686648415900000; -y[36] = 1.15838588519750910000; -y[37] = 1.22705270315911450000; -y[38] = 1.27669520176831840000; -y[39] = 1.31408799636151090000; -y[40] = 1.34319210978761980000; -y[41] = 1.36645204745321510000; -y[42] = 1.38544837679920190000; -y[43] = 1.40124433129607070000; -y[44] = 1.41457960835077490000; -y[45] = 1.42598382855595760000; -y[46] = 1.43584570229039390000; -y[47] = 1.44445671565255360000; -y[48] = 1.45203959426707030000; -y[49] = 1.45876736436890870000; -y[50] = 1.46477643093971600000; -y[51] = 1.47017574693777100000; -y[52] = 1.47505336756015580000; -y[53] = 1.47948121756761840000; -y[54] = 1.48351861384543530000; -y[55] = 1.48721490565349580000; -y[56] = 1.49061147949358030000; -y[57] = 1.49374329974393950000; -y[58] = 1.49664010557682300000; -y[59] = 1.49932735026103090000; -y[60] = 1.50182694519358660000; -y[61] = 1.50415785436419310000; -y[62] = 1.50633657314382670000; -y[63] = 1.50837751679893930000; - - - - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.atan(x[i]); - if (!isEqual(val, y[i])) - { - $ERROR("\nx = " + x[i] + "\nlibc.atan(x) = " + y[i] + "\nMath.atan(x) = " + Math.atan(x[i]) + "\nMath.abs(libc.atan(x) - Math.atan(x)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A10.js b/test/built-ins/Math/atan2/S15.8.2.5_A10.js deleted file mode 100644 index 498064d1e1..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A10.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y is -0 and x is -0, Math.atan2(y,x) is an implementation-dependent - approximation to -PI -es5id: 15.8.2.5_A10 -description: Checking if Math.atan2(-0,-0) is an approximation to -PI -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -//prec = 0.00000000000001; -var y = -0; -var x = -0; -if (!isEqual(Math.atan2(y,x), -Math.PI)) - $ERROR("#1: !isEqual(Math.atan2(-0,-0), -Math.PI)"); diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A11.js b/test/built-ins/Math/atan2/S15.8.2.5_A11.js deleted file mode 100644 index a499f7aa09..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A11.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y is equal to -0 and x<0, Math.atan2(y,x) is an - implementation-dependent approximation to -PI -es5id: 15.8.2.5_A11 -description: Checking if Math.atan2(-0,x) is an approximation to -PI, where x<0 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var y = -0; -//prec = 0.00000000000001; -var x = new Array(); -x[0] = -0.000000000000001; -x[2] = -Infinity; -x[1] = -1; -var xnum = 3; - -for (var i = 0; i < xnum; i++) -{ - if (!isEqual(Math.atan2(y,x[i]), - Math.PI)) - $ERROR("#1: Math.abs(Math.atan2(" + y + ", " + x[i] + ") + Math.PI) >= " + prec); -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A12.js b/test/built-ins/Math/atan2/S15.8.2.5_A12.js deleted file mode 100644 index 3a8fcd9186..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A12.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y<0 and x is +0, Math.atan2(y,x) is an implementation-dependent - approximation to -PI/2 -es5id: 15.8.2.5_A12 -description: > - Checking if Math.atan2(y,+0) is an approximation to -PI/2, where - y<0 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var x = +0; -//prec = 0.00000000000001; -var y = new Array(); -y[0] = -0.000000000000001; -y[2] = -Infinity; -y[1] = -1; -var ynum = 3; - -for (var i = 0; i < ynum; i++) -{ - if (!isEqual(Math.atan2(y[i],x), -(Math.PI)/2)) - $ERROR("#1: Math.abs(Math.atan2(" + y[i] + ", " + x + ") + ((Math.PI)/2)) >= " + prec); -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A13.js b/test/built-ins/Math/atan2/S15.8.2.5_A13.js deleted file mode 100644 index 4c4829a084..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A13.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y<0 and x is -0, Math.atan2(y,x) is an implementation-dependent - approximation to -PI/2 -es5id: 15.8.2.5_A13 -description: > - Checking if Math.atan2(y,-0) is an approximation to -PI/2, where - y<0 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var x = -0; -//prec = 0.00000000000001; -var y = new Array(); -y[0] = -0.000000000000001; -y[2] = -Infinity; -y[1] = -1; -var ynum = 3; - -for (var i = 0; i < ynum; i++) -{ - if (!isEqual(Math.atan2(y[i],x), -(Math.PI)/2)) - $ERROR("#1: Math.abs(Math.atan2(" + y[i] + ", -0) + ((Math.PI)/2)) >= " + prec); -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A15.js b/test/built-ins/Math/atan2/S15.8.2.5_A15.js deleted file mode 100644 index 4ddfb401ad..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A15.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y>0 and y is finite and x is equal to -Infinity, Math.atan2(y,x) is an - implementation-dependent approximation to +PI -es5id: 15.8.2.5_A15 -description: > - Checking if Math.atan2(y,x) is an approximation to +PI, where y>0 - and y is finite and x is equal to -Infinity -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var x = -Infinity; -var y = new Array(); -y[0] = 0.000000000000001; -y[1] = 1; -y[2] = 1.7976931348623157E308; //largest finite number -var ynum = 3; - -for (var i = 0; i < ynum; i++) -{ - if (!isEqual(Math.atan2(y[i],x),Math.PI)) - $ERROR("#1: Math.abs(Math.atan2(" + y[i] + ", " + x + ") - Math.PI) >= " + prec); -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A17.js b/test/built-ins/Math/atan2/S15.8.2.5_A17.js deleted file mode 100644 index 0648d750c1..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A17.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y<0 and y is finite and x is equal to -Infinity, Math.atan2(y,x) is an - implementation-dependent approximation to -PI -es5id: 15.8.2.5_A17 -description: > - Checking if Math.atan2(y,x) is an approximation to -PI, where y<0 - and y is finite and x is equal to -Infinity -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var x = -Infinity; -var y = new Array(); -y[0] = -0.000000000000001; -y[1] = -1; -y[2] = -1.7976931348623157E308; //largest (by module) finite number -var ynum = 3; - -for (var i = 0; i < ynum; i++) -{ - if (!isEqual(Math.atan2(y[i],x), -Math.PI)) - $ERROR("#1: Math.abs(Math.atan2(" + y[i] + ", " + x + ") + Math.PI) >= " + prec); -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A18.js b/test/built-ins/Math/atan2/S15.8.2.5_A18.js deleted file mode 100644 index 294e177472..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A18.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y is +Infinity and x is finite, Math.atan2(y,x) is an - implementation-dependent approximation to +PI/2 -es5id: 15.8.2.5_A18 -description: > - Checking if Math.atan2(y,x) is an approximation to +PI/2, where y - is +Infinity and x is finite -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var y = +Infinity; -var x = new Array(); -x[0] = 0.000000000000001; -x[1] = 1; -x[2] = 1.7976931348623157E308; //largest finite number -x[3] = -0.000000000000001; -x[4] = -1; -x[5] = -1.7976931348623157E308; //largest (by module) finite number - -var xnum = 6; - -for (var i = 0; i < xnum; i++) -{ - if (!isEqual(Math.atan2(y,x[i]), (Math.PI)/2)) - $ERROR("#1: Math.abs(Math.atan2(" + y + ", " + x[i] + ") - (Math.PI/2)) >= " + prec); -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A19.js b/test/built-ins/Math/atan2/S15.8.2.5_A19.js deleted file mode 100644 index 92c559fbf6..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A19.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y is -Infinity and x is finite, Math.atan2(y,x) is an - implementation-dependent approximation to -PI/2 -es5id: 15.8.2.5_A19 -description: > - Checking if Math.atan2(y,x) is an approximation to -PI/2, where y - is -Infinity and x is finite -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -//prec = 0.00000000000001; -var y = -Infinity; -var x = new Array(); -x[0] = 0.000000000000001; -x[1] = 1; -x[2] = 1.7976931348623157E308; //largest finite number -x[3] = -0.000000000000001; -x[4] = -1; -x[5] = -1.7976931348623157E308; //largest (by module) finite number - -var xnum = 6; - -for (var i = 0; i < xnum; i++) -{ - if (!isEqual(Math.atan2(y,x[i]), -(Math.PI)/2)) - $ERROR("#1: Math.abs(Math.atan2(" + y + ", " + x[i] + ") + (Math.PI/2)) >= " + prec); -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A2.js b/test/built-ins/Math/atan2/S15.8.2.5_A2.js deleted file mode 100644 index d51ac1b26f..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A2.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y>0 and x is +0, Math.atan2(y,x) is an implementation-dependent - approximation to +PI/2 -es5id: 15.8.2.5_A2 -description: > - Checking if Math.atan2(y,x) is an approximation to +PI/2, where - y>0 and x is +0 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var x = +0; -//prec = 0.00000000000001; -var y = new Array(); -y[0] = 0.000000000000001; -y[2] = +Infinity; -y[1] = 1; -var ynum = 3; - -for (var i = 0; i < ynum; i++) -{ - if (!isEqual(Math.atan2(y[i],x),(Math.PI)/2)) - $ERROR("#1: Math.abs(Math.atan2(" + y[i] + ", " + x + ") - ((Math.PI)/2)) >= " + prec); -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A20.js b/test/built-ins/Math/atan2/S15.8.2.5_A20.js deleted file mode 100644 index f4ba5a6ff7..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A20.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y is equal to +Infinity and x is equal to +Infinity, Math.atan2(y,x) - is an implementation-dependent approximation to +PI/4 -es5id: 15.8.2.5_A20 -description: > - Checking if Math.atan2(y,x) is an approximation to +PI/4, where y - is equal to +Infinity and x is equal to +Infinity -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -//prec = 0.00000000000001; -var y = +Infinity; -var x = +Infinity; - -if (!isEqual(Math.atan2(y,x),(Math.PI)/4)) - $ERROR("#1: Math.abs(Math.atan2(" + y + ", " + x + ") - (Math.PI/4)) >= " + prec); diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A21.js b/test/built-ins/Math/atan2/S15.8.2.5_A21.js deleted file mode 100644 index 31eb3ed9f5..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A21.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y is equal to +Infinity and x is equal to -Infinity, Math.atan2(y,x) - is an implementation-dependent approximation to +3*PI/4 -es5id: 15.8.2.5_A21 -description: > - Checking if Math.atan2(y,x) is an approximation to +3*PI/4, where - y is equal to +Infinity and x is equal to -Infinity -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -//prec = 0.00000000000001; -var y = +Infinity; -var x = -Infinity; - -if (!isEqual(Math.atan2(y,x), (3*Math.PI)/4)) - $ERROR("#1: Math.abs(Math.atan2(" + y + ", " + x + ") - (3*Math.PI/4)) >= " + prec); diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A22.js b/test/built-ins/Math/atan2/S15.8.2.5_A22.js deleted file mode 100644 index 78b55657c3..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A22.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y is equal to -Infinity and x is equal to +Infinity, Math.atan2(y,x) - is an implementation-dependent approximation to -PI/4 -es5id: 15.8.2.5_A22 -description: > - Checking if Math.atan2(y,x) is an approximation to -PI/4, where y - is equal to -Infinity and x is equal to +Infinity -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -//prec = 0.00000000000001; -var y = -Infinity; -var x = +Infinity; - -if (!isEqual(Math.atan2(y,x),- (Math.PI)/4)) - $ERROR("#1: Math.abs(Math.atan2(" + y + ", " + x + ") + (Math.PI/4)) >= " + prec); diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A23.js b/test/built-ins/Math/atan2/S15.8.2.5_A23.js deleted file mode 100644 index ed8b8aef28..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A23.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y is equal to -Infinity and x is equal to -Infinity, Math.atan2(y,x) - is an implementation-dependent approximation to -3*PI/4 -es5id: 15.8.2.5_A23 -description: > - Checking if Math.atan2(y,x) is an approximation to -3*PI/4, where - y is equal to -Infinity and x is equal to -Infinity -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -//prec = 0.00000000000001; -var y = -Infinity; -var x = -Infinity; - -if (!isEqual(Math.atan2(y,x), -(3*Math.PI)/4)) - $ERROR("#1: Math.abs(Math.atan2(" + y + ", " + x + ") + (3*Math.PI/4)) >= " + prec); diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A24.js b/test/built-ins/Math/atan2/S15.8.2.5_A24.js deleted file mode 100644 index 8715ccbc5a..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A24.js +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - Math.atan2, recommended that implementations use the approximation - algorithms for IEEE 754 arithmetic contained in fdlibm -es5id: 15.8.2.5_A24 -description: > - Checking if Math.atan2(argument1, argument2) is approximately - equals to its mathematical values on the set of 64 argument1 - values and 64 argument2 values; all the sample values is - calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var vnum = 64; -var x1 = new Array(); -x1[0] = -16.00000000000000000000; -x1[1] = -15.49206349206349200000; -x1[2] = -14.98412698412698400000; -x1[3] = -14.47619047619047600000; -x1[4] = -13.96825396825396800000; -x1[5] = -13.46031746031746000000; -x1[6] = -12.95238095238095300000; -x1[7] = -12.44444444444444500000; -x1[8] = -11.93650793650793700000; -x1[9] = -11.42857142857142900000; -x1[10] = -10.92063492063492100000; -x1[11] = -10.41269841269841300000; -x1[12] = -9.90476190476190510000; -x1[13] = -9.39682539682539720000; -x1[14] = -8.88888888888888930000; -x1[15] = -8.38095238095238140000; -x1[16] = -7.87301587301587350000; -x1[17] = -7.36507936507936560000; -x1[18] = -6.85714285714285770000; -x1[19] = -6.34920634920634970000; -x1[20] = -5.84126984126984180000; -x1[21] = -5.33333333333333390000; -x1[22] = -4.82539682539682600000; -x1[23] = -4.31746031746031810000; -x1[24] = -3.80952380952381020000; -x1[25] = -3.30158730158730230000; -x1[26] = -2.79365079365079440000; -x1[27] = -2.28571428571428650000; -x1[28] = -1.77777777777777860000; -x1[29] = -1.26984126984127070000; -x1[30] = -0.76190476190476275000; -x1[31] = -0.25396825396825484000; -x1[32] = 0.25396825396825307000; -x1[33] = 0.76190476190476275000; -x1[34] = 1.26984126984126890000; -x1[35] = 1.77777777777777860000; -x1[36] = 2.28571428571428470000; -x1[37] = 2.79365079365079440000; -x1[38] = 3.30158730158730050000; -x1[39] = 3.80952380952381020000; -x1[40] = 4.31746031746031630000; -x1[41] = 4.82539682539682600000; -x1[42] = 5.33333333333333210000; -x1[43] = 5.84126984126984180000; -x1[44] = 6.34920634920634800000; -x1[45] = 6.85714285714285770000; -x1[46] = 7.36507936507936380000; -x1[47] = 7.87301587301587350000; -x1[48] = 8.38095238095237960000; -x1[49] = 8.88888888888888930000; -x1[50] = 9.39682539682539540000; -x1[51] = 9.90476190476190510000; -x1[52] = 10.41269841269841100000; -x1[53] = 10.92063492063492100000; -x1[54] = 11.42857142857142700000; -x1[55] = 11.93650793650793700000; -x1[56] = 12.44444444444444300000; -x1[57] = 12.95238095238095300000; -x1[58] = 13.46031746031745900000; -x1[59] = 13.96825396825396800000; -x1[60] = 14.47619047619047400000; -x1[61] = 14.98412698412698400000; -x1[62] = 15.49206349206349000000; -x1[63] = 16.00000000000000000000; - - -var x2 = new Array(); -x2[0] = -8.00000000000000000000; -x2[1] = -7.74603174603174600000; -x2[2] = -7.49206349206349210000; -x2[3] = -7.23809523809523810000; -x2[4] = -6.98412698412698420000; -x2[5] = -6.73015873015873020000; -x2[6] = -6.47619047619047630000; -x2[7] = -6.22222222222222230000; -x2[8] = -5.96825396825396840000; -x2[9] = -5.71428571428571440000; -x2[10] = -5.46031746031746050000; -x2[11] = -5.20634920634920650000; -x2[12] = -4.95238095238095260000; -x2[13] = -4.69841269841269860000; -x2[14] = -4.44444444444444460000; -x2[15] = -4.19047619047619070000; -x2[16] = -3.93650793650793670000; -x2[17] = -3.68253968253968280000; -x2[18] = -3.42857142857142880000; -x2[19] = -3.17460317460317490000; -x2[20] = -2.92063492063492090000; -x2[21] = -2.66666666666666700000; -x2[22] = -2.41269841269841300000; -x2[23] = -2.15873015873015910000; -x2[24] = -1.90476190476190510000; -x2[25] = -1.65079365079365110000; -x2[26] = -1.39682539682539720000; -x2[27] = -1.14285714285714320000; -x2[28] = -0.88888888888888928000; -x2[29] = -0.63492063492063533000; -x2[30] = -0.38095238095238138000; -x2[31] = -0.12698412698412742000; -x2[32] = 0.12698412698412653000; -x2[33] = 0.38095238095238138000; -x2[34] = 0.63492063492063444000; -x2[35] = 0.88888888888888928000; -x2[36] = 1.14285714285714230000; -x2[37] = 1.39682539682539720000; -x2[38] = 1.65079365079365030000; -x2[39] = 1.90476190476190510000; -x2[40] = 2.15873015873015820000; -x2[41] = 2.41269841269841300000; -x2[42] = 2.66666666666666610000; -x2[43] = 2.92063492063492090000; -x2[44] = 3.17460317460317400000; -x2[45] = 3.42857142857142880000; -x2[46] = 3.68253968253968190000; -x2[47] = 3.93650793650793670000; -x2[48] = 4.19047619047618980000; -x2[49] = 4.44444444444444460000; -x2[50] = 4.69841269841269770000; -x2[51] = 4.95238095238095260000; -x2[52] = 5.20634920634920560000; -x2[53] = 5.46031746031746050000; -x2[54] = 5.71428571428571350000; -x2[55] = 5.96825396825396840000; -x2[56] = 6.22222222222222140000; -x2[57] = 6.47619047619047630000; -x2[58] = 6.73015873015872930000; -x2[59] = 6.98412698412698420000; -x2[60] = 7.23809523809523720000; -x2[61] = 7.49206349206349210000; -x2[62] = 7.74603174603174520000; -x2[63] = 8.00000000000000000000; - - -var y = new Array(); -y[0] = -2.03444393579570270000; -y[1] = -2.03444393579570270000; -y[2] = -2.03444393579570270000; -y[3] = -2.03444393579570270000; -y[4] = -2.03444393579570270000; -y[5] = -2.03444393579570270000; -y[6] = -2.03444393579570270000; -y[7] = -2.03444393579570270000; -y[8] = -2.03444393579570270000; -y[9] = -2.03444393579570270000; -y[10] = -2.03444393579570270000; -y[11] = -2.03444393579570270000; -y[12] = -2.03444393579570270000; -y[13] = -2.03444393579570270000; -y[14] = -2.03444393579570270000; -y[15] = -2.03444393579570270000; -y[16] = -2.03444393579570270000; -y[17] = -2.03444393579570270000; -y[18] = -2.03444393579570270000; -y[19] = -2.03444393579570270000; -y[20] = -2.03444393579570270000; -y[21] = -2.03444393579570270000; -y[22] = -2.03444393579570270000; -y[23] = -2.03444393579570270000; -y[24] = -2.03444393579570270000; -y[25] = -2.03444393579570270000; -y[26] = -2.03444393579570270000; -y[27] = -2.03444393579570270000; -y[28] = -2.03444393579570270000; -y[29] = -2.03444393579570270000; -y[30] = -2.03444393579570270000; -y[31] = -2.03444393579570270000; -y[32] = 1.10714871779409040000; -y[33] = 1.10714871779409040000; -y[34] = 1.10714871779409040000; -y[35] = 1.10714871779409040000; -y[36] = 1.10714871779409040000; -y[37] = 1.10714871779409040000; -y[38] = 1.10714871779409040000; -y[39] = 1.10714871779409040000; -y[40] = 1.10714871779409040000; -y[41] = 1.10714871779409040000; -y[42] = 1.10714871779409040000; -y[43] = 1.10714871779409040000; -y[44] = 1.10714871779409040000; -y[45] = 1.10714871779409040000; -y[46] = 1.10714871779409040000; -y[47] = 1.10714871779409040000; -y[48] = 1.10714871779409040000; -y[49] = 1.10714871779409040000; -y[50] = 1.10714871779409040000; -y[51] = 1.10714871779409040000; -y[52] = 1.10714871779409040000; -y[53] = 1.10714871779409040000; -y[54] = 1.10714871779409040000; -y[55] = 1.10714871779409040000; -y[56] = 1.10714871779409040000; -y[57] = 1.10714871779409040000; -y[58] = 1.10714871779409040000; -y[59] = 1.10714871779409040000; -y[60] = 1.10714871779409040000; -y[61] = 1.10714871779409040000; -y[62] = 1.10714871779409040000; -y[63] = 1.10714871779409040000; - - - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.atan2(x1[i], x2[i]); - if (!isEqual(val, y[i])) - { - $ERROR("\nx1 = " + x1[i] + "\nx2 = " + x2[i] + "\nlibc.atan2(x1,x2) = " + y[i] + "\nMath.atan2(x1,x2) = " + Math.atan2(x1[i],x2[i]) + "\nMath.abs(libc.atan2(x1,x2) - Math.atan2(x1,x2)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A3.js b/test/built-ins/Math/atan2/S15.8.2.5_A3.js deleted file mode 100644 index 5ead1cc7b5..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A3.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y>0 and x is -0, Math.atan2(y,x) is an implementation-dependent - approximation to +PI/2 -es5id: 15.8.2.5_A3 -description: > - Checking if Math.atan2(y,x) is an approximation to +PI/2, where - y>0 and x is -0 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var x = -0; -//prec = 0.00000000000001; -var y = new Array(); -y[0] = 0.000000000000001; -y[2] = +Infinity; -y[1] = 1; -var ynum = 3; - -for (var i = 0; i < ynum; i++) -{ - if (!isEqual(Math.atan2(y[i],x), (Math.PI)/2)) - $ERROR("#1: Math.abs(Math.atan2(" + y[i] + ", " + x + ") - ((Math.PI)/2)) >= " + prec); -} diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A6.js b/test/built-ins/Math/atan2/S15.8.2.5_A6.js deleted file mode 100644 index d6bb1b4b69..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A6.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y is +0 and x is -0, Math.atan2(y,x) is an implementation-dependent - approximation to +PI -es5id: 15.8.2.5_A6 -description: > - Checking if Math.atan2(y,x) is an approximation to +PI, where y is - +0 and x is -0 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -//prec = 0.00000000000001; -var y = +0; -var x = -0; -if (!isEqual(Math.atan2(y,x), Math.PI)) - $ERROR("#1: Math.abs(Math.atan2(" + y + ", -0) - Math.PI) >= " + prec); diff --git a/test/built-ins/Math/atan2/S15.8.2.5_A7.js b/test/built-ins/Math/atan2/S15.8.2.5_A7.js deleted file mode 100644 index 992cc39e0a..0000000000 --- a/test/built-ins/Math/atan2/S15.8.2.5_A7.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If y is equal to +0 and x<0, Math.atan2(y,x) is an - implementation-dependent approximation to +PI -es5id: 15.8.2.5_A7 -description: > - Checking if Math.atan2(y,x) is an approximation to +PI, where y is - equal to +0 and x<0 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var y = +0; -//prec = 0.00000000000001; -var x = new Array(); -x[0] = -0.000000000000001; -x[2] = -Infinity; -x[1] = -1; -var xnum = 3; - -for (var i = 0; i < xnum; i++) -{ - if (!isEqual(Math.atan2(y,x[i]), Math.PI)) - $ERROR("#1: Math.abs(Math.atan2(" + y + ", " + x[i] + ") - Math.PI) >= " + prec); -} diff --git a/test/built-ins/Math/cos/S15.8.2.7_A6.js b/test/built-ins/Math/cos/S15.8.2.7_A6.js deleted file mode 100644 index 55d54d0abc..0000000000 --- a/test/built-ins/Math/cos/S15.8.2.7_A6.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Cosine is a periodic function with period 2*PI -es5id: 15.8.2.7_A6 -description: > - Checking if Math.cos(x) equals to Math.cos(x+n*2*Math.PI) with - precision 0.000000000003, where n is an integer from 1 to 100 and - x is one of 10 float point values from -Math.PI to +Math.PI ----*/ - -// CHECK#1 -var prec = 0.000000000003; -//prec = 0.000000000000001; -var period = 2*Math.PI; -var pernum = 100; - -var a = -pernum * period; -var b = pernum * period; -var snum = 9; -var step = period/snum + 0.0; -var x = new Array(); -for (var i = 0; i < snum; i++) -{ - x[i] = a + i*step; -} -x[9] = a + period; - -var curval; -var curx; -var j; -for (i = 0; i < snum; i++) -{ - curval = Math.cos(x[i]); - curx = x[i] + period; - j = 0; - while (curx <= b) - { - curx += period; - j++; - if (Math.abs(Math.cos(curx) - curval) >= prec) - { - $ERROR("#1: cos is found out to not be periodic:\n Math.abs(Math.cos(" + x[i] + ") - Math.cos(" + x[i] + " + 2*Math.PI*" + j + ")) >= " + prec + "\n Math.cos(" + x[i] + ") === " + curval + "\n Math.cos(" + curx + ") === " + Math.cos(curx)); - } - } -} diff --git a/test/built-ins/Math/cos/S15.8.2.7_A7.js b/test/built-ins/Math/cos/S15.8.2.7_A7.js deleted file mode 100644 index 7e02d69103..0000000000 --- a/test/built-ins/Math/cos/S15.8.2.7_A7.js +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - Math.cos it is recommended that implementations use the approximation - algorithms for IEEE 754 arithmetic contained in fdlibm -es5id: 15.8.2.7_A7 -description: > - Checking if Math.cos is approximately equals to its mathematical - values on the set of 64 argument values; all the sample values is - calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var vnum = 64; -var x = new Array(); -x[0] = -3.14159265358979310000; -x[1] = -3.04185955347583150000; -x[2] = -2.94212645336186980000; -x[3] = -2.84239335324790820000; -x[4] = -2.74266025313394660000; -x[5] = -2.64292715301998450000; -x[6] = -2.54319405290602290000; -x[7] = -2.44346095279206120000; -x[8] = -2.34372785267809960000; -x[9] = -2.24399475256413790000; -x[10] = -2.14426165245017630000; -x[11] = -2.04452855233621470000; -x[12] = -1.94479545222225280000; -x[13] = -1.84506235210829120000; -x[14] = -1.74532925199432950000; -x[15] = -1.64559615188036790000; -x[16] = -1.54586305176640600000; -x[17] = -1.44612995165244440000; -x[18] = -1.34639685153848280000; -x[19] = -1.24666375142452110000; -x[20] = -1.14693065131055950000; -x[21] = -1.04719755119659740000; -x[22] = -0.94746445108263622000; -x[23] = -0.84773135096867458000; -x[24] = -0.74799825085471250000; -x[25] = -0.64826515074075086000; -x[26] = -0.54853205062678922000; -x[27] = -0.44879895051282759000; -x[28] = -0.34906585039886595000; -x[29] = -0.24933275028490431000; -x[30] = -0.14959965017094268000; -x[31] = -0.04986655005698104000; -x[32] = 0.04986655005698104000; -x[33] = 0.14959965017094268000; -x[34] = 0.24933275028490431000; -x[35] = 0.34906585039886595000; -x[36] = 0.44879895051282759000; -x[37] = 0.54853205062678922000; -x[38] = 0.64826515074075086000; -x[39] = 0.74799825085471250000; -x[40] = 0.84773135096867414000; -x[41] = 0.94746445108263533000; -x[42] = 1.04719755119659830000; -x[43] = 1.14693065131055950000; -x[44] = 1.24666375142452070000; -x[45] = 1.34639685153848280000; -x[46] = 1.44612995165244400000; -x[47] = 1.54586305176640600000; -x[48] = 1.64559615188036810000; -x[49] = 1.74532925199432930000; -x[50] = 1.84506235210829140000; -x[51] = 1.94479545222225260000; -x[52] = 2.04452855233621470000; -x[53] = 2.14426165245017670000; -x[54] = 2.24399475256413790000; -x[55] = 2.34372785267810000000; -x[56] = 2.44346095279206120000; -x[57] = 2.54319405290602240000; -x[58] = 2.64292715301998450000; -x[59] = 2.74266025313394660000; -x[60] = 2.84239335324790780000; -x[61] = 2.94212645336186980000; -x[62] = 3.04185955347583100000; -x[63] = 3.14159265358979310000; - - -var y = new Array(); -y[0] = -1.00000000000000000000; -y[1] = -0.99503077536540141000; -y[2] = -0.98017248784854383000; -y[3] = -0.95557280578614079000; -y[4] = -0.92147621187040774000; -y[5] = -0.87822157337022844000; -y[6] = -0.82623877431599468000; -y[7] = -0.76604444311897790000; -y[8] = -0.69823681808607274000; -y[9] = -0.62348980185873348000; -y[10] = -0.54254626386575933000; -y[11] = -0.45621065735316296000; -y[12] = -0.36534102436639487000; -y[13] = -0.27084046814300500000; -y[14] = -0.17364817766693030000; -y[15] = -0.07473009358642426800; -y[16] = 0.02493069173807303500; -y[17] = 0.12434370464748527000; -y[18] = 0.22252093395631445000; -y[19] = 0.31848665025168443000; -y[20] = 0.41128710313061151000; -y[21] = 0.50000000000000033000; -y[22] = 0.58374367223478973000; -y[23] = 0.66168583759685928000; -y[24] = 0.73305187182982645000; -y[25] = 0.79713250722292250000; -y[26] = 0.85329088163215572000; -y[27] = 0.90096886790241915000; -y[28] = 0.93969262078590832000; -y[29] = 0.96907728622907796000; -y[30] = 0.98883082622512852000; -y[31] = 0.99875692121892234000; -y[32] = 0.99875692121892234000; -y[33] = 0.98883082622512852000; -y[34] = 0.96907728622907796000; -y[35] = 0.93969262078590832000; -y[36] = 0.90096886790241915000; -y[37] = 0.85329088163215572000; -y[38] = 0.79713250722292250000; -y[39] = 0.73305187182982645000; -y[40] = 0.66168583759685962000; -y[41] = 0.58374367223479051000; -y[42] = 0.49999999999999950000; -y[43] = 0.41128710313061151000; -y[44] = 0.31848665025168482000; -y[45] = 0.22252093395631445000; -y[46] = 0.12434370464748572000; -y[47] = 0.02493069173807303500; -y[48] = -0.07473009358642449000; -y[49] = -0.17364817766693008000; -y[50] = -0.27084046814300522000; -y[51] = -0.36534102436639465000; -y[52] = -0.45621065735316296000; -y[53] = -0.54254626386575977000; -y[54] = -0.62348980185873348000; -y[55] = -0.69823681808607307000; -y[56] = -0.76604444311897790000; -y[57] = -0.82623877431599446000; -y[58] = -0.87822157337022844000; -y[59] = -0.92147621187040774000; -y[60] = -0.95557280578614057000; -y[61] = -0.98017248784854383000; -y[62] = -0.99503077536540141000; -y[63] = -1.00000000000000000000; - - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.cos(x[i]); - if (!isEqual(val, y[i])) - { - $ERROR("\nx = " + x[i] + "\nlibc.cos(x) = " + y[i] + "\nMath.cos(x) = " + Math.cos(x[i]) + "\nMath.abs(libc.cos(x) - Math.cos(x)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Math/exp/S15.8.2.8_A6.js b/test/built-ins/Math/exp/S15.8.2.8_A6.js deleted file mode 100644 index b2641772cb..0000000000 --- a/test/built-ins/Math/exp/S15.8.2.8_A6.js +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - Math.exp, recommended that implementations use the approximation - algorithms for IEEE 754 arithmetic contained in fdlibm -es5id: 15.8.2.8_A6 -description: > - Checking if Math.exp is approximately equals to its mathematical - values on the set of 64 argument values; all the sample values is - calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var vnum = 64; -var x = new Array(); -x[0] = -16.00000000000000000000; -x[1] = -15.49206349206349200000; -x[2] = -14.98412698412698400000; -x[3] = -14.47619047619047600000; -x[4] = -13.96825396825396800000; -x[5] = -13.46031746031746000000; -x[6] = -12.95238095238095300000; -x[7] = -12.44444444444444500000; -x[8] = -11.93650793650793700000; -x[9] = -11.42857142857142900000; -x[10] = -10.92063492063492100000; -x[11] = -10.41269841269841300000; -x[12] = -9.90476190476190510000; -x[13] = -9.39682539682539720000; -x[14] = -8.88888888888888930000; -x[15] = -8.38095238095238140000; -x[16] = -7.87301587301587350000; -x[17] = -7.36507936507936560000; -x[18] = -6.85714285714285770000; -x[19] = -6.34920634920634970000; -x[20] = -5.84126984126984180000; -x[21] = -5.33333333333333390000; -x[22] = -4.82539682539682600000; -x[23] = -4.31746031746031810000; -x[24] = -3.80952380952381020000; -x[25] = -3.30158730158730230000; -x[26] = -2.79365079365079440000; -x[27] = -2.28571428571428650000; -x[28] = -1.77777777777777860000; -x[29] = -1.26984126984127070000; -x[30] = -0.76190476190476275000; -x[31] = -0.25396825396825484000; -x[32] = 0.25396825396825307000; -x[33] = 0.76190476190476275000; -x[34] = 1.26984126984126890000; -x[35] = 1.77777777777777860000; -x[36] = 2.28571428571428470000; -x[37] = 2.79365079365079440000; -x[38] = 3.30158730158730050000; -x[39] = 3.80952380952381020000; -x[40] = 4.31746031746031630000; -x[41] = 4.82539682539682600000; -x[42] = 5.33333333333333210000; -x[43] = 5.84126984126984180000; -x[44] = 6.34920634920634800000; -x[45] = 6.85714285714285770000; -x[46] = 7.36507936507936380000; -x[47] = 7.87301587301587350000; -x[48] = 8.38095238095237960000; -x[49] = 8.88888888888888930000; -x[50] = 9.39682539682539540000; -x[51] = 9.90476190476190510000; -x[52] = 10.41269841269841100000; -x[53] = 10.92063492063492100000; -x[54] = 11.42857142857142700000; -x[55] = 11.93650793650793700000; -x[56] = 12.44444444444444300000; -x[57] = 12.95238095238095300000; -x[58] = 13.46031746031745900000; -x[59] = 13.96825396825396800000; -x[60] = 14.47619047619047400000; -x[61] = 14.98412698412698400000; -x[62] = 15.49206349206349000000; -x[63] = 16.00000000000000000000; - - - -var y = new Array(); -y[0] = 0.0000001125351747192591200; -y[1] = 0.0000001870175279627160400; -y[2] = 0.0000003107966540465112000; -y[3] = 0.0000005165000372893601900; -y[4] = 0.0000008583499373194266000; -y[5] = 0.000001426456073000250500; -y[6] = 0.000002370568039596737700; -y[7] = 0.000003939548463303105900; -y[8] = 0.000006546971795567619300; -y[9] = 0.00001088014022196331600; -y[10] = 0.00001808125266855845500; -y[11] = 0.00003004848204109428100; -y[12] = 0.00004993632297081056800; -y[13] = 0.00008298709893014922600; -y[14] = 0.0001379128093365619200; -y[15] = 0.0002291915638009238700; -y[16] = 0.0003808839307255494700; -y[17] = 0.0006329751683659501200; -y[18] = 0.001051915114939835700; -y[19] = 0.001748133993779607700; -y[20] = 0.002905151201656255000; -y[21] = 0.004827949993831437100; -y[22] = 0.008023369361859111100; -y[23] = 0.01333370395283075800; -y[24] = 0.02215872822045164600; -y[25] = 0.03682466913056056000; -y[26] = 0.06119738655956222900; -y[27] = 0.1017013923042267600; -y[28] = 0.1690133154060659600; -y[29] = 0.2808762017642814100; -y[30] = 0.4667764816516809500; -y[31] = 0.7757164275739275600; -y[32] = 1.289130878828392400; -y[33] = 2.142353009006615400; -y[34] = 3.560287392519015300; -y[35] = 5.916693590664334800; -y[36] = 9.832707078469738300; -y[37] = 16.340567076777361000; -y[38] = 27.155709029035226000; -y[39] = 45.128943775619703000; -y[40] = 74.997915323273489000; -y[41] = 124.635917268588530000; -y[42] = 207.127248889834330000; -y[43] = 344.216163148372520000; -y[44] = 572.038529974419700000; -y[45] = 950.647049174870860000; -y[46] = 1579.840805732611900000; -y[47] = 2625.471749609100700000; -y[48] = 4363.162340777078500000; -y[49] = 7250.958085841060000000; -y[50] = 12050.065767953940000000; -y[51] = 20025.503291152076000000; -y[52] = 33279.551314186152000000; -y[53] = 55305.902656783459000000; -y[54] = 91910.580157904318000000; -y[55] = 152742.371775148380000000; -y[56] = 253836.197045168550000000; -y[57] = 421839.822058054970000000; -y[58] = 701038.061338060300000000; -y[59] = 1165026.006902193900000000; -y[60] = 1936108.282291886200000000; -y[61] = 3217537.856280616000000000; -y[62] = 5347092.386973262800000000; -y[63] = 8886110.520507872100000000; - - - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.exp(x[i]); - if (!isEqual(val, y[i])) - { - $ERROR("\nx = " + x[i] + "\nlibc.exp(x) = " + y[i] + "\nMath.exp(x) = " + Math.exp(x[i]) + "\nMath.abs(libc.exp(x) - Math.exp(x)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Math/hypot/Math.hypot_Success.js b/test/built-ins/Math/hypot/Math.hypot_Success.js deleted file mode 100644 index 02d7fc7e38..0000000000 --- a/test/built-ins/Math/hypot/Math.hypot_Success.js +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2014 Ryan Lewis. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es6id: 20.2.2.18 -author: Ryan Lewis -description: Math.hypot should return 4 if called with 3 and 2.6457513110645907. ----*/ - -assert.sameValue(Math.hypot(3,2.6457513110645907), 4, 'Math.hypot(3,2.6457513110645907)'); diff --git a/test/built-ins/Math/log/S15.8.2.10_A6.js b/test/built-ins/Math/log/S15.8.2.10_A6.js deleted file mode 100644 index 850e2434f4..0000000000 --- a/test/built-ins/Math/log/S15.8.2.10_A6.js +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - Math.log, recommended that implementations use the approximation - algorithms for IEEE 754 arithmetic contained in fdlibm -es5id: 15.8.2.10_A6 -description: > - Checking if Math.log is approximately equals to its mathematical - values on the set of 64 argument values; all the sample values is - calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var vnum = 64; -var x = new Array(); -x[0] = 0.00000000000000000000; -x[1] = 0.25396825396825395000; -x[2] = 0.50793650793650791000; -x[3] = 0.76190476190476186000; -x[4] = 1.01587301587301580000; -x[5] = 1.26984126984126980000; -x[6] = 1.52380952380952370000; -x[7] = 1.77777777777777770000; -x[8] = 2.03174603174603160000; -x[9] = 2.28571428571428560000; -x[10] = 2.53968253968253950000; -x[11] = 2.79365079365079350000; -x[12] = 3.04761904761904740000; -x[13] = 3.30158730158730140000; -x[14] = 3.55555555555555540000; -x[15] = 3.80952380952380930000; -x[16] = 4.06349206349206330000; -x[17] = 4.31746031746031720000; -x[18] = 4.57142857142857120000; -x[19] = 4.82539682539682510000; -x[20] = 5.07936507936507910000; -x[21] = 5.33333333333333300000; -x[22] = 5.58730158730158700000; -x[23] = 5.84126984126984090000; -x[24] = 6.09523809523809490000; -x[25] = 6.34920634920634890000; -x[26] = 6.60317460317460280000; -x[27] = 6.85714285714285680000; -x[28] = 7.11111111111111070000; -x[29] = 7.36507936507936470000; -x[30] = 7.61904761904761860000; -x[31] = 7.87301587301587260000; -x[32] = 8.12698412698412650000; -x[33] = 8.38095238095238140000; -x[34] = 8.63492063492063440000; -x[35] = 8.88888888888888930000; -x[36] = 9.14285714285714230000; -x[37] = 9.39682539682539720000; -x[38] = 9.65079365079365030000; -x[39] = 9.90476190476190510000; -x[40] = 10.15873015873015800000; -x[41] = 10.41269841269841300000; -x[42] = 10.66666666666666600000; -x[43] = 10.92063492063492100000; -x[44] = 11.17460317460317400000; -x[45] = 11.42857142857142900000; -x[46] = 11.68253968253968200000; -x[47] = 11.93650793650793700000; -x[48] = 12.19047619047619000000; -x[49] = 12.44444444444444500000; -x[50] = 12.69841269841269800000; -x[51] = 12.95238095238095300000; -x[52] = 13.20634920634920600000; -x[53] = 13.46031746031746000000; -x[54] = 13.71428571428571400000; -x[55] = 13.96825396825396800000; -x[56] = 14.22222222222222100000; -x[57] = 14.47619047619047600000; -x[58] = 14.73015873015872900000; -x[59] = 14.98412698412698400000; -x[60] = 15.23809523809523700000; -x[61] = 15.49206349206349200000; -x[62] = 15.74603174603174500000; -x[63] = 16.00000000000000000000; - - - -var y = new Array(); -y[0] = -Infinity; -y[1] = -1.37054600415175140000; -y[2] = -0.67739882359180614000; -y[3] = -0.27193371548364181000; -y[4] = 0.01574835696813911200; -y[5] = 0.23889190828234888000; -y[6] = 0.42121346507630347000; -y[7] = 0.57536414490356180000; -y[8] = 0.70889553752808443000; -y[9] = 0.82667857318446791000; -y[10] = 0.93203908884229414000; -y[11] = 1.02734926864661900000; -y[12] = 1.11436064563624870000; -y[13] = 1.19440335330978530000; -y[14] = 1.26851132546350720000; -y[15] = 1.33750419695045860000; -y[16] = 1.40204271808802970000; -y[17] = 1.46266733990446450000; -y[18] = 1.51982575374441310000; -y[19] = 1.57389297501468910000; -y[20] = 1.62518626940223940000; -y[21] = 1.67397643357167160000; -y[22] = 1.72049644920656440000; -y[23] = 1.76494821177739820000; -y[24] = 1.80750782619619410000; -y[25] = 1.84832982071644910000; -y[26] = 1.88755053386973050000; -y[27] = 1.92529086185257750000; -y[28] = 1.96165850602345240000; -y[29] = 1.99674982583472250000; -y[30] = 2.03065137751040400000; -y[31] = 2.06344120033339480000; -y[32] = 2.09518989864797510000; -y[33] = 2.12596155731472880000; -y[34] = 2.15581452046440970000; -y[35] = 2.18480205733766210000; -y[36] = 2.21297293430435850000; -y[37] = 2.24037190849247290000; -y[38] = 2.26704015557463420000; -y[39] = 2.29301564197789490000; -y[40] = 2.31833344996218480000; -y[41] = 2.34302606255255650000; -y[42] = 2.36712361413161700000; -y[43] = 2.39065411154181100000; -y[44] = 2.41364362976650960000; -y[45] = 2.43611648561856820000; -y[46] = 2.45809539233734360000; -y[47] = 2.47960159755830700000; -y[48] = 2.50065500675613930000; -y[49] = 2.52127429395887500000; -y[50] = 2.54147700127639450000; -y[51] = 2.56127962857257430000; -y[52] = 2.58069771442967570000; -y[53] = 2.59974590940037050000; -y[54] = 2.61843804241252310000; -y[55] = 2.63678718108071930000; -y[56] = 2.65480568658339780000; -y[57] = 2.67250526368279880000; -y[58] = 2.68989700639466770000; -y[59] = 2.70699143975396780000; -y[60] = 2.72379855807034900000; -y[61] = 2.74032786002155990000; -y[62] = 2.75658838089334020000; -y[63] = 2.77258872223978110000; - - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.log(x[i]); - if (!isEqual(val, y[i])) - { - $ERROR("\nx = " + x[i] + "\nlibc.log(x) = " + y[i] + "\nMath.log(x) = " + Math.log(x[i]) + "\nMath.abs(libc.log(x) - Math.log(x)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Math/pow/applying-the-exp-operator_A24.js b/test/built-ins/Math/pow/applying-the-exp-operator_A24.js deleted file mode 100644 index 13d1173666..0000000000 --- a/test/built-ins/Math/pow/applying-the-exp-operator_A24.js +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-applying-the-exp-operator -description: > - Checking if Math.pow(argument1, argument2) is approbaseimatelexponent equals - to its mathematical value on the set of 64 argument1 values and 64 - argument2 values; all the sample values is calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -var vnum = 64; -var base1 = new Array(); -base1[0] = 0.00000000000000000000; -base1[1] = 0.25396825396825395000; -base1[2] = 0.50793650793650791000; -base1[3] = 0.76190476190476186000; -base1[4] = 1.01587301587301580000; -base1[5] = 1.26984126984126980000; -base1[6] = 1.52380952380952370000; -base1[7] = 1.77777777777777770000; -base1[8] = 2.03174603174603160000; -base1[9] = 2.28571428571428560000; -base1[10] = 2.53968253968253950000; -base1[11] = 2.79365079365079350000; -base1[12] = 3.04761904761904740000; -base1[13] = 3.30158730158730140000; -base1[14] = 3.55555555555555540000; -base1[15] = 3.80952380952380930000; -base1[16] = 4.06349206349206330000; -base1[17] = 4.31746031746031720000; -base1[18] = 4.57142857142857120000; -base1[19] = 4.82539682539682510000; -base1[20] = 5.07936507936507910000; -base1[21] = 5.33333333333333300000; -base1[22] = 5.58730158730158700000; -base1[23] = 5.84126984126984090000; -base1[24] = 6.09523809523809490000; -base1[25] = 6.34920634920634890000; -base1[26] = 6.60317460317460280000; -base1[27] = 6.85714285714285680000; -base1[28] = 7.11111111111111070000; -base1[29] = 7.36507936507936470000; -base1[30] = 7.61904761904761860000; -base1[31] = 7.87301587301587260000; -base1[32] = 8.12698412698412650000; -base1[33] = 8.38095238095238140000; -base1[34] = 8.63492063492063440000; -base1[35] = 8.88888888888888930000; -base1[36] = 9.14285714285714230000; -base1[37] = 9.39682539682539720000; -base1[38] = 9.65079365079365030000; -base1[39] = 9.90476190476190510000; -base1[40] = 10.15873015873015800000; -base1[41] = 10.41269841269841300000; -base1[42] = 10.66666666666666600000; -base1[43] = 10.92063492063492100000; -base1[44] = 11.17460317460317400000; -base1[45] = 11.42857142857142900000; -base1[46] = 11.68253968253968200000; -base1[47] = 11.93650793650793700000; -base1[48] = 12.19047619047619000000; -base1[49] = 12.44444444444444500000; -base1[50] = 12.69841269841269800000; -base1[51] = 12.95238095238095300000; -base1[52] = 13.20634920634920600000; -base1[53] = 13.46031746031746000000; -base1[54] = 13.71428571428571400000; -base1[55] = 13.96825396825396800000; -base1[56] = 14.22222222222222100000; -base1[57] = 14.47619047619047600000; -base1[58] = 14.73015873015872900000; -base1[59] = 14.98412698412698400000; -base1[60] = 15.23809523809523700000; -base1[61] = 15.49206349206349200000; -base1[62] = 15.74603174603174500000; -base1[63] = 16.00000000000000000000; - - - -var base2 = new Array(); -base2[0] = -16.00000000000000000000; -base2[1] = -15.49206349206349200000; -base2[2] = -14.98412698412698400000; -base2[3] = -14.47619047619047600000; -base2[4] = -13.96825396825396800000; -base2[5] = -13.46031746031746000000; -base2[6] = -12.95238095238095300000; -base2[7] = -12.44444444444444500000; -base2[8] = -11.93650793650793700000; -base2[9] = -11.42857142857142900000; -base2[10] = -10.92063492063492100000; -base2[11] = -10.41269841269841300000; -base2[12] = -9.90476190476190510000; -base2[13] = -9.39682539682539720000; -base2[14] = -8.88888888888888930000; -base2[15] = -8.38095238095238140000; -base2[16] = -7.87301587301587350000; -base2[17] = -7.36507936507936560000; -base2[18] = -6.85714285714285770000; -base2[19] = -6.34920634920634970000; -base2[20] = -5.84126984126984180000; -base2[21] = -5.33333333333333390000; -base2[22] = -4.82539682539682600000; -base2[23] = -4.31746031746031810000; -base2[24] = -3.80952380952381020000; -base2[25] = -3.30158730158730230000; -base2[26] = -2.79365079365079440000; -base2[27] = -2.28571428571428650000; -base2[28] = -1.77777777777777860000; -base2[29] = -1.26984126984127070000; -base2[30] = -0.76190476190476275000; -base2[31] = -0.25396825396825484000; -base2[32] = 0.25396825396825307000; -base2[33] = 0.76190476190476275000; -base2[34] = 1.26984126984126890000; -base2[35] = 1.77777777777777860000; -base2[36] = 2.28571428571428470000; -base2[37] = 2.79365079365079440000; -base2[38] = 3.30158730158730050000; -base2[39] = 3.80952380952381020000; -base2[40] = 4.31746031746031630000; -base2[41] = 4.82539682539682600000; -base2[42] = 5.33333333333333210000; -base2[43] = 5.84126984126984180000; -base2[44] = 6.34920634920634800000; -base2[45] = 6.85714285714285770000; -base2[46] = 7.36507936507936380000; -base2[47] = 7.87301587301587350000; -base2[48] = 8.38095238095237960000; -base2[49] = 8.88888888888888930000; -base2[50] = 9.39682539682539540000; -base2[51] = 9.90476190476190510000; -base2[52] = 10.41269841269841100000; -base2[53] = 10.92063492063492100000; -base2[54] = 11.42857142857142700000; -base2[55] = 11.93650793650793700000; -base2[56] = 12.44444444444444300000; -base2[57] = 12.95238095238095300000; -base2[58] = 13.46031746031745900000; -base2[59] = 13.96825396825396800000; -base2[60] = 14.47619047619047400000; -base2[61] = 14.98412698412698400000; -base2[62] = 15.49206349206349000000; -base2[63] = 16.00000000000000000000; - - -var exponent = new Array(); -exponent[0] = +Infinity; -exponent[1] = 1664158979.11096290000000000000; -exponent[2] = 25596.98862206424700000000; -exponent[3] = 51.24224360332205900000; -exponent[4] = 0.80253721621001273000; -exponent[5] = 0.04013281604184240600; -exponent[6] = 0.00427181167466968250; -exponent[7] = 0.00077698684629307839; -exponent[8] = 0.00021140449751288852; -exponent[9] = 0.00007886641216275820; -exponent[10] = 0.00003797970495625904; -exponent[11] = 0.00002260186576944384; -exponent[12] = 0.00001608735704675994; -exponent[13] = 0.00001335526639440840; -exponent[14] = 0.00001267782407825002; -exponent[15] = 0.00001354410739307298; -exponent[16] = 0.00001607404700077214; -exponent[17] = 0.00002096489798949858; -exponent[18] = 0.00002978033411316872; -exponent[19] = 0.00004572015769326707; -exponent[20] = 0.00007536620884896827; -exponent[21] = 0.00013263967558882687; -exponent[22] = 0.00024800091950917796; -exponent[23] = 0.00049049578772052680; -exponent[24] = 0.00102225521238885490; -exponent[25] = 0.00223744147356661880; -exponent[26] = 0.00512739755878587920; -exponent[27] = 0.01226918030754863000; -exponent[28] = 0.03058049475427409400; -exponent[29] = 0.07921771472569966200; -exponent[30] = 0.21285098601167457000; -exponent[31] = 0.59211846233860321000; -exponent[32] = 1.70252376919407730000; -exponent[33] = 5.05197994186350920000; -exponent[34] = 15.44896866758827700000; -exponent[35] = 48.62279949816147700000; -exponent[36] = 157.31086033139039000000; -exponent[37] = 522.60021277476767000000; -exponent[38] = 1780.82316713426990000000; -exponent[39] = 6218.58509846337710000000; -exponent[40] = 22232.54916898025500000000; -exponent[41] = 81310.50695814844200000000; -exponent[42] = 303962.39599994919000000000; -exponent[43] = 1160609.39151835810000000000; -exponent[44] = 4523160.16396183520000000000; -exponent[45] = 17980506.53105686600000000000; -exponent[46] = 72861260.63140085300000000000; -exponent[47] = 300795965.18372804000000000000; -exponent[48] = 1264408843.88636260000000000000; -exponent[49] = 5408983705.82595920000000000000; -exponent[50] = 23536438485.32324600000000000000; -exponent[51] = 104125724201.77888000000000000000; -exponent[52] = 468137079409.17462000000000000000; -exponent[53] = 2137965865913.91260000000000000000; -exponent[54] = 9914368643808.25200000000000000000; -exponent[55] = 46665726995317.89800000000000000000; -exponent[56] = 222863786409039.87000000000000000000; -exponent[57] = 1079534443702065.00000000000000000000; -exponent[58] = 5302037850329952.00000000000000000000; -exponent[59] = 26394813313751084.00000000000000000000; -exponent[60] = 133146543235024720.00000000000000000000; -exponent[61] = 680375082351885950.00000000000000000000; -exponent[62] = 3520878542447823900.00000000000000000000; -exponent[63] = 18446744073709552000.00000000000000000000; - - - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.pow(base1[i], base2[i]); - if (!isEqual(val, exponent[i])) - { - $ERROR("\nbase1 = " + base1[i] + "\nbase2 = " + base2[i] + "\nlibc.pow(base1,base2) = " + exponent[i] + "\nMath.pow(base1,base2) = " + Math.pow(base1[i], base2[i]) + "\nMath.abs(libc.pow(base1,base2) - Math.pow(base1,base2)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Math/sin/S15.8.2.16_A6.js b/test/built-ins/Math/sin/S15.8.2.16_A6.js deleted file mode 100644 index e982dec1b8..0000000000 --- a/test/built-ins/Math/sin/S15.8.2.16_A6.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Sine is a periodic function with period 2*PI -es5id: 15.8.2.16_A6 -description: > - Checking if Math.sin(x) equals to Math.sin(x+n*2*Math.PI) with - precision 0.000000000003, where n is an integer from 1 to 100 and - x is one of 10 float point values from 0 to 2*Math.PI ----*/ - -// CHECK#1 -var prec = 0.000000000003; -//prec = 0.000000000000001; -var period = 2*Math.PI; -var pernum = 100; - -var a = -pernum * period; -var b = pernum * period; -var snum = 9; -var step = period/snum + 0.0; -var x = new Array(); -for (var i = 0; i < snum; i++) -{ - x[i] = a + i*step; -} -x[9] = a + period; - -var curval; -var curx; -var j; -for (i = 0; i < snum; i++) -{ - curval = Math.sin(x[i]); - curx = x[i] + period; - var j = 0; - while (curx <= b) - { - curx += period; - j++; - if (Math.abs(Math.sin(curx) - curval) >= prec) - { - $ERROR("#1: sin is found out to not be periodic:\n Math.abs(Math.sin(" + x[i] + ") - Math.sin(" + x[i] + " + 2*Math.PI*" + j + ")) >= " + prec + "\n Math.sin(" + x[i] + ") === " + curval + "\n Math.sin(" + curx + ") === " + Math.sin(curx)); - } - } -} diff --git a/test/built-ins/Math/sin/S15.8.2.16_A7.js b/test/built-ins/Math/sin/S15.8.2.16_A7.js deleted file mode 100644 index cb6d2f8849..0000000000 --- a/test/built-ins/Math/sin/S15.8.2.16_A7.js +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - Math.sin it is recommended that implementations use the approximation - algorithms for IEEE 754 arithmetic contained in fdlibm -es5id: 15.8.2.16_A7 -description: > - Checking if Math.sin is approximately equals to its mathematical - values on the set of 64 argument values; all the sample values is - calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var vnum = 64; -var x = new Array(); -x[0] = 0.00000000000000000000; -x[1] = 0.09973310011396169200; -x[2] = 0.19946620022792338000; -x[3] = 0.29919930034188508000; -x[4] = 0.39893240045584677000; -x[5] = 0.49866550056980841000; -x[6] = 0.59839860068377015000; -x[7] = 0.69813170079773179000; -x[8] = 0.79786480091169354000; -x[9] = 0.89759790102565518000; -x[10] = 0.99733100113961681000; -x[11] = 1.09706410125357840000; -x[12] = 1.19679720136754030000; -x[13] = 1.29653030148150190000; -x[14] = 1.39626340159546360000; -x[15] = 1.49599650170942520000; -x[16] = 1.59572960182338710000; -x[17] = 1.69546270193734870000; -x[18] = 1.79519580205131040000; -x[19] = 1.89492890216527200000; -x[20] = 1.99466200227923360000; -x[21] = 2.09439510239319570000; -x[22] = 2.19412820250715690000; -x[23] = 2.29386130262111850000; -x[24] = 2.39359440273508060000; -x[25] = 2.49332750284904230000; -x[26] = 2.59306060296300390000; -x[27] = 2.69279370307696550000; -x[28] = 2.79252680319092720000; -x[29] = 2.89225990330488880000; -x[30] = 2.99199300341885040000; -x[31] = 3.09172610353281210000; -x[32] = 3.19145920364677420000; -x[33] = 3.29119230376073580000; -x[34] = 3.39092540387469740000; -x[35] = 3.49065850398865910000; -x[36] = 3.59039160410262070000; -x[37] = 3.69012470421658230000; -x[38] = 3.78985780433054400000; -x[39] = 3.88959090444450560000; -x[40] = 3.98932400455846730000; -x[41] = 4.08905710467242840000; -x[42] = 4.18879020478639140000; -x[43] = 4.28852330490035260000; -x[44] = 4.38825640501431380000; -x[45] = 4.48798950512827590000; -x[46] = 4.58772260524223710000; -x[47] = 4.68745570535619920000; -x[48] = 4.78718880547016120000; -x[49] = 4.88692190558412240000; -x[50] = 4.98665500569808450000; -x[51] = 5.08638810581204570000; -x[52] = 5.18612120592600780000; -x[53] = 5.28585430603996990000; -x[54] = 5.38558740615393110000; -x[55] = 5.48532050626789310000; -x[56] = 5.58505360638185430000; -x[57] = 5.68478670649581550000; -x[58] = 5.78451980660977760000; -x[59] = 5.88425290672373970000; -x[60] = 5.98398600683770090000; -x[61] = 6.08371910695166300000; -x[62] = 6.18345220706562420000; -// Result is implementation dependent and varies on platform as you approach limits. -// e.g. Output approaches zero as input approaches PI * 2 (6.28318530717958647). -// The value of 6.2831 for x[63] is chosen below as an arbitrary cut off point for -// expecting a result within the validation's tolerance range. -x[63] = 6.2831; - - -var y = new Array(); -y[0] = 0.00000000000000000000; -y[1] = 0.09956784659581666100; -y[2] = 0.19814614319939758000; -y[3] = 0.29475517441090421000; -y[4] = 0.38843479627469474000; -y[5] = 0.47825397862131819000; -y[6] = 0.56332005806362206000; -y[7] = 0.64278760968653925000; -y[8] = 0.71586684925971844000; -y[9] = 0.78183148246802980000; -y[10] = 0.84002592315077140000; -y[11] = 0.88987180881146855000; -y[12] = 0.93087374864420425000; -y[13] = 0.96262424695001203000; -y[14] = 0.98480775301220802000; -y[15] = 0.99720379718118013000; -y[16] = 0.99968918200081625000; -y[17] = 0.99223920660017206000; -y[18] = 0.97492791218182362000; -y[19] = 0.94792734616713181000; -y[20] = 0.91150585231167325000; -y[21] = 0.86602540378443849000; -y[22] = 0.81193800571585661000; -y[23] = 0.74978120296773443000; -y[24] = 0.68017273777091936000; -y[25] = 0.60380441032547738000; -y[26] = 0.52143520337949811000; -y[27] = 0.43388373911755823000; -y[28] = 0.34202014332566888000; -y[29] = 0.24675739769029384000; -y[30] = 0.14904226617617472000; -y[31] = 0.04984588566069748200; -y[32] = -0.04984588566069723300; -y[33] = -0.14904226617617447000; -y[34] = -0.24675739769029362000; -y[35] = -0.34202014332566866000; -y[36] = -0.43388373911755801000; -y[37] = -0.52143520337949789000; -y[38] = -0.60380441032547716000; -y[39] = -0.68017273777091913000; -y[40] = -0.74978120296773398000; -y[41] = -0.81193800571585595000; -y[42] = -0.86602540378443882000; -y[43] = -0.91150585231167314000; -y[44] = -0.94792734616713159000; -y[45] = -0.97492791218182362000; -y[46] = -0.99223920660017195000; -y[47] = -0.99968918200081625000; -y[48] = -0.99720379718118013000; -y[49] = -0.98480775301220813000; -y[50] = -0.96262424695001203000; -y[51] = -0.93087374864420447000; -y[52] = -0.88987180881146866000; -y[53] = -0.84002592315077129000; -y[54] = -0.78183148246802991000; -y[55] = -0.71586684925971833000; -y[56] = -0.64278760968653958000; -y[57] = -0.56332005806362273000; -y[58] = -0.47825397862131858000; -y[59] = -0.38843479627469474000; -y[60] = -0.29475517441090471000; -y[61] = -0.19814614319939772000; -y[62] = -0.09956784659581728600; -y[63] = -0.00008530717948287973; - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.sin(x[i]); - if (!isEqual(val, y[i])) - { - $ERROR("\nx = " + x[i] + "\nlibc.sin(x) = " + y[i] + "\nMath.sin(x) = " + Math.sin(x[i]) + "\nMath.abs(libc.sin(x) - Math.sin(x)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Math/sqrt/S15.8.2.17_A6.js b/test/built-ins/Math/sqrt/S15.8.2.17_A6.js deleted file mode 100644 index b8abff5171..0000000000 --- a/test/built-ins/Math/sqrt/S15.8.2.17_A6.js +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - Math.sqrt, recommended that implementations use the approximation - algorithms for IEEE 754 arithmetic contained in fdlibm -es5id: 15.8.2.17_A6 -description: > - Checking if Math.sqrt is approximately equals to its mathematical - values on the set of 64 argument values; all the sample values is - calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var vnum = 64; -var x = new Array(); -x[0] = 0.00000000000000000000; -x[1] = 0.25396825396825395000; -x[2] = 0.50793650793650791000; -x[3] = 0.76190476190476186000; -x[4] = 1.01587301587301580000; -x[5] = 1.26984126984126980000; -x[6] = 1.52380952380952370000; -x[7] = 1.77777777777777770000; -x[8] = 2.03174603174603160000; -x[9] = 2.28571428571428560000; -x[10] = 2.53968253968253950000; -x[11] = 2.79365079365079350000; -x[12] = 3.04761904761904740000; -x[13] = 3.30158730158730140000; -x[14] = 3.55555555555555540000; -x[15] = 3.80952380952380930000; -x[16] = 4.06349206349206330000; -x[17] = 4.31746031746031720000; -x[18] = 4.57142857142857120000; -x[19] = 4.82539682539682510000; -x[20] = 5.07936507936507910000; -x[21] = 5.33333333333333300000; -x[22] = 5.58730158730158700000; -x[23] = 5.84126984126984090000; -x[24] = 6.09523809523809490000; -x[25] = 6.34920634920634890000; -x[26] = 6.60317460317460280000; -x[27] = 6.85714285714285680000; -x[28] = 7.11111111111111070000; -x[29] = 7.36507936507936470000; -x[30] = 7.61904761904761860000; -x[31] = 7.87301587301587260000; -x[32] = 8.12698412698412650000; -x[33] = 8.38095238095238140000; -x[34] = 8.63492063492063440000; -x[35] = 8.88888888888888930000; -x[36] = 9.14285714285714230000; -x[37] = 9.39682539682539720000; -x[38] = 9.65079365079365030000; -x[39] = 9.90476190476190510000; -x[40] = 10.15873015873015800000; -x[41] = 10.41269841269841300000; -x[42] = 10.66666666666666600000; -x[43] = 10.92063492063492100000; -x[44] = 11.17460317460317400000; -x[45] = 11.42857142857142900000; -x[46] = 11.68253968253968200000; -x[47] = 11.93650793650793700000; -x[48] = 12.19047619047619000000; -x[49] = 12.44444444444444500000; -x[50] = 12.69841269841269800000; -x[51] = 12.95238095238095300000; -x[52] = 13.20634920634920600000; -x[53] = 13.46031746031746000000; -x[54] = 13.71428571428571400000; -x[55] = 13.96825396825396800000; -x[56] = 14.22222222222222100000; -x[57] = 14.47619047619047600000; -x[58] = 14.73015873015872900000; -x[59] = 14.98412698412698400000; -x[60] = 15.23809523809523700000; -x[61] = 15.49206349206349200000; -x[62] = 15.74603174603174500000; -x[63] = 16.00000000000000000000; - - - -var y = new Array(); -y[0] = 0.00000000000000000000; -y[1] = 0.50395263067896967000; -y[2] = 0.71269664509979835000; -y[3] = 0.87287156094396945000; -y[4] = 1.00790526135793930000; -y[5] = 1.12687233963802200000; -y[6] = 1.23442679969673530000; -y[7] = 1.33333333333333330000; -y[8] = 1.42539329019959670000; -y[9] = 1.51185789203690880000; -y[10] = 1.59363814577919150000; -y[11] = 1.67142178807468980000; -y[12] = 1.74574312188793890000; -y[13] = 1.81702705031799170000; -y[14] = 1.88561808316412670000; -y[15] = 1.95180014589706640000; -y[16] = 2.01581052271587870000; -y[17] = 2.07784992659727900000; -y[18] = 2.13808993529939520000; -y[19] = 2.19667858946110380000; -y[20] = 2.25374467927604400000; -y[21] = 2.30940107675850290000; -y[22] = 2.36374736114111530000; -y[23] = 2.41687191246657520000; -y[24] = 2.46885359939347060000; -y[25] = 2.51976315339484810000; -y[26] = 2.56966429775848400000; -y[27] = 2.61861468283190830000; -y[28] = 2.66666666666666650000; -y[29] = 2.71386797119523940000; -y[30] = 2.76026223736941700000; -y[31] = 2.80588949764880670000; -y[32] = 2.85078658039919340000; -y[33] = 2.89498745782298350000; -y[34] = 2.93852354676981160000; -y[35] = 2.98142396999971960000; -y[36] = 3.02371578407381760000; -y[37] = 3.06542417893925380000; -y[38] = 3.10657265339049320000; -y[39] = 3.14718316987777280000; -y[40] = 3.18727629155838300000; -y[41] = 3.22687130401855570000; -y[42] = 3.26598632371090410000; -y[43] = 3.30463839483761390000; -y[44] = 3.34284357614937950000; -y[45] = 3.38061701891406630000; -y[46] = 3.41797303712883060000; -y[47] = 3.45492517089848670000; -y[48] = 3.49148624377587780000; -y[49] = 3.52766841475278750000; -y[50] = 3.56348322549899170000; -y[51] = 3.59894164336974940000; -y[52] = 3.63405410063598340000; -y[53] = 3.66883053033489940000; -y[54] = 3.70328039909020570000; -y[55] = 3.73741273720925400000; -y[56] = 3.77123616632825340000; -y[57] = 3.80475892484536750000; -y[58] = 3.83798889135426350000; -y[59] = 3.87093360626696680000; -y[60] = 3.90360029179413280000; -y[61] = 3.93599587043272870000; -y[62] = 3.96812698209517300000; -y[63] = 4.00000000000000000000; - - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.sqrt(x[i]); - if (!isEqual(val, y[i])) - { - $ERROR("\nx = " + x[i] + "\nlibc.sqrt(x) = " + y[i] + "\nMath.sqrt(x) = " + Math.sqrt(x[i]) + "\nMath.abs(libc.sqrt(x) - Math.sqrt(x)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Math/tan/S15.8.2.18_A6.js b/test/built-ins/Math/tan/S15.8.2.18_A6.js deleted file mode 100644 index c3484066b0..0000000000 --- a/test/built-ins/Math/tan/S15.8.2.18_A6.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Tangent is a periodic function with period PI -es5id: 15.8.2.18_A6 -description: > - Checking if Math.tan(x) equals to Math.tan(x+n*Math.PI) with - precision 0.000000000003, where n is an integer from 1 to 100 and - x is one of 10 float point values from 0 to Math.PI ----*/ - -// CHECK#1 -var prec = 0.00000000003; -//prec = 0.000000000000001; -var period = Math.PI; -var pernum = 100; - -var a = -pernum * period + period/2; -var b = pernum * period - period/2; -var snum = 9; -var step = period/(snum + 2); -var x = new Array(); -for (var i = 0; i <= snum; i++) //// We exlude special points -{ //// in this cycle. - x[i] = a + (i+1)*step; //// -} //// - - -var curval; -var curx; -var j; -for (i = 0; i < snum; i++) -{ - curval = Math.tan(x[i]); - curx = x[i] + period; - var j = 0; - while (curx <= b) - { - curx += period; - j++; - if (Math.abs(Math.tan(curx) - curval) >= prec) - { - $ERROR("#1: tan is found out to not be periodic:\n Math.abs(Math.tan(" + x[i] + ") - Math.tan(" + x[i] + " + 2*Math.PI*" + j + ")) >= " + prec + "\n Math.tan(" + x[i] + ") === " + curval + "\n Math.tan(" + curx + ") === " + Math.tan(curx)); - } - } -} diff --git a/test/built-ins/Math/tan/S15.8.2.18_A7.js b/test/built-ins/Math/tan/S15.8.2.18_A7.js deleted file mode 100644 index b210835139..0000000000 --- a/test/built-ins/Math/tan/S15.8.2.18_A7.js +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - Math.tan, recommended that implementations use the approximation - algorithms for IEEE 754 arithmetic contained in fdlibm -es5id: 15.8.2.18_A7 -description: > - Checking if Math.tan is approximately equals to its mathematical - values on the set of 64 argument values; all the sample values is - calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -var vnum = 64; -var x = new Array(); -// Result is implementation dependent and varies on platform as you approach limits. -// e.g. Output approaches Infinity as input approaches PI / 2 (1.5707963267948966) -// The value of 1.5707 for x[0] is chosen below as an arbitrary cut off point for -// expecting a result within the validation's tolerance range. -x[0] = -1.5707; -x[1] = -1.52092977673791570000; -x[2] = -1.47106322668093490000; -x[3] = -1.42119667662395410000; -x[4] = -1.37133012656697330000; -x[5] = -1.32146357650999220000; -x[6] = -1.27159702645301140000; -x[7] = -1.22173047639603060000; -x[8] = -1.17186392633904980000; -x[9] = -1.12199737628206900000; -x[10] = -1.07213082622508820000; -x[11] = -1.02226427616810730000; -x[12] = -0.97239772611112640000; -x[13] = -0.92253117605414559000; -x[14] = -0.87266462599716477000; -x[15] = -0.82279807594018395000; -x[16] = -0.77293152588320302000; -x[17] = -0.72306497582622220000; -x[18] = -0.67319842576924138000; -x[19] = -0.62333187571226056000; -x[20] = -0.57346532565527975000; -x[21] = -0.52359877559829870000; -x[22] = -0.47373222554131811000; -x[23] = -0.42386567548433729000; -x[24] = -0.37399912542735625000; -x[25] = -0.32413257537037543000; -x[26] = -0.27426602531339461000; -x[27] = -0.22439947525641379000; -x[28] = -0.17453292519943298000; -x[29] = -0.12466637514245216000; -x[30] = -0.07479982508547133900; -x[31] = -0.02493327502849052000; -x[32] = 0.02493327502849052000; -x[33] = 0.07479982508547133900; -x[34] = 0.12466637514245216000; -x[35] = 0.17453292519943298000; -x[36] = 0.22439947525641379000; -x[37] = 0.27426602531339461000; -x[38] = 0.32413257537037543000; -x[39] = 0.37399912542735625000; -x[40] = 0.42386567548433707000; -x[41] = 0.47373222554131766000; -x[42] = 0.52359877559829915000; -x[43] = 0.57346532565527975000; -x[44] = 0.62333187571226034000; -x[45] = 0.67319842576924138000; -x[46] = 0.72306497582622198000; -x[47] = 0.77293152588320302000; -x[48] = 0.82279807594018406000; -x[49] = 0.87266462599716466000; -x[50] = 0.92253117605414570000; -x[51] = 0.97239772611112629000; -x[52] = 1.02226427616810730000; -x[53] = 1.07213082622508840000; -x[54] = 1.12199737628206900000; -x[55] = 1.17186392633905000000; -x[56] = 1.22173047639603060000; -x[57] = 1.27159702645301120000; -x[58] = 1.32146357650999220000; -x[59] = 1.37133012656697330000; -x[60] = 1.42119667662395390000; -x[61] = 1.47106322668093490000; -x[62] = 1.52092977673791550000; -x[63] = 1.5707; - - - -var y = new Array(); -y[0] = -10381.32741756979; -y[1] = -20.03689788997828100000; -y[2] = -9.99349498241742220000; -y[3] = -6.63456649978931170000; -y[4] = -4.94671494494940060000; -y[5] = -3.92724714760272690000; -y[6] = -3.24192037576928720000; -y[7] = -2.74747741945462160000; -y[8] = -2.37228029184788760000; -y[9] = -2.07652139657233640000; -y[10] = -1.83630792973623100000; -y[11] = -1.63642745273401610000; -y[12] = -1.46673061342097340000; -y[13] = -1.32018331365488460000; -y[14] = -1.19175359259421000000; -y[15] = -1.07774368351222650000; -y[16] = -0.97537247158200291000; -y[17] = -0.88250523616465493000; -y[18] = -0.79747338888240393000; -y[19] = -0.71895103828786056000; -y[20] = -0.64586847728552887000; -y[21] = -0.57735026918962551000; -y[22] = -0.51267008667516678000; -y[23] = -0.45121718317830323000; -y[24] = -0.39247107881010240000; -y[25] = -0.33598213147817668000; -y[26] = -0.28135637451595324000; -y[27] = -0.22824347439014994000; -y[28] = -0.17632698070846500000; -y[29] = -0.12531625823730441000; -y[30] = -0.07493964001908703900; -y[31] = -0.02493844305504610100; -y[32] = 0.02493844305504610100; -y[33] = 0.07493964001908703900; -y[34] = 0.12531625823730441000; -y[35] = 0.17632698070846500000; -y[36] = 0.22824347439014994000; -y[37] = 0.28135637451595324000; -y[38] = 0.33598213147817668000; -y[39] = 0.39247107881010240000; -y[40] = 0.45121718317830301000; -y[41] = 0.51267008667516623000; -y[42] = 0.57735026918962618000; -y[43] = 0.64586847728552887000; -y[44] = 0.71895103828786022000; -y[45] = 0.79747338888240393000; -y[46] = 0.88250523616465459000; -y[47] = 0.97537247158200291000; -y[48] = 1.07774368351222670000; -y[49] = 1.19175359259420950000; -y[50] = 1.32018331365488510000; -y[51] = 1.46673061342097320000; -y[52] = 1.63642745273401610000; -y[53] = 1.83630792973623190000; -y[54] = 2.07652139657233640000; -y[55] = 2.37228029184788890000; -y[56] = 2.74747741945462160000; -y[57] = 3.24192037576928450000; -y[58] = 3.92724714760272690000; -y[59] = 4.94671494494940060000; -y[60] = 6.63456649978930190000; -y[61] = 9.99349498241742220000; -y[62] = 20.03689788997819200000; -y[63] = 10381.32741756979; - - -var val; -for (var i = 0; i < vnum; i++) -{ - val = Math.tan(x[i]); - if (!isEqual(val, y[i])) - { - $ERROR("\nx = " + x[i] + "\nlibc.tan(x) = " + y[i] + "\nMath.tan(x) = " + Math.tan(x[i]) + "\nMath.abs(libc.tan(x) - Math.tan(x)) > " + prec + "\n\n"); - } -} diff --git a/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A1.js b/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A1.js deleted file mode 100644 index 41437b85fb..0000000000 --- a/test/built-ins/Number/MAX_VALUE/S15.7.3.2_A1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Number.MAX_VALUE is approximately 1.7976931348623157e308 -es5id: 15.7.3.2_A1 -description: Checking Number.MAX_VALUE value -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -if (!isEqual(Number.MAX_VALUE, 1.7976931348623157e308)) { - $ERROR('#1: Number.MAX_VALUE approximately equal to 1.7976931348623157e308'); -} diff --git a/test/built-ins/Number/S9.3_A4.1_T1.js b/test/built-ins/Number/S9.3_A4.1_T1.js index aea8a515d8..ad8eea310c 100644 --- a/test/built-ins/Number/S9.3_A4.1_T1.js +++ b/test/built-ins/Number/S9.3_A4.1_T1.js @@ -30,13 +30,3 @@ if (Number(1.3) !== 1.3) { if (Number(-1.3) !== -1.3) { $ERROR('#4: Number(-1.3) === -1.3. Actual: ' + (Number(-1.3))); } - -// CHECK#5 -if (Number(Number.MAX_VALUE) !== 1.7976931348623157e308) { - $ERROR('#5: Number(Number.MAX_VALUE) === 1.7976931348623157e308. Actual: ' + (Number(Number.MAX_VALUE))); -} - -// CHECK#6 -if (Number(Number.MIN_VALUE) !== 5e-324) { - $ERROR('#6: Number(Number.MIN_VALUE) === 5e-324. Actual: ' + (Number(Number.MIN_VALUE))); -} diff --git a/test/language/expressions/addition/S9.3_A4.1_T2.js b/test/language/expressions/addition/S9.3_A4.1_T2.js index 9b84b011d2..587749acde 100644 --- a/test/language/expressions/addition/S9.3_A4.1_T2.js +++ b/test/language/expressions/addition/S9.3_A4.1_T2.js @@ -30,13 +30,3 @@ if (+(1.3) !== 1.3) { if (+(-1.3) !== -1.3) { $ERROR('#4: +(-1.3) === -1.3. Actual: ' + (+(-1.3))); } - -// CHECK#5 -if (+(Number.MAX_VALUE) !== 1.7976931348623157e308) { - $ERROR('#5: +(Number.MAX_VALUE) === 1.7976931348623157e308. Actual: ' + (+(Number.MAX_VALUE))); -} - -// CHECK#6 -if (+(Number.MIN_VALUE) !== 5e-324) { - $ERROR('#6: +(Number.MIN_VALUE) === 5e-324. Actual: ' + (+(Number.MIN_VALUE))); -} diff --git a/test/language/expressions/exponentiation/applying-the-exp-operator_A24.js b/test/language/expressions/exponentiation/applying-the-exp-operator_A24.js deleted file mode 100644 index 9592ccd328..0000000000 --- a/test/language/expressions/exponentiation/applying-the-exp-operator_A24.js +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2016 Rick Waldron. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-applying-the-exp-operator -description: > - Checking if Math.pow(argument1, argument2) is approximately equals - to its mathematical value on the set of 64 argument1 values and 64 - argument2 values; all the sample values is calculated with LibC -includes: - - math_precision.js - - math_isequal.js ----*/ - -var vnum = 64; -var base1 = []; -base1[0] = 0.00000000000000000000; -base1[1] = 0.25396825396825395000; -base1[2] = 0.50793650793650791000; -base1[3] = 0.76190476190476186000; -base1[4] = 1.01587301587301580000; -base1[5] = 1.26984126984126980000; -base1[6] = 1.52380952380952370000; -base1[7] = 1.77777777777777770000; -base1[8] = 2.03174603174603160000; -base1[9] = 2.28571428571428560000; -base1[10] = 2.53968253968253950000; -base1[11] = 2.79365079365079350000; -base1[12] = 3.04761904761904740000; -base1[13] = 3.30158730158730140000; -base1[14] = 3.55555555555555540000; -base1[15] = 3.80952380952380930000; -base1[16] = 4.06349206349206330000; -base1[17] = 4.31746031746031720000; -base1[18] = 4.57142857142857120000; -base1[19] = 4.82539682539682510000; -base1[20] = 5.07936507936507910000; -base1[21] = 5.33333333333333300000; -base1[22] = 5.58730158730158700000; -base1[23] = 5.84126984126984090000; -base1[24] = 6.09523809523809490000; -base1[25] = 6.34920634920634890000; -base1[26] = 6.60317460317460280000; -base1[27] = 6.85714285714285680000; -base1[28] = 7.11111111111111070000; -base1[29] = 7.36507936507936470000; -base1[30] = 7.61904761904761860000; -base1[31] = 7.87301587301587260000; -base1[32] = 8.12698412698412650000; -base1[33] = 8.38095238095238140000; -base1[34] = 8.63492063492063440000; -base1[35] = 8.88888888888888930000; -base1[36] = 9.14285714285714230000; -base1[37] = 9.39682539682539720000; -base1[38] = 9.65079365079365030000; -base1[39] = 9.90476190476190510000; -base1[40] = 10.15873015873015800000; -base1[41] = 10.41269841269841300000; -base1[42] = 10.66666666666666600000; -base1[43] = 10.92063492063492100000; -base1[44] = 11.17460317460317400000; -base1[45] = 11.42857142857142900000; -base1[46] = 11.68253968253968200000; -base1[47] = 11.93650793650793700000; -base1[48] = 12.19047619047619000000; -base1[49] = 12.44444444444444500000; -base1[50] = 12.69841269841269800000; -base1[51] = 12.95238095238095300000; -base1[52] = 13.20634920634920600000; -base1[53] = 13.46031746031746000000; -base1[54] = 13.71428571428571400000; -base1[55] = 13.96825396825396800000; -base1[56] = 14.22222222222222100000; -base1[57] = 14.47619047619047600000; -base1[58] = 14.73015873015872900000; -base1[59] = 14.98412698412698400000; -base1[60] = 15.23809523809523700000; -base1[61] = 15.49206349206349200000; -base1[62] = 15.74603174603174500000; -base1[63] = 16.00000000000000000000; - - - -var base2 = []; -base2[0] = -16.00000000000000000000; -base2[1] = -15.49206349206349200000; -base2[2] = -14.98412698412698400000; -base2[3] = -14.47619047619047600000; -base2[4] = -13.96825396825396800000; -base2[5] = -13.46031746031746000000; -base2[6] = -12.95238095238095300000; -base2[7] = -12.44444444444444500000; -base2[8] = -11.93650793650793700000; -base2[9] = -11.42857142857142900000; -base2[10] = -10.92063492063492100000; -base2[11] = -10.41269841269841300000; -base2[12] = -9.90476190476190510000; -base2[13] = -9.39682539682539720000; -base2[14] = -8.88888888888888930000; -base2[15] = -8.38095238095238140000; -base2[16] = -7.87301587301587350000; -base2[17] = -7.36507936507936560000; -base2[18] = -6.85714285714285770000; -base2[19] = -6.34920634920634970000; -base2[20] = -5.84126984126984180000; -base2[21] = -5.33333333333333390000; -base2[22] = -4.82539682539682600000; -base2[23] = -4.31746031746031810000; -base2[24] = -3.80952380952381020000; -base2[25] = -3.30158730158730230000; -base2[26] = -2.79365079365079440000; -base2[27] = -2.28571428571428650000; -base2[28] = -1.77777777777777860000; -base2[29] = -1.26984126984127070000; -base2[30] = -0.76190476190476275000; -base2[31] = -0.25396825396825484000; -base2[32] = 0.25396825396825307000; -base2[33] = 0.76190476190476275000; -base2[34] = 1.26984126984126890000; -base2[35] = 1.77777777777777860000; -base2[36] = 2.28571428571428470000; -base2[37] = 2.79365079365079440000; -base2[38] = 3.30158730158730050000; -base2[39] = 3.80952380952381020000; -base2[40] = 4.31746031746031630000; -base2[41] = 4.82539682539682600000; -base2[42] = 5.33333333333333210000; -base2[43] = 5.84126984126984180000; -base2[44] = 6.34920634920634800000; -base2[45] = 6.85714285714285770000; -base2[46] = 7.36507936507936380000; -base2[47] = 7.87301587301587350000; -base2[48] = 8.38095238095237960000; -base2[49] = 8.88888888888888930000; -base2[50] = 9.39682539682539540000; -base2[51] = 9.90476190476190510000; -base2[52] = 10.41269841269841100000; -base2[53] = 10.92063492063492100000; -base2[54] = 11.42857142857142700000; -base2[55] = 11.93650793650793700000; -base2[56] = 12.44444444444444300000; -base2[57] = 12.95238095238095300000; -base2[58] = 13.46031746031745900000; -base2[59] = 13.96825396825396800000; -base2[60] = 14.47619047619047400000; -base2[61] = 14.98412698412698400000; -base2[62] = 15.49206349206349000000; -base2[63] = 16.00000000000000000000; - - -var exponents = []; -exponents[0] = +Infinity; -exponents[1] = 1664158979.11096290000000000000; -exponents[2] = 25596.98862206424700000000; -exponents[3] = 51.24224360332205900000; -exponents[4] = 0.80253721621001273000; -exponents[5] = 0.04013281604184240600; -exponents[6] = 0.00427181167466968250; -exponents[7] = 0.00077698684629307839; -exponents[8] = 0.00021140449751288852; -exponents[9] = 0.00007886641216275820; -exponents[10] = 0.00003797970495625904; -exponents[11] = 0.00002260186576944384; -exponents[12] = 0.00001608735704675994; -exponents[13] = 0.00001335526639440840; -exponents[14] = 0.00001267782407825002; -exponents[15] = 0.00001354410739307298; -exponents[16] = 0.00001607404700077214; -exponents[17] = 0.00002096489798949858; -exponents[18] = 0.00002978033411316872; -exponents[19] = 0.00004572015769326707; -exponents[20] = 0.00007536620884896827; -exponents[21] = 0.00013263967558882687; -exponents[22] = 0.00024800091950917796; -exponents[23] = 0.00049049578772052680; -exponents[24] = 0.00102225521238885490; -exponents[25] = 0.00223744147356661880; -exponents[26] = 0.00512739755878587920; -exponents[27] = 0.01226918030754863000; -exponents[28] = 0.03058049475427409400; -exponents[29] = 0.07921771472569966200; -exponents[30] = 0.21285098601167457000; -exponents[31] = 0.59211846233860321000; -exponents[32] = 1.70252376919407730000; -exponents[33] = 5.05197994186350920000; -exponents[34] = 15.44896866758827700000; -exponents[35] = 48.62279949816147700000; -exponents[36] = 157.31086033139039000000; -exponents[37] = 522.60021277476767000000; -exponents[38] = 1780.82316713426990000000; -exponents[39] = 6218.58509846337710000000; -exponents[40] = 22232.54916898025500000000; -exponents[41] = 81310.50695814844200000000; -exponents[42] = 303962.39599994919000000000; -exponents[43] = 1160609.39151835810000000000; -exponents[44] = 4523160.16396183520000000000; -exponents[45] = 17980506.53105686600000000000; -exponents[46] = 72861260.63140085300000000000; -exponents[47] = 300795965.18372804000000000000; -exponents[48] = 1264408843.88636260000000000000; -exponents[49] = 5408983705.82595920000000000000; -exponents[50] = 23536438485.32324600000000000000; -exponents[51] = 104125724201.77888000000000000000; -exponents[52] = 468137079409.17462000000000000000; -exponents[53] = 2137965865913.91260000000000000000; -exponents[54] = 9914368643808.25200000000000000000; -exponents[55] = 46665726995317.89800000000000000000; -exponents[56] = 222863786409039.87000000000000000000; -exponents[57] = 1079534443702065.00000000000000000000; -exponents[58] = 5302037850329952.00000000000000000000; -exponents[59] = 26394813313751084.00000000000000000000; -exponents[60] = 133146543235024720.00000000000000000000; -exponents[61] = 680375082351885950.00000000000000000000; -exponents[62] = 3520878542447823900.00000000000000000000; -exponents[63] = 18446744073709552000.00000000000000000000; - - - -var val; -for (var i = 0; i < vnum; i++) { - val = base1[i] ** base2[i]; - if (!isEqual(val, exponents[i])) { - $ERROR("\nx1 = " + base1[i] + "\nx2 = " + base2[i] + "\nlibc.pow(x1,x2) = " + exponents[i] + "\n(x1 ** base2) = " + (base1[i] ** base2[i]) + "\nMath.abs(libc.pow(x1,x2) - (x1 ** base2)) > " + prec + "\n\n"); - } -}