[math-fun] symbolic algebra handling of (+/-) signs
Over the years, I've had occasion to use Macsyma/Maxima to produce formulae that were then utilized in my computer code (Lisp/C/...). While these symbolic algebra tools are extremely useful, there is one area where symbolic algebra systems could be improved quite a lot -- the handling of signs (e.g., +/-). While Maxima does a pretty good job of understanding the absolute value function ('abs'), it doesn't seem to know very much about the intimately related "sign" ('signmum') function. For example, although 'asinh' is a perfectly good odd function, Maxima doesn't know how to move 'signum' in and out of the 'asinh' function. Dealing with 'signum' in a high quality way should be considerably easier than attempting to handle 'if-then-else' expressions (aka "()?:" expressions in C/C++, etc.). But there are occasions where symbolic algebra systems would be extremely helpful if they could handle such if-then-else expressions. The alternative is pretty ugly: it may be necessary to create a software "harness" and then evaluate the alternative expressions with every conceivable boolean combination -- a strategy that quickly blows up exponentially, but it is still better if this strategy is implemented mechanically, to make sure that all combinations are checked. I haven't had a lot of experience with other symbolic algebra systems. Do Maple & Mathematica (or any others) do a better job of handling these signum and/or if-then-else expressions? Alternatively, has anyone here had any experience in teaching the Macsyma/Maxima simplifier about such expressions, so that I could expand its capabilities ? In Macsyma 2.4, (c16) TRIGSIGN; (d16) true (c17) ASINH(SIGNUM(A)*B); (d17) signum(a) asinh(b) (c18) BLOCK([TRIGSIGN : FALSE],ASINH(SIGNUM(A)*B)); (d18) asinh(signum(a) b) (c19) ASINH(SIGNUM(A)*B*(-1)^INTEGER); integer (d19) signum(a) asinh(b) (- 1) (c20) MAKELIST(THETA[K](-X,Q),K,1,4); (d20) [- theta (x, q), theta (x, q), theta (x, q), theta (x, q)] 1 2 3 4 with similar control by trigsign. I actually saw a proposal to remove trigsign from Maxima. I wonder if those people know what they're doing. (They should maybe collect a bunch of Macsyma code and notebooks, and just string search to see if anybody uses such-and-such symbol. I found 14 *conversational* uses of trigsign in my .mfes.) --rwg
participants (1)
-
Bill Gosper