aboutsummaryrefslogtreecommitdiff
path: root/pl/math/tools/atanf.sollya
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2023-01-25 16:31:42 +0000
committerElliott Hughes <enh@google.com>2023-01-25 18:11:56 +0000
commit62662f115a17a5548402fcd02f3b7e1b9b38e087 (patch)
tree945eb1832687ad5eb97c433013617dbe107718e5 /pl/math/tools/atanf.sollya
parent04d0bc466ce39c702459d77a15754a19533eaec9 (diff)
parent56e3bf05c19c4e28e1f5edd9093c712f16c5c32a (diff)
downloadarm-optimized-routines-62662f115a17a5548402fcd02f3b7e1b9b38e087.tar.gz
Upgrade ARM-software/optimized-routines to v23.01
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update arm-optimized-routines For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md Test: TreeHugger Change-Id: I03de0ecb0ea89c2a77b1c411685af09fd480b63e
Diffstat (limited to 'pl/math/tools/atanf.sollya')
-rw-r--r--pl/math/tools/atanf.sollya20
1 files changed, 20 insertions, 0 deletions
diff --git a/pl/math/tools/atanf.sollya b/pl/math/tools/atanf.sollya
new file mode 100644
index 0000000..ed88d0b
--- /dev/null
+++ b/pl/math/tools/atanf.sollya
@@ -0,0 +1,20 @@
+// polynomial for approximating atanf(x)
+//
+// Copyright (c) 2022-2023, Arm Limited.
+// SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
+
+// Generate list of monomials:
+// Taylor series of atan is of the form x + ax^3 + bx^5 + cx^7 + ...
+// So generate a, b, c, ... such that we can approximate atan(x) by:
+// x + x^3 * (a + bx^2 + cx^4 + ...)
+
+deg = 7;
+
+a = 1.1754943508222875e-38;
+b = 1;
+
+poly = fpminimax((atan(sqrt(x))-sqrt(x))/x^(3/2), deg, [|single ...|], [a;b]);
+
+display = hexadecimal;
+print("coeffs:");
+for i from 0 to deg do coeff(poly,i);