haskell-numerics / hmatrix

Linear algebra and numerical computation
381 stars 104 forks source link

Falsifiable nullSpace in hmatrix_tests 0.6.0.0 running against hmatrix-0.18.2.0 #276

Open blackgnezdo opened 6 years ago

blackgnezdo commented 6 years ago

------ index +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ mult Double +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ sub-trans +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ ctrans +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ lu +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ inv (linearSolve) +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ luSolve +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ ldlSolve +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ cholSolve +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ luSolveLS +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests (5% trivial). +++ OK, passed 100 tests (5% trivial). ------ pinv (linearSolveSVD) +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ det +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ svd +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. ------ eig +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++ OK, passed 100 tests. +++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+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.12213350857761761 :+ 0.264092457198331, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.11829923048693576 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 43600.0 :+ 0.0, 33.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 7.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ (-5.0), 32.0 :+ 8.101461635651868, 0.0 :+ 0.0, 1.0 :+ 5.0, 0.0 :+ 6.0, 0.0 :+ 20.0, 17.0 :+ 6.677273927117131, (-63.0) :+ 29.93639912518279, 0.0 :+ (-50.0), (-7.650332610108192) :+ (-23.467368620933776), (-36.81836731307263) :+ 11.054064564178018, (-7.2667766599135275) :+ (-43.25128841370489) , (-6.839670661038717) :+ (-13.599700407894078), 13.889350729724974 :+ 5.0, 15.953871842067237 :+ 17.863351606004123, 16.983940399635422 :+ 2.0827439846773422e-2, 42.715041846059215 :+ 25.0, (-6.92531408824834) :+ 33.02634737790766, 9.299865332167043 :+ (-5.820426066332271), 16.68364230748364 :+ 11.0, 18.79416866992343 :+ (-17.738191351126897), (-77.25975271078072) :+ (-16.18081467676167), 13.837010725594165 :+ 63.218866999700715, (-2.4779585638276735) :+ 10.290088070625405, (-95.3675303434495) :+ (-126.5031089169918), (-17.763951236662603) :+ 36.41936797716083, 10.385410462744508 :+ 0.0, (-4.134791499970825) :+ 23.71442916900611, (-20.0) :+ (-21.46183601125759) ]

blackgnezdo commented 6 years ago

Dug up one more:

------ nullSpace +++ OK, passed 100 tests (50% trivial). *** Failed! Falsifiable (after 79 tests and 531 shrinks): (8><18) [ 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.4577537185173488 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.9469423585201827 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.3997172706774486, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+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559741 :+ 1.0, 0.0 :+ 1.0, 17.0 :+ (-0.6464858210256607), 76.0 :+ 0.0, 15.0 :+ (-0.15983620019832284), 16.0 :+ 16.0775250835356, 24.67632238931616 :+ 88.25698067381997, 19.57120867937428 :+ (-24.091979839328108), 17.360355965858744 :+ 933.0, 0.0 :+ 5.625116836300755, 13.978863686323104 :+ 19.130996431895582, 73.85344526985779 :+ 12.805858322436581, 42.503128224168364 :+ 3.4844826163630733, 16.377830477574772 :+ 30.9726732862679, (-10.484297452514923) :+ (-126.75608514000216), 57.29682376388987 :+ 6.399888551261866 ]

blackgnezdo commented 6 years ago

And another one for completeness sake.

------ nullSpace +++ OK, passed 100 tests (58% trivial). *** Failed! Falsifiable (after 79 tests and 382 shrinks): (8><12) [ 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 6.055467053267189e-2 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.2833528682572159 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.18355819892485867, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.6024061004061326 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0 , 0.0 :+ 0.0, 0.0 :+ 0.0, 0.54564429137839 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.0, 0.0 :+ 0.33445665471692887, 0.0 :+ 203678.0, 4.0 :+ 0.0, 8.0 :+ 18.087892226570023 ]

idontgetoutmuch commented 6 years ago

Almost certainly a malformed test case. The trouble with randomly generating tests is that you can often create e.g. a matrix with a determinant very close to 0 causing instabilities. Please help by improving the tests :)