summaryrefslogtreecommitdiff
path: root/lib/libm/ctanl.c
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-09 19:20:15 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-09 19:20:15 +0100
commit885f5974cdf65b59415837ae97f5a14ef1350670 (patch)
tree66ac13de29c7f4932c5fcae11773df574e4e256a /lib/libm/ctanl.c
parent8f9e448b2ef6db7cd905540c21f3c5b190e7a1e7 (diff)
feat: add gzip and new headers
Diffstat (limited to 'lib/libm/ctanl.c')
-rw-r--r--lib/libm/ctanl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libm/ctanl.c b/lib/libm/ctanl.c
new file mode 100644
index 00000000..a410db0e
--- /dev/null
+++ b/lib/libm/ctanl.c
@@ -0,0 +1,17 @@
+#include "__complex.h"
+
+long double complex ctanl(long double complex z)
+{
+ long double d = cosl(2.0L * creall(z)) + coshl(2.0L * cimagl(z));
+
+ if (fabsl(d) < 0.25L) {
+ d = ctansl(z);
+ }
+
+ if (d == 0.0L) {
+ return HUGE_VALL + HUGE_VALL * (long double complex)I;
+ }
+
+ return sinl(2.0L * creall(z)) / d +
+ (sinhl(2.0L * cimagl(z)) / d) * (long double complex)I;
+}