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 ) {
116116 } else {
117117 w = x - ONE ;
118118 }
119- y = f32 ( - w * f32 ( f32 ( polyvalA ( w ) ) / f32 ( polyvalB ( w ) ) ) ) ;
119+ y = f32 ( - w * f32 ( polyvalA ( w ) / polyvalB ( w ) ) ) ;
120120 if ( flg & 1 ) {
121121 y = f32 ( PI2O6 - f32 ( lnf ( x ) * lnf ( ONE - x ) ) - y ) ;
122122 }
Original file line number Diff line number Diff line change 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/**
@@ -38,7 +43,7 @@ function evalpoly( x ) {
3843 if ( x === 0.0 ) {
3944 return 1.0 ;
4045 }
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
4247}
4348
4449
Original file line number Diff line number Diff line change 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/**
@@ -38,7 +43,7 @@ function evalpoly( x ) {
3843 if ( x === 0.0 ) {
3944 return 1.0 ;
4045 }
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
4247}
4348
4449
Original file line number Diff line number Diff line change @@ -113,11 +113,15 @@ function main() {
113113 } ;
114114
115115 fpath = resolve ( __dirname , '..' , 'lib' , 'polyval_a.js' ) ;
116- str = header + compile ( A ) ;
116+ str = header + compile ( A , {
117+ 'dtype' : 'float32'
118+ } ) ;
117119 writeFileSync ( fpath , str , opts ) ;
118120
119121 fpath = resolve ( __dirname , '..' , 'lib' , 'polyval_b.js' ) ;
120- str = header + compile ( B ) ;
122+ str = header + compile ( B , {
123+ 'dtype' : 'float32'
124+ } ) ;
121125 writeFileSync ( fpath , str , opts ) ;
122126
123127 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
7979 for ( i = 0 ; i < x . length ; i ++ ) {
8080 v = spencef ( x [ i ] ) ;
8181 delta = absf ( v - expected [ i ] ) ;
82- tol = 1.8 * EPS * absf ( expected [ i ] ) ;
82+ tol = 8.2 * EPS * absf ( expected [ i ] ) ;
8383 t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. actual: ' + v + '. expected: ' + expected [ i ] + '. tol: ' + tol + '. Δ: ' + delta + '.' ) ;
8484 }
8585 t . end ( ) ;
@@ -119,7 +119,7 @@ tape( 'the function accurately computes the dilogarithm for huge positive number
119119 for ( i = 0 ; i < x . length ; i ++ ) {
120120 v = spencef ( x [ i ] ) ;
121121 delta = absf ( v - expected [ i ] ) ;
122- tol = 1.7 * EPS * absf ( expected [ i ] ) ;
122+ tol = 7.0 * EPS * absf ( expected [ i ] ) ;
123123 t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. actual: ' + v + '. expected: ' + expected [ i ] + '. tol: ' + tol + '. Δ: ' + delta + '.' ) ;
124124 }
125125 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
8888 for ( i = 0 ; i < x . length ; i ++ ) {
8989 v = spencef ( x [ i ] ) ;
9090 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
9391 tol = 8.2 * EPS * absf ( expected [ i ] ) ;
9492 t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. actual: ' + v + '. expected: ' + expected [ i ] + '. tol: ' + tol + '. Δ: ' + delta + '.' ) ;
9593 }
@@ -130,8 +128,6 @@ tape( 'the function accurately computes the dilogarithm for huge positive number
130128 for ( i = 0 ; i < x . length ; i ++ ) {
131129 v = spencef ( x [ i ] ) ;
132130 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
135131 tol = 7.0 * EPS * absf ( expected [ i ] ) ;
136132 t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. actual: ' + v + '. expected: ' + expected [ i ] + '. tol: ' + tol + '. Δ: ' + delta + '.' ) ;
137133 }
You can’t perform that action at this time.
0 commit comments