Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Oct 2, 2024
1 parent a46a4de commit 3382d3d
Show file tree
Hide file tree
Showing 18 changed files with 287 additions and 114 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,28 @@

<!-- /.package -->

<section class="package" id="math-base-special-erf-unreleased">

#### [@stdlib/math/base/special/erf](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/erf)

<details>

<section class="bug-fixes">

##### Bug Fixes

- [`3e201d7`](https://github.com/stdlib-js/stdlib/commit/3e201d779fa5844dd5808418f103f37d1a905d61) - update function alias and add WebAssembly configuration

</section>

<!-- /.bug-fixes -->

</details>

</section>

<!-- /.package -->

<section class="package" id="math-base-special-erfcx-unreleased">

#### [@stdlib/math/base/special/erfcx](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/erfcx)
Expand Down Expand Up @@ -409,6 +431,15 @@ A total of 4 people contributed to this release. Thank you to the following cont

<details>

- [`24fadbf`](https://github.com/stdlib-js/stdlib/commit/24fadbf27f7a01624648ed5bea5cce504b3f65d1) - **bench:** fix runner _(by Athan Reines)_
- [`8f0f3b6`](https://github.com/stdlib-js/stdlib/commit/8f0f3b65ddcd28963d55d7956a22d801f59155fa) - **bench:** use SpecialFunctions package _(by Athan Reines)_
- [`c94a8b2`](https://github.com/stdlib-js/stdlib/commit/c94a8b2eee5d00c623ecccbb0aeef4daefb4ed06) - **bench:** update value ranges _(by Athan Reines)_
- [`2e75575`](https://github.com/stdlib-js/stdlib/commit/2e7557545d196c0af52afe1df1800735d7068836) - **build:** add WebAssembly configuration _(by Athan Reines)_
- [`4531104`](https://github.com/stdlib-js/stdlib/commit/45311043928ef04b43f9045965c4c5fdacf3f434) - **build:** add WebAssembly configuration _(by Athan Reines)_
- [`c20c2c3`](https://github.com/stdlib-js/stdlib/commit/c20c2c34c3f7f87ab1902cbbefaffd1729077370) - **build:** add WebAssembly configuration _(by Athan Reines)_
- [`6b54c29`](https://github.com/stdlib-js/stdlib/commit/6b54c297e4f7eb90c4c6432896a2a62c4cb77de4) - **build:** add WebAssembly configuration _(by Athan Reines)_
- [`3e201d7`](https://github.com/stdlib-js/stdlib/commit/3e201d779fa5844dd5808418f103f37d1a905d61) - **fix:** update function alias and add WebAssembly configuration _(by Athan Reines)_
- [`644c390`](https://github.com/stdlib-js/stdlib/commit/644c39075c6d5b630f8d0e2fce1ecbde540a9892) - **build:** add WebAssembly configuration and fix indentation _(by Athan Reines)_
- [`c24de14`](https://github.com/stdlib-js/stdlib/commit/c24de14b9ee9c026f00c40ed378077007a8054b0) - **chore:** clean-up docs, benchmarks, and examples _(by Athan Reines)_
- [`16c903b`](https://github.com/stdlib-js/stdlib/commit/16c903bdbd31c7d81bc3d6811e942e35c6de38e6) - **fix:** add missing `native.js` and fix indentation [(#2975)](https://github.com/stdlib-js/stdlib/pull/2975) _(by Gunj Joshi)_
- [`aa94a37`](https://github.com/stdlib-js/stdlib/commit/aa94a37728cfa9d7356f9a9880bfc411f302443a) - **refactor:** remove hardcoded constant [(#2970)](https://github.com/stdlib-js/stdlib/pull/2970) _(by Gunj Joshi)_
Expand Down
160 changes: 90 additions & 70 deletions base/special/abs/manifest.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,95 @@
{
"options": {
"task": "build"
},
"fields": [
{
"field": "src",
"resolve": true,
"relative": true
},
{
"field": "include",
"resolve": true,
"relative": true
},
{
"field": "libraries",
"resolve": false,
"relative": false
},
{
"field": "libpath",
"resolve": true,
"relative": false
}
],
"confs": [
{
"task": "build",
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/napi/unary",
"@stdlib/constants/float64/high-word-abs-mask",
"options": {
"task": "build",
"wasm": false
},
"fields": [
{
"field": "src",
"resolve": true,
"relative": true
},
{
"field": "include",
"resolve": true,
"relative": true
},
{
"field": "libraries",
"resolve": false,
"relative": false
},
{
"field": "libpath",
"resolve": true,
"relative": false
}
],
"confs": [
{
"task": "build",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/napi/unary",
"@stdlib/constants/float64/high-word-abs-mask",
"@stdlib/number/float64/base/to-words"
]
},
{
"task": "benchmark",
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/constants/float64/high-word-abs-mask",
]
},
{
"task": "benchmark",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/constants/float64/high-word-abs-mask",
"@stdlib/number/float64/base/to-words"
]
},
{
"task": "examples",
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/constants/float64/high-word-abs-mask",
]
},
{
"task": "examples",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/constants/float64/high-word-abs-mask",
"@stdlib/number/float64/base/to-words"
]
}
]
]
},
{
"task": "build",
"wasm": true,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/constants/float64/high-word-abs-mask",
"@stdlib/number/float64/base/to-words"
]
}
]
}
35 changes: 26 additions & 9 deletions base/special/copysign/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"options": {
"task": "build"
"task": "build",
"wasm": false
},
"fields": [
{
Expand All @@ -27,15 +28,14 @@
"confs": [
{
"task": "build",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/constants/float64/high-word-abs-mask",
Expand All @@ -48,15 +48,14 @@
},
{
"task": "benchmark",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/constants/float64/high-word-abs-mask",
Expand All @@ -68,15 +67,33 @@
},
{
"task": "examples",
"wasm": false,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/constants/float64/high-word-abs-mask",
"@stdlib/constants/float64/high-word-sign-mask",
"@stdlib/number/float64/base/to-words",
"@stdlib/number/float64/base/get-high-word",
"@stdlib/number/float64/base/from-words"
]
},
{
"task": "build",
"wasm": true,
"src": [
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/constants/float64/high-word-abs-mask",
Expand Down
9 changes: 6 additions & 3 deletions base/special/erf/benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// MODULES //

var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/array/uniform' );
var isnan = require( './../../../../base/assert/is-nan' );
var pkg = require( './../package.json' ).name;
var erf = require( './../lib' );
Expand All @@ -34,10 +34,13 @@ bench( pkg, function benchmark( b ) {
var y;
var i;

x = uniform( 10, -1.0, 1.0, {
'dtype': 'generic'
});

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*1000.0 ) - 500.0;
y = erf( x );
y = erf( x[ i%x.length ] );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
Expand Down
9 changes: 6 additions & 3 deletions base/special/erf/benchmark/benchmark.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/base/randu' );
var uniform = require( '@stdlib/random/array/uniform' );
var isnan = require( './../../../../base/assert/is-nan' );
var tryRequire = require( '@stdlib/utils/try-require' );
var pkg = require( './../package.json' ).name;
Expand All @@ -43,10 +43,13 @@ bench( pkg+'::native', opts, function benchmark( b ) {
var y;
var i;

x = uniform( 10, -1.0, 1.0, {
'dtype': 'generic'
});

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*1000.0 ) - 500.0;
y = erf( x );
y = erf( x[ i%x.length ] );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
Expand Down
2 changes: 1 addition & 1 deletion base/special/erf/benchmark/c/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static double benchmark( void ) {

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
x = ( 1000.0*rand_double() ) - 500.0;
x = ( 2.0*rand_double() ) - 1.0;
y = erf( x );
if ( y != y ) {
printf( "should not return NaN\n" );
Expand Down
2 changes: 1 addition & 1 deletion base/special/erf/benchmark/c/native/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static double benchmark( void ) {

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
x = ( 1000.0*rand_double() ) - 500.0;
x = ( 2.0*rand_double() ) - 1.0;
y = stdlib_base_erf( x );
if ( y != y ) {
printf( "should not return NaN\n" );
Expand Down
2 changes: 1 addition & 1 deletion base/special/erf/benchmark/cpp/boost/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ double benchmark() {
mt19937 rng;

// Define a uniform distribution for generating pseudorandom numbers as "doubles" between a minimum value (inclusive) and a maximum value (exclusive):
uniform_real_distribution<> randu( -500.0, 500.0 );
uniform_real_distribution<> randu( -1.0, 1.0 );

t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
Expand Down
1 change: 1 addition & 0 deletions base/special/erf/benchmark/julia/REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
julia 1.5
BenchmarkTools 0.5.0
SpecialFunctions 0.10.3
3 changes: 2 additions & 1 deletion base/special/erf/benchmark/julia/benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# limitations under the License.

import BenchmarkTools
using SpecialFunctions
using Printf

# Benchmark variables:
Expand Down Expand Up @@ -107,7 +108,7 @@ julia> out = benchmark();
```
"""
function benchmark()
t = BenchmarkTools.@benchmark erf( (1000.0*rand()) - 500.0 ) samples=1e6
t = BenchmarkTools.@benchmark erf( (2.0*rand()) - 1.0 ) samples=1e6

# Compute the total "elapsed" time and convert from nanoseconds to seconds:
s = sum( t.times ) / 1.0e9;
Expand Down
2 changes: 1 addition & 1 deletion base/special/erf/benchmark/python/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def print_results(elapsed):
def benchmark():
"""Run the benchmark and print benchmark results."""
setup = "from math import erf; from random import random;"
stmt = "y = erf(1000.0*random() - 500.0)"
stmt = "y = erf(2.0*random() - 1.0)"

t = timeit.Timer(stmt, setup=setup)

Expand Down
Loading

0 comments on commit 3382d3d

Please sign in to comment.