double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l));
}
double code(double x, double l, double t) {
double tmp;
if (t <= -8.77596588101209e+129) {
tmp = (t * sqrt(2.0)) / ((2.0 * (t / (2.0 * (x * (sqrt(2.0) * x))))) - ((t * sqrt(2.0)) + ((t / sqrt(2.0)) * ((2.0 / x) + (2.0 / (x * x))))));
} else if ((t <= 3.4253329703721362e-276) || (!(t <= 1.951729093596874e-167) && (t <= 2.2489208127391157e+26))) {
tmp = (t * sqrt(2.0)) / sqrt((4.0 * ((t * t) / x)) + (2.0 * ((t * t) + ((l / (cbrt(x) * cbrt(x))) * (l / cbrt(x))))));
} else {
tmp = (t * sqrt(2.0)) / ((t * sqrt(2.0)) + (((t / (x * x)) * ((2.0 / sqrt(2.0)) - (2.0 / (2.0 * sqrt(2.0))))) + (2.0 * (t / (sqrt(2.0) * x)))));
}
return tmp;
}



Bits error versus x



Bits error versus l



Bits error versus t
Results
if t < -8.7759658810120904e129Initial program 56.2
Taylor expanded around -inf 2.7
Simplified2.7
if -8.7759658810120904e129 < t < 3.42533297037213622e-276 or 1.95172909359687396e-167 < t < 2.24892081273911571e26Initial program 35.8
Taylor expanded around inf 15.3
Simplified15.3
rmApplied add-cube-cbrt15.3
Applied times-frac11.0
if 3.42533297037213622e-276 < t < 1.95172909359687396e-167 or 2.24892081273911571e26 < t Initial program 47.1
Taylor expanded around inf 11.7
Simplified11.7
Final simplification9.7
herbie shell --seed 2020338
(FPCore (x l t)
:name "Toniolo and Linder, Equation (7)"
:precision binary64
(/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))