/* gcc acoth.c * expected output: acoth(i) = 0.0000 -0.7854i * output on musl: acoth(i) = 100000000000000001097906362944045541740492309677311846336810682903157585404911491537163328978494688899061249669721172515611590283743140088328307009198146046031271664502933027185697489699588559043338384466165001178426897626212945177628091195786707458122783970171784415105291802893207873272974885715430223118336.0000 -100000000000000001097906362944045541740492309677311846336810682903157585404911491537163328978494688899061249669721172515611590283743140088328307009198146046031271664502933027185697489699588559043338384466165001178426897626212945177628091195786707458122783970171784415105291802893207873272974885715430223118336.0000i */ #include #include int main() { double complex arg = I; // acoth(x) = atanh(1 / x) double complex res = catanh(1.0 / arg); printf("acoth(i) = %.4lf %+.4lfi\n", creal(res), cimag(res)); }