Skip to content

Commit b7c97a5

Browse files
committed
refactor: precompute constant
--- 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: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - 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: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent b0790e4 commit b7c97a5

File tree

4 files changed

+4
-24
lines changed

4 files changed

+4
-24
lines changed

lib/node_modules/@stdlib/stats/base/dists/gumbel/kurtosis/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function kurtosis( mu, beta ) {
6060
) {
6161
return NaN;
6262
}
63-
return 12.0 / 5.0;
63+
return 2.4; // 12.0 / 5.0
6464
}
6565

6666

lib/node_modules/@stdlib/stats/base/dists/gumbel/kurtosis/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ double stdlib_base_dists_gumbel_kurtosis( const double mu, const double beta ) {
3838
) {
3939
return 0.0/0.0; // NaN
4040
}
41-
return 12.0 / 5.0;
41+
return 2.4; // 12.0 / 5.0
4242
}

lib/node_modules/@stdlib/stats/base/dists/gumbel/kurtosis/test/test.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222

2323
var tape = require( 'tape' );
2424
var isnan = require( '@stdlib/math/base/assert/is-nan' );
25-
var abs = require( '@stdlib/math/base/special/abs' );
2625
var PINF = require( '@stdlib/constants/float64/pinf' );
2726
var NINF = require( '@stdlib/constants/float64/ninf' );
28-
var EPS = require( '@stdlib/constants/float64/eps' );
2927
var kurtosis = require( './../lib' );
3028

3129

@@ -79,9 +77,7 @@ tape( 'if provided a nonpositive `beta`, the function returns `NaN`', function t
7977

8078
tape( 'the function returns the excess kurtosis of a Gumbel distribution', function test( t ) {
8179
var expected;
82-
var delta;
8380
var beta;
84-
var tol;
8581
var mu;
8682
var y;
8783
var i;
@@ -92,13 +88,7 @@ tape( 'the function returns the excess kurtosis of a Gumbel distribution', funct
9288
for ( i = 0; i < mu.length; i++ ) {
9389
y = kurtosis( mu[i], beta[i] );
9490
if ( expected[i] !== null ) {
95-
if ( y === expected[i] ) {
96-
t.equal( y, expected[i], 'mu:'+mu[i]+', beta: '+beta[i]+', y: '+y+', expected: '+expected[i] );
97-
} else {
98-
delta = abs( y - expected[ i ] );
99-
tol = 2.0 * EPS * abs( expected[ i ] );
100-
t.ok( delta <= tol, 'within tolerance. mu: '+mu[i]+'. beta: '+beta[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
101-
}
91+
t.equal( y, expected[i], 'mu:'+mu[i]+', beta: '+beta[i]+', y: '+y+', expected: '+expected[i] );
10292
}
10393
}
10494
t.end();

lib/node_modules/@stdlib/stats/base/dists/gumbel/kurtosis/test/test.native.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
2525
var tryRequire = require( '@stdlib/utils/try-require' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
27-
var abs = require( '@stdlib/math/base/special/abs' );
2827
var PINF = require( '@stdlib/constants/float64/pinf' );
2928
var NINF = require( '@stdlib/constants/float64/ninf' );
30-
var EPS = require( '@stdlib/constants/float64/eps' );
3129

3230

3331
// FIXTURES //
@@ -88,9 +86,7 @@ tape( 'if provided a nonpositive `beta`, the function returns `NaN`', opts, func
8886

8987
tape( 'the function returns the excess kurtosis of a Gumbel distribution', opts, function test( t ) {
9088
var expected;
91-
var delta;
9289
var beta;
93-
var tol;
9490
var mu;
9591
var y;
9692
var i;
@@ -101,13 +97,7 @@ tape( 'the function returns the excess kurtosis of a Gumbel distribution', opts,
10197
for ( i = 0; i < mu.length; i++ ) {
10298
y = kurtosis( mu[i], beta[i] );
10399
if ( expected[i] !== null) {
104-
if ( y === expected[i] ) {
105-
t.equal( y, expected[i], 'mu:'+mu[i]+', beta: '+beta[i]+', y: '+y+', expected: '+expected[i] );
106-
} else {
107-
delta = abs( y - expected[ i ] );
108-
tol = 2.0 * EPS * abs( expected[ i ] );
109-
t.ok( delta <= tol, 'within tolerance. mu: '+mu[i]+'. beta: '+beta[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
110-
}
100+
t.equal( y, expected[i], 'mu:'+mu[i]+', beta: '+beta[i]+', y: '+y+', expected: '+expected[i] );
111101
}
112102
}
113103
t.end();

0 commit comments

Comments
 (0)