From 885f5974cdf65b59415837ae97f5a14ef1350670 Mon Sep 17 00:00:00 2001 From: Kacper Date: Tue, 9 Dec 2025 19:20:15 +0100 Subject: feat: add gzip and new headers --- lib/libm/catanl.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/libm/catanl.c (limited to 'lib/libm/catanl.c') diff --git a/lib/libm/catanl.c b/lib/libm/catanl.c new file mode 100644 index 00000000..949dc3d9 --- /dev/null +++ b/lib/libm/catanl.c @@ -0,0 +1,34 @@ +#include +#include "__complex.h" + +long double complex catanl(long double complex z) +{ + long double complex w; + long double a, t, x, x2, y; + + x = creall(z); + y = cimagl(z); + + if ((x == 0.0L) && (y > 1.0L)) + goto overflow; + + x2 = x * x; + a = 1.0L - x2 - (y * y); + if (a == 0.0) + goto overflow; + + t = 0.5L * atan2l(2.0L * x, a); + w = redupil(t); + + t = y - 1.0L; + a = x2 + (t * t); + if (a == 0.0L) + goto overflow; + + t = y + 1.0L; + a = (x2 + (t * t)) / a; + return w + (0.25L * logl(a)) * I; + +overflow: + return LDBL_MAX + LDBL_MAX * I; +} -- cgit v1.2.3