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 Mar 14, 2024
1 parent e6f917c commit 843ca9a
Show file tree
Hide file tree
Showing 18 changed files with 1,459 additions and 50 deletions.
28 changes: 14 additions & 14 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
#
# Contributors listed in alphabetical order.

Adarsh Palaskar <[email protected].com>
Aditya Sapra <[email protected].com>
Adarsh Palaskar <adarshpalaskar99@gmail.com>
Aditya Sapra <adityaework@gmail.com>
AgPriyanshu18 <[email protected]>
Ali Salesi <[email protected]>
Aman Bhansali <[email protected]>
Aman Bhansali <[email protected]>
Amit Jimiwal <[email protected]>
Anudeep Sanapala <[email protected].com>
Anudeep Sanapala <anudeep0306@gmail.com>
Athan Reines <[email protected]>
Brendan Graetz <[email protected]>
Bruno Fenzl <[email protected]>
Chinmay J <[email protected]>
Chinmay Joshi <[email protected]>
Christopher Dambamuromo <[email protected]>
Dan Rose <[email protected]>
Daniel Killenberger <[email protected]>
Dominik Moritz <[email protected]>
Dorrin Sotoudeh <[email protected]>
EuniceSim142 <[email protected]>
Frank Kovacs <[email protected]>
GUNJ JOSHI <gunjjoshi8372@gmail.com>
Golden <[email protected].com>
Golden Kumar <[email protected].com>
Gunj Joshi <gunjjoshi8372@gmail.com>
Harshita Kalani <[email protected]>
Jaimin Godhani <[email protected]>
James Gelok <[email protected]>
Expand Down Expand Up @@ -50,7 +50,7 @@ Pranav Goswami <[email protected]>
Praneki <[email protected]>
Pratik <[email protected]>
Priyansh <[email protected]>
Raunak Kumar Gupta <[email protected].com>
Raunak Kumar Gupta <raunakmodanwal321@gmail.com>
Rejoan Sardar <[email protected]>
Ricky Reusser <[email protected]>
Robert Gislason <[email protected]>
Expand All @@ -59,16 +59,16 @@ Rutam <[email protected]>
Ryan Seal <[email protected]>
Sai Srikar Dumpeti <[email protected]>
Seyyed Parsa Neshaei <[email protected]>
Shashank Shekhar Singh <[email protected].com>
Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
Shraddheya Shendre <[email protected]>
Shubham <[email protected]>
Shubham Mishra <[email protected]>
Snehil Shah <[email protected]>
Spandan Barve <[email protected]>
Spandan Barve <[email protected]>
Stephannie Jiménez Gacha <[email protected]>
Utkarsh <[email protected]>
Utkarsh <http://[email protected]>
Utkarsh Raj <[email protected]>
Varad Gupta <[email protected]>
Yernar Yergaziyev <[email protected]>
nishant-s7 <[email protected]>
orimiles5 <[email protected]>
rei2hu <[email protected]>
utkarsh_raj <[email protected]>
vr-varad <[email protected]>
71 changes: 37 additions & 34 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,28 @@ 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.

* Cephes <http://www.netlib.org/cephes/readme>

Copyright (c) 1984-2000 Stephen L. Moshier

Some software in this archive may be from the book _Methods and Programs for
Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989)
or from the Cephes Mathematical Library, a commercial product. In either event,
it is copyrighted by the author. What you see here may be used freely but it
comes with no support or guarantee.

Stephen L. Moshier
[email protected]

* FreeBSD <https://svnweb.freebsd.org/>

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.

* Go <https://raw.githubusercontent.com/golang/go/master/LICENSE>

Copyright (c) 2009 The Go Authors. All rights reserved.
Expand Down Expand Up @@ -237,28 +259,6 @@ 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.

* Cephes <http://www.netlib.org/cephes/readme>

Copyright (c) 1984-2000 Stephen L. Moshier

Some software in this archive may be from the book _Methods and Programs for
Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989)
or from the Cephes Mathematical Library, a commercial product. In either event,
it is copyrighted by the author. What you see here may be used freely but it
comes with no support or guarantee.

Stephen L. Moshier
[email protected]

* FreeBSD <https://svnweb.freebsd.org/>

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.

* Faddeeva <http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package#License>

Copyright (c) 2012 Massachusetts Institute of Technology
Expand All @@ -282,18 +282,13 @@ 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.

* SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/>

Public domain.

* FDLIBM <http://www.netlib.org/fdlibm/>

Copyright (C) 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.
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/
Expand Down Expand Up @@ -325,3 +320,11 @@ 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.

* SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/>

Public domain.

* FDLIBM <http://www.netlib.org/fdlibm/>

Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.

88 changes: 88 additions & 0 deletions base/special/bernoulli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,94 @@ for ( i = 0; i < 280; i++ ) {

<!-- /.examples -->

<!-- C interface documentation. -->

* * *

<section class="c">

## C APIs

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- C usage documentation. -->

<section class="usage">

### Usage

```c
#include "stdlib/math/base/special/bernoulli.h"
```

#### stdlib_base_bernoulli( n )

Computes the nth [Bernoulli number][bernoulli-number].

```c
double out = stdlib_base_bernoulli( 0 );
// returns 1.0

out = stdlib_base_bernoulli( 1 );
// returns 0.0
```

The function accepts the following arguments:

- **n**: `[in] int32_t` input value.

```c
double stdlib_base_bernoulli( const int32_t n );
```
</section>
<!-- /.usage -->
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
<section class="notes">
</section>
<!-- /.notes -->
<!-- C API usage examples. -->
<section class="examples">
### Examples
```c
#include "stdlib/math/base/special/bernoulli.h"
#include <stdio.h>
#include <stdint.h>
int main( void ) {
int32_t i;
double v;
for ( i = 0; i < 130; i++ ) {
v = stdlib_base_bernoulli( i );
printf( "bernoulli(%d) = %lf\n", i, v );
}
}
```

</section>

<!-- /.examples -->

</section>

<!-- /.c -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">
Expand Down
61 changes: 61 additions & 0 deletions base/special/bernoulli/benchmark/benchmark.native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2024 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var randu = require( '@stdlib/random/base/randu' );
var floor = require( './../../../../base/special/floor' );
var isnan = require( './../../../../base/assert/is-nan' );
var tryRequire = require( '@stdlib/utils/try-require' );
var pkg = require( './../package.json' ).name;


// VARIABLES //

var bernoulli = tryRequire( resolve( __dirname, './../lib/native.js' ) );
var opts = {
'skip': ( bernoulli instanceof Error )
};


// MAIN //

bench( pkg+'::native', opts, function benchmark( b ) {
var x;
var y;
var i;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = floor( randu() * 500.0 );
y = bernoulli( x );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
}
b.toc();
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
b.pass( 'benchmark finished' );
b.end();
});
Loading

0 comments on commit 843ca9a

Please sign in to comment.