diff --git a/CHANGELOG.md b/CHANGELOG.md index 9be16eb07..bf3a256aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-10-10) +## Unreleased (2024-10-15)
@@ -432,6 +432,11 @@ A total of 5 people contributed to this release. Thank you to the following cont
+- [`6c58a22`](https://github.com/stdlib-js/stdlib/commit/6c58a22b6f7e514fb358c3256b9573357e4baa65) - **bench:** refactor benchmarks _(by Athan Reines)_ +- [`870f645`](https://github.com/stdlib-js/stdlib/commit/870f64561a7d90579bd92920c8733a205ed0a55c) - **build:** add WebAssembly configuration _(by Athan Reines)_ +- [`2ce25ea`](https://github.com/stdlib-js/stdlib/commit/2ce25ea8e857700287558847d93b108f3ca6b33d) - **build:** add WebAssembly configuration _(by Athan Reines)_ +- [`d71493e`](https://github.com/stdlib-js/stdlib/commit/d71493e2f9ec53c9b7168ae0baf81731ebf15a9d) - **build:** add WebAssembly configuration _(by Athan Reines)_ +- [`03a4ad7`](https://github.com/stdlib-js/stdlib/commit/03a4ad79edbde3654b67e84a4f8d19ad0f670003) - **style:** fix spacing _(by Athan Reines)_ - [`4a94497`](https://github.com/stdlib-js/stdlib/commit/4a94497c4e429430d5409d65ef55c0077ca1edbd) - **docs:** update function description in `math/base/special/min` [(#2998)](https://github.com/stdlib-js/stdlib/pull/2998) _(by Gunj Joshi)_ - [`3a595ac`](https://github.com/stdlib-js/stdlib/commit/3a595acf04202235c63824e0ebe99f584d83ce47) - **docs:** update function description in `math/base/special/max` [(#2999)](https://github.com/stdlib-js/stdlib/pull/2999) _(by Gunj Joshi)_ - [`2b6f932`](https://github.com/stdlib-js/stdlib/commit/2b6f932477bdbbfe755ee3ff9bd0a04020b049bd) - **build:** add WebAssembly configuration to `math/base/special/abs2` and `math/base/special/sqrt` [(#2989)](https://github.com/stdlib-js/stdlib/pull/2989) _(by Aman Bhansali, Athan Reines)_ diff --git a/CONTRIBUTORS b/CONTRIBUTORS index f1b00f3f8..9b6e69d17 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -45,6 +45,7 @@ Justin Dennison Kaif Mohd Karthik Prakash <116057817+skoriop@users.noreply.github.com> Khaldon +Kohantika Nath <145763549+kohantikanath@users.noreply.github.com> Krishnendu Das <86651039+itskdhere@users.noreply.github.com> Lovelin <100030865+lovelindhoni@users.noreply.github.com> Manik Sharma diff --git a/LICENSE b/LICENSE index 347714bb0..bab3338f5 100644 --- a/LICENSE +++ b/LICENSE @@ -229,43 +229,43 @@ Permission to use, copy, modify, and distribute this software is freely granted, provided that this notice is preserved. -* SLATEC Common Mathematical Library - -Public domain. - * FDLIBM Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. -* Go +* Faddeeva -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright (c) 2012 Massachusetts Institute of Technology -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ * SpecialFunctions.jl @@ -294,42 +294,35 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -* Faddeeva - -Copyright (c) 2012 Massachusetts Institute of Technology +* Go -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Copyright (c) 2009 The Go Authors. All rights reserved. -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Stephen L. Moshier moshier@na-net.ornl.gov @@ -337,3 +330,7 @@ moshier@na-net.ornl.gov Version 2.0, January 2004 http://www.apache.org/licenses/ +* SLATEC Common Mathematical Library + +Public domain. + diff --git a/base/special/erf/benchmark/c/benchmark.c b/base/special/erf/benchmark/c/benchmark.c index 594df4612..be466a682 100644 --- a/base/special/erf/benchmark/c/benchmark.c +++ b/base/special/erf/benchmark/c/benchmark.c @@ -89,16 +89,18 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double values[ 10 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 10; i++ ) { + values[ i ] = ( 2.0*rand_double() ) - 1.0; + } t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 2.0*rand_double() ) - 1.0; - y = erf( x ); + y = erf( values[ i%10 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/base/special/erf/benchmark/c/cephes/benchmark.c b/base/special/erf/benchmark/c/cephes/benchmark.c index dc7e719ed..8b384e802 100644 --- a/base/special/erf/benchmark/c/cephes/benchmark.c +++ b/base/special/erf/benchmark/c/cephes/benchmark.c @@ -94,16 +94,18 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double values[ 10 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 10; i++ ) { + values[ i ] = ( 2.0*rand_double() ) - 1.0; + } t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 2.0*rand_double() ) - 1.0; - y = erf( x ); + y = erf( values[ i%10 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/base/special/erf/benchmark/c/native/benchmark.c b/base/special/erf/benchmark/c/native/benchmark.c index 9c0029ca4..beda7fc2b 100644 --- a/base/special/erf/benchmark/c/native/benchmark.c +++ b/base/special/erf/benchmark/c/native/benchmark.c @@ -90,16 +90,18 @@ static double rand_double( void ) { * @return elapsed time in seconds */ static double benchmark( void ) { + double values[ 10 ]; double elapsed; - double x; double y; double t; int i; + for ( i = 0; i < 10; i++ ) { + values[ i ] = ( 2.0*rand_double() ) - 1.0; + } t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - x = ( 2.0*rand_double() ) - 1.0; - y = stdlib_base_erf( x ); + y = stdlib_base_erf( values[ i%10 ] ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/base/special/exp2/manifest.json b/base/special/exp2/manifest.json index 231455d84..a2adffecf 100644 --- a/base/special/exp2/manifest.json +++ b/base/special/exp2/manifest.json @@ -1,6 +1,7 @@ { "options": { - "task": "build" + "task": "build", + "wasm": false }, "fields": [ { @@ -27,6 +28,7 @@ "confs": [ { "task": "build", + "wasm": false, "src": [ "./src/main.c" ], @@ -47,6 +49,7 @@ }, { "task": "benchmark", + "wasm": false, "src": [ "./src/main.c" ], @@ -66,6 +69,27 @@ }, { "task": "examples", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/assert/is-nan", + "@stdlib/constants/float64/max-base2-exponent", + "@stdlib/constants/float64/pinf", + "@stdlib/math/base/special/round", + "@stdlib/math/base/special/ldexp", + "@stdlib/constants/float64/min-base2-exponent" + ] + }, + { + "task": "build", + "wasm": true, "src": [ "./src/main.c" ], diff --git a/base/special/floor/manifest.json b/base/special/floor/manifest.json index 5d84b9cad..2de89c6ed 100644 --- a/base/special/floor/manifest.json +++ b/base/special/floor/manifest.json @@ -1,6 +1,7 @@ { "options": { - "task": "build" + "task": "build", + "wasm": false }, "fields": [ { @@ -27,6 +28,7 @@ "confs": [ { "task": "build", + "wasm": false, "src": [ "./src/floor.c" ], @@ -43,6 +45,7 @@ }, { "task": "benchmark", + "wasm": false, "src": [ "./src/floor.c" ], @@ -57,6 +60,7 @@ }, { "task": "examples", + "wasm": false, "src": [ "./src/floor.c" ], @@ -68,6 +72,21 @@ ], "libpath": [], "dependencies": [] - } + }, + { + "task": "build", + "wasm": true, + "src": [ + "./src/floor.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [] + } ] } diff --git a/base/special/log/src/main.c b/base/special/log/src/main.c index 8ec3fb319..092be90fe 100644 --- a/base/special/log/src/main.c +++ b/base/special/log/src/main.c @@ -31,5 +31,5 @@ * // returns 2.0 */ double stdlib_base_log( const double x, const double b ) { - return stdlib_base_ln ( x ) / stdlib_base_ln ( b ); + return stdlib_base_ln( x ) / stdlib_base_ln( b ); } diff --git a/base/special/round/manifest.json b/base/special/round/manifest.json index fba97891a..d52c3d1ec 100644 --- a/base/special/round/manifest.json +++ b/base/special/round/manifest.json @@ -1,6 +1,7 @@ { "options": { - "task": "build" + "task": "build", + "wasm": false }, "fields": [ { @@ -27,6 +28,7 @@ "confs": [ { "task": "build", + "wasm": false, "src": [ "./src/main.c" ], @@ -44,6 +46,7 @@ }, { "task": "benchmark", + "wasm": false, "src": [ "./src/main.c" ], @@ -60,6 +63,24 @@ }, { "task": "examples", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/special/floor", + "@stdlib/math/base/assert/is-nan", + "@stdlib/math/base/assert/is-negative-zero" + ] + }, + { + "task": "build", + "wasm": true, "src": [ "./src/main.c" ],