Don't you become even a bit suspicious when the answers don't agree?
Consider the number on the lower right hand corner:

PLJsAPL:     2815820646.25489
Dyalog:      2815825985
NARS2000:    2815820182
J Rational:  2815827300 (true answer).

If you are proud of implementation X, I can bring it down to earth real
quick by asking it to invert H 2*n, or by working in rational numbers.

   H=: %@>:@(+/~)@i.
   (+/ .* %.) H 20x
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1



On Mon, Jun 18, 2012 at 6:32 PM, Paul Jackson <plj...@gmail.com> wrote:

> I only raised it because it is so bad compared to everyone else I've
> looked at, including mine.  An original copy of my result and my
> implementation code are available on request.  Please note, I cannot
> speak for others but I didn't take a Hilbert matrix into account in
> writing mine.
>
> Paul
>
> PLJsAPL=: 0 : 0
>       80.9999531610822      ¯3239.99665986097       41579.9420943319
>    ¯249479.578965133       810808.433035166      ¯1513508.76245454
>   1621616.2451529      ¯926637.713155974       218789.430959011
>    ¯3239.99667368818       172799.763174579      ¯2494795.89900529
>   15966690.2071222      ¯54053889.1945398       103783451.186115
> ¯113513134.744105      65894238.5094722      ¯15752839.8286812
>    41579.9425036479      ¯2494795.91108115       38419849.2522369
>  ¯256132286.350815       891889090.567644      ¯1748102418.55488
> 1942335832.29382    ¯1141617699.88458        275674708.595751
>  ¯249479.582883114       15966690.3618727      ¯256132287.510015
>  1756335480.92061      ¯6243223179.83275       12430950040.9097
> ¯13984817837.5535      8302674292.97357      ¯2021614600.3302
>   810808.450415449      ¯54053889.9691135       891889098.317587
> ¯6243223204.79328      22544971251.5605       ¯45450659629.1162
> 51648474522.865     ¯30918813482.0781        7581054973.44456
>  ¯1513508.80311881       103783453.123491      ¯1748102440.39083
> 12430950134.7588      ¯45450659786.3692        92554068055.4922
> ¯106051533619.168      63930593442.9569      ¯15768594736.8895
>  1621616.2969454       ¯113513137.31893        1942335863.28028
> ¯13984817987.4734       51648474857.9506      ¯106051533934.55
> 122367153478.811     ¯74205153752.1709       18396694252.0436
>  ¯926637.747107004       65894240.2479428     ¯1141617721.69509
>  8302674405.58929     ¯30918813765.3446        63930593798.5238
> ¯74205153941.7251     45229808347.2382      ¯11263282403.1867
>   218789.439925196      ¯15752840.2978892       275674714.654419
> ¯2021614632.92992       7581055060.93416      ¯15768594860.4611
> 18396694339.8914    ¯11263282427.9574        2815820646.25489
> )
>
> DialogAPL=: 0 : 0
>      81.00000837      ¯3240.000441       41580.00571 ¯2.494800309E5
> 8.108100843E5  ¯1.513512123E6   1.621620094E6  ¯9.266400324E5
> 2.187900028E5
>   ¯3240.000352       172800.0149      ¯2494800.132    1.596672026E7
> ¯5.405399896E7   1.037836745E8  ¯1.135133904E8   6.589439254E7
> ¯1.575287780E7
>   41580.0033       ¯2494800.068       38419919.12    ¯2.561327823E8
> 8.918909013E8  ¯1.748106101E9   1.942340048E9  ¯1.141620239E9
> 2.756753345E8
>  ¯249480.0094       15966719.51      ¯256132777.2      1.756338956E9
> ¯6.243235864E9   1.243097584E10 ¯1.398484736E10  8.302692071E9
> ¯2.021618982E9
>  810809.9941      ¯54053995.43       891890869.5     ¯6.243235770E9
> 2.254501711E10 ¯4.545075286E10  5.164858121E10 ¯3.091887772E10
> 7.581070803E9
> ¯1513511.922       103783666.1      ¯1748106017        1.243097550E10
> ¯4.545075234E10  9.255425620E10 ¯1.060517489E11  6.393072306E10
> ¯1.576862667E10
>  1621619.848      ¯113513379.8       1942339933       ¯1.398484685E10
> 5.164858015E10 ¯1.060517480E11  1.223673983E11 ¯7.420530117E10
> 1.839673057E10
>  ¯926639.8769       65894385.62     ¯1141620161        8.302691705E9
> ¯3.091887687E10  6.393072205E10 ¯7.420530065E10  4.522989667E10
> ¯1.126330416E10
>  218789.963       ¯15752875.99       275675313.6     ¯2.021618879E9
> 7.581070548E9  ¯1.576862633E10  1.839673034E10 ¯1.126330410E10
> 2.815825985E9
> )
>
> NARS2000=: 0 : 0
>       80.99994931      ¯3239.996392       41579.93755
> ¯249479.5464              810808.3137            ¯1513508.519
>   1621615.966              ¯926637.5448              218789.3894
>    ¯3239.996409       172799.7447      ¯2494795.584      15966687.95
>           ¯54053880.89             103783434.2
> ¯113513115.2               65894226.72             ¯15752836.92
>    41579.93807      ¯2494795.6         38419843.93     ¯256132248.1
>           891888949.5            ¯1748102130              1942335500
>            ¯1141617499                275674658.9
>  ¯249479.5515       15966688.15      ¯256132249.6      1756335208
>         ¯6243222172                        1.243094797E10
> ¯1.398481546E10  8302672851              ¯2021614244
>   810808.3362      ¯54053881.9        891888959.6     ¯6243222204
>                   2.254496755E10          ¯4.545065203E10
> 5.164846577E10          ¯3.091880818E10  7581053660
>  ¯1513508.571       103783436.7      ¯1748102158
> 1.243094809E10          ¯4.545065223E10           9.255405253E10
>  ¯1.060515157E11           6.393058258E10          ¯1.576859205E10
>  1621616.032      ¯113513118.6       1942335540
> ¯1.398481565E10           5.164846618E10          ¯1.060515161E11
>    1.223671329E11          ¯7.420514126E10           1.839669115E10
>  ¯926637.5882       65894228.96     ¯1141617527        8302672992
>                  ¯3.091880853E10           6.393058301E10
> ¯7.420514148E10           4.522980079E10          ¯1.126328053E10
>   218789.4008      ¯15752837.52       275674666.5     ¯2021614284
>          7581053766                       ¯1.576859219E10
> 1.839669126E10          ¯1.126328056E10  2815820182
> )
>
>
> On Mon, Jun 18, 2012 at 4:11 PM, Roger Hui <rogerhui.can...@gmail.com>
> wrote:
> > Do not be alarmed! :-)  The Hilbert matrix is notoriously ill-conditioned
> > and attempts to invert it does go very bad very fast.  This is not due to
> > any deficiency in the algorithm or implementation but to the fact that
> > 64-bit floats do not have sufficient precision to represent the answer.
> >
> > http://en.wikipedia.org/wiki/Hilbert_matrix
> > http://www.jsoftware.com/papers/APLQA.htm#Hilbert_matrix
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to