Skip to content

Commit 70a7c2f

Browse files
chore: address commit comments in README, benchmarks, and main.c
PR-URL: #5763 Closes: #5712 Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com> Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com> Signed-off-by: Abhay Punia <156515195+Hecker165@users.noreply.github.com> Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
1 parent 8c9c9f2 commit 70a7c2f

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

lib/node_modules/@stdlib/stats/base/dists/normal/quantile/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ for ( i = 0; i < 10; i++ ) {
152152

153153
<!-- /.examples -->
154154

155-
<!-- 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. -->
156-
157-
<section class="references">
158155

159156
<!-- C interface documentation. -->
160157

@@ -249,6 +246,18 @@ int main( void ) {
249246

250247
</section>
251248

249+
<!-- /.examples -->
250+
251+
</section>
252+
253+
<!-- /.c -->
254+
255+
<!-- 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. -->
256+
257+
<section class="references">
258+
259+
</section>
260+
252261
<!-- /.references -->
253262

254263
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

lib/node_modules/@stdlib/stats/base/dists/normal/quantile/benchmark/c/benchmark.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ static double random_uniform( const double min, const double max ) {
9393
* @return elapsed time in seconds
9494
*/
9595
static double benchmark( void ) {
96-
double elapsed;
97-
double p[ 100 ];
98-
double mu[ 100 ];
9996
double sigma[ 100 ];
100-
double y;
97+
double mu[ 100 ];
98+
double p[ 100 ];
99+
double elapsed;
101100
double t;
101+
double y;
102102
int i;
103103

104104
for ( i = 0; i < 100; i++ ) {

lib/node_modules/@stdlib/stats/base/dists/normal/quantile/manifest.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"@stdlib/math/base/napi/ternary",
4242
"@stdlib/math/base/assert/is-nan",
4343
"@stdlib/math/base/special/sqrt",
44-
"@stdlib/math/base/special/erfinv"
44+
"@stdlib/math/base/special/erfinv",
45+
"@stdlib/constants/float64/sqrt-two"
4546
]
4647
},
4748
{
@@ -59,7 +60,8 @@
5960
"@stdlib/math/base/assert/is-nan",
6061
"@stdlib/math/base/special/sqrt",
6162
"@stdlib/math/base/special/erfinv",
62-
"@stdlib/constants/float64/eps"
63+
"@stdlib/constants/float64/eps",
64+
"@stdlib/constants/float64/sqrt-two"
6365
]
6466
},
6567
{
@@ -77,7 +79,8 @@
7779
"@stdlib/math/base/assert/is-nan",
7880
"@stdlib/math/base/special/sqrt",
7981
"@stdlib/math/base/special/erfinv",
80-
"@stdlib/constants/float64/eps"
82+
"@stdlib/constants/float64/eps",
83+
"@stdlib/constants/float64/sqrt-two"
8184
]
8285
}
8386
]

lib/node_modules/@stdlib/stats/base/dists/normal/quantile/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "stdlib/math/base/assert/is_nan.h"
2121
#include "stdlib/math/base/special/sqrt.h"
2222
#include "stdlib/math/base/special/erfinv.h"
23+
#include "stdlib/constants/float64/sqrt_two.h"
2324

2425
/**
2526
* Evaluates the quantile function for a normal distribution with mean `mu` and standard deviation `sigma` at a probability `p`.
@@ -47,5 +48,5 @@ double stdlib_base_dists_normal_quantile( const double p, const double mu, const
4748
if ( sigma == 0.0 ) {
4849
return mu;
4950
}
50-
return mu + ( ( sigma * stdlib_base_sqrt( 2.0 ) ) * stdlib_base_erfinv( ( 2.0 * p ) - 1.0 ) );
51+
return mu + ( ( sigma * STDLIB_CONSTANT_FLOAT64_SQRT2 ) * stdlib_base_erfinv( ( 2.0 * p ) - 1.0 ) );
5152
}

0 commit comments

Comments
 (0)