nuttx/libc/math
David S. Alessio c145159c6b This commit fixes the following libc/math issues:
1) asin[f l]() use Newton’s method to converge on a solution. But Newton’s method converges very slowly (> 500,000 iterations) for values of x close to 1.0; and, in the case of asinl(), sometimes fails to converge (loops forever). The attached patch uses an trig identity for values of x > sqrt(2). The resultant functions converge in no more than 5 iterations, 6 for asinl().

2) The NuttX erf[f l]() functions are based on Chebyshev fitting to a good guess. The problem there’s a bug in the implementation that causes the functions to blow up with x near -3.0. This patch fixes that problem. It should be noted that this method returns the error function erf(x) with fractional error less than 1.2E-07 and that’s fine for the float version erff(), but the same method is used for double and long double version which will yield only slightly better precision. This patch doesn't address the issue of lower precision for erf() and erfl().

3) a faster version of copysignf() for floats is included.
2016-07-30 15:43:56 -06:00
..
Kconfig Move include/nuttx/math.h to include/nuttx/lib/math.h 2016-07-21 13:58:09 -06:00
lib_acos.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_acosf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_acosh.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_acoshf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_acoshl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_acosl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_asin.c This commit fixes the following libc/math issues: 2016-07-30 15:43:56 -06:00
lib_asinf.c This commit fixes the following libc/math issues: 2016-07-30 15:43:56 -06:00
lib_asinh.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_asinhf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_asinhl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_asinl.c This commit fixes the following libc/math issues: 2016-07-30 15:43:56 -06:00
lib_atan2.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_atan2f.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_atan2l.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_atan.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_atanf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_atanh.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_atanhf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_atanhl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_atanl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_ceil.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_ceilf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_ceill.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_copysign.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_copysignf.c This commit fixes the following libc/math issues: 2016-07-30 15:43:56 -06:00
lib_copysignl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_cos.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_cosf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_cosh.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_coshf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_coshl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_cosl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_erf.c This commit fixes the following libc/math issues: 2016-07-30 15:43:56 -06:00
lib_erff.c This commit fixes the following libc/math issues: 2016-07-30 15:43:56 -06:00
lib_erfl.c This commit fixes the following libc/math issues: 2016-07-30 15:43:56 -06:00
lib_exp.c Rename all head files in main NuttX repository with names like *internal.h, removing the internal 2015-12-29 17:31:17 -06:00
lib_expf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_expl.c Rename all head files in main NuttX repository with names like *internal.h, removing the internal 2015-12-29 17:31:17 -06:00
lib_fabs.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_fabsf.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_fabsl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_floor.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_floorf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_floorl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_fmod.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_fmodf.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_fmodl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_frexp.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_frexpf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_frexpl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_ldexp.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_ldexpf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_ldexpl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_libexpi.c libm: Fix/improve range checks in lib_expi() and lib_expif(). 2016-07-12 09:59:10 -06:00
lib_libexpif.c libm: Fix/improve range checks in lib_expi() and lib_expif(). 2016-07-12 09:59:10 -06:00
lib_libsqrtapprox.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_log2.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_log2f.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_log2l.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_log10.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_log10f.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_log10l.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_log.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_logf.c Fix bug in logf() algorithm that caused erroneous INFINITY results. 2016-07-14 20:15:37 -06:00
lib_logl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_modf.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_modff.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_modfl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_pow.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_powf.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_powl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_rint.c Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
lib_rintf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_rintl.c Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
lib_round.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_roundf.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_roundl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_sin.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_sinf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_sinh.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_sinhf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_sinhl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_sinl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_sqrt.c Rename all head files in main NuttX repository with names like *internal.h, removing the internal 2015-12-29 17:31:17 -06:00
lib_sqrtf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_sqrtl.c Rename all head files in main NuttX repository with names like *internal.h, removing the internal 2015-12-29 17:31:17 -06:00
lib_tan.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_tanf.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_tanh.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_tanhf.c This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00
lib_tanhl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_tanl.c Standardize the width of all comment boxes in C files 2015-10-02 17:43:18 -06:00
lib_trunc.c nuttx/libc: Fix some spacing and alignment issues 2015-10-12 07:45:02 -06:00
lib_truncf.c nuttx/libc: Fix some spacing and alignment issues 2015-10-12 07:45:02 -06:00
lib_truncl.c nuttx/libc: Fix some spacing and alignment issues 2015-10-12 07:45:02 -06:00
Make.defs This change should significantly improve the performance of single precision floating point math library functions. The vast majority of changes have to do with preventing the compiler from needlessly promoting floats to doubles, performing the calculation with doubles, only to demote the result to float. These changes only affect the math lib functions that return float. 2016-07-11 07:02:50 -06:00