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.
Why Mathematica does not simplify sinh(arccosh(x))
21–30 of 64 posts
Re: Why Mathematica does not simplify sinh(arccosh(x))
#22Earlier quoted context omitted.
Many built-in functions are open source too. Use the "PrintDefinitions" ResourceFunction to see the code of functions that are implemented in Wolfram Language itself.
Source available? The license is still proprietary, right?
Re: Why Mathematica does not simplify sinh(arccosh(x))
#23I really wish Mathematica would open-source the heuristics behind these core functions (including common mathematical functions, Simplify, Integrate, etc.). The documentation is good, but it still lags behind the actual implementation. It would be much easier if we could peek inside the black box.
For Simplify, I expect its a black, or at least gray box to Mathematica maintainers, too. It will have simple rules such as constant folding, “replace x - x by zero”, “replace zero times something with the conditions under which ‘something’ has a value”, etc, lots of more complex but still easy to understand rules with conditionals such as “√x² = |x| if x is real”, and some weird logic that decides the order in which…
Re: Why Mathematica does not simplify sinh(arccosh(x))
#24I really wish Mathematica would open-source the heuristics behind these core functions (including common mathematical functions, Simplify, Integrate, etc.). The documentation is good, but it still lags behind the actual implementation. It would be much easier if we could peek inside the black box.
For Simplify, I expect its a black, or at least gray box to Mathematica maintainers, too. It will have simple rules such as constant folding, “replace x - x by zero”, “replace zero times something with the conditions under which ‘something’ has a value”, etc, lots of more complex but still easy to understand rules with conditionals such as “√x² = |x| if x is real”, and some weird logic that decides the order in which…
Re: Why Mathematica does not simplify sinh(arccosh(x))
#25This is a general pattern in CAS. For a more basic case, it’s not obvious sqrt(square(x)) will simplify to x without any further assumptions on x.
That's not what it simplifies to using a real or complex number domains for x, it's abs(x). CAS need type inference assumptions and/or type qualifiers to be more powerful. Edit: Fixed stuff.
Re: Why Mathematica does not simplify sinh(arccosh(x))
#26Earlier quoted context omitted.
That's not what it simplifies to using a real or complex number domains for x, it's abs(x). CAS need type inference assumptions and/or type qualifiers to be more powerful. Edit: Fixed stuff.
For x = -i, square(x) = -1, sqrt(square(x)) = i. Meanwhile, abs(x) = 1. You're right that it simplifies to abs(x) for real x, but that no longer holds for arbitrary complex values.
so sqrt(square(-i)) = +-i, one of which is x
Re: Why Mathematica does not simplify sinh(arccosh(x))
#27More 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.
I 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: si…
Re: Why Mathematica does not simplify sinh(arccosh(x))
#28Earlier quoted context omitted.
For x = -i, square(x) = -1, sqrt(square(x)) = i. Meanwhile, abs(x) = 1. You're right that it simplifies to abs(x) for real x, but that no longer holds for arbitrary complex values.
for arbitrary complex values sqrt() gives 2 answers with +- signs so sqrt(square(-i)) = +-i, one of which is x
Re: Why Mathematica does not simplify sinh(arccosh(x))
#29Earlier quoted context omitted.
It also equals x with appropriate assumptions (x > 0).
so there's an unconditionally correct answer (it's also equal to abs(x) for x>0), and then there is an answer that is only correct for half the domain, which requires an additional assumption.
So no, it’s not unconditionally correct either.
Re: Why Mathematica does not simplify sinh(arccosh(x))
#30Earlier quoted context omitted.
I 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: si…
How is going from two functions with one variable to three functions with a variable and a constant a simplification?
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).