@@ -103,9 +103,7 @@ tape( 'the function evaluates the MGF for `x` given a small range `b - a`', opts
103
103
t . equal ( y , expected [ i ] , 'x: ' + x [ i ] + ', a: ' + a [ i ] + ', b: ' + b [ i ] + ', c: ' + c [ i ] + ', y: ' + y + ', expected: ' + expected [ i ] ) ;
104
104
} else {
105
105
delta = abs ( y - expected [ i ] ) ;
106
-
107
- // FIXME: the tolerance for the C implementation is widely different from the JavaScript implementation, and it is not clear why.
108
- tol = 1.0e7 * EPS * abs ( expected [ i ] ) ;
106
+ tol = 4.0 * EPS * abs ( expected [ i ] ) ;
109
107
t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. a: ' + a [ i ] + '. b: ' + b [ i ] + '. c: ' + c [ i ] + '. y: ' + y + '. E: ' + expected [ i ] + '. Δ: ' + delta + '. tol: ' + tol + '.' ) ;
110
108
}
111
109
}
@@ -134,9 +132,7 @@ tape( 'the function evaluates the MGF for `x` given a medium range `b - a`', opt
134
132
t . equal ( y , expected [ i ] , 'x: ' + x [ i ] + ', a: ' + a [ i ] + ', b: ' + b [ i ] + ', c: ' + c [ i ] + ', y: ' + y + ', expected: ' + expected [ i ] ) ;
135
133
} else {
136
134
delta = abs ( y - expected [ i ] ) ;
137
-
138
- // FIXME: the tolerance for the C implementation is widely different from the JavaScript implementation, and it is not clear why.
139
- tol = 1.0e7 * EPS * abs ( expected [ i ] ) ;
135
+ tol = 4.0 * EPS * abs ( expected [ i ] ) ;
140
136
t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. a: ' + a [ i ] + '. b: ' + b [ i ] + '. c: ' + c [ i ] + '. y: ' + y + '. E: ' + expected [ i ] + '. Δ: ' + delta + '. tol: ' + tol + '.' ) ;
141
137
}
142
138
}
@@ -165,9 +161,7 @@ tape( 'the function evaluates the MGF for `x` given a large range `b - a`', opts
165
161
t . equal ( y , expected [ i ] , 'x: ' + x [ i ] + ', a: ' + a [ i ] + ', b: ' + b [ i ] + ', c: ' + c [ i ] + ', y: ' + y + ', expected: ' + expected [ i ] ) ;
166
162
} else {
167
163
delta = abs ( y - expected [ i ] ) ;
168
-
169
- // FIXME: the tolerance for the C implementation is widely different from the JavaScript implementation, and it is not clear why.
170
- tol = 1.0e7 * EPS * abs ( expected [ i ] ) ;
164
+ tol = 4.0 * EPS * abs ( expected [ i ] ) ;
171
165
t . ok ( delta <= tol , 'within tolerance. x: ' + x [ i ] + '. a: ' + a [ i ] + '. b: ' + b [ i ] + '. c: ' + c [ i ] + '. y: ' + y + '. E: ' + expected [ i ] + '. Δ: ' + delta + '. tol: ' + tol + '.' ) ;
172
166
}
173
167
}
0 commit comments