nuttx/libs/libc/math
Petro Karashchenko b859f2750b libc/math: fix log and logf calculations on ARMv7 (and maybe others)
Probably this is a bug of a GCC, but on AMRv7 the code "if (relax_factor > 1)"
generates "bne.n" instruction if "relax_factor" is "int". Few lines above
"relax_factor *= LOG_RELAX_MULTIPLIER;" is done without overflow check hence
at some moment overflow occurs and "relax_factor" becomes a zero and condition
"if (relax_factor > 1)" becomes always evaluated to "true" hence "epsilon"
becomes zero always.

Probably this is not the best way to fix the bug (The best way is to report it
to GCC), but this change allows to get correct behavior of "log" and "logf" for
ARMv7 based MCUs

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-01 20:38:38 +08:00
..
__cos.c LICENSE: add libs/libc/math/ to license file 2021-09-02 21:56:05 +08:00
__sin.c LICENSE: add libs/libc/math/ to license file 2021-09-02 21:56:05 +08:00
Kconfig Sources and Docs: Fix typos and nxstyle issues 2020-10-02 04:54:52 +02:00
lib_acos.c
lib_acosf.c
lib_acosh.c author: Brennan Ashton: update licenses to Apache 2021-09-02 21:56:05 +08:00
lib_acoshf.c author: Brennan Ashton: update licenses to Apache 2021-09-02 21:56:05 +08:00
lib_acoshl.c author: Brennan Ashton: update licenses to Apache 2021-09-02 21:56:05 +08:00
lib_acosl.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_asin.c libs: fix nxstyle errors 2021-04-02 11:12:25 -05:00
lib_asinf.c libs: fix nxstyle errors 2021-04-02 11:12:25 -05:00
lib_asinh.c author: Brennan Ashton: update licenses to Apache 2021-09-02 21:56:05 +08:00
lib_asinhf.c author: Brennan Ashton: update licenses to Apache 2021-09-02 21:56:05 +08:00
lib_asinhl.c author: Brennan Ashton: update licenses to Apache 2021-09-02 21:56:05 +08:00
lib_asinl.c libs: fix nxstyle errors 2021-04-02 11:12:25 -05:00
lib_atan2.c
lib_atan2f.c
lib_atan2l.c
lib_atan.c
lib_atanf.c
lib_atanh.c author: Brennan Ashton: update licenses to Apache 2021-09-02 21:56:05 +08:00
lib_atanhf.c author: Brennan Ashton: update licenses to Apache 2021-09-02 21:56:05 +08:00
lib_atanhl.c author: Brennan Ashton: update licenses to Apache 2021-09-02 21:56:05 +08:00
lib_atanl.c
lib_cbrt.c math: Implement cbrt 2020-08-14 07:27:55 -05:00
lib_ceil.c
lib_ceilf.c
lib_ceill.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_copysign.c libs: libc: update licenses to Apache 2021-05-27 08:07:25 +09:00
lib_copysignf.c LICENSE: add libs/libc/math/ to license file 2021-09-02 21:56:05 +08:00
lib_copysignl.c libs: libc: update licenses to Apache 2021-05-27 08:07:25 +09:00
lib_cos.c
lib_cosf.c
lib_cosh.c
lib_coshf.c
lib_coshl.c
lib_cosl.c
lib_erf.c libs: libc: update licenses to Apache 2021-05-27 08:07:25 +09:00
lib_erfc.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_erfcf.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_erfcl.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_erff.c libs: libc: update licenses to Apache 2021-05-27 08:07:25 +09:00
lib_erfl.c author: Brennan Ashton: update licenses to Apache 2021-09-02 21:56:05 +08:00
lib_exp.c
lib_expf.c
lib_expl.c
lib_expm1.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_expm1f.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_expm1l.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_fabs.c
lib_fabsf.c libs/libc/machine/arm/armv7-m: Add Cortex M4F mach optimized fabsf and sqrtf. 2019-07-29 20:27:33 -06:00
lib_fabsl.c
lib_floor.c Fix wait loop and void cast (#24) 2020-01-02 10:54:43 -06:00
lib_floorf.c Fix wait loop and void cast (#24) 2020-01-02 10:54:43 -06:00
lib_floorl.c libs: fix nxstyle errors 2021-04-02 11:12:25 -05:00
lib_fmax.c libc/math: Add fmax and fmin functions 2021-07-10 11:00:07 -03:00
lib_fmaxf.c libc/math: Add fmax and fmin functions 2021-07-10 11:00:07 -03:00
lib_fmaxl.c libc/math: Add fmax and fmin functions 2021-07-10 11:00:07 -03:00
lib_fmin.c libc/math: Add fmax and fmin functions 2021-07-10 11:00:07 -03:00
lib_fminf.c libc/math: Add fmax and fmin functions 2021-07-10 11:00:07 -03:00
lib_fminl.c libc/math: Add fmax and fmin functions 2021-07-10 11:00:07 -03:00
lib_fmod.c libc/math: fix fmod family operation 2021-12-31 20:51:23 +08:00
lib_fmodf.c libc/math: fix fmod family operation 2021-12-31 20:51:23 +08:00
lib_fmodl.c libc/math: fix fmod family operation 2021-12-31 20:51:23 +08:00
lib_frexp.c
lib_frexpf.c
lib_frexpl.c
lib_gamma.c Squashed commit of the following: 2019-02-27 08:41:08 -06:00
lib_ldexp.c
lib_ldexpf.c
lib_ldexpl.c
lib_lgamma.c LICENSE: add libs/libc/math/ to license file 2021-09-02 21:56:05 +08:00
lib_libexpi.c
lib_libexpif.c
lib_libsqrtapprox.c libc/math: Fix warning: dereferencing type-punned pointer will break strict-aliasing rules 2020-06-29 16:25:22 +01:00
lib_llround.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_llroundf.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_llroundl.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_log2.c
lib_log2f.c
lib_log2l.c
lib_log10.c
lib_log10f.c
lib_log10l.c
lib_log.c libc/math: fix log and logf calculations on ARMv7 (and maybe others) 2022-01-01 20:38:38 +08:00
lib_logf.c libc/math: fix log and logf calculations on ARMv7 (and maybe others) 2022-01-01 20:38:38 +08:00
lib_logl.c libc/math: fix log and logf calculations on ARMv7 (and maybe others) 2022-01-01 20:38:38 +08:00
lib_lround.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_lroundf.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_lroundl.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_modf.c libc/math: fix fmod family operation 2021-12-31 20:51:23 +08:00
lib_modff.c libc/math: fix fmod family operation 2021-12-31 20:51:23 +08:00
lib_modfl.c libc/math: fix fmod family operation 2021-12-31 20:51:23 +08:00
lib_nan.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_nanf.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_nanl.c sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
lib_pow.c
lib_powf.c
lib_powl.c
lib_rint.c NuttX: Fix nxtyle errors 2021-04-03 04:20:31 -07:00
lib_rintf.c NuttX: Fix nxtyle errors 2021-04-03 04:20:31 -07:00
lib_rintl.c NuttX: Fix nxtyle errors 2021-04-03 04:20:31 -07:00
lib_round.c libs: libc: update licenses to Apache 2021-05-27 08:07:25 +09:00
lib_roundf.c libs: libc: update licenses to Apache 2021-05-27 08:07:25 +09:00
lib_roundl.c libs: libc: update licenses to Apache 2021-05-27 08:07:25 +09:00
lib_sin.c
lib_sinf.c
lib_sinh.c
lib_sinhf.c
lib_sinhl.c
lib_sinl.c
lib_sqrt.c libs: fix nxstyle errors 2021-04-02 11:12:25 -05:00
lib_sqrtf.c libs/libc/machine/arm/armv7-m: Add Cortex M4F mach optimized fabsf and sqrtf. 2019-07-29 20:27:33 -06:00
lib_sqrtl.c libs: fix nxstyle errors 2021-04-02 11:12:25 -05:00
lib_tan.c
lib_tanf.c
lib_tanh.c various fixes (#49) 2020-01-07 09:06:02 -06:00
lib_tanhf.c various fixes (#49) 2020-01-07 09:06:02 -06:00
lib_tanhl.c various fixes (#49) 2020-01-07 09:06:02 -06:00
lib_tanl.c
lib_trunc.c Fix wait loop and void cast (#24) 2020-01-02 10:54:43 -06:00
lib_truncf.c Fix wait loop and void cast (#24) 2020-01-02 10:54:43 -06:00
lib_truncl.c libs: fix nxstyle errors 2021-04-02 11:12:25 -05:00
Make.defs libc/math: Add fmax and fmin functions 2021-07-10 11:00:07 -03:00