Bug 449371 Firefox/Thunderbird crashes at exit [@ gdk_display_x11_finalize], p=Brian...
[wine-gecko.git] / testing / performance / talos / page_load_test / jss / real-partial-sums-3.html
bloba9c652add010059b9cde8445593b89f57953de2f
1 <html><head>
2 <!-- MOZ_INSERT_CONTENT_HOOK -->
3 <script src = runner.js></script>
4 <script>
5 var onlyName = 'Partial Sums', onlyNum = 4096;
6 function thisTest() {
8 // The Computer Language Shootout
9 // http://shootout.alioth.debian.org/
10 // contributed by Isaac Gouy
12 function partial(n){
13 var a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0.0;
14 var twothirds = 2.0/3.0;
15 var alt = -1.0;
16 var k2 = k3 = sk = ck = 0.0;
18 for (var k = 1; k <= n; k++){
19 k2 = k*k;
20 k3 = k2*k;
21 sk = Math.sin(k);
22 ck = Math.cos(k);
23 alt = -alt;
25 a1 += Math.pow(twothirds,k-1);
26 a2 += Math.pow(k,-0.5);
27 a3 += 1.0/(k*(k+1.0));
28 a4 += 1.0/(k3 * sk*sk);
29 a5 += 1.0/(k3 * ck*ck);
30 a6 += 1.0/k;
31 a7 += 1.0/k2;
32 a8 += alt/k;
33 a9 += alt/(2*k -1);
37 startTest("real-partial-sums");
39 for ( var i = 1024; i <= 8192; i *= 2 ) (function(i){
40 test( "Partial Sums", i, function(){
41 partial(i);
42 });
43 })(i);
45 endTest();
47 </script>
48 <body onload="thisTest()"></body></html>