Skip to content

Commit 63bc5ad

Browse files
committed
test: update comment about high tolerance issue
--- 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
1 parent d36338c commit 63bc5ad

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/lib/factory.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ function factory( a, b, c ) {
7575
if ( c < b ) {
7676
return exp( c*t ) * ( ( (c-a)*phi2( (a-c)*t ) ) + ( (b-c)*phi2( (b-c)*t ) ) ) / ( b-a ); // eslint-disable-line max-len
7777
}
78-
return exp( c * t ) * phi2( ( a - c ) * t );
78+
return exp( c*t ) * phi2( ( a-c ) * t );
7979
}
8080
if ( c < b ) {
81-
return exp( c * t ) * phi2( ( b - c ) * t );
81+
return exp( c*t ) * phi2( ( b-c ) * t );
8282
}
83-
return exp( c * t );
83+
return exp( c*t );
8484
}
8585
}
8686

lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ function mgf( t, a, b, c ) {
8787
if ( c < b ) {
8888
return exp( c*t ) * ( ( (c-a)*phi2( (a-c)*t ) ) + ( (b-c)*phi2( (b-c)*t ) ) ) / ( b-a ); // eslint-disable-line max-len
8989
}
90-
return exp( c * t ) * phi2( ( a - c ) * t );
90+
return exp( c*t ) * phi2( ( a-c ) * t );
9191
}
9292
if ( c < b ) {
93-
return exp( c * t ) * phi2( ( b - c ) * t );
93+
return exp( c*t ) * phi2( ( b-c ) * t );
9494
}
95-
return exp( c * t );
95+
return exp( c*t );
9696
}
9797

9898

lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/lib/phi2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function phi2( x ) {
3636
if ( x === 0.0 ) {
3737
return 1.0;
3838
}
39-
return ( 2.0 * ( expm1( x ) - x ) ) / ( x * x );
39+
return ( 2.0 * ( expm1( x ) - x ) ) / ( x*x );
4040
}
4141

4242
module.exports = phi2;

lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/src/main.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static double phi2( const double x ) {
3131
if ( x == 0.0 ) {
3232
return 1.0;
3333
}
34-
return ( 2.0 * ( stdlib_base_expm1( x ) - x ) ) / ( x * x );
34+
return ( 2.0 * ( stdlib_base_expm1( x ) - x ) ) / ( x*x );
3535
}
3636

3737
/**
@@ -53,14 +53,14 @@ double stdlib_base_dists_triangular_mgf( const double t, const double a, const d
5353
}
5454
if ( a < c ) {
5555
if ( c < b ) {
56-
double term1 = ( c - a ) * phi2( ( a - c ) * t );
57-
double term2 = ( b - c ) * phi2( ( b - c ) * t );
58-
return stdlib_base_exp( c * t ) * ( term1 + term2 ) / ( b - a );
56+
double term1 = ( c-a ) * phi2( ( a-c ) * t );
57+
double term2 = ( b-c ) * phi2( ( b-c ) * t );
58+
return stdlib_base_exp( c*t ) * ( term1+term2 ) / ( b-a );
5959
}
60-
return stdlib_base_exp( c * t ) * phi2( ( a - c ) * t );
60+
return stdlib_base_exp( c*t ) * phi2( ( a-c ) * t );
6161
}
6262
if ( c < b ) {
63-
return stdlib_base_exp( c * t ) * phi2( ( b - c ) * t );
63+
return stdlib_base_exp( c*t ) * phi2( ( b-c ) * t );
6464
}
65-
return stdlib_base_exp( c * t );
65+
return stdlib_base_exp( c*t );
6666
}

lib/node_modules/@stdlib/stats/base/dists/triangular/mgf/test/test.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ tape( 'the function evaluates the MGF for `x` given a small range `b - a`', opts
108108
} else {
109109
delta = abs( y - expected[ i ] );
110110

111-
// NOTE: The tolerance here is larger than that of the JavaScript implementation due to differences in the calculation of `expm1`, which result in a divergence of results. For more details, see the discussion at: https://github.com/stdlib-js/stdlib/pull/4768#discussion_r1921047716
111+
// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
112112
tol = 2.0 * EPS * abs( expected[ i ] );
113113
t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. a: '+a[i]+'. b: '+b[i]+'. c: '+c[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
114114
}

0 commit comments

Comments
 (0)