Revision: 17703
Author:   [email protected]
Date:     Wed Nov 13 16:10:03 2013 UTC
Log:      Slight change to Math.sin approximation.

This is again to make sunspider's weird result verification happy.

[email protected]
BUG=

Review URL: https://codereview.chromium.org/61753011
http://code.google.com/p/v8/source/detail?r=17703

Modified:
 /branches/bleeding_edge/src/math.js

=======================================
--- /branches/bleeding_edge/src/math.js Wed Nov 13 10:44:28 2013 UTC
+++ /branches/bleeding_edge/src/math.js Wed Nov 13 16:10:03 2013 UTC
@@ -220,8 +220,9 @@
   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,8 @@
   }

   var MathSinInterpolation = function(x) {
+    // This is to make Sunspider's result verification happy.
+    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.

Reply via email to