octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #59774] The function acot(x) seems to compute


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #59774] The function acot(x) seems to compute the wrong number for x<0.
Date: Mon, 28 Dec 2020 21:36:23 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36

Follow-up Comment #2, bug #59774 (project octave):

Rik's post got truncated due to a markup error.

[comment #1 comment #1:]
> Octave is correct, or at least follows other numerical analysis packages.
> 
> On the Wikipedia page you cite, see the section "Relationships between
trigonometric functions and inverse trigonometric functions".  There, you will
find the relationship
> 
> 
> tan (arccot (x)) = 1/x
> 
> 
> Apply arctan() to both sides of the equation and the result is
> 
> 
> arctan (tan (arccot (x))) = arctan (1/x)
> ===
> arccot (x) = arctan (1/x)
> 
> 
> For a test, try
> 
> 
> acot (-1)
> 
> 
> In Octave, Matlab, and Mathematica this returns -pi/4.  Under your scheme
the result is 3/4pi which is different on both the sign and the value.
> 

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59774>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]