Skip to content

Commit 03e8e72

Browse files
authored
chore: minor clean-up
Signed-off-by: Philipp Burckhardt <[email protected]>
1 parent cdfddb1 commit 03e8e72

File tree

5 files changed

+25
-29
lines changed

5 files changed

+25
-29
lines changed

lib/node_modules/@stdlib/stats/base/dists/logistic/cdf/README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ for ( i = 0; i < 10; i++ ) {
176176

177177
#### stdlib_base_dists_logistic_cdf( x, mu, s )
178178

179-
Returns the cumulative distribution function (CDF) for a logistic distribution with location parameter `mu` and scale parameter `s` at a value `x`.
179+
Evaluates the [cumulative distribution function][cdf] (CDF) for a [logistic][logistic-distribution] distribution with parameters `mu` (location parameter) and `s` (scale parameter).
180180

181181
```c
182182
double out = stdlib_base_dists_logistic_cdf( 2.0, 0.0, 1.0 );
@@ -194,34 +194,46 @@ double stdlib_base_dists_logistic_cdf( const double x, const double mu, const do
194194
```
195195
196196
</section>
197+
197198
<!-- /.usage -->
199+
198200
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
201+
199202
<section class="notes">
203+
200204
</section>
205+
201206
<!-- /.notes -->
207+
202208
<!-- C API usage examples. -->
209+
203210
<section class="examples">
211+
204212
### Examples
213+
205214
```c
206215
#include "stdlib/stats/base/dists/logistic/cdf.h"
207216
#include <stdlib.h>
208217
#include <stdio.h>
218+
209219
static double random_uniform( const double min, const double max ) {
210220
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
211221
return min + ( v*(max-min) );
212222
}
223+
213224
int main( void ) {
214225
double mu;
215226
double s;
216227
double x;
217228
double y;
218229
int i;
230+
219231
for ( i = 0; i < 25; i++ ) {
220-
mu = random_uniform( 0.0, 10.0 ) - 5.0;
221-
s = random_uniform( 0.0, 20.0 );
222-
x = random_uniform( 0.0, 20.0 );
232+
mu = random_uniform( 0.0, 10.0 );
233+
s = random_uniform( 0.0, 10.0 );
234+
x = random_uniform( 0.0, 10.0 );
223235
y = stdlib_base_dists_logistic_cdf( x, mu, s );
224-
printf( "x: %lf, µ: %lf, s: %lf, CDF(X;x,µ,s): %lf\n", x, mu, s, y );
236+
printf( "x: %lf, µ: %lf, s: %lf, F(x;µ,s): %lf\n", x, mu, s, y );
225237
}
226238
}
227239
```

lib/node_modules/@stdlib/stats/base/dists/logistic/cdf/benchmark/c/benchmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ static double benchmark( void ) {
101101
int i;
102102

103103
for ( i = 0; i < 100; i++ ) {
104-
mu[ i ] = random_uniform( 0.0, 100.0 ) - 50.0;
105-
s[ i ] = random_uniform( 0.0, 20.0 ) + STDLIB_CONSTANT_FLOAT64_EPS;
104+
mu[ i ] = random_uniform( -50.0, 50.0 );
105+
s[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 );
106106
x[ i ] = random_uniform( 0.0, 10.0 );
107107
}
108108

lib/node_modules/@stdlib/stats/base/dists/logistic/cdf/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ int main( void ) {
3737
s = random_uniform( 0.0, 10.0 );
3838
x = random_uniform( 0.0, 10.0 );
3939
y = stdlib_base_dists_logistic_cdf( x, mu, s );
40-
printf( "x: %lf, µ: %lf, s: %lf, CDF(X;x,µ,s): %lf\n", x, mu, s, y );
40+
printf( "x: %lf, µ: %lf, s: %lf, F(x;µ,s): %lf\n", x, mu, s, y );
4141
}
4242
}

lib/node_modules/@stdlib/stats/base/dists/logistic/cdf/include/stdlib/stats/base/dists/logistic/cdf.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-
* Returns the cumulative distribution function (CDF) for a logistic distribution with location parameter `mu` and scale parameter `s` at a value `x`.
30+
* Evaluates the cumulative distribution function (CDF) for a logistic distribution with location parameter `mu` and scale parameter `s` at a value `x`.
3131
*/
3232
double stdlib_base_dists_logistic_cdf( const double x, const double mu, const double s );
3333

lib/node_modules/@stdlib/stats/base/dists/logistic/cdf/src/main.c

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,14 @@
2323
/**
2424
* Evaluates the cumulative distribution function (CDF) for a logistic distribution with location parameter `mu` and scale parameter `s` at a value `x`.
2525
*
26-
* @param {number} x - input value
27-
* @param {number} mu - location parameter
28-
* @param {NonNegativeNumber} s - scale parameter
29-
* @returns {Probability} evaluated CDF
26+
* @param x input value
27+
* @param mu location parameter
28+
* @param s scale parameter
29+
* @return evaluated CDF
3030
*
3131
* @example
3232
* double y = stdlib_base_dists_logistic_cdf( 2.0, 0.0, 1.0 );
3333
* // returns ~0.881
34-
*
35-
* @example
36-
* double y = stdlib_base_dists_logistic_cdf( 5.0, 10.0, 3.0 );
37-
* // returns ~0.159
38-
*
39-
* @example
40-
* double y = stdlib_base_dists_logistic_cdf( 2.0, 0.0, NaN );
41-
* // returns NaN
42-
*
43-
* @example
44-
* double y = stdlib_base_dists_logistic_cdf( 2.0, NaN, 1.0 );
45-
* // returns NaN
46-
*
47-
* @example
48-
* double y = stdlib_base_dists_logistic_cdf( NaN, 0.0, 1.0 );
49-
* // returns NaN
5034
*/
5135
double stdlib_base_dists_logistic_cdf( const double x, const double mu, const double s ) {
5236
double z;

0 commit comments

Comments
 (0)