Further optimize the math library

The sincosf() function is now twice as fast, thanks to ARM Limited. The
same might also be true of logf() and expm1f() which have been updated.
This commit is contained in:
Justine Tunney 2023-04-28 01:17:28 -07:00
parent e8b43903b2
commit 420f889ac3
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
22 changed files with 854 additions and 118 deletions

View file

@ -0,0 +1,24 @@
#ifndef COSMOPOLITAN_LIBC_TINYMATH_HORNERF_INTERNAL_H_
#define COSMOPOLITAN_LIBC_TINYMATH_HORNERF_INTERNAL_H_
#include "third_party/libcxx/math.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
/*
* Helper macros for double-precision Horner polynomial evaluation.
*
* Copyright (c) 2022-2023, Arm Limited.
* SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
*/
#if WANT_VMATH
#define FMA(x, y, z) vfmaq_f32(z, x, y)
#else
#define FMA fmaf
#endif
#include "libc/tinymath/horner_wrap.internal.h"
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_TINYMATH_HORNERF_INTERNAL_H_ */