Reviewers: Jakob,
Description:
Slight change to Math.sin approximation.
This is again to make sunspider's weird result verification happy.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/61753011/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+4, -2 lines):
M src/math.js
Index: src/math.js
diff --git a/src/math.js b/src/math.js
index
385b3c2a221832bbe1d15cc268ed7ae2b6ac74e0..e1a6ae9e4b675a76857f74802a5e3e2fa4c7b45b
100644
--- a/src/math.js
+++ b/src/math.js
@@ -220,8 +220,9 @@ function SetupTrigonometricFunctions() {
var samples = 1800; // Table size.
var pi = 3.1415926535897932;
var pi_half = pi / 2;
- var inverse_pi_half = 1 / pi_half;
- var two_pi = pi * 2;
+ var inverse_pi_half = 2 / pi;
+ var two_pi = 2 * pi;
+ var four_pi = 4 * pi;
var interval = pi_half / samples;
var inverse_interval = samples / pi_half;
var table_sin;
@@ -252,6 +253,7 @@ function SetupTrigonometricFunctions() {
}
var MathSinInterpolation = function(x) {
+ if (x > four_pi) x -= four_pi;
var multiple = MathFloor(x * inverse_pi_half);
if (%_IsMinusZero(multiple)) return multiple;
x = (multiple & 1) * pi_half +
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.