File tree Expand file tree Collapse file tree 6 files changed +21
-11
lines changed
lib/node_modules/@stdlib/math/base/special/spencef Expand file tree Collapse file tree 6 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ function spencef( x ) {
116
116
} else {
117
117
w = x - ONE ;
118
118
}
119
- y = f32 ( - w * f32 ( f32 ( polyvalA ( w ) ) / f32 ( polyvalB ( w ) ) ) ) ;
119
+ y = f32 ( - w * f32 ( polyvalA ( w ) / polyvalB ( w ) ) ) ;
120
120
if ( flg & 1 ) {
121
121
y = f32 ( PI2O6 - f32 ( lnf ( x ) * lnf ( ONE - x ) ) - y ) ;
122
122
}
Original file line number Diff line number Diff line change 19
19
/* This is a generated file. Do not edit directly. */
20
20
'use strict' ;
21
21
22
+ // MODULES //
23
+
24
+ var float64ToFloat32 = require ( '@stdlib/number/float64/base/to-float32' ) ;
25
+
26
+
22
27
// MAIN //
23
28
24
29
/**
@@ -38,7 +43,7 @@ function evalpoly( x ) {
38
43
if ( x === 0.0 ) {
39
44
return 1.0 ;
40
45
}
41
- return 1.0 + ( x * ( 3.297713409852251 + ( x * ( 4.256971560081218 + ( x * ( 2.7114985119655346 + ( x * ( 0.8796913117545303 + ( x * ( 0.13384763957830903 + ( x * ( 0.007315890452380947 + ( x * 0.000046512858607399003 ) ) ) ) ) ) ) ) ) ) ) ) ) ; // eslint-disable-line max-len
46
+ return float64ToFloat32 ( 1.0 + float64ToFloat32 ( x * float64ToFloat32 ( 3.2977135181427 + float64ToFloat32 ( x * float64ToFloat32 ( 4.25697135925293 + float64ToFloat32 ( x * float64ToFloat32 ( 2.711498498916626 + float64ToFloat32 ( x * float64ToFloat32 ( 0.8796913027763367 + float64ToFloat32 ( x * float64ToFloat32 ( 0.13384763896465302 + float64ToFloat32 ( x * float64ToFloat32 ( 0.007315890397876501 + float64ToFloat32 ( x * 0.00004651285780710168 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ; // eslint-disable-line max-len
42
47
}
43
48
44
49
Original file line number Diff line number Diff line change 19
19
/* This is a generated file. Do not edit directly. */
20
20
'use strict' ;
21
21
22
+ // MODULES //
23
+
24
+ var float64ToFloat32 = require ( '@stdlib/number/float64/base/to-float32' ) ;
25
+
26
+
22
27
// MAIN //
23
28
24
29
/**
@@ -38,7 +43,7 @@ function evalpoly( x ) {
38
43
if ( x === 0.0 ) {
39
44
return 1.0 ;
40
45
}
41
- return 1.0 + ( x * ( 3.547713409852251 + ( x * ( 5.03278880143317 + ( x * ( 3.6380053334513707 + ( x * ( 1.4117259775183106 + ( x * ( 0.2829748606025681 + ( x * ( 0.02540437639325444 + ( x * 0.0006909904889125533 ) ) ) ) ) ) ) ) ) ) ) ) ) ; // eslint-disable-line max-len
46
+ return float64ToFloat32 ( 1.0 + float64ToFloat32 ( x * float64ToFloat32 ( 3.5477135181427 + float64ToFloat32 ( x * float64ToFloat32 ( 5.0327887535095215 + float64ToFloat32 ( x * float64ToFloat32 ( 3.638005256652832 + float64ToFloat32 ( x * float64ToFloat32 ( 1.4117259979248047 + float64ToFloat32 ( x * float64ToFloat32 ( 0.28297486901283264 + float64ToFloat32 ( x * float64ToFloat32 ( 0.025404376909136772 + float64ToFloat32 ( x * 0.0006909904768690467 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ; // eslint-disable-line max-len
42
47
}
43
48
44
49
Original file line number Diff line number Diff line change @@ -113,11 +113,15 @@ function main() {
113
113
} ;
114
114
115
115
fpath = resolve ( __dirname , '..' , 'lib' , 'polyval_a.js' ) ;
116
- str = header + compile ( A ) ;
116
+ str = header + compile ( A , {
117
+ 'dtype' : 'float32'
118
+ } ) ;
117
119
writeFileSync ( fpath , str , opts ) ;
118
120
119
121
fpath = resolve ( __dirname , '..' , 'lib' , 'polyval_b.js' ) ;
120
- str = header + compile ( B ) ;
122
+ str = header + compile ( B , {
123
+ 'dtype' : 'float32'
124
+ } ) ;
121
125
writeFileSync ( fpath , str , opts ) ;
122
126
123
127
copts = {
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ tape( 'the function accurately computes the dilogarithm for medium positive numb
79
79
for ( i = 0 ; i < x . length ; i ++ ) {
80
80
v = spencef ( x [ i ] ) ;
81
81
delta = absf ( v - expected [ i ] ) ;
82
- tol = 1.8 * EPS * absf ( expected [ i ] ) ;
82
+ tol = 8.2 * EPS * absf ( expected [ i ] ) ;
83
83
t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. actual: ' + v + '. expected: ' + expected [ i ] + '. tol: ' + tol + '. Δ: ' + delta + '.' ) ;
84
84
}
85
85
t . end ( ) ;
@@ -119,7 +119,7 @@ tape( 'the function accurately computes the dilogarithm for huge positive number
119
119
for ( i = 0 ; i < x . length ; i ++ ) {
120
120
v = spencef ( x [ i ] ) ;
121
121
delta = absf ( v - expected [ i ] ) ;
122
- tol = 1.7 * EPS * absf ( expected [ i ] ) ;
122
+ tol = 7.0 * EPS * absf ( expected [ i ] ) ;
123
123
t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. actual: ' + v + '. expected: ' + expected [ i ] + '. tol: ' + tol + '. Δ: ' + delta + '.' ) ;
124
124
}
125
125
t . end ( ) ;
Original file line number Diff line number Diff line change @@ -88,8 +88,6 @@ tape( 'the function accurately computes the dilogarithm for medium positive numb
88
88
for ( i = 0 ; i < x . length ; i ++ ) {
89
89
v = spencef ( x [ i ] ) ;
90
90
delta = absf ( v - expected [ i ] ) ;
91
-
92
- // NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
93
91
tol = 8.2 * EPS * absf ( expected [ i ] ) ;
94
92
t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. actual: ' + v + '. expected: ' + expected [ i ] + '. tol: ' + tol + '. Δ: ' + delta + '.' ) ;
95
93
}
@@ -130,8 +128,6 @@ tape( 'the function accurately computes the dilogarithm for huge positive number
130
128
for ( i = 0 ; i < x . length ; i ++ ) {
131
129
v = spencef ( x [ i ] ) ;
132
130
delta = absf ( v - expected [ i ] ) ;
133
-
134
- // NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
135
131
tol = 7.0 * EPS * absf ( expected [ i ] ) ;
136
132
t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. actual: ' + v + '. expected: ' + expected [ i ] + '. tol: ' + tol + '. Δ: ' + delta + '.' ) ;
137
133
}
You can’t perform that action at this time.
0 commit comments