From a2ed0ddd7262b1c33feb79414d9438d664df6a8f Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Wed, 4 Sep 2024 17:59:23 +0200 Subject: [PATCH] libs/libm: fix epsilon relaxation in log and logf Signed-off-by: Petro Karashchenko --- libs/libm/libm/lib_log.c | 2 +- libs/libm/libm/lib_logf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/libm/libm/lib_log.c b/libs/libm/libm/lib_log.c index 9b8e23b97d..5bf3c67948 100644 --- a/libs/libm/libm/lib_log.c +++ b/libs/libm/libm/lib_log.c @@ -98,7 +98,7 @@ double log(double x) iter = 0; } - if (relax_factor > 1.0) + if (iter == 0) { epsilon *= relax_factor; } diff --git a/libs/libm/libm/lib_logf.c b/libs/libm/libm/lib_logf.c index 35672915b4..3cf050bca0 100644 --- a/libs/libm/libm/lib_logf.c +++ b/libs/libm/libm/lib_logf.c @@ -94,7 +94,7 @@ float logf(float x) iter = 0; } - if (relax_factor > 1.0F) + if (iter == 0) { epsilon *= relax_factor; }