3 <script src=
"../htmlrunner.js"></script>
5 // The Great Computer Language Shootout
6 // http://shootout.alioth.debian.org/
8 // contributed by Ian Osgood
11 return 1/((i+j)*(i+j+1)/2+i
+1);
15 for (var i
=0; i
<u
.length
; ++i
) {
17 for (var j
=0; j
<u
.length
; ++j
)
24 for (var i
=0; i
<u
.length
; ++i
) {
26 for (var j
=0; j
<u
.length
; ++j
)
32 function AtAu(u
,v
,w
) {
37 function spectralnorm(n
) {
38 var i
, u
=[], v
=[], w
=[], vv
=0, vBv
=0;
40 u
[i
] = 1; v
[i
] = w
[i
] = 0;
42 for (i
=0; i
<10; ++i
) {
50 return Math
.sqrt(vBv
/vv
);
53 window
.onload = function(){ startTest("sunspider-math-spectral-norm", 'e740809d');
55 test( "Spectral Norm", function(){
56 for (var i
= 12; i
<= 24; i
*= 2)