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
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
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
lib_ceil.c
lib_ceilf.c
lib_ceill.c
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
lib_erfcf.c
lib_erfcl.c
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
lib_expm1f.c
lib_expm1l.c
lib_fabs.c
lib_fabsf.c
lib_fabsl.c
lib_floor.c
lib_floorf.c
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
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
lib_llround.c
lib_llroundf.c
lib_llroundl.c
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
lib_lroundf.c
lib_lroundl.c
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
lib_nanf.c
lib_nanl.c
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
lib_sqrtl.c libs: fix nxstyle errors 2021-04-02 11:12:25 -05:00
lib_tan.c
lib_tanf.c
lib_tanh.c
lib_tanhf.c
lib_tanhl.c
lib_tanl.c
lib_trunc.c
lib_truncf.c
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