3 ms·
More generally it's not at all clear what 'simplify' means. Is x*x simpler than x^2? Probably? Is sqrt(5)^3 simpler than 5^(3/2)? I don't know. It entirely de
by noosphr 7mo ago
More generally it's not at all clear what 'simplify' means.
Is x*x simpler than x^2? Probably? Is sqrt(5)^3 simpler than 5^(3/2)? I don't know.
It entirely depends on what you're going to be doing with the expression later.
- jmyeet 7mo agoI think "simplify" is pretty clear here. For trigonometric functions you would expect a trig function and an inverse trig function to be simplified. We all know what we'd expect if we saw sin(arcsin(x)) (ie x). If we saw cos(arcsin(x)) I'll spoil it for you: it simplifies to sqrt(1-x^2). Hyperbolic functions aren't used as much but the same principle applies. Here the core identity is cosh^2(x) = sinh^2(x) = 1 so: sinh(arccosh(x)) = sqrt(1 + cosh^2(arccosh(x)) = sqrt(1 + x^2) You should absolutely expect that from "simplify".
- noosphr 7mo agoHow is going from two functions with one variable to three functions with a variable and a constant a simplification?
- jmyeet 7mo agoIf you can't recognize how much simpler the simplified version is, I'm not sure exactly what to tell you. But let's think about it in terms of assembly steps: 1. Multiply the input by itself 2. Add 1 3. Take the square root. There is often a fast square root function available. The above is a fairly simply sequence of SIMD instructions. You can even do it without SIMD if you want. Compare this to sinh being (e^x - e^-x) / 2 (you can reduce this to one exponentiation in terms of e^2x but I digress) and arccosh being ln(x + sqrt(s^2 - 1)) and you have an exponentiation, subtraction, division, logarithm, addition, square root and a subtraction. Computers generally implement e^2 and logarithm using numerical method approximations (eg of a Taylor's series expansion).
- noosphr 7mo agoIf simplify means make it fast for a computer to run we might as well make division illegal.
- deleted 7mo ago[deleted]
- oh_my_goodness 7mo agoThis is sometimes helpful. But more often it has very little overlap with what I need when I "simplify" some math. "Simplify" is a very old term (>50y) in computer algebra. Its meaning has become kind of layered in that time.
- tzs 7mo agoOK, something weird is going on with HN here. The first time I looked at the comment above, there was a reply, a reply to that reply, and a reply to the reply to the reply. Later I came back and this time there were no replies. Since HN won't let you delete a comment that has a reply the only ways a comment chain should be able to go away are (1) the participants delete them in reverse order, or (2) a moderator intervenes. I came back again and the comments are back! I wonder if this is related to another comment problem I've seen many times in the past few weeks? I'll be using the "next" or "prev" links on top level comments to move through the comment and will come to a point where that breaks. Next reaches a comment that it will not go past. Coming from below prev will also not go past that point. Examining the links, next and prev are pointing to a nonexistent comment.
- deleted 7mo ago[deleted]
- nurettin 7mo agoIn this case, a heuristic like "less parameters, less operators and less function calls" covers all the cases.
- deleted 7mo ago[deleted]
- oh_my_goodness 7mo agoIt doesn't, because we might consider different outputs "simple" depending on what we're going to do next.
- nurettin 7mo agoSure, an example would be nice.
- oh_my_goodness 7mo agoExamples in TFA and at least one in the thread. Or say 4-quadrant atan might be simpler or less simple than 2-quadrant atan, depending on what you're doing next. Lots of stuff like that. Is a factored polynomial simpler than unfactored?
- henrikeh 7mo agoWhile some comments do point out the general opaqueness of Mathematica, the goal of Simplify is actually documented in Mathematica and something which can be changed: https://reference.wolfram.com/language/ref/ComplexityFunction.html https://reference.wolfram.com/language/ref/ComplexityFunctio... The default is a balance between leaf count and number of digits. But the documentation page above gives an example of how to nudge the cost function away from specialised functions.