diff --git a/blas/ext/base/dnansumkbn2/coverage.ndjson b/blas/ext/base/dnansumkbn2/coverage.ndjson index 463874773..21abe95ea 100644 --- a/blas/ext/base/dnansumkbn2/coverage.ndjson +++ b/blas/ext/base/dnansumkbn2/coverage.ndjson @@ -1,2 +1,3 @@ [462,462,100,45,45,100,4,4,100,462,462,100,"6246c5dcbe7163afe809a80ce221a712ea56772d","2024-03-25 22:38:03 -0400"] [462,462,100,45,45,100,4,4,100,462,462,100,"3080f032a477cbd046b4201d7ffdd407c9d93816","2024-03-29 11:47:48 -0400"] +[404,406,99.5074,24,25,96,4,4,100,404,406,99.5074,"dc4b7b138a07ebbc5250fd7580ca758db7803875","2024-10-29 21:05:06 -0400"] diff --git a/blas/ext/base/dnansumkbn2/dnansumkbn2.js.html b/blas/ext/base/dnansumkbn2/dnansumkbn2.js.html index f2d078691..384a608dd 100644 --- a/blas/ext/base/dnansumkbn2/dnansumkbn2.js.html +++ b/blas/ext/base/dnansumkbn2/dnansumkbn2.js.html @@ -25,14 +25,14 @@

All files / bla
100% Statements - 109/109 + 60/60
100% Branches - 19/19 + 2/2
@@ -46,7 +46,7 @@

All files / bla
100% Lines - 109/109 + 60/60
@@ -123,56 +123,7 @@

All files / bla 58 59 60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -1102x +612x 2x 2x 2x @@ -224,60 +175,11 @@

All files / bla 2x 2x 2x -2x -15x -15x -15x -15x -15x -15x -15x -15x -15x 15x 15x 15x 2x 2x -15x -4x -1x -1x -3x -3x -15x -1x -15x -8x -8x -9x -9x -9x -15x -45x -45x -34x -34x -13x -34x -21x -21x -34x -34x -34x -33x -34x -1x -1x -34x -34x -34x -45x -45x -9x -15x -2x -2x 2x 2x 2x @@ -303,8 +205,8 @@

All files / bla   // MODULES //   -var isnan = require( '@stdlib/math/base/assert/is-nan' ); -var abs = require( '@stdlib/math/base/special/abs' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var ndarray = require( './ndarray.js' );     // MAIN // @@ -322,68 +224,19 @@

All files / bla * * @param {PositiveInteger} N - number of indexed elements * @param {Float64Array} x - input array -* @param {integer} stride - stride length +* @param {integer} strideX - stride length * @returns {number} sum * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * var x = new Float64Array( [ 1.0, -2.0, NaN, 2.0 ] ); -* var N = x.length; * -* var v = dnansumkbn2( N, x, 1 ); +* var v = dnansumkbn2( x.length, x, 1 ); * // returns 1.0 */ -function dnansumkbn2( N, x, stride ) { - var sum; - var ccs; - var ix; - var cs; - var cc; - var v; - var t; - var c; - var i; -  - if ( N <= 0 ) { - return 0.0; - } - if ( N === 1 || stride === 0 ) { - if ( isnan( x[ 0 ] ) ) { - return 0.0; - } - return x[ 0 ]; - } - if ( stride < 0 ) { - ix = (1-N) * stride; - } else { - ix = 0; - } - sum = 0.0; - ccs = 0.0; // second order correction term for lost low order bits - cs = 0.0; // first order correction term for lost low order bits - for ( i = 0; i < N; i++ ) { - v = x[ ix ]; - if ( isnan( v ) === false ) { - t = sum + v; - if ( abs( sum ) >= abs( v ) ) { - c = (sum-t) + v; - } else { - c = (v-t) + sum; - } - sum = t; - t = cs + c; - if ( abs( cs ) >= abs( c ) ) { - cc = (cs-t) + c; - } else { - cc = (c-t) + cs; - } - cs = t; - ccs += cc; - } - ix += stride; - } - return sum + cs + ccs; +function dnansumkbn2( N, x, strideX ) { + return ndarray( N, x, strideX, stride2offset( N, strideX ) ); }     @@ -397,7 +250,7 @@

All files / bla