Live data from Hacker News

Why Mathematica does not simplify sinh(arccosh(x))

johndcook.com

41–50 of 64 posts

Re: Why Mathematica does not simplify sinh(arccosh(x))

#41

And yet it incorrectly simplifies f(x) = x/x with f(x) = 1

I believe this is correct: x/x = 1 everywhere except 0, where it has a removable singularity. So you can extend x/x holomorphically to full C.

This is completely different from the phenomenon described in the article: arccosh discontinuity can’t be dealt the same way. In fact complex analysis prefers to deal with it my making functions path-dependent (multi-valued).

Re: Why Mathematica does not simplify sinh(arccosh(x))

#42
post #20

Earlier quoted context omitted.

Source available? The license is still proprietary, right?

Yes, it is all proprietary, but there are still ways to inspect most of the WL-implemented functions since the system does not go to extreme pains to keep them hidden from introspection. It is not unlike Maple in that sense.

Yeah, hiding the recipes for how the math is really done would make the whole system kinda guess-and-hope for serious users.

Re: Why Mathematica does not simplify sinh(arccosh(x))

#43
post #3

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.

In this case, a heuristic like "less parameters, less operators and less function calls" covers all the cases.

[deleted]

Re: Why Mathematica does not simplify sinh(arccosh(x))

#44
This is what differentiates (pun intended) between Complex Algebra and Complex Analysis: complex functions in analysis are multivalued (or path dependent in some schools). Even a simple concept of value of F at complex point x becomes a topic of several lectures.

I’m algebraist at heart and training, but I remember beautiful many-layered surfaces of ordinary complex functions in books and on blackboards.

Re: Why Mathematica does not simplify sinh(arccosh(x))

#45
post #18
post #3

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.

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…

OK, 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.

Re: Why Mathematica does not simplify sinh(arccosh(x))

#46

This 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.

That abs(x) (or |x| as we wrote it) used to catch out so many of us in HS trig and algebra.

Re: Why Mathematica does not simplify sinh(arccosh(x))

#47
post #3

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.

In this case, a heuristic like "less parameters, less operators and less function calls" covers all the cases.

It doesn't, because we might consider different outputs "simple" depending on what we're going to do next.

Re: Why Mathematica does not simplify sinh(arccosh(x))

#48
post #30
post #27

Earlier quoted context omitted.

How is going from two functions with one variable to three functions with a variable and a constant a simplification?

If 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^…

[deleted]

Re: Why Mathematica does not simplify sinh(arccosh(x))

#49
post #30
post #27

Earlier quoted context omitted.

How is going from two functions with one variable to three functions with a variable and a constant a simplification?

If 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^…

This 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.

Re: Why Mathematica does not simplify sinh(arccosh(x))

#50
post #34

This 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.

I think you would get sqrt(x^2) = x, if x belonged to the natural domain of sqrt , which is a Riemann surface, that may also be defined using the language of "sheaves". I don't know how to connect this to the article or Mathematica.

it's literally the prototypical example for `Assuming`

https://reference.wolfram.com/language/ref/Assuming.html

Post reply on HN