aboutsummaryrefslogtreecommitdiff
path: root/pl/math/erfcf.h
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/erfcf.h
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/erfcf.h')
-rw-r--r--pl/math/erfcf.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/pl/math/erfcf.h b/pl/math/erfcf.h
new file mode 100644
index 0000000..8f1e5f4
--- /dev/null
+++ b/pl/math/erfcf.h
@@ -0,0 +1,38 @@
+/*
+ * Shared functions for scalar and vector single-precision erfc(x) functions.
+ *
+ * Copyright (c) 2021-2023, Arm Limited.
+ * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
+ */
+
+#ifndef PL_MATH_ERFCF_H
+#define PL_MATH_ERFCF_H
+
+#include "math_config.h"
+
+#define FMA fma
+#include "estrin_wrap.h"
+
+/* Accurate exponential from optimized-routines. */
+double
+__exp_dd (double x, double xtail);
+
+static inline double
+eval_poly (double z, const double *coeff)
+{
+ double z2 = z * z;
+ double z4 = z2 * z2;
+ double z8 = z4 * z4;
+#define C(i) coeff[i]
+ return ESTRIN_15 (z, z2, z4, z8, C);
+#undef C
+}
+
+static inline double
+eval_exp_mx2 (double x)
+{
+ return __exp_dd (-(x * x), 0.0);
+}
+
+#undef FMA
+#endif // PL_MATH_ERFCF_H