Roll leveldb 3f7758:803d69 (v1.17 -> v1.18)
[chromium-blink-merge.git] / chrome / test / data / dromaeo / tests / sunspider-math-partial-sums.html
blob582265cb0d2674d70614638700382ea068d74273
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
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;
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;
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);
34 window.onload = function(){ startTest("sunspider-math-partial-sums", 'a31c1c44');
36 test( "Partial Sums", function(){
37 partial(2048);
38 });
40 endTest(); };
41 </script>
42 </head>
43 <body></body>
44 </html>