@@ -1551,6 +1551,7 @@ dist_patch_DATA = \
%D%/packages/patches/mathjax-no-a11y.patch \
%D%/packages/patches/mathjax-3.1.2-no-a11y.patch \
%D%/packages/patches/maxima-defsystem-mkdir.patch \
+ %D%/packages/patches/maxima-matrixexp.patch \
%D%/packages/patches/maxima-test-precision.patch \
%D%/packages/patches/maven-generate-component-xml.patch \
%D%/packages/patches/maven-generate-javax-inject-named.patch \
@@ -4359,6 +4359,7 @@ (define-public maxima
(base32
"01wbm8jj43p7gpdj4h55aij0b44bjydn4bwb7q1wjrfs91mz143k"))
(patches (search-patches "maxima-defsystem-mkdir.patch"
+ "maxima-matrixexp.patch"
"maxima-test-precision.patch"))))
(build-system gnu-build-system)
(inputs
new file mode 100644
@@ -0,0 +1,17 @@
+Taken from sagemath 9.8
+
+diff --git a/share/linearalgebra/matrixexp.lisp b/share/linearalgebra/matrixexp.lisp
+index 218bf35..f2fd468 100644
+--- a/share/linearalgebra/matrixexp.lisp
++++ b/share/linearalgebra/matrixexp.lisp
+@@ -138,8 +138,8 @@
+ (print `(ratvars = ,$ratvars gcd = '$gcd algebraic = ,$algebraic))
+ (print `(ratfac = ,$ratfac))
+ (merror "Unable to find the spectrum")))
+-
+- (setq res ($fullratsimp (ncpower (sub (mult z ($ident n)) mat) -1) z))
++
++ (setq res ($fullratsimp ($invert_by_lu (sub (mult z ($ident n)) mat) '$crering) z))
+ (setq m (length sp))
+ (dotimes (i m)
+ (setq zi (nth i sp))