diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 00:58:26 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 00:58:26 +0000 |
commit | 29109db5ff4f54e1b9694505aa34d54fda6ab6d2 (patch) | |
tree | b6182e391304fb3a42c51d482dcf671f540f2363 /pl/math/erfcf.h | |
parent | 5977ae8110ccfef79770bcc209243185bda69811 (diff) | |
parent | 172d24a7ae67ee7bae413d5a8618f1b5edc002be (diff) | |
download | arm-optimized-routines-29109db5ff4f54e1b9694505aa34d54fda6ab6d2.tar.gz |
Snap for 10447354 from 172d24a7ae67ee7bae413d5a8618f1b5edc002be to mainline-tethering-releaseaml_tet_341712060aml_tet_341610020aml_tet_341511010aml_tet_341411060aml_tet_341310230aml_tet_341112070aml_tet_341010040aml_tet_340913030android14-mainline-tethering-release
Change-Id: I3d1ba62dd3ec4f1f932ef5e2ce24308402f6b85d
Diffstat (limited to 'pl/math/erfcf.h')
-rw-r--r-- | pl/math/erfcf.h | 38 |
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 |