New comment by tornaria on void-packages repository https://github.com/void-linux/void-packages/pull/44529#issuecomment-1599570276 Comment: Actually, this seems like a bug in musl libm: ``` $ cat cacosh.c #include #include void main() { double complex z = -1 -I, c; c = cacosh(z); printf("cacosh(z) = %6.3f %6.3f*i\n", creal(c), cimag(c)); } $ cc cacosh.c -o cacosh -lm && ./cacosh cacosh(z) = -1.061 2.237*i ``` Note that `cacosh(3p)` says: ``` RETURN VALUE These functions shall return the complex arc hyperbolic cosine value, in the range of a half-strip of non-negative values along the real axis and in the interval [-iπ, +iπ] along the imaginary axis. ``` For whatever reason `cmath.acosh` is not catching this error (probably because it's not using C99 complex trig functions but reimplementing them from C89 real functions).