Skip to content

Commit 134e0da

Browse files
chore: updated x value and x should be greater than a
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: passed - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: passed - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 83e9034 commit 134e0da

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logpmf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ int main( void ) {
224224
int i;
225225
226226
for ( i = 0; i < 10; i++ ) {
227-
x = random_uniform( -10.0, 10.0 );
228227
a = stdlib_base_round( random_uniform( 0.0, 10.0 ) );
229228
b = stdlib_base_round( random_uniform( 0.0, 10.0 ) ) + a;
229+
x = stdlib_base_round( random_uniform( a*1.0, b*1.0 ) );
230230
y = stdlib_base_dists_discrete_uniform_logpmf( x, a, b );
231231
printf( "x:%lf, a: %d, b: %d, ln(P(X=x;a,b)): %lf\n", x, a, b, y );
232232
}

lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logpmf/benchmark/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ bench( pkg, function benchmark( b ) {
4444
min = new Float64Array( len );
4545
max = new Float64Array( len );
4646
for ( i = 0; i < len; i++ ) {
47-
x[ i ] = ( randu() * 20.0 ) - 10.0;
48-
min[ i ] = round( randu()*10.0 );
47+
min[ i ] = round( randu() * 10.0 );
4948
max[ i ] = round( randu() * 10.0 ) + min[ i ];
49+
x[ i ] = round( randu() * max[ i ] ) - min[ i ];
5050
}
5151

5252
b.tic();

lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logpmf/benchmark/benchmark.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5353
min = new Float64Array( len );
5454
max = new Float64Array( len );
5555
for ( i = 0; i < len; i++ ) {
56-
x[ i ] = ( randu() * 20.0 ) - 10.0;
5756
min[ i ] = round( randu()*10.0 );
5857
max[ i ] = round( randu() * 10.0 ) + min[ i ];
58+
x[ i ] = round( randu() * max[ i ] ) - min[ i ];
5959
}
6060

6161
b.tic();

lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logpmf/benchmark/c/benchmark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ static double benchmark( void ) {
103103
int i;
104104

105105
for ( i = 0; i < 100; i++ ) {
106-
x[ i ] = random_uniform( -10.0, 10.0 );
107106
a[ i ] = stdlib_base_round( random_uniform( 0.0, 10.0 ) );
108107
b[ i ] = stdlib_base_round( random_uniform( 0.0, 10.0 ) ) + a[ i ];
108+
x[ i ] = stdlib_base_round( random_uniform( a[ i ]*1.0, b[ i ]*1.0 ) );
109109
}
110110

111111
t = tic();

lib/node_modules/@stdlib/stats/base/dists/discrete-uniform/logpmf/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ int main( void ) {
3535
int i;
3636

3737
for ( i = 0; i < 10; i++ ) {
38-
x = random_uniform( -10.0, 10.0 );
3938
a = stdlib_base_round( random_uniform( 0.0, 10.0 ) );
4039
b = stdlib_base_round( random_uniform( 0.0, 10.0 ) ) + a;
40+
x = stdlib_base_round( random_uniform( a*1.0, b*1.0 ) );
4141
y = stdlib_base_dists_discrete_uniform_logpmf( x, a, b );
4242
printf( "x:%lf, a: %d, b: %d, ln(P(X=x;a,b)): %lf\n", x, a, b, y );
4343
}

0 commit comments

Comments
 (0)