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

Side by Side Diff: test/mjsunit/sin-cos.js

Issue 305403002: fdlibm: reduce accuracy slightly in favor of performance. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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
« src/math.js ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 assertEquals(0.41421356237309503, Math.tan(Math.PI / 8)); 218 assertEquals(0.41421356237309503, Math.tan(Math.PI / 8));
219 219
220 // Tests for Math.sin. 220 // Tests for Math.sin.
221 assertEquals(0.479425538604203, Math.sin(0.5)); 221 assertEquals(0.479425538604203, Math.sin(0.5));
222 assertEquals(-0.479425538604203, Math.sin(-0.5)); 222 assertEquals(-0.479425538604203, Math.sin(-0.5));
223 assertEquals(1, Math.sin(Math.PI/2)); 223 assertEquals(1, Math.sin(Math.PI/2));
224 assertEquals(-1, Math.sin(-Math.PI/2)); 224 assertEquals(-1, Math.sin(-Math.PI/2));
225 assertEquals(1.2246467991473532e-16, Math.sin(Math.PI)); 225 assertEquals(1.2246467991473532e-16, Math.sin(Math.PI));
226 assertEquals(-7.047032979958965e-14, Math.sin(2200*Math.PI)); 226 assertEquals(-7.047032979958965e-14, Math.sin(2200*Math.PI));
227 assertEquals(-0.7071067811865477, Math.sin(7/4 * Math.PI)); 227 assertEquals(-0.7071067811865477, Math.sin(7/4 * Math.PI));
228 assertEquals(0.7071067811865474, Math.sin(9/4 * Math.PI)); 228 // assertEquals(0.7071067811865474, Math.sin(9/4 * Math.PI));
229 assertEquals(0.7071067811865483, Math.sin(11/4 * Math.PI)); 229 assertEquals(0.7071067811865483, Math.sin(11/4 * Math.PI));
230 assertEquals(-0.7071067811865479, Math.sin(13/4 * Math.PI)); 230 // assertEquals(-0.7071067811865479, Math.sin(13/4 * Math.PI));
231 assertEquals(-3.2103381051568376e-11, Math.sin(1048576/4 * Math.PI)); 231 assertEquals(-3.2103381051568376e-11, Math.sin(1048576/4 * Math.PI));
232 232
233 // Tests for Math.cos. 233 // Tests for Math.cos.
234 assertEquals(1, Math.cos(two_28)); 234 assertEquals(1, Math.cos(two_28));
235 assertEquals(0.9689124217106447, Math.cos(0.25)); 235 assertEquals(0.9689124217106447, Math.cos(0.25));
236 assertEquals(0.8775825618903728, Math.cos(0.5)); 236 assertEquals(0.8775825618903728, Math.cos(0.5));
237 assertEquals(0.7073882691671998, Math.cos(0.785)); 237 assertEquals(0.7073882691671998, Math.cos(0.785));
238 assertEquals(6.123233995736766e-17, Math.cos(Math.PI/2)); 238 assertEquals(6.123233995736766e-17, Math.cos(Math.PI/2));
239 assertEquals(0.7071067811865474, Math.cos(7/4 * Math.PI)); 239 assertEquals(0.7071067811865474, Math.cos(7/4 * Math.PI));
240 assertEquals(0.7071067811865477, Math.cos(9/4 * Math.PI)); 240 assertEquals(0.7071067811865477, Math.cos(9/4 * Math.PI));
241 assertEquals(-0.7071067811865467, Math.cos(11/4 * Math.PI)); 241 assertEquals(-0.7071067811865467, Math.cos(11/4 * Math.PI));
242 assertEquals(-0.7071067811865471, Math.cos(13/4 * Math.PI)); 242 // assertEquals(-0.7071067811865471, Math.cos(13/4 * Math.PI));
243 assertEquals(0.9367521275331447, Math.cos(1000000)); 243 assertEquals(0.9367521275331447, Math.cos(1000000));
244 assertEquals(-3.435757038074824e-12, Math.cos(1048575/2 * Math.PI)); 244 assertEquals(-3.435757038074824e-12, Math.cos(1048575/2 * Math.PI));
245 245
246 // Tests for Math.tan. 246 // Tests for Math.tan.
247 assertEquals(two_28, Math.tan(two_28)); 247 assertEquals(two_28, Math.tan(two_28));
248 assertEquals(1.633123935319537e16, Math.tan(Math.PI/2)); 248 assertEquals(1.633123935319537e16, Math.tan(Math.PI/2));
249 assertEquals(0.5463024898437905, Math.tan(0.5)); 249 assertEquals(0.5463024898437905, Math.tan(0.5));
250 assertEquals(0.8211418015898941, Math.tan(11/16)); 250 assertEquals(0.8211418015898941, Math.tan(11/16));
251 assertEquals(2.0000000000000027, Math.tan(1.107148717794091)); 251 // assertEquals(2.0000000000000027, Math.tan(1.107148717794091));
252 assertEquals(-1.0000000000000004, Math.tan(7/4*Math.PI)); 252 assertEquals(-1.0000000000000004, Math.tan(7/4*Math.PI));
253 assertEquals(0.9999999999999994, Math.tan(9/4*Math.PI)); 253 assertEquals(0.9999999999999994, Math.tan(9/4*Math.PI));
254 assertEquals(-6.420676210313675e-11, Math.tan(1048576/2*Math.PI)); 254 assertEquals(-6.420676210313675e-11, Math.tan(1048576/2*Math.PI));
255 assertEquals(2.910566692924059e11, Math.tan(1048575/2*Math.PI)); 255 assertEquals(2.910566692924059e11, Math.tan(1048575/2*Math.PI));
OLDNEW
« src/math.js ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698