Skip to content

chore: address commit comments in README, benchmark, and main.c #5763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 5, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ for ( i = 0; i < 10; i++ ) {

<!-- /.examples -->

<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="references">

<!-- C interface documentation. -->

Expand Down Expand Up @@ -249,6 +246,18 @@ int main( void ) {

</section>

<!-- /.examples -->

</section>

<!-- /.c -->

<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="references">

</section>

<!-- /.references -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ static double random_uniform( const double min, const double max ) {
* @return elapsed time in seconds
*/
static double benchmark( void ) {
double sigma[100];
double mu[100];
double p[100];
double elapsed;
double p[ 100 ];
double mu[ 100 ];
double sigma[ 100 ];
double y;
double t;
int i;
double y;
int i;

for ( i = 0; i < 100; i++ ) {
p[ i ] = random_uniform( 0.0, 1.0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/sqrt",
"@stdlib/math/base/special/erfinv",
"@stdlib/constants/float64/eps"
"@stdlib/constants/float64/eps",
"@stdlib/constants/float64/sqrt_two"
]
},
{
Expand All @@ -77,7 +78,8 @@
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/sqrt",
"@stdlib/math/base/special/erfinv",
"@stdlib/constants/float64/eps"
"@stdlib/constants/float64/eps",
"@stdlib/constants/float64/sqrt_two"
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "stdlib/math/base/assert/is_nan.h"
#include "stdlib/math/base/special/sqrt.h"
#include "stdlib/math/base/special/erfinv.h"
#include "stdlib/constants/float64/sqrt_two.h"

/**
* Evaluates the quantile function for a normal distribution with mean `mu` and standard deviation `sigma` at a probability `p`.
Expand Down Expand Up @@ -47,5 +48,5 @@ double stdlib_base_dists_normal_quantile( const double p, const double mu, const
if ( sigma == 0.0 ) {
return mu;
}
return mu + ( ( sigma * stdlib_base_sqrt( 2.0 ) ) * stdlib_base_erfinv( ( 2.0 * p ) - 1.0 ) );
return mu + ( ( sigma * STDLIB_CONSTANT_FLOAT64_SQRT2 ) * stdlib_base_erfinv( ( 2.0 * p ) - 1.0 ) );
}
Loading