Skip to content

Commit 8d8d4dd

Browse files
author
aayush0325
committed
feat: auto generated functions
1 parent 44e4005 commit 8d8d4dd

File tree

10 files changed

+32
-22
lines changed

10 files changed

+32
-22
lines changed

lib/node_modules/@stdlib/math/base/special/exp2f/lib/polyval_p.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
/* This is a generated file. Do not edit directly. */
2020
'use strict';
2121

22+
// MODULES //
23+
24+
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
25+
26+
2227
// MAIN //
2328

2429
/**
@@ -36,9 +41,9 @@
3641
*/
3742
function evalpoly( x ) {
3843
if ( x === 0.0 ) {
39-
return 1513.906801156151;
44+
return 1513.9068603515625;
4045
}
41-
return 1513.906801156151 + (x * (20.202065669316532 + (x * 0.023093347705734523))); // eslint-disable-line max-len
46+
return float64ToFloat32(1513.9068603515625 + float64ToFloat32(x * float64ToFloat32(20.20206642150879 + float64ToFloat32(x * 0.023093348369002342)))); // eslint-disable-line max-len
4247
}
4348

4449

lib/node_modules/@stdlib/math/base/special/exp2f/lib/polyval_q.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
/* This is a generated file. Do not edit directly. */
2020
'use strict';
2121

22+
// MODULES //
23+
24+
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
25+
26+
2227
// MAIN //
2328

2429
/**
@@ -36,9 +41,9 @@
3641
*/
3742
function evalpoly( x ) {
3843
if ( x === 0.0 ) {
39-
return 4368.211668792106;
44+
return 4368.21142578125;
4045
}
41-
return 4368.211668792106 + (x * (233.1842117223149 + (x * 1.0)));
46+
return float64ToFloat32(4368.21142578125 + float64ToFloat32(x * float64ToFloat32(233.1842041015625 + float64ToFloat32(x * 1.0)))); // eslint-disable-line max-len
4247
}
4348

4449

lib/node_modules/@stdlib/math/base/special/exp2f/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
* @return evaluated polynomial
5656
*/
5757
static float polyval_p( const float x ) {
58-
return 1513.906801156151 + (x * (20.202065669316532 + (x * 0.023093347705734523)));
58+
return 1513.906801156151f + (x * (20.202065669316532f + (x * 0.023093347705734523f)));
5959
}
6060

6161
// END: polyval_p
@@ -75,7 +75,7 @@ static float polyval_p( const float x ) {
7575
* @return evaluated polynomial
7676
*/
7777
static float polyval_q( const float x ) {
78-
return 4368.211668792106 + (x * (233.1842117223149 + (x * 1.0)));
78+
return 4368.211668792106f + (x * (233.1842117223149f + (x * 1.0f)));
7979
}
8080

8181
// END: polyval_q

lib/node_modules/@stdlib/math/base/special/exp2f/test/fixtures/julia/medium_negative.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/node_modules/@stdlib/math/base/special/exp2f/test/fixtures/julia/medium_positive.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/node_modules/@stdlib/math/base/special/exp2f/test/fixtures/julia/runner.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ julia> gen( x, \"data.json\" );
3737
"""
3838
function gen( domain, name )
3939
x = Float32.( collect( domain ) );
40-
y = exp2.( x );
40+
y = Float32.( exp2.( Float32.( x ) ) );
4141

4242
# Store data to be written to file as a collection:
4343
data = Dict([
@@ -62,21 +62,21 @@ file = @__FILE__;
6262
dir = dirname( file );
6363

6464
# Medium negative values:
65-
x = range( -1022.0, stop = -1.0, length = 1003 );
65+
x = range( -120.0, stop = -1.0, length = 120 );
6666
gen( x, "medium_negative.json" );
6767

6868
# Medium positive values:
69-
x = range( 1.0, stop = 1023.0, length = 1003 );
69+
x = range( 1.0, stop = 120.0, length = 120 );
7070
gen( x, "medium_positive.json" );
7171

7272
# Small negative values:
73-
x = range( -1.0, stop = -2.0^-54, length = 1007 );
73+
x = range( -1.0, stop = -2.0^-27, length = 1007 );
7474
gen( x, "small_negative.json" );
7575

7676
# Small positive values:
77-
x = range( 2.0^-54, stop = 1.0, length = 1007 );
77+
x = range( 2.0^-27, stop = 1.0, length = 1007 );
7878
gen( x, "small_positive.json" );
7979

8080
# Tiny values:
81-
x = range( -2.0^-54, stop = 2.0^-54, length = 1007 );
81+
x = range( -2.0^-27, stop = 2.0^-27, length = 1007 );
8282
gen( x, "tiny.json" );

lib/node_modules/@stdlib/math/base/special/exp2f/test/fixtures/julia/small_negative.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/node_modules/@stdlib/math/base/special/exp2f/test/fixtures/julia/small_positive.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/node_modules/@stdlib/math/base/special/exp2f/test/fixtures/julia/tiny.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/node_modules/@stdlib/math/base/special/exp2f/test/test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ tape( 'the function accurately computes `2**x` for negative medium numbers', fun
6060
for ( i = 0; i < x.length; i++ ) {
6161
v = exp2f( x[ i ] );
6262
delta = absf( v - expected[ i ] );
63-
tol = 1.5 * EPS * absf( expected[ i ] );
63+
tol = 2.0 * EPS * absf( expected[ i ] );
6464
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' );
6565
}
6666
t.end();
@@ -80,7 +80,7 @@ tape( 'the function accurately computes `2**x` for positive medium numbers', fun
8080
for ( i = 0; i < x.length; i++ ) {
8181
v = exp2f( x[ i ] );
8282
delta = absf( v - expected[ i ] );
83-
tol = 1.5 * EPS * absf( expected[ i ] );
83+
tol = 2.0 * EPS * absf( expected[ i ] );
8484
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' );
8585
}
8686
t.end();
@@ -100,7 +100,7 @@ tape( 'the function accurately computes `2**x` for negative small numbers', func
100100
for ( i = 0; i < x.length; i++ ) {
101101
v = exp2f( x[ i ] );
102102
delta = absf( v - expected[ i ] );
103-
tol = 1.5 * EPS * absf( expected[ i ] );
103+
tol = 2.0 * EPS * absf( expected[ i ] );
104104
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' );
105105
}
106106
t.end();
@@ -120,7 +120,7 @@ tape( 'the function accurately computes `2**x` for positive small numbers', func
120120
for ( i = 0; i < x.length; i++ ) {
121121
v = exp2f( x[ i ] );
122122
delta = absf( v - expected[ i ] );
123-
tol = 1.5 * EPS * absf( expected[ i ] );
123+
tol = 2.0 * EPS * absf( expected[ i ] );
124124
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' );
125125
}
126126
t.end();
@@ -140,7 +140,7 @@ tape( 'the function accurately computes `2**x` for very small `x`', function tes
140140
for ( i = 0; i < x.length; i++ ) {
141141
v = exp2f( x[ i ] );
142142
delta = absf( v - expected[ i ] );
143-
tol = 1.5 * EPS * absf( expected[ i ] );
143+
tol = 2.0 * EPS * absf( expected[ i ] );
144144
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Delta: ' + delta + '. Tolerance: ' + tol + '.' );
145145
}
146146
t.end();

0 commit comments

Comments
 (0)