Package: mathomatic
Version: 16.0.5-4
Severity: normal
Dear Tony,
Thank you very much for maintaining Debian's
mathomatic package.
It's colorful and easy to use.
The main reason I'm writing is to give a specific
example suggesting, at least to yours truly, that
ol' mathomatic might try to simplify math
expressions containing exponents/powers a little
too agressively.
When I type this at a linux bash shell command
line...
$ mathomatic -e -- "(X^2)^0.50001"
mathomatic returns
1-> (X^2)^0.50001
#1: X^1.00002
As you can see, mathomatic automatically
simplifyed the
"^2" and
"^0.50001"
powers into just
"^1.00002"
But, I'm worried that if the X variable contains a
*negative* number, mathomatic's automatic
"simplification" may lead to
"complex" imaginary numbers and
so called "Not a Number"s (ie: "NaN"s)
down stream.
To be fair, mathomatic's documentation admits
"With Mathomatic, if x is imaginary, you may
get an unwanted imaginary result"
at
https://fossies.org/linux/mathomatic/doc/manual.html
I humbly suggest
1.) Consider enhancing mathomatic to give its
user more control over
when and
how aggressively
it simplifies exponents.
Three options are reviewed at
https://docs.sympy.org/latest/tutorial/simplification.html#powers
Mathomatic's "simplify" command already has a
"symbolic" option that approaches a fix.
You can see this is so at
https://fossies.org/linux/mathomatic/doc/am.html#simplify
2.) Use python's sympy module instead.
But it's not quite as
easy or
colorful.
Thanks again,
Kingsley
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 4.4.0-1-686-pae (SMP w/2 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
Versions of packages mathomatic depends on:
ii libc6 2.33-7
ii libedit2 3.1-20210910-1
ii m4 1.4.18-2
mathomatic recommends no packages.
Versions of packages mathomatic suggests:
ii gnuplot 5.2.7+dfsg1-3
ii gnuplot-x11 [gnuplot] 5.2.7+dfsg1-3
pn rlwrap <none>
-- no debconf information