Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: test/mjsunit/harmony/math-hyperbolic.js

Issue 181453002: Reset trunk to 3.24.35.4 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/harmony/math-fround.js ('k') | test/mjsunit/harmony/math-log1p.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 test_id(Math.tanh, Math.atanh, -x); 53 test_id(Math.tanh, Math.atanh, -x);
54 }); 54 });
55 55
56 56
57 [Math.sinh, Math.asinh, Math.tanh, Math.atanh].forEach(function(fun) { 57 [Math.sinh, Math.asinh, Math.tanh, Math.atanh].forEach(function(fun) {
58 assertEquals("-Infinity", String(1/fun(-0))); 58 assertEquals("-Infinity", String(1/fun(-0)));
59 assertEquals("Infinity", String(1/fun(0))); 59 assertEquals("Infinity", String(1/fun(0)));
60 }); 60 });
61 61
62 62
63 [Math.sinh, Math.asinh].forEach(function(fun) { 63 [Math.sinh, Math.asinh, Math.cosh].forEach(function(fun) {
64 assertEquals("-Infinity", String(fun(-Infinity))); 64 assertEquals("-Infinity", String(fun(-Infinity)));
65 assertEquals("Infinity", String(fun(Infinity))); 65 assertEquals("Infinity", String(fun(Infinity)));
66 assertEquals("-Infinity", String(fun("-Infinity"))); 66 assertEquals("-Infinity", String(fun("-Infinity")));
67 assertEquals("Infinity", String(fun("Infinity"))); 67 assertEquals("Infinity", String(fun("Infinity")));
68 }); 68 });
69 69
70 70
71 assertEquals("Infinity", String(Math.cosh(-Infinity)));
72 assertEquals("Infinity", String(Math.cosh(Infinity)));
73 assertEquals("Infinity", String(Math.cosh("-Infinity")));
74 assertEquals("Infinity", String(Math.cosh("Infinity")));
75
76
77 assertEquals("-Infinity", String(Math.atanh(-1))); 71 assertEquals("-Infinity", String(Math.atanh(-1)));
78 assertEquals("Infinity", String(Math.atanh(1))); 72 assertEquals("Infinity", String(Math.atanh(1)));
79 73
80 // Math.atanh(x) is NaN for |x| > 1 and NaN 74 // Math.atanh(x) is NaN for |x| > 1 and NaN
81 [1.000000000001, Math.PI, 10000000, 2, Infinity, NaN].forEach(function(x) { 75 [1.000000000001, Math.PI, 10000000, 2, Infinity, NaN].forEach(function(x) {
82 assertTrue(isNaN(Math.atanh(-x))); 76 assertTrue(isNaN(Math.atanh(-x)));
83 assertTrue(isNaN(Math.atanh(x))); 77 assertTrue(isNaN(Math.atanh(x)));
84 }); 78 });
85 79
86 80
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 assertEqualsDelta(-0.5493061443341, Math.atanh(-0.5), 1E-12); 123 assertEqualsDelta(-0.5493061443341, Math.atanh(-0.5), 1E-12);
130 assertEqualsDelta(-0.1003353477311, Math.atanh(-0.1), 1E-12); 124 assertEqualsDelta(-0.1003353477311, Math.atanh(-0.1), 1E-12);
131 125
132 [0, 1E-50, 1E-10, 1E10, 1E50, 1E100, 1E150].forEach(function(x) { 126 [0, 1E-50, 1E-10, 1E10, 1E50, 1E100, 1E150].forEach(function(x) {
133 assertEqualsDelta(Math.asinh(x), -Math.asinh(-x), 1E-12); 127 assertEqualsDelta(Math.asinh(x), -Math.asinh(-x), 1E-12);
134 }); 128 });
135 129
136 [1-(1E-16), 0, 1E-10, 1E-50].forEach(function(x) { 130 [1-(1E-16), 0, 1E-10, 1E-50].forEach(function(x) {
137 assertEqualsDelta(Math.atanh(x), -Math.atanh(-x), 1E-12); 131 assertEqualsDelta(Math.atanh(x), -Math.atanh(-x), 1E-12);
138 }); 132 });
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/math-fround.js ('k') | test/mjsunit/harmony/math-log1p.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698