2 <!-- MOZ_INSERT_CONTENT_HOOK -->
3 <script src = runner.js
></script>
5 var onlyName
= 'Spectral Norm', onlyNum
= 16;
8 // The Great Computer Language Shootout
9 // http://shootout.alioth.debian.org/
11 // contributed by Ian Osgood
14 return 1/((i+j)*(i+j+1)/2+i
+1);
18 for (var i
=0; i
<u
.length
; ++i
) {
20 for (var j
=0; j
<u
.length
; ++j
)
27 for (var i
=0; i
<u
.length
; ++i
) {
29 for (var j
=0; j
<u
.length
; ++j
)
35 function AtAu(u
,v
,w
) {
40 function spectralnorm(n
) {
41 var i
, u
=[], v
=[], w
=[], vv
=0, vBv
=0;
43 u
[i
] = 1; v
[i
] = w
[i
] = 0;
45 for (i
=0; i
<10; ++i
) {
53 return Math
.sqrt(vBv
/vv
);
56 startTest("real-spectral-norm");
58 for ( var i
= 8; i
<= 64; i
*= 2 ) (function(i
){
59 test( "Spectral Norm", i
, function(){
67 <body onload=
"thisTest()"></body></html>