Bug 449371 Firefox/Thunderbird crashes at exit [@ gdk_display_x11_finalize], p=Brian...
[wine-gecko.git] / testing / performance / talos / page_load_test / jss / real-recursive-10.html
blob4aaee1460d34bc0cc714112c23da16f904c055dd
1 <html><head>
2 <!-- MOZ_INSERT_CONTENT_HOOK -->
3 <script src = runner.js></script>
4 <script>
5 var onlyName = 'Ack', onlyNum = 6;
6 function thisTest() {
8 // The Computer Language Shootout
9 // http://shootout.alioth.debian.org/
10 // contributed by Isaac Gouy
12 function ack(m,n){
13 if (m==0) { return n+1; }
14 if (n==0) { return ack(m-1,1); }
15 return ack(m-1, ack(m,n-1) );
18 function fib(n) {
19 if (n < 2){ return 1; }
20 return fib(n-2) + fib(n-1);
23 function tak(x,y,z) {
24 if (y >= x) return z;
25 return tak(tak(x-1,y,z), tak(y-1,z,x), tak(z-1,x,y));
28 startTest("real-recursive");
30 for ( var i = 3; i <= 6; i++ ) (function(i){
32 test("Ack", i, function(){
33 ack(3,i);
34 });
36 test("Fib", i, function(){
37 fib(10.0+i);
38 });
40 test("Tak", i, function(){
41 tak(3*i,2*i,i);
42 });
44 })(i);
46 endTest();
48 </script>
49 <body onload="thisTest()"></body></html>