Skip to content

Commit 56aa9ac

Browse files
chore: added new implementation and corrected docs
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 46d0f11 commit 56aa9ac

File tree

31 files changed

+348
-823
lines changed

31 files changed

+348
-823
lines changed

lib/node_modules/@stdlib/math/base/special/log1pf/benchmark/benchmark.js

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,57 +21,30 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var randu = require( '@stdlib/random/base/randu' );
25-
var isnan = require( '@stdlib/math/base/assert/is-nan' );
24+
var randu = require( '@stdlib/random/array/uniform' );
25+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2626
var pkg = require( './../package.json' ).name;
2727
var log1pf = require( './../lib' );
2828

2929

30-
// VARIABLES //
31-
32-
var opts = {
33-
'skip': ( typeof Math.log1pf !== 'function' ) // eslint-disable-line stdlib/no-builtin-math
34-
};
35-
36-
3730
// MAIN //
3831

3932
bench( pkg, function benchmark( b ) {
4033
var x;
4134
var y;
4235
var i;
4336

44-
b.tic();
45-
for ( i = 0; i < b.iterations; i++ ) {
46-
x = ( randu()*1000.0 ) - 0.0;
47-
y = log1pf( x );
48-
if ( isnan( y ) ) {
49-
b.fail( 'should not return NaN' );
50-
}
51-
}
52-
b.toc();
53-
if ( isnan( y ) ) {
54-
b.fail( 'should not return NaN' );
55-
}
56-
b.pass( 'benchmark finished' );
57-
b.end();
58-
});
59-
60-
bench( pkg+'::built-in', opts, function benchmark( b ) {
61-
var x;
62-
var y;
63-
var i;
37+
x = randu( 100, 0.0, 1000.0 );
6438

6539
b.tic();
6640
for ( i = 0; i < b.iterations; i++ ) {
67-
x = ( randu()*1000.0 ) - 0.0;
68-
y = Math.log1pf( x ); // eslint-disable-line stdlib/no-builtin-math
69-
if ( isnan( y ) ) {
41+
y = log1pf( x[ i % x.length ] );
42+
if ( isnanf( y ) ) {
7043
b.fail( 'should not return NaN' );
7144
}
7245
}
7346
b.toc();
74-
if ( isnan( y ) ) {
47+
if ( isnanf( y ) ) {
7548
b.fail( 'should not return NaN' );
7649
}
7750
b.pass( 'benchmark finished' );

lib/node_modules/@stdlib/math/base/special/log1pf/benchmark/benchmark.native.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
25-
var randu = require( '@stdlib/random/base/randu' );
26-
var isnan = require( '@stdlib/math/base/assert/is-nan' );
25+
var randu = require( '@stdlib/random/array/uniform' );
26+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
2727
var tryRequire = require( '@stdlib/utils/try-require' );
2828
var pkg = require( './../package.json' ).name;
2929

@@ -43,16 +43,17 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4343
var y;
4444
var i;
4545

46+
x = randu( 100, 0.0, 1000.0 );
47+
4648
b.tic();
4749
for ( i = 0; i < b.iterations; i++ ) {
48-
x = ( randu()*1000.0 ) - 0.0;
49-
y = log1pf( x );
50-
if ( isnan( y ) ) {
50+
y = log1pf( x[ i % x.length ] );
51+
if ( isnanf( y ) ) {
5152
b.fail( 'should not return NaN' );
5253
}
5354
}
5455
b.toc();
55-
if ( isnan( y ) ) {
56+
if ( isnanf( y ) ) {
5657
b.fail( 'should not return NaN' );
5758
}
5859
b.pass( 'benchmark finished' );

lib/node_modules/@stdlib/math/base/special/log1pf/benchmark/c/Makefile

Lines changed: 0 additions & 127 deletions
This file was deleted.

lib/node_modules/@stdlib/math/base/special/log1pf/benchmark/c/benchmark.c

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)