aboutsummaryrefslogtreecommitdiffstats
path: root/website/resources/scripts/testcases2/15.8.2.3_asin.json
blob: c804f679d017a0891a783946ba70a83cf4adae56 (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.3_asin",
  "numTests": 6,
  "tests": [
   {
    "section": "15.8.2.3",
    "description": "Checking if Math.asin(NaN) is NaN",
    "test": "// CHECK#1\nvar x = NaN;\nif (!isNaN(Math.asin(x)))\n{\n\t$ERROR(\"#1: 'var x=NaN; isNaN(Math.asin(x)) === false'\");\n}\n",
    "id": "S15.8.2.3_A1"
   },
   {
    "section": "15.8.2.3",
    "description": "Checking if Math.asin(x) is NaN, where x is greater than 1",
    "test": "// CHECK#1\nvar x = 1.000000000000001;\nif (!isNaN(Math.asin(x)))\n{\n\t$ERROR(\"#1: 'var x = 1.000000000000001; isNaN(Math.asin(x)) === false'\");\n}\n\n// CHECK#2\nx = 2;\nif (!isNaN(Math.asin(x)))\n{\n\t$ERROR(\"#2: 'x = 2; isNaN(Math.asin(x)) === false'\");\n}\n\n// CHECK#3\nx = +Infinity;\nif (!isNaN(Math.asin(x)))\n{\n\t$ERROR(\"#3: 'x = +Infinity; isNaN(Math.asin(x)) === false'\");\n}\n",
    "id": "S15.8.2.3_A2"
   },
   {
    "section": "15.8.2.3",
    "description": "Checking if Math.asin(x) is NaN, where x is less than -1",
    "test": "// CHECK#1\nvar x = -1.000000000000001;\nif (!isNaN(Math.asin(x)))\n{\n\t$ERROR(\"#1: 'var x = -1.000000000000001; isNaN(Math.asin(x)) === false'\");\n}\n\n// CHECK#2\nx = -2;\nif (!isNaN(Math.asin(x)))\n{\n\t$ERROR(\"#2: 'x = -2; isNaN(Math.asin(x)) === false'\");\n}\n\n// CHECK#3\nx = -Infinity;\nif (!isNaN(Math.asin(x)))\n{\n\t$ERROR(\"#3: 'x = -Infinity; isNaN(Math.asin(x)) === false'\");\n}\n",
    "id": "S15.8.2.3_A3"
   },
   {
    "section": "15.8.2.3",
    "description": "Checking if Math.asin(+0) equals +0",
    "test": "// CHECK#1\nvar x = +0;\nif (Math.asin(x) !== +0)\n{\n\t$ERROR(\"#1: 'var x = +0; Math.asin(x) !== +0'\");\n}\n",
    "id": "S15.8.2.3_A4"
   },
   {
    "section": "15.8.2.3",
    "description": "Checking if Math.asin(-0) equals to -0",
    "test": "// CHECK#1\nvar x = -0;\nif (Math.asin(x) !== -0)\n{\n\t$ERROR(\"#1: 'var x = -0; Math.asin(x) !== -0'\");\n}\n",
    "id": "S15.8.2.3_A5"
   },
   {
    "section": "15.8.2.3",
    "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;",
    "test": "$INCLUDE(\"math_precision.js\");\n$INCLUDE(\"math_isequal.js\");\n\n// CHECK#1\nvnum = 64;\nvar x = new Array();\nx[0] = -1.00000000000000000000;\nx[1] = -0.96825396825396826000;\nx[2] = -0.93650793650793651000;\nx[3] = -0.90476190476190477000;\nx[4] = -0.87301587301587302000;\nx[5] = -0.84126984126984128000;\nx[6] = -0.80952380952380953000;\nx[7] = -0.77777777777777779000;\nx[8] = -0.74603174603174605000;\nx[9] = -0.71428571428571430000;\nx[10] = -0.68253968253968256000;\nx[11] = -0.65079365079365081000;\nx[12] = -0.61904761904761907000;\nx[13] = -0.58730158730158732000;\nx[14] = -0.55555555555555558000;\nx[15] = -0.52380952380952384000;\nx[16] = -0.49206349206349209000;\nx[17] = -0.46031746031746035000;\nx[18] = -0.42857142857142860000;\nx[19] = -0.39682539682539686000;\nx[20] = -0.36507936507936511000;\nx[21] = -0.33333333333333337000;\nx[22] = -0.30158730158730163000;\nx[23] = -0.26984126984126988000;\nx[24] = -0.23809523809523814000;\nx[25] = -0.20634920634920639000;\nx[26] = -0.17460317460317465000;\nx[27] = -0.14285714285714290000;\nx[28] = -0.11111111111111116000;\nx[29] = -0.07936507936507941600;\nx[30] = -0.04761904761904767200;\nx[31] = -0.01587301587301592800;\nx[32] = 0.01587301587301581700;\nx[33] = 0.04761904761904767200;\nx[34] = 0.07936507936507930500;\nx[35] = 0.11111111111111116000;\nx[36] = 0.14285714285714279000;\nx[37] = 0.17460317460317465000;\nx[38] = 0.20634920634920628000;\nx[39] = 0.23809523809523814000;\nx[40] = 0.26984126984126977000;\nx[41] = 0.30158730158730163000;\nx[42] = 0.33333333333333326000;\nx[43] = 0.36507936507936511000;\nx[44] = 0.39682539682539675000;\nx[45] = 0.42857142857142860000;\nx[46] = 0.46031746031746024000;\nx[47] = 0.49206349206349209000;\nx[48] = 0.52380952380952372000;\nx[49] = 0.55555555555555558000;\nx[50] = 0.58730158730158721000;\nx[51] = 0.61904761904761907000;\nx[52] = 0.65079365079365070000;\nx[53] = 0.68253968253968256000;\nx[54] = 0.71428571428571419000;\nx[55] = 0.74603174603174605000;\nx[56] = 0.77777777777777768000;\nx[57] = 0.80952380952380953000;\nx[58] = 0.84126984126984117000;\nx[59] = 0.87301587301587302000;\nx[60] = 0.90476190476190466000;\nx[61] = 0.93650793650793651000;\nx[62] = 0.96825396825396814000;\nx[63] = 1.00000000000000000000;\n\n\n\n\nvar y = new Array();\ny[0] = -1.57079632679489660000;\ny[1] = -1.31814860051033310000;\ny[2] = -1.21253510828227990000;\ny[3] = -1.13082037200397780000;\ny[4] = -1.06135247798300370000;\ny[5] = -0.99962782822935903000;\ny[6] = -0.94334055387170590000;\ny[7] = -0.89112250788665281000;\ny[8] = -0.84208287605149101000;\ny[9] = -0.79560295348453536000;\ny[10] = -0.75123199912663585000;\ny[11] = -0.70862927156238398000;\ny[12] = -0.66752944463583297000;\ny[13] = -0.62772081765791266000;\ny[14] = -0.58903097021627393000;\ny[15] = -0.55131696913188277000;\ny[16] = -0.51445847556118673000;\ny[17] = -0.47835276464925774000;\ny[18] = -0.44291104407363896000;\ny[19] = -0.40805567730127851000;\ny[20] = -0.37371805094291394000;\ny[21] = -0.33983690945412198000;\ny[22] = -0.30635703455691915000;\ny[23] = -0.27322818254063785000;\ny[24] = -0.24040421676925938000;\ny[25] = -0.20784238935334678000;\ny[26] = -0.17550273757572274000;\ny[27] = -0.14334756890536540000;\ny[28] = -0.11134101434096394000;\ny[29] = -0.07944863408513722100;\ny[30] = -0.04763706262440318300;\ny[31] = -0.01587368248995573600;\ny[32] = 0.01587368248995562500;\ny[33] = 0.04763706262440318300;\ny[34] = 0.07944863408513711000;\ny[35] = 0.11134101434096394000;\ny[36] = 0.14334756890536529000;\ny[37] = 0.17550273757572274000;\ny[38] = 0.20784238935334667000;\ny[39] = 0.24040421676925938000;\ny[40] = 0.27322818254063774000;\ny[41] = 0.30635703455691915000;\ny[42] = 0.33983690945412187000;\ny[43] = 0.37371805094291394000;\ny[44] = 0.40805567730127840000;\ny[45] = 0.44291104407363896000;\ny[46] = 0.47835276464925758000;\ny[47] = 0.51445847556118673000;\ny[48] = 0.55131696913188266000;\ny[49] = 0.58903097021627393000;\ny[50] = 0.62772081765791254000;\ny[51] = 0.66752944463583297000;\ny[52] = 0.70862927156238387000;\ny[53] = 0.75123199912663585000;\ny[54] = 0.79560295348453514000;\ny[55] = 0.84208287605149101000;\ny[56] = 0.89112250788665259000;\ny[57] = 0.94334055387170590000;\ny[58] = 0.99962782822935881000;\ny[59] = 1.06135247798300370000;\ny[60] = 1.13082037200397760000;\ny[61] = 1.21253510828227990000;\ny[62] = 1.31814860051033270000;\ny[63] = 1.57079632679489660000;\n\n\n\nvar val;\nfor (i = 0; i < vnum; i++)\n{\n\tval = Math.asin(x[i]);\n\tif (!isEqual(val, y[i]))\n\t{\n\t\t$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\"); \n\t}\n}\n",
    "id": "S15.8.2.3_A6"
   }
  ]
 }
}