Thread: inverse hyperbolic cotangent

  1. #1
    Registered User
    Join Date
    Apr 2008

    inverse hyperbolic cotangent

    I think the inverse hyperbolic cotangent is the same as 1/(atanh) however math.h doesnt have acoth however my problem is this:
    c code produces #QNAN0 from this:
    xx = (exp(a_global*2*pi) - cosh(a_global*b_global*rev_t))/(sinh(a_global*b_global*rev_t));
    c0 = -1/atanh(xx);
    however xx produces the value 4.31.
    -acoth(4.31) in matlab produces -0.2363
    -1/atanh(4.31) in matlab produces -0.0937 + 0.6225i

    so i know its imaginary and therefore c cannot calculate it. However how else can I calculate acoth() in c, because this obviously doesnt work?

  2. #2
    Registered User
    Join Date
    Nov 2010
    Long Beach, CA
    According to this article: Inverse hyperbolic function - Wikipedia, the free encyclopedia, acoth x = atanh 1/x, so I think you want to calculate atanh(1/4.31), not 1/atanh(4.31).

    EDIT: And the C99 standard allows for handling of complex numbers, though not all compilers support it. Check your compiler docs and the C99 standard here: C Draft Standards.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. inverse Sin Cos Tan
    By headshot119 in forum C++ Programming
    Replies: 2
    Last Post: 09-21-2009, 12:50 PM
  2. Help with inverse...
    By Ervilha in forum C Programming
    Replies: 14
    Last Post: 10-29-2008, 08:08 PM
  3. Inverse
    By bumfluff in forum C++ Programming
    Replies: 2
    Last Post: 05-14-2006, 06:42 AM
  4. Inverse Tan
    By spidereen in forum C++ Programming
    Replies: 2
    Last Post: 03-04-2003, 08:55 AM
  5. ack, need help with inverse sin
    By Valerie in forum C++ Programming
    Replies: 4
    Last Post: 10-06-2002, 08:25 PM