Skip to content
Merged
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 elapsed;
double p[ 100 ];
double mu[ 100 ];
double sigma[ 100 ];
double y;
double mu[ 100 ];
double p[ 100 ];
double elapsed;
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 @@ -41,7 +41,8 @@
"@stdlib/math/base/napi/ternary",
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/sqrt",
"@stdlib/math/base/special/erfinv"
"@stdlib/math/base/special/erfinv",
"@stdlib/constants/float64/sqrt-two"
]
},
{
Expand All @@ -59,7 +60,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 +79,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