Skip to content

Commit 2d97061

Browse files
chore: changes as per code review
--- 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: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - 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: passed - task: lint_c_benchmarks status: passed - 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 915231a commit 2d97061

File tree

8 files changed

+17
-18
lines changed

8 files changed

+17
-18
lines changed

lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ double y = stdlib_base_dists_geometric_logcdf( 0.5, -1.0, 1.0, 0.0 );
196196
The function accepts the following arguments:
197197

198198
- **x**: `[in] double` input value.
199-
- **a**: `[in] double` lower limit
200-
- **b**: `[in] double` upper limit
201-
- **c**: `[in] double` mode
199+
- **a**: `[in] double` lower limit.
200+
- **b**: `[in] double` upper limit.
201+
- **c**: `[in] double` mode.
202202

203203
```c
204204
double stdlib_base_dists_geometric_logcdf( const double x, const double a, const double b, const double c );
@@ -245,8 +245,8 @@ int main( void ) {
245245
for ( i = 0; i < 25; i++ ) {
246246
x = random_uniform( 0.0, 30.0 );
247247
a = random_uniform( 0.0, 10.0 );
248-
b = random_uniform( a, 40.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
249-
c = a + random_uniform( 0.0, b - a );
248+
b = random_uniform( a + STDLIB_CONSTANT_FLOAT64_EPS, 40.0 );
249+
c = random_uniform( a, b );
250250
y = stdlib_base_dists_triangular_logcdf( x, a, b, c );
251251
printf( "x: %lf, a: %lf, b: %lf, c: %lf, ln(F(x;a,b,c)): %lf\n", x, a, b, c, y );
252252
}

lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/benchmark/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ bench( pkg, function benchmark( b ) {
4848
for ( i = 0; i < len; i++ ) {
4949
x[ i ] = uniform( 0.0, 30.0 );
5050
min[ i ] = uniform( 0.0, 10.0 );
51-
max[ i ] = min[ i ] + ( uniform( 0.0, 40.0 ) ) + EPS;
52-
mode[ i ] = min[ i ] + ( ( max[ i ] - min[ i ] ) * uniform( 0.0, 1.0 ) ); // eslint-disable-line max-len
51+
max[ i ] = uniform( min[ i ] + EPS, min[ i ] + 40.0 );
52+
mode[ i ] = uniform( min[ i ], max[ i ] );
5353
}
5454

5555
b.tic();

lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/benchmark/benchmark.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5757
for ( i = 0; i < len; i++ ) {
5858
x[ i ] = uniform( 0.0, 30.0 );
5959
min[ i ] = uniform( 0.0, 10.0 );
60-
max[ i ] = min[ i ] + ( uniform( 0.0, 40.0 ) ) + EPS;
61-
mode[ i ] = min[ i ] + ( ( max[ i ] - min[ i ] ) * uniform( 0.0, 1.0 ) ); // eslint-disable-line max-len
60+
max[ i ] = uniform( min[ i ] + EPS, 40.0 );
61+
mode[ i ] = uniform( min[ i ], max[ i ] );
6262
}
6363

6464
b.tic();

lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/benchmark/c/benchmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ static double benchmark( void ) {
105105
for ( i = 0; i < 100; i++ ) {
106106
x[ i ] = random_uniform( 0.0, 30.0 );
107107
a[ i ] = random_uniform( 0.0, 10.0 );
108-
b[ i ] = random_uniform( a[ i ], 40.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
109-
c[ i ] = a[ i ] + random_uniform( 0.0, b[ i ] - a[ i ] );
108+
b[ i ] = random_uniform( a[ i ] + STDLIB_CONSTANT_FLOAT64_EPS, 40.0 );
109+
c[ i ] = random_uniform( a[ i ], b[ i ] );
110110
}
111111

112112
t = tic();

lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/examples/c/example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ int main( void ) {
3838
for ( i = 0; i < 25; i++ ) {
3939
x = random_uniform( 0.0, 30.0 );
4040
a = random_uniform( 0.0, 10.0 );
41-
b = random_uniform( a, 40.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
42-
c = a + random_uniform( 0.0, b - a );
41+
b = random_uniform( a + STDLIB_CONSTANT_FLOAT64_EPS, 40.0 );
42+
c = random_uniform( a, b );
4343
y = stdlib_base_dists_triangular_logcdf( x, a, b, c );
4444
printf( "x: %lf, a: %lf, b: %lf, c: %lf, ln(F(x;a,b,c)): %lf\n", x, a, b, c, y );
4545
}

lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/include/stdlib/stats/base/dists/triangular/logcdf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
#endif
2828

2929
/**
30-
* Evaluates the natural logarithm of the cumulative distribution function for the triangular distribution with parameters a, b, and c.
30+
* Evaluates the natural logarithm of the cumulative distribution function for the triangular distribution with lower limit `a`, upper limit `b`, and mode `c` at a value `x`.
3131
*/
3232
double stdlib_base_dists_triangular_logcdf( const double x, const double a, const double b, const double c );
3333

lib/node_modules/@stdlib/stats/base/dists/triangular/logcdf/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242
"@stdlib/math/base/assert/is-nan",
4343
"@stdlib/constants/float64/ninf",
4444
"@stdlib/math/base/special/ln",
45-
"@stdlib/math/base/special/pow",
46-
"@stdlib/constants/float64/ninf"
45+
"@stdlib/math/base/special/pow"
4746
]
4847
},
4948
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "stdlib/math/base/special/pow.h"
2424

2525
/**
26-
* Evaluates the natural logarithm of the cumulative distribution function (CDF) for a triangular distribution with lower limit `a` and upper limit `b` and mode `c` at a value `x`.
26+
* Evaluates the natural logarithm of the cumulative distribution function (CDF) for a triangular distribution with lower limit `a`, upper limit `b`, and mode `c` at a value `x`.
2727
*
2828
* @param x input value
2929
* @param a lower limit
@@ -32,7 +32,7 @@
3232
* @return evaluated logCDF
3333
*
3434
* @example
35-
* double y = stdlib_base_dists_geometric_logcdf( 0.5, -1.0, 1.0, 0.0 );
35+
* double y = stdlib_base_dists_triangular_logcdf( 0.5, -1.0, 1.0, 0.0 );
3636
* // returns ~-0.134
3737
*/
3838
double stdlib_base_dists_triangular_logcdf( const double x, const double a, const double b, const double c ) {

0 commit comments

Comments
 (0)