diff options
author | Joe Ramsay <Joe.Ramsay@arm.com> | 2022-12-09 12:19:38 +0000 |
---|---|---|
committer | Joe Ramsay <joe.ramsay@arm.com> | 2022-12-09 12:19:38 +0000 |
commit | bc7cc9d2a762a26b2fcbf150b3fc9c6993ffa16c (patch) | |
tree | 0b06cfa5fab3f8f594ff16a1d093a92412e8fb86 /pl/math/v_tanhf_2u6.c | |
parent | 132d2f5da6155e64ff39a54fdbb46145a3892d6a (diff) | |
download | arm-optimized-routines-bc7cc9d2a762a26b2fcbf150b3fc9c6993ffa16c.tar.gz |
pl/math: Add polynomial helpers
Add macros for simplifying polynomial evaluation using either Horner,
pairwise Horner or Estrin. Several routines have been modified to use
the new helpers. Readability is improved slightly, and we expect that
this will make prototyping new routines simpler.
Diffstat (limited to 'pl/math/v_tanhf_2u6.c')
-rw-r--r-- | pl/math/v_tanhf_2u6.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pl/math/v_tanhf_2u6.c b/pl/math/v_tanhf_2u6.c index 571fd8b..67e4520 100644 --- a/pl/math/v_tanhf_2u6.c +++ b/pl/math/v_tanhf_2u6.c @@ -6,6 +6,7 @@ #include "v_math.h" #include "mathlib.h" +#include "estrinf.h" #if V_SUPPORTED @@ -39,10 +40,7 @@ expm1f_inline (v_f32_t x) /* Approximate expm1(f) with polynomial P, expm1(f) ~= f + f^2 * P(f). Uses Estrin scheme, where the main __v_expm1f routine uses Horner. */ v_f32_t f2 = f * f; - v_f32_t p_01 = v_fma_f32 (f, C (1), C (0)); - v_f32_t p_23 = v_fma_f32 (f, C (3), C (2)); - v_f32_t p = v_fma_f32 (f2, p_23, p_01); - p = v_fma_f32 (f2 * f2, C (4), p); + v_f32_t p = ESTRIN_4 (f, f2, f2 * f2, C); p = v_fma_f32 (f2, p, f); /* t = 2^i. */ |