Bug with inverse hyperbolic cosine 'acosh'

53 views
Skip to first unread message

Arnaud Usciati

unread,
Mar 31, 2015, 10:40:18 AM3/31/15
to sy...@googlegroups.com
Hello everybody,

I tried values with acosh function and I found an issue.
Suppose x = symbols('x', real=True) and f = lambda x: acosh(-x).

For instance :
> Input : f(1)
> Output : I*pi
  --> That's OK

> Input : f(-1)
> Output : 0
  --> That's OK

But f(x) returns -acosh(x) instead of acosh(-x) ! It's wrong because 'acosh' it's certainly not odd !!

Arnaud


Joachim Durchholz

unread,
Mar 31, 2015, 3:49:19 PM3/31/15
to sy...@googlegroups.com
Am 31.03.2015 um 15:06 schrieb Arnaud Usciati:
> Hello everybody,
>
> I tried values with acosh function and I found an issue.
> Suppose x = symbols('x', real=True) and f = lambda x: acosh(-x).

Just a heads-up: the x inside the lambda is unrelated to the symbol x.

> But f(x) returns -acosh(x) instead of acosh(-x) !

I did a bit more testing and found I wouldn't need f, or the real=True
assumption on x:

$ python
Python 2.6.9 (unknown, Dec 26 2014, 22:51:25)
[GCC 4.8.2] on linux3
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import Symbol, acosh
>>> x = Symbol('x')
>>> acosh(-x)
-acosh(x)

This looks indeed like a bug to me.

AMiT Kumar

unread,
Apr 1, 2015, 12:18:14 PM4/1/15
to sy...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages