-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b7807c5
commit e76b3e9
Showing
20 changed files
with
1,282 additions
and
5 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,7 @@ Marcus Fantham <[email protected]> | |
Matt Cochrane <[email protected]> | ||
Mihir Pandit <[email protected]> | ||
Milan Raj <[email protected]> | ||
Mohammad Bin Aftab <[email protected]> | ||
Mohammad Kaif <[email protected]> | ||
Momtchil Momtchev <[email protected]> | ||
Muhammad Haris <[email protected]> | ||
|
@@ -125,5 +126,6 @@ Xiaochuan Ye <[email protected]> | |
Yaswanth Kosuru <[email protected]> | ||
Yernar Yergaziyev <[email protected]> | ||
olenkabilonizhka <[email protected]> | ||
pranav-1720 <[email protected]> | ||
rainn <[email protected]> | ||
rei2hu <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
|
||
/** | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2025 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-harness' ); | ||
var uniform = require( '@stdlib/random-base-uniform' ); | ||
var Float64Array = require( '@stdlib/array-float64' ); | ||
var isnan = require( '@stdlib/math-base-assert-is-nan' ); | ||
var tryRequire = require( '@stdlib/utils-try-require' ); | ||
var pkg = require( './../package.json' ).name; | ||
|
||
|
||
// VARIABLES // | ||
|
||
var logcdf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); | ||
var opts = { | ||
'skip': ( logcdf instanceof Error ) | ||
}; | ||
|
||
|
||
// MAIN // | ||
|
||
bench( pkg+'::native', opts, function benchmark( b ) { | ||
var len; | ||
var mu; | ||
var x; | ||
var y; | ||
var i; | ||
|
||
len = 100; | ||
x = new Float64Array( len ); | ||
mu = new Float64Array( len ); | ||
for ( i = 0; i < len; i++ ) { | ||
x[ i ] = uniform( -100.0, 0.0 ); | ||
mu[ i ] = uniform( -50.0, 50.0 ); | ||
} | ||
|
||
b.tic(); | ||
for ( i = 0; i < b.iterations; i++ ) { | ||
y = logcdf( x[ i % len ], mu[ i % len ] ); | ||
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(); | ||
}); |
Oops, something went wrong.