From 0ef191ae159892fe0440d46ad3343ad0fc89936f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 24 Jul 2024 15:22:44 +0000 Subject: [PATCH] Auto-generated commit --- .github/workflows/productionize.yml | 20 +-- .github/workflows/publish.yml | 4 +- CHANGELOG.md | 6 +- CONTRIBUTORS | 1 + LICENSE | 97 +++++----- base/special/binet/README.md | 88 +++++++++ .../binet/benchmark/benchmark.native.js | 61 +++++++ .../special/binet/benchmark/c/native/Makefile | 146 +++++++++++++++ .../binet/benchmark/c/native/benchmark.c | 136 ++++++++++++++ base/special/binet/binding.gyp | 170 ++++++++++++++++++ base/special/binet/examples/c/Makefile | 146 +++++++++++++++ base/special/binet/examples/c/example.c | 31 ++++ base/special/binet/include.gypi | 53 ++++++ .../include/stdlib/math/base/special/binet.h | 41 +++++ base/special/binet/lib/native.js | 82 +++++++++ base/special/binet/manifest.json | 87 +++++++++ base/special/binet/src/Makefile | 70 ++++++++ base/special/binet/src/addon.c | 22 +++ base/special/binet/src/main.c | 57 ++++++ base/special/binet/test/test.native.js | 107 +++++++++++ 20 files changed, 1365 insertions(+), 60 deletions(-) create mode 100644 base/special/binet/benchmark/benchmark.native.js create mode 100644 base/special/binet/benchmark/c/native/Makefile create mode 100644 base/special/binet/benchmark/c/native/benchmark.c create mode 100644 base/special/binet/binding.gyp create mode 100644 base/special/binet/examples/c/Makefile create mode 100644 base/special/binet/examples/c/example.c create mode 100644 base/special/binet/include.gypi create mode 100644 base/special/binet/include/stdlib/math/base/special/binet.h create mode 100644 base/special/binet/lib/native.js create mode 100644 base/special/binet/manifest.json create mode 100644 base/special/binet/src/Makefile create mode 100644 base/special/binet/src/addon.c create mode 100644 base/special/binet/src/main.c create mode 100644 base/special/binet/test/test.native.js diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index f92a6c5c1..f4575e923 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -94,8 +94,8 @@ jobs: node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );" fi - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -191,8 +191,8 @@ jobs: # Pin action to full length commit SHA uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -366,8 +366,8 @@ jobs: # Pin action to full length commit SHA uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -539,8 +539,8 @@ jobs: # Pin action to full length commit SHA uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -735,8 +735,8 @@ jobs: echo "bump=true" >> $GITHUB_OUTPUT fi - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' if: steps.check-if-bump.outputs.bump run: | git config --local user.email "noreply@stdlib.io" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 027cf188a..55320e773 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -72,8 +72,8 @@ jobs: node-version: 20 timeout-minutes: 5 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" diff --git a/CHANGELOG.md b/CHANGELOG.md index b21235783..888cf1196 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-07-21) +## Unreleased (2024-07-24)
@@ -860,6 +860,7 @@ This release closes the following issue: ##### Features +- [`c77f866`](https://github.com/stdlib-js/stdlib/commit/c77f866c93006ba4bf73221cb28c94c23195ca06) - add C implementation for `math/base/special/binet` [(##2653)](#2653) - [`5df976a`](https://github.com/stdlib-js/stdlib/commit/5df976abacaaf3082890fa852e40edfdf1b79f4b) - update namespace TypeScript declarations [(#2637)](https://github.com/stdlib-js/stdlib/pull/2637) - [`81b48ae`](https://github.com/stdlib-js/stdlib/commit/81b48aeb9d5d2b16fe039f9db7e710c95a35585f) - update namespace TypeScript declarations [(##2621)](#2621) - [`09618b7`](https://github.com/stdlib-js/stdlib/commit/09618b7064d674d3e4afd1f67d877b1388098784) - update namespace TypeScript declarations @@ -5515,6 +5516,7 @@ A total of 29 people contributed to this release. Thank you to the following con
+- [`c77f866`](https://github.com/stdlib-js/stdlib/commit/c77f866c93006ba4bf73221cb28c94c23195ca06) - **feat:** add C implementation for `math/base/special/binet` [(##2653)](#2653) _(by Gunj Joshi)_ - [`9dc29b4`](https://github.com/stdlib-js/stdlib/commit/9dc29b4d2e6eb5ba0b2625c3bfe9f50034a3ed99) - **docs:** add sub-namespace sections and update namespace table of contents _(by Philipp Burckhardt)_ - [`8de8d90`](https://github.com/stdlib-js/stdlib/commit/8de8d90b8a5d72f7c2e57ae21593be5f5f1eb8e7) - **refactor:** perform explicit cast [(#2642)](https://github.com/stdlib-js/stdlib/pull/2642) _(by Gunj Joshi)_ - [`6a0cbd9`](https://github.com/stdlib-js/stdlib/commit/6a0cbd9c10f0895d795be449fe1ea2a456f2683a) - **test:** fix tests for native implementation [(#2641)](https://github.com/stdlib-js/stdlib/pull/2641) _(by Gunj Joshi)_ @@ -5610,7 +5612,7 @@ A total of 29 people contributed to this release. Thank you to the following con - [`822491d`](https://github.com/stdlib-js/stdlib/commit/822491dd173e2ca1195c4b4f4600419f55b5ee15) - **docs:** fix function signature in table of contents [(##2371)](#2371 ) _(by stdlib-bot, Philipp Burckhardt)_ - [`fdba877`](https://github.com/stdlib-js/stdlib/commit/fdba877adb81859aa87b72685f19a8921d4dd8db) - **feat:** add C implementation for `math/base/special/csc` [(##2367)](#2367 ) _(by Gunj Joshi)_ - [`ae92cf0`](https://github.com/stdlib-js/stdlib/commit/ae92cf0e2ff55d9e0d490ece6bd32eb8da0506a9) - **fix:** use significand mask in `math/base/special/rempio2` [(##2366)](#2366) _(by Gunj Joshi)_ -- [`9df1610`](https://github.com/stdlib-js/stdlib/commit/9df16105aa2d89808d3395c610334ca9cce35b3c) - **docs:** remove long comment [(##2634)](#2634) _(by Gunj Joshi)_ +- [`9df1610`](https://github.com/stdlib-js/stdlib/commit/9df16105aa2d89808d3395c610334ca9cce35b3c) - **docs:** remove long comment [(##2364)](#2364) _(by Gunj Joshi)_ - [`3cf2e89`](https://github.com/stdlib-js/stdlib/commit/3cf2e897adf5128f94bd7279e88ca9d42dfe7caa) - **feat:** add C implementation for `math/base/special/coversin` [(##2361)](#2361) _(by Gunj Joshi)_ - [`34bc79c`](https://github.com/stdlib-js/stdlib/commit/34bc79cf154e0c82320c4a60c2cc805434a4b6e6) - **chore:** delete extra repl.txt file _(by Philipp Burckhardt)_ - [`a4dee7d`](https://github.com/stdlib-js/stdlib/commit/a4dee7d62df7875184dfc8fc3212afe086587353) - **fix:** move repl.txt file and address feedback _(by Philipp Burckhardt)_ diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 7ec15a743..26a1c4610 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -51,6 +51,7 @@ Muhammad Haris Naresh Jagadeesan NightKnight Nithin Katta <88046362+nithinkatta@users.noreply.github.com> +Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com> Ognjen Jevremović Oneday12323 <107678750+Oneday12323@users.noreply.github.com> Philipp Burckhardt diff --git a/LICENSE b/LICENSE index efe9bdb13..b1f521331 100644 --- a/LICENSE +++ b/LICENSE @@ -181,6 +181,15 @@ The library links against the following external libraries or contains implementations from the following external libraries, which have their own licenses: +* FreeBSD + +Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. + +Developed at SunPro, a Sun Microsystems, Inc. business. +Permission to use, copy, modify, and distribute this +software is freely granted, provided that this notice +is preserved. + * Boost Boost Software License - Version 1.0 - August 17th, 2003 @@ -207,18 +216,6 @@ 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. -* FreeBSD - -Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. - -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - * Cephes Copyright (c) 1984-2000 Stephen L. Moshier @@ -232,11 +229,6 @@ comes with no support or guarantee. Stephen L. Moshier moshier@na-net.ornl.gov -Developed at SunPro, a Sun Microsystems, Inc. business. -Permission to use, copy, modify, and distribute this -software is freely granted, provided that this notice -is preserved. - * Go Copyright (c) 2009 The Go Authors. All rights reserved. @@ -267,9 +259,40 @@ 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. -* SLATEC Common Mathematical Library +* Faddeeva -Public domain. +Copyright (c) 2012 Massachusetts Institute of Technology + +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: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of 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 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. + +Developed at SunPro, a Sun Microsystems, Inc. business. +Permission to use, copy, modify, and distribute this +software is freely granted, provided that this notice +is preserved. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +* FDLIBM + +Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. * SpecialFunctions.jl @@ -298,36 +321,18 @@ 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. -Stephen L. Moshier -moshier@na-net.ornl.gov +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/ -* FDLIBM - -Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. - -* Faddeeva - -Copyright (c) 2012 Massachusetts Institute of Technology - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +* SLATEC Common Mathematical Library -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. +Public domain. diff --git a/base/special/binet/README.md b/base/special/binet/README.md index 2846288d3..374a0633b 100644 --- a/base/special/binet/README.md +++ b/base/special/binet/README.md @@ -134,6 +134,94 @@ for ( i = 0; i < 79; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/math/base/special/binet.h" +``` + +#### stdlib_base_binet( x ) + +Evaluates [Binet's formula][fibonacci-number] extended to real numbers. + +```c +double out = stdlib_base_binet( 0.0 ); +// returns 0.0 + +out = stdlib_base_binet( 1.0 ); +// returns 1.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. + +```c +double stdlib_base_binet( const double x ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/math/base/special/binet.h" +#include + +int main( void ) { + const double x[] = { 0.0, 1.0, 2.0, 3.0, 4.0 }; + + double y; + int i; + for ( i = 0; i < 5; i++ ) { + y = stdlib_base_binet( x[ i ] ); + printf( "binet(%lf) = %lf\n", x[ i ], y ); + } +} +``` + +
+ + + +
+ + +