Matrix package:lapack

QC.forAll genDD $ \(xs, (ys0,ys1)) -> approxArray (dividedDifferencesMatrix xs (ys0|+|ys1)) (dividedDifferencesMatrix xs ys0 #+# dividedDifferencesMatrix xs ys1)
QC.forAll genDD $ \(xs, (ys0,ys1)) -> approxArray (dividedDifferencesMatrix xs (Vector.mul ys0 ys1)) (dividedDifferencesMatrix xs ys0 <> dividedDifferencesMatrix xs ys1)
QC.forAll (QC.choose (0,10)) $ \n -> let sh = shapeInt n in QC.forAll (Util.genDistinct [-10..10] [-10..10] sh) $ \xs -> approxArray (DD.parameterDifferencesMatrix xs) (DD.upperFromPyramid sh (Vector.zero sh : DD.parameterDifferences xs))
LowerUpper.fromMatrix a computes the LU decomposition of matrix a with row pivotisation. You can reconstruct a from lu depending on whether a is tall or wide.
LU.multiplyP NonInverted lu $ LU.extractL lu ##*# LU.tallExtractU lu
LU.multiplyP NonInverted lu $ LU.wideExtractL lu #*## LU.extractU lu