Skip to content

Commit c18ebf8

Browse files
committed
chore: remove EPS addition and directly draw from desired distribution
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: passed - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent f3df15f commit c18ebf8

File tree

5 files changed

+12
-21
lines changed

5 files changed

+12
-21
lines changed

lib/node_modules/@stdlib/stats/base/dists/beta/mode/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ v = mode( 1.0, -1.0 );
124124

125125
```javascript
126126
var randu = require( '@stdlib/random/base/randu' );
127-
var EPS = require( '@stdlib/constants/float64/eps' );
128127
var mode = require( '@stdlib/stats/base/dists/beta/mode' );
129128

130129
var alpha;
@@ -133,8 +132,8 @@ var v;
133132
var i;
134133

135134
for ( i = 0; i < 10; i++ ) {
136-
alpha = ( randu()*10.0 ) + 1.0 + EPS;
137-
beta = ( randu()*10.0 ) + 1.0 + EPS;
135+
alpha = ( randu()*10.0 ) + 1.0;
136+
beta = ( randu()*10.0 ) + 1.0;
138137
v = mode( alpha, beta );
139138
console.log( 'α: %d, β: %d, mode(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) );
140139
}
@@ -208,7 +207,6 @@ double stdlib_base_dists_beta_mode( const double alpha, const double beta );
208207
209208
```c
210209
#include "stdlib/stats/base/dists/beta/mode.h"
211-
#include "stdlib/constants/float64/eps.h"
212210
#include <stdlib.h>
213211
#include <stdio.h>
214212
@@ -223,8 +221,8 @@ int main( void ) {
223221
double y;
224222
int i;
225223
for ( i = 0; i < 25; i++ ) {
226-
alpha = random_uniform( 0.0, 10.0 ) + 1.0 + STDLIB_CONSTANT_FLOAT64_EPS;
227-
beta = random_uniform( 0.0, 10.0 ) + 1.0 + STDLIB_CONSTANT_FLOAT64_EPS;
224+
alpha = random_uniform( 1.0, 11.0 );
225+
beta = random_uniform( 1.0, 11.0 );
228226
y = stdlib_base_dists_beta_mode( alpha, beta );
229227
printf( "alpha: %lf, beta: %lf, mode(X;alpha,beta): %lf\n", alpha, beta, y );
230228
}

lib/node_modules/@stdlib/stats/base/dists/beta/mode/benchmark/c/benchmark.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818

1919
#include "stdlib/stats/base/dists/beta/mode.h"
20-
#include "stdlib/constants/float64/eps.h"
2120
#include <stdlib.h>
2221
#include <stdio.h>
2322
#include <math.h>
@@ -101,8 +100,8 @@ static double benchmark( void ) {
101100
int i;
102101

103102
for ( i = 0; i < 100; i++ ) {
104-
alpha[ i ] = random_uniform( 0.0, 10.0 ) + 1.0 + STDLIB_CONSTANT_FLOAT64_EPS;
105-
beta[ i ] = random_uniform( 0.0, 10.0 ) + 1.0 + STDLIB_CONSTANT_FLOAT64_EPS;
103+
alpha[ i ] = random_uniform( 1.0, 11.0 );
104+
beta[ i ] = random_uniform( 1.0, 11.0 );
106105
}
107106

108107
t = tic();

lib/node_modules/@stdlib/stats/base/dists/beta/mode/examples/c/example.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818

1919
#include "stdlib/stats/base/dists/beta/mode.h"
20-
#include "stdlib/constants/float64/eps.h"
2120
#include <stdlib.h>
2221
#include <stdio.h>
2322

@@ -33,8 +32,8 @@ int main( void ) {
3332
int i;
3433

3534
for ( i = 0; i < 25; i++ ) {
36-
alpha = random_uniform( 0.0, 10.0 ) + 1.0 + STDLIB_CONSTANT_FLOAT64_EPS;
37-
beta = random_uniform( 0.0, 10.0 ) + 1.0 + STDLIB_CONSTANT_FLOAT64_EPS;
35+
alpha = random_uniform( 1.0, 11.0 );
36+
beta = random_uniform( 1.0, 11.0 );
3837
y = stdlib_base_dists_beta_mode( alpha, beta );
3938
printf( "alpha: %lf, beta: %lf, mode(X;alpha,beta): %lf\n", alpha, beta, y );
4039
}

lib/node_modules/@stdlib/stats/base/dists/beta/mode/examples/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
'use strict';
2020

2121
var randu = require( '@stdlib/random/base/randu' );
22-
var EPS = require( '@stdlib/constants/float64/eps' );
2322
var mode = require( './../lib' );
2423

2524
var alpha;
@@ -28,8 +27,8 @@ var v;
2827
var i;
2928

3029
for ( i = 0; i < 10; i++ ) {
31-
alpha = ( randu()*10.0 ) + 1.0 + EPS;
32-
beta = ( randu()*10.0 ) + 1.0 + EPS;
30+
alpha = ( randu()*10.0 ) + 1.0;
31+
beta = ( randu()*10.0 ) + 1.0;
3332
v = mode( alpha, beta );
3433
console.log( 'α: %d, β: %d, mode(X;α,β): %d', alpha.toFixed( 4 ), beta.toFixed( 4 ), v.toFixed( 4 ) );
3534
}

lib/node_modules/@stdlib/stats/base/dists/beta/mode/manifest.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@
5353
],
5454
"libraries": [],
5555
"libpath": [],
56-
"dependencies": [
57-
"@stdlib/constants/float64/eps"
58-
]
56+
"dependencies": []
5957
},
6058
{
6159
"task": "examples",
@@ -68,9 +66,7 @@
6866
],
6967
"libraries": [],
7068
"libpath": [],
71-
"dependencies": [
72-
"@stdlib/constants/float64/eps"
73-
]
69+
"dependencies": []
7470
}
7571
]
7672
}

0 commit comments

Comments
 (0)