Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/node_modules/@stdlib/stats/base/dists/normal/pdf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,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 @@ -214,7 +210,6 @@ double stdlib_base_dists_normal_pdf( const double x, const double mu, const doub
#include "stdlib/constants/float64/eps.h"
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

static double random_uniform( const double min, const double max ) {
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
Expand All @@ -240,6 +235,12 @@ int main( void ) {

</section>

<!-- 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 @@ -40,7 +40,7 @@ var opts = {

// MAIN //

bench( pkg, opts, function benchmark( b ) {
bench( pkg+'::native', opts, function benchmark( b ) {
var sigma;
var len;
var mu;
Expand All @@ -60,7 +60,7 @@ bench( pkg, opts, function benchmark( b ) {

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
y = pdf( x[ i % len ], mu[ i % len ], sigma[ i % len ]);
y = pdf( x[ i % len ], mu[ i % len ], sigma[ i % len ] );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#define NAME "normal-pdf"
#define ITERATIONS 1000000
#define REPEATS 3
#define LEN 100

/**
* Prints the TAP version.
Expand Down Expand Up @@ -94,14 +93,15 @@ 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 elapsed;
double x[ LEN ];
double mu[ LEN ];
double sigma[ LEN ];
double y;
double t;
int i;

double x[ 100 ];

for ( i = 0; i < LEN; i++ ) {
x[ i ] = random_uniform( -100.0, 100.0 );
mu[ i ] = random_uniform( -50.0, 50.0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "stdlib/constants/float64/eps.h"
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

static double random_uniform( const double min, const double max ) {
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
Expand Down