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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_acosf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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_atan.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_atan2.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_atan2f.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_atan2l.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_atanf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_cbrt.c math: Implement cbrt 2020-08-14 07:27:55 -05:00
lib_ceil.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_ceilf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_cosf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_cosh.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_coshf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_coshl.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_cosl.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_expf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_expl.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_frexpf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_frexpl.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_gamma.c Squashed commit of the following: 2019-02-27 08:41:08 -06:00
lib_ldexp.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_ldexpf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_ldexpl.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_lgamma.c LICENSE: add libs/libc/math/ to license file 2021-09-02 21:56:05 +08:00
lib_libexpi.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_libexpif.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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_log.c libc/math: fix log and logf calculations on ARMv7 (and maybe others) 2022-01-01 20:38:38 +08:00
lib_log2.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_log2f.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_log2l.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_log10.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_log10f.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_log10l.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06: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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_powf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_powl.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_sinf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_sinh.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_sinhf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_sinhl.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_sinl.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
lib_tanf.c This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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 This commit moves all of the libraries under a common directory called libs/. This most certainly break libcxx and uClibc++ for now. 2018-05-29 13:21:26 -06:00
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