Skip to content

Commit 2eb827f

Browse files
authored
chore: apply suggestions from code review
Signed-off-by: Philipp Burckhardt <[email protected]>
1 parent d9b5015 commit 2eb827f

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

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

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

175175
#### stdlib_base_dists_cauchy_logpdf( x, x0, gamma )
176176

177-
Evaluates the logarithm of the probability density function (logPDF) for a Cauchy distribution
177+
Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [Cauchy][cauchy-distribution] distribution with parameters `x0` (location parameter) and `gamma > 0` (scale parameter).
178178

179179
```c
180180
double out = stdlib_base_dists_cauchy_logpdf( 0.5, 0.0, 2.0 );
@@ -230,7 +230,7 @@ int main( void ) {
230230
for ( i = 0; i < 25; i++ ) {
231231
x = random_uniform( 0.0, 10.0 );
232232
x0 = random_uniform( -5.0, 5.0 );
233-
gamma = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
233+
gamma = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
234234
y = stdlib_base_dists_cauchy_logpdf( x, x0, gamma );
235235
printf( "x: %lf, x0: %lf, γ: %lf, ln(f(x;x0,γ)): %lf\n", x, x0, gamma, y );
236236
}

lib/node_modules/@stdlib/stats/base/dists/cauchy/logpdf/benchmark/benchmark.native.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5353
x0 = new Float64Array( len );
5454
gamma = new Float64Array( len );
5555
for ( i = 0; i < len; i++ ) {
56-
x[ i ] = uniform( -100, 100 );
57-
x0[ i ] = uniform( -50, 50 );
58-
gamma[ i ] = uniform( EPS, 20 );
56+
x[ i ] = uniform( -100.0, 100.0 );
57+
x0[ i ] = uniform( -50.0, 50.0 );
58+
gamma[ i ] = uniform( EPS, 20.0 );
5959
}
6060

6161
b.tic();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int main( void ) {
3636
for ( i = 0; i < 25; i++ ) {
3737
x = random_uniform( 0.0, 10.0 );
3838
x0 = random_uniform( -5.0, 5.0 );
39-
gamma = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
39+
gamma = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
4040
y = stdlib_base_dists_cauchy_logpdf( x, x0, gamma );
4141
printf( "x: %lf, x0: %lf, γ: %lf, ln(f(x;x0,γ)): %lf\n", x, x0, gamma, y );
4242
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@
2323
#include "stdlib/math/base/special/pow.h"
2424
#include "stdlib/constants/float64/ln_pi.h"
2525

26-
2726
/**
2827
* Evaluates the natural logarithm of the probability density function (logPDF) for a Cauchy distribution with location parameter `x0` and scale parameter `gamma` at a value `x`.
2928
*
3029
* @param x input value
3130
* @param x0 location parameter
3231
* @param gamma scale parameter
33-
* @return evaluated LOGPDF
32+
* @return evaluated logPDF
3433
*
3534
* @example
36-
* double y = stdlib_base_weibull_logpdf( 2.0, 1.0, 1.0 );
35+
* double y = stdlib_base_dists_cauchy_logpdf( 2.0, 1.0, 1.0 );
3736
* // returns ~-1.838
3837
*/
3938
double stdlib_base_dists_cauchy_logpdf( const double x, const double x0, const double gamma ) {

0 commit comments

Comments
 (0)