Skip to content

Commit 21c9cbe

Browse files
authored
chore: apply suggestions from code review
Signed-off-by: Philipp Burckhardt <[email protected]>
1 parent 9acd0f6 commit 21c9cbe

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ for ( i = 0; i < 10; i++ ) {
177177

178178
#### stdlib_base_dists_cauchy_logcdf( x, x0, gamma )
179179

180-
Evaluates the logarithm of the cumulative distribution function (logCDF) for a Cauchy distribution.
180+
Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [Cauchy][cauchy-distribution] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter).
181181

182182
```c
183183
double out = stdlib_base_dists_cauchy_logcdf( 4.0, 0.0, 2.0 );
@@ -233,9 +233,9 @@ int main( void ) {
233233
for ( i = 0; i < 25; i++ ) {
234234
x = random_uniform( 0.0, 10.0 );
235235
x0 = random_uniform( 0.0, 10.0 );
236-
gamma = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
236+
gamma = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
237237
y = stdlib_base_dists_cauchy_logcdf( x, x0, gamma );
238-
printf( "x: %lf, k: %lf, γ: %lf, ln(F(x;x0,γ)): %lf\n", x, x0, gamma, y );
238+
printf( "x: %lf, x0: %lf, γ: %lf, ln(F(x;x0,γ)): %lf\n", x, x0, gamma, y );
239239
}
240240
}
241241
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static double benchmark( void ) {
102102
int i;
103103

104104
for ( i = 0; i < 100; i++ ) {
105-
x[ i ] = random_uniform( -100.0 , 0.0 );
105+
x[ i ] = random_uniform( -100.0, 0.0 );
106106
x0[ i ] = random_uniform( -50.0, 50.0 );
107107
gamma[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
108108
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ int main( void ) {
3636
for ( i = 0; i < 25; i++ ) {
3737
x = random_uniform( 0.0, 10.0 );
3838
x0 = random_uniform( 0.0, 10.0 );
39-
gamma = random_uniform( 0.0, 10.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
39+
gamma = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 );
4040
y = stdlib_base_dists_cauchy_logcdf( x, x0, gamma );
41-
printf( "x: %lf, k: %lf, γ: %lf, ln(F(x;x0,γ)): %lf\n", x, x0, gamma, y );
41+
printf( "x: %lf, x0: %lf, γ: %lf, ln(F(x;x0,γ)): %lf\n", x, x0, gamma, y );
4242
}
4343
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "stdlib/math/base/special/atan2.h"
2222
#include "stdlib/math/base/special/ln.h"
2323

24-
const double ONE_OVER_PI = 0.3183098861837907;
24+
static const double ONE_OVER_PI = 0.3183098861837907;
2525

2626
/**
2727
* Evaluates the natural logarithm of the cumulative distribution function (logCDF) for a Cauchy distribution with location parameter `x0` and scale parameter `gamma` at a value `x`.
@@ -32,7 +32,7 @@ const double ONE_OVER_PI = 0.3183098861837907;
3232
* @return evaluated logCDF
3333
*
3434
* @example
35-
* double y = stdlib_base_cauchy_logcdf( 4.0, 0.0, 2.0 );
35+
* double y = stdlib_base_dists_cauchy_logcdf( 4.0, 0.0, 2.0 );
3636
* // returns ~-0.16
3737
*/
3838
double stdlib_base_dists_cauchy_logcdf( const double x, const double x0, const double gamma ) {

0 commit comments

Comments
 (0)