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

Side by Side Diff: chrome/test/data/dromaeo/tests/sunspider-math-partial-sums.html

Issue 269054: Importing dromaeo performance tests to src/chrome/test/data.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../htmlrunner.js"></script>
4 <script>
5 // The Computer Language Shootout
6 // http://shootout.alioth.debian.org/
7 // contributed by Isaac Gouy
8
9 function partial(n){
10 var a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0.0;
11 var twothirds = 2.0/3.0;
12 var alt = -1.0;
13 var k2 = k3 = sk = ck = 0.0;
14
15 for (var k = 1; k <= n; k++){
16 k2 = k*k;
17 k3 = k2*k;
18 sk = Math.sin(k);
19 ck = Math.cos(k);
20 alt = -alt;
21
22 a1 += Math.pow(twothirds,k-1);
23 a2 += Math.pow(k,-0.5);
24 a3 += 1.0/(k*(k+1.0));
25 a4 += 1.0/(k3 * sk*sk);
26 a5 += 1.0/(k3 * ck*ck);
27 a6 += 1.0/k;
28 a7 += 1.0/k2;
29 a8 += alt/k;
30 a9 += alt/(2*k -1);
31 }
32 }
33
34 window.onload = function(){ startTest("sunspider-math-partial-sums", '');
35
36 test( "Partial Sums", function(){
37 partial(2048);
38 });
39
40 endTest(); };
41 </script>
42 </head>
43 <body></body>
44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698