aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/15.8.2.8_exp.json
blob: 47cf62774bb9e8583a4c4abb375fafa76dba629d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
 "testCollection": {
  "name": "15.8.2.8_exp",
  "numTests": 6,
  "tests": [
   {
    "section": "15.8.2.8",
    "description": "Checking if Math.exp(NaN) is NaN",
    "test": "// CHECK#1\nvar x = NaN;\nif (!isNaN(Math.exp(x)))\n{\n\t$ERROR(\"#1: 'var x=NaN; isNaN(Math.exp(x)) === false'\");\n}\n",
    "id": "S15.8.2.8_A1"
   },
   {
    "section": "15.8.2.8",
    "description": "Checking if Math.exp(+0) is 1",
    "test": "// CHECK#1\nvar x = +0;\nif (Math.exp(x) !== 1)\n{\n\t$ERROR(\"#1: 'var x = +0; Math.exp(x) !== 1'\");\n}\n",
    "id": "S15.8.2.8_A2"
   },
   {
    "section": "15.8.2.8",
    "description": "Checking if Math.exp(-0) is 1",
    "test": "// CHECK#1\nvar x = -0;\nif (Math.exp(x) !== 1)\n{\n\t$ERROR(\"#1: 'var x = -0; Math.exp(x) !== 1'\");\n}\n",
    "id": "S15.8.2.8_A3"
   },
   {
    "section": "15.8.2.8",
    "description": "Checking if Math.exp(+Infinity) is +Ifinity",
    "test": "// CHECK#1\nvar x = +Infinity;\nif (Math.exp(x) !== +Infinity)\n{\n\t$ERROR(\"#1: 'var x = +Infinity; Math.exp(x) !== +Infinity'\");\n}\n",
    "id": "S15.8.2.8_A4"
   },
   {
    "section": "15.8.2.8",
    "description": "Checking if Math.exp(-Infinity) is +0",
    "test": "// CHECK#1\nvar x = -Infinity;\nif (Math.exp(x) !== +0)\n{\n\t$ERROR(\"#1: 'var x = -Infinity; Math.exp(x) !== +0'\");\n}\n",
    "id": "S15.8.2.8_A5"
   },
   {
    "section": "15.8.2.8",
    "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;",
    "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\");\n\n// CHECK#1\nvnum = 64;\nvar x = new Array();\nx[0] = -16.00000000000000000000;\nx[1] = -15.49206349206349200000;\nx[2] = -14.98412698412698400000;\nx[3] = -14.47619047619047600000;\nx[4] = -13.96825396825396800000;\nx[5] = -13.46031746031746000000;\nx[6] = -12.95238095238095300000;\nx[7] = -12.44444444444444500000;\nx[8] = -11.93650793650793700000;\nx[9] = -11.42857142857142900000;\nx[10] = -10.92063492063492100000;\nx[11] = -10.41269841269841300000;\nx[12] = -9.90476190476190510000;\nx[13] = -9.39682539682539720000;\nx[14] = -8.88888888888888930000;\nx[15] = -8.38095238095238140000;\nx[16] = -7.87301587301587350000;\nx[17] = -7.36507936507936560000;\nx[18] = -6.85714285714285770000;\nx[19] = -6.34920634920634970000;\nx[20] = -5.84126984126984180000;\nx[21] = -5.33333333333333390000;\nx[22] = -4.82539682539682600000;\nx[23] = -4.31746031746031810000;\nx[24] = -3.80952380952381020000;\nx[25] = -3.30158730158730230000;\nx[26] = -2.79365079365079440000;\nx[27] = -2.28571428571428650000;\nx[28] = -1.77777777777777860000;\nx[29] = -1.26984126984127070000;\nx[30] = -0.76190476190476275000;\nx[31] = -0.25396825396825484000;\nx[32] = 0.25396825396825307000;\nx[33] = 0.76190476190476275000;\nx[34] = 1.26984126984126890000;\nx[35] = 1.77777777777777860000;\nx[36] = 2.28571428571428470000;\nx[37] = 2.79365079365079440000;\nx[38] = 3.30158730158730050000;\nx[39] = 3.80952380952381020000;\nx[40] = 4.31746031746031630000;\nx[41] = 4.82539682539682600000;\nx[42] = 5.33333333333333210000;\nx[43] = 5.84126984126984180000;\nx[44] = 6.34920634920634800000;\nx[45] = 6.85714285714285770000;\nx[46] = 7.36507936507936380000;\nx[47] = 7.87301587301587350000;\nx[48] = 8.38095238095237960000;\nx[49] = 8.88888888888888930000;\nx[50] = 9.39682539682539540000;\nx[51] = 9.90476190476190510000;\nx[52] = 10.41269841269841100000;\nx[53] = 10.92063492063492100000;\nx[54] = 11.42857142857142700000;\nx[55] = 11.93650793650793700000;\nx[56] = 12.44444444444444300000;\nx[57] = 12.95238095238095300000;\nx[58] = 13.46031746031745900000;\nx[59] = 13.96825396825396800000;\nx[60] = 14.47619047619047400000;\nx[61] = 14.98412698412698400000;\nx[62] = 15.49206349206349000000;\nx[63] = 16.00000000000000000000;\n\n\n\nvar y = new Array();\ny[0] = 0.0000001125351747192591200;\ny[1] = 0.0000001870175279627160400;\ny[2] = 0.0000003107966540465112000;\ny[3] = 0.0000005165000372893601900;\ny[4] = 0.0000008583499373194266000;\ny[5] = 0.000001426456073000250500;\ny[6] = 0.000002370568039596737700;\ny[7] = 0.000003939548463303105900;\ny[8] = 0.000006546971795567619300;\ny[9] = 0.00001088014022196331600;\ny[10] = 0.00001808125266855845500;\ny[11] = 0.00003004848204109428100;\ny[12] = 0.00004993632297081056800;\ny[13] = 0.00008298709893014922600;\ny[14] = 0.0001379128093365619200;\ny[15] = 0.0002291915638009238700;\ny[16] = 0.0003808839307255494700;\ny[17] = 0.0006329751683659501200;\ny[18] = 0.001051915114939835700;\ny[19] = 0.001748133993779607700;\ny[20] = 0.002905151201656255000;\ny[21] = 0.004827949993831437100;\ny[22] = 0.008023369361859111100;\ny[23] = 0.01333370395283075800;\ny[24] = 0.02215872822045164600;\ny[25] = 0.03682466913056056000;\ny[26] = 0.06119738655956222900;\ny[27] = 0.1017013923042267600;\ny[28] = 0.1690133154060659600;\ny[29] = 0.2808762017642814100;\ny[30] = 0.4667764816516809500;\ny[31] = 0.7757164275739275600;\ny[32] = 1.289130878828392400;\ny[33] = 2.142353009006615400;\ny[34] = 3.560287392519015300;\ny[35] = 5.916693590664334800;\ny[36] = 9.832707078469738300;\ny[37] = 16.340567076777361000;\ny[38] = 27.155709029035226000;\ny[39] = 45.128943775619703000;\ny[40] = 74.997915323273489000;\ny[41] = 124.635917268588530000;\ny[42] = 207.127248889834330000;\ny[43] = 344.216163148372520000;\ny[44] = 572.038529974419700000;\ny[45] = 950.647049174870860000;\ny[46] = 1579.840805732611900000;\ny[47] = 2625.471749609100700000;\ny[48] = 4363.162340777078500000;\ny[49] = 7250.958085841060000000;\ny[50] = 12050.065767953940000000;\ny[51] = 20025.503291152076000000;\ny[52] = 33279.551314186152000000;\ny[53] = 55305.902656783459000000;\ny[54] = 91910.580157904318000000;\ny[55] = 152742.371775148380000000;\ny[56] = 253836.197045168550000000;\ny[57] = 421839.822058054970000000;\ny[58] = 701038.061338060300000000;\ny[59] = 1165026.006902193900000000;\ny[60] = 1936108.282291886200000000;\ny[61] = 3217537.856280616000000000;\ny[62] = 5347092.386973262800000000;\ny[63] = 8886110.520507872100000000;\n\n\n\nvar val;\nfor (i = 0; i < vnum; i++)\n{\n\tval = Math.exp(x[i]);\n\tif (!isEqual(val, y[i]))\n\t{\n\t\t$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\"); \n\t}\n}\n",
    "id": "S15.8.2.8_A6"
   }
  ]
 }
}