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

Unified Diff: test/mjsunit/harmony/math-expm1.js

Issue 195123002: Harmony: move math features to es-staging. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: done Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/harmony/math-expm1.js
diff --git a/test/mjsunit/harmony/math-expm1.js b/test/mjsunit/harmony/math-expm1.js
deleted file mode 100644
index de915c0969eb495f4d87142a339b85ecf1e275c7..0000000000000000000000000000000000000000
--- a/test/mjsunit/harmony/math-expm1.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --harmony-maths --no-fast-math
-
-assertTrue(isNaN(Math.expm1(NaN)));
-assertTrue(isNaN(Math.expm1(function() {})));
-assertTrue(isNaN(Math.expm1({ toString: function() { return NaN; } })));
-assertTrue(isNaN(Math.expm1({ valueOf: function() { return "abc"; } })));
-assertEquals("Infinity", String(1/Math.expm1(0)));
-assertEquals("-Infinity", String(1/Math.expm1(-0)));
-assertEquals("Infinity", String(Math.expm1(Infinity)));
-assertEquals(-1, Math.expm1(-Infinity));
-
-for (var x = 0.1; x < 700; x += 0.1) {
- var expected = Math.exp(x) - 1;
- assertEqualsDelta(expected, Math.expm1(x), expected * 1E-14);
- expected = Math.exp(-x) - 1;
- assertEqualsDelta(expected, Math.expm1(-x), -expected * 1E-14);
-}
-
-// Values close to 0:
-// Use six terms of Taylor expansion at 0 for exp(x) as test expectation:
-// exp(x) - 1 == exp(0) + exp(0) * x + x * x / 2 + ... - 1
-// == x + x * x / 2 + x * x * x / 6 + ...
-function expm1(x) {
- return x * (1 + x * (1/2 + x * (
- 1/6 + x * (1/24 + x * (
- 1/120 + x * (1/720 + x * (
- 1/5040 + x * (1/40320 + x*(
- 1/362880 + x * (1/3628800))))))))));
-}
-
-for (var x = 1E-1; x > 1E-300; x *= 0.8) {
- var expected = expm1(x);
- assertEqualsDelta(expected, Math.expm1(x), expected * 1E-14);
-}

Powered by Google App Engine
This is Rietveld 408576698