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: Rik
Subject: [Octave-bug-tracker] [bug #59774] The function acot(x) seems to compute the wrong number for x<0.
Date: Mon, 28 Dec 2020 20:09:21 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36

Update of bug #59774 (project octave):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 
        Operating System:       Microsoft Windows => Any                    

    _______________________________________________________

Follow-up 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
+verbatim-

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]