From 4eb9aea88656f98ba3f65075b4a7cb3335284716 Mon Sep 17 00:00:00 2001 From: Muhammad Haris <101793258+headlessNode@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:35:14 +0500 Subject: [PATCH] refactor: replace `fabs` with `stdlib_base_abs` in C implementation of `blas/ext/base/dapxsumkbn` PR-URL: https://github.com/stdlib-js/stdlib/pull/3214 Reviewed-by: Athan Reines Co-authored-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> --- .../@stdlib/blas/ext/base/dapxsumkbn/manifest.json | 9 ++++++--- .../@stdlib/blas/ext/base/dapxsumkbn/src/main.c | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/manifest.json index 1f8a079f9bee..1efce77b76c1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/manifest.json @@ -43,7 +43,8 @@ "@stdlib/napi/argv-int64", "@stdlib/napi/argv-double", "@stdlib/napi/argv-strided-float64array", - "@stdlib/napi/create-double" + "@stdlib/napi/create-double", + "@stdlib/math/base/special/abs" ] }, { @@ -58,7 +59,8 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/stride2offset" + "@stdlib/strided/base/stride2offset", + "@stdlib/math/base/special/abs" ] }, { @@ -73,7 +75,8 @@ "libpath": [], "dependencies": [ "@stdlib/blas/base/shared", - "@stdlib/strided/base/stride2offset" + "@stdlib/strided/base/stride2offset", + "@stdlib/math/base/special/abs" ] } ] diff --git a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/src/main.c b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/src/main.c index 9148f3dacf21..43850d142833 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/src/main.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dapxsumkbn/src/main.c @@ -19,7 +19,7 @@ #include "stdlib/blas/ext/base/dapxsumkbn.h" #include "stdlib/blas/base/shared.h" #include "stdlib/strided/base/stride2offset.h" -#include +#include "stdlib/math/base/special/abs.h" /** * Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm. @@ -72,7 +72,7 @@ double API_SUFFIX(stdlib_strided_dapxsumkbn_ndarray)( const CBLAS_INT N, const d for ( i = 0; i < N; i++ ) { v = alpha + X[ ix ]; t = sum + v; - if ( fabs( sum ) >= fabs( v ) ) { + if ( stdlib_base_abs( sum ) >= stdlib_base_abs( v ) ) { c += (sum-t) + v; } else { c += (v-t) + sum;