Skip to content

Commit 3e201d7

Browse files
committed
fix: update function alias and add WebAssembly configuration
1 parent 644c390 commit 3e201d7

File tree

4 files changed

+37
-8
lines changed

4 files changed

+37
-8
lines changed

lib/node_modules/@stdlib/math/base/special/erf/benchmark/benchmark.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2626
var pkg = require( './../package.json' ).name;
2727
var erf = require( './../lib' );
@@ -34,10 +34,13 @@ bench( pkg, function benchmark( b ) {
3434
var y;
3535
var i;
3636

37+
x = uniform( 10, -500.0, 500.0, {
38+
'dtype': 'generic'
39+
});
40+
3741
b.tic();
3842
for ( i = 0; i < b.iterations; i++ ) {
39-
x = ( randu()*1000.0 ) - 500.0;
40-
y = erf( x );
43+
y = erf( x[ i%x.length ] );
4144
if ( isnan( y ) ) {
4245
b.fail( 'should not return NaN' );
4346
}

lib/node_modules/@stdlib/math/base/special/erf/benchmark/benchmark.native.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25-
var randu = require( '@stdlib/random/base/randu' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
2828
var pkg = require( './../package.json' ).name;
@@ -43,10 +43,13 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4343
var y;
4444
var i;
4545

46+
x = uniform( 10, -500.0, 500.0, {
47+
'dtype': 'generic'
48+
});
49+
4650
b.tic();
4751
for ( i = 0; i < b.iterations; i++ ) {
48-
x = ( randu()*1000.0 ) - 500.0;
49-
y = erf( x );
52+
y = erf( x[ i%x.length ] );
5053
if ( isnan( y ) ) {
5154
b.fail( 'should not return NaN' );
5255
}

lib/node_modules/@stdlib/math/base/special/erf/manifest.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"options": {
3-
"task": "build"
3+
"task": "build",
4+
"wasm": false
45
},
56
"fields": [
67
{
@@ -27,6 +28,7 @@
2728
"confs": [
2829
{
2930
"task": "build",
31+
"wasm": false,
3032
"src": [
3133
"./src/main.c"
3234
],
@@ -46,6 +48,7 @@
4648
},
4749
{
4850
"task": "benchmark",
51+
"wasm": false,
4952
"src": [
5053
"./src/main.c"
5154
],
@@ -64,6 +67,26 @@
6467
},
6568
{
6669
"task": "examples",
70+
"wasm": false,
71+
"src": [
72+
"./src/main.c"
73+
],
74+
"include": [
75+
"./include"
76+
],
77+
"libraries": [],
78+
"libpath": [],
79+
"dependencies": [
80+
"@stdlib/math/base/assert/is-nan",
81+
"@stdlib/constants/float64/ninf",
82+
"@stdlib/constants/float64/pinf",
83+
"@stdlib/math/base/special/exp",
84+
"@stdlib/number/float64/base/set-low-word"
85+
]
86+
},
87+
{
88+
"task": "build",
89+
"wasm": true,
6790
"src": [
6891
"./src/main.c"
6992
],

lib/node_modules/@stdlib/math/base/special/erf/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ double stdlib_base_erf( const double x ) {
524524
}
525525
z = ax;
526526
stdlib_base_float64_set_low_word( 0, &z ); // pseudo-single (20-bit) precision x
527-
r = stdlib_base_exp( -( z * z ) - 0.5625 ) * exp( ( ( z - ax ) * ( z + ax ) ) + ( r / s ) );
527+
r = stdlib_base_exp( -( z * z ) - 0.5625 ) * stdlib_base_exp( ( ( z - ax ) * ( z + ax ) ) + ( r / s ) );
528528
if ( sign == 1 ) {
529529
return ( r / ax ) - 1.0;
530530
}

0 commit comments

Comments
 (0)