(* This was the original Mathematica code that I used to produce the test results to check the Fortran against! The data are just a random matrix and vector. *) a = { { 0.483836 , 0.266372 , 0.579677 , 0.234781 , 0.0530176} , { 0.759127 , 0.575231 , 0.547177 , 0.77256 , 0.0687799 } , { 0.649651 , 0.942712 , 0.0837541 , 0.186192 , 0.235544 } , { 0.236206 , 0.292983 , 0.349548 , 0.290192 , 0.475288 } , { 0.522635 , 0.863739 , 0.689245 , 0.755017 , 0.997574 } } ; c = { 0.203949 , 0.887397 , 0.4687 , 0.624823 , 0.200951 } ; Print [ x = LinearSolve [ a , c ] ] ; Print [ a.x ] ;