\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\begin{array}{l}
\mathbf{if}\;t \leq -1.43838900620848 \cdot 10^{-27}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -3.702260431372761 \cdot 10^{-236}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)}}\\
\mathbf{elif}\;t \leq 5.463357865450902 \cdot 10^{-189}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{2}{x}}}\\
\mathbf{elif}\;t \leq 1.2822754990186077 \cdot 10^{+34}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2 \cdot \frac{x}{x - 1} + 2 \cdot \frac{1}{x - 1}}}\\
\end{array}(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
(FPCore (x l t)
:precision binary64
(if (<= t -1.43838900620848e-27)
(/
(* t (sqrt 2.0))
(- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
(if (<= t -3.702260431372761e-236)
(/
(* t (sqrt 2.0))
(sqrt
(+
(* 2.0 (/ (pow l 2.0) x))
(+ (* 4.0 (/ (pow t 2.0) x)) (* 2.0 (pow t 2.0))))))
(if (<= t 5.463357865450902e-189)
(/ (* t (sqrt 2.0)) (* l (sqrt (+ (/ 2.0 (* x x)) (/ 2.0 x)))))
(if (<= t 1.2822754990186077e+34)
(/
(* t (sqrt 2.0))
(sqrt
(+
(* 2.0 (/ (pow l 2.0) x))
(+ (* 4.0 (/ (pow t 2.0) x)) (* 2.0 (pow t 2.0))))))
(/
(* t (sqrt 2.0))
(*
t
(sqrt (+ (* 2.0 (/ x (- x 1.0))) (* 2.0 (/ 1.0 (- x 1.0))))))))))))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 <= -1.43838900620848e-27) {
tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
} else if (t <= -3.702260431372761e-236) {
tmp = (t * sqrt(2.0)) / sqrt((2.0 * (pow(l, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / x)) + (2.0 * pow(t, 2.0))));
} else if (t <= 5.463357865450902e-189) {
tmp = (t * sqrt(2.0)) / (l * sqrt((2.0 / (x * x)) + (2.0 / x)));
} else if (t <= 1.2822754990186077e+34) {
tmp = (t * sqrt(2.0)) / sqrt((2.0 * (pow(l, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / x)) + (2.0 * pow(t, 2.0))));
} else {
tmp = (t * sqrt(2.0)) / (t * sqrt((2.0 * (x / (x - 1.0))) + (2.0 * (1.0 / (x - 1.0)))));
}
return tmp;
}



Bits error versus x



Bits error versus l



Bits error versus t
Results
if t < -1.43838900620848004e-27Initial program 40.5
Taylor expanded around -inf 5.8
Simplified5.8
if -1.43838900620848004e-27 < t < -3.70226043137276091e-236 or 5.4633578654509018e-189 < t < 1.28227549901860767e34Initial program 37.2
Taylor expanded around inf 15.6
if -3.70226043137276091e-236 < t < 5.4633578654509018e-189Initial program 62.9
Taylor expanded around inf 36.9
Simplified36.9
Taylor expanded around inf 35.8
Simplified35.8
if 1.28227549901860767e34 < t Initial program 43.6
Taylor expanded around inf 4.0
Final simplification12.0
herbie shell --seed 2021098
(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)))))