While taking a quick peek at Bug 1370433, trigsimp(sqrt(%i2)) !=
sqrt(trigsimp(%i2)), I noticed that src/trgsmp.lisp is a translated
file, and it seems that it was translated from
share/trigonometry/trgsmp.mac 20 years ago.
Is there really a reason to use the translated file instead of using
trgsmp.mac directly? Or even just always converting trgsmp.mac to
trgsmp.lisp during the build? Reading trgsmp.mac is far easier than
reading trgsmp.lisp, and any bugfixes/changes/enhancements should
probably done on trgsmp.mac.
So, as an experiment, I ran translate_file("trgsmp"). After comparing
the two, they seem mostly identical except for a few items. Most of
the places where the translation has
(progn
(defprop $trigsimp t translated)
(add2lnc '$trigsimp $props)
(defmtrfun ($trigsimp $any mdefine nil nil)
($x)
...))
(progn
'compile
(fset '$htrigrule4
(lambda (TR-GENSYM~79)
...)))
trgsmp.lisp has
(eval-when (compile eval load)
(defprop $trigsimp t translated)
(add2lnc '$trigsimp $props)
(defmtrfun
($trigsimp $any mdefine nil nil)
($x)
(eval-when (compile eval load)
(defun $htrigrule4
(|tr-gensym~24|)
...))
Also, most function calls in trgsmp.lisp like ($radcan foo) are
(mfunction-call $radcan foo). Is that really necessary?
Does anyone know when (progn 'compile ...) means? Should all of those
progn's really be eval-when's?
And finally, loading trgsmp.mac seems to work, and the one test case
in rtest3.mac passes. But running the test suite causes that one
failure, presumably because the functions or rules were killed.
Would it make sense to convert trgsmp.mac to trgsmp.lisp and
compile that whenever maxima is built?
Ray
BTW, desoln, elim, invert, nusum, and ode2 also seem to be translated
files.