Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,15 @@ static double rand_double( void ) {
*/
static double benchmark1( int iterations, int N ) {
stdlib_complex128_t alpha;
double x[ N*2 ];
double y[ N*2 ];
double elapsed;
double *x;
double *y;
double t;
int i;

alpha = stdlib_complex128( 1.0, 0.0 );
x = (double *) malloc( N * 2 * sizeof( double ) );
y = (double *) malloc( N * 2 * sizeof( double ) );
for ( i = 0; i < N*2; i+=2 ) {
x[ i ] = ( rand_double()*20.0 ) - 10.0;
x[ i+1 ] = ( rand_double()*20.0 ) - 10.0;
Expand All @@ -122,6 +124,8 @@ static double benchmark1( int iterations, int N ) {
if ( y[ i%(N*2) ] != y[ i%(N*2) ] ) {
printf( "should not return NaN\n" );
}
free( x );
free( y );
return elapsed;
}

Expand All @@ -134,13 +138,15 @@ static double benchmark1( int iterations, int N ) {
*/
static double benchmark2( int iterations, int N ) {
stdlib_complex128_t alpha;
double x[ N*2 ];
double y[ N*2 ];
double elapsed;
double *x;
double *y;
double t;
int i;

alpha = stdlib_complex128( 1.0, 0.0 );
x = (double *) malloc( N * 2 * sizeof( double ) );
y = (double *) malloc( N * 2 * sizeof( double ) );
for ( i = 0; i < N*2; i+=2 ) {
x[ i ] = ( rand_double()*20.0 ) - 10.0;
x[ i+1 ] = ( rand_double()*20.0 ) - 10.0;
Expand All @@ -159,6 +165,8 @@ static double benchmark2( int iterations, int N ) {
if ( y[ i%(N*2) ] != y[ i%(N*2) ] ) {
printf( "should not return NaN\n" );
}
free( x );
free( y );
return elapsed;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ double out = stdlib_base_dists_pareto_type1_skewness( 3.5, 1.0 );

The function accepts the following arguments:

- **alpha**: `[in] double` first shape parameter.
- **beta**: `[in] double` second shape parameter.
- **alpha**: `[in] double` shape parameter.
- **beta**: `[in] double` scale parameter.

```c
double stdlib_base_dists_pareto_type1_skewness( const double alpha, const double beta );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
/**
* Returns the skewness of a Pareto (Type I) distribution.
*
* @param alpha first shape parameter
* @param beta second shape parameter
* @param alpha shape parameter
* @param beta scale parameter
* @return skewness
*
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ double out = stdlib_base_dists_pareto_type1_stdev( 2.5, 1.0 );

The function accepts the following arguments:

- **alpha**: `[in] double` first shape parameter.
- **beta**: `[in] double` second shape parameter.
- **alpha**: `[in] double` shape parameter.
- **beta**: `[in] double` scale parameter.

```c
double stdlib_base_dists_pareto_type1_stdev( const double alpha, const double beta );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
/**
* Returns the standard deviation of a Pareto (Type I) distribution.
*
* @param alpha first shape parameter
* @param beta second shape parameter
* @param alpha shape parameter
* @param beta scale parameter
* @return standard deviation
*
* @example
Expand Down