\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}
t_1 := t \cdot \sqrt{2}\\
t_2 := t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}\\
\mathbf{if}\;t \leq -1.6738301690329368 \cdot 10^{+35}:\\
\;\;\;\;\frac{t_1}{-t_2}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \frac{t_1}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x \cdot x}, \mathsf{fma}\left(4, \frac{t \cdot t}{x}, \mathsf{fma}\left(2, \frac{\ell}{x} \cdot \frac{\ell}{x}, 2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)\right)\right)\right)}}\\
\mathbf{if}\;t \leq -3.675917657008533 \cdot 10^{-164}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -3.7962369205500905 \cdot 10^{-284}:\\
\;\;\;\;\begin{array}{l}
t_4 := 2 + \left(\frac{4}{x} + \frac{4}{x \cdot x}\right)\\
\frac{t_1}{-\left(\sqrt{\frac{1}{t_4}} \cdot \left(\frac{\ell \cdot \ell}{t \cdot x} + \frac{\ell \cdot \ell}{t \cdot \left(x \cdot x\right)}\right) + t \cdot \sqrt{t_4}\right)}
\end{array}\\
\mathbf{elif}\;t \leq 5.986192385954492 \cdot 10^{-176}:\\
\;\;\;\;\begin{array}{l}
t_5 := \sqrt{2} \cdot x\\
\frac{t_1}{\mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(2, \frac{t}{t_5}, \frac{\ell \cdot \ell}{t \cdot t_5}\right)\right)}
\end{array}\\
\mathbf{elif}\;t \leq 1.61647280189764 \cdot 10^{+54}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t_2}\\
\end{array}\\
\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
(let* ((t_1 (* t (sqrt 2.0)))
(t_2 (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
(if (<= t -1.6738301690329368e+35)
(/ t_1 (- t_2))
(let* ((t_3
(/
t_1
(sqrt
(fma
4.0
(/ (* t t) (* x x))
(fma
4.0
(/ (* t t) x)
(fma
2.0
(* (/ l x) (/ l x))
(* 2.0 (+ (* t t) (/ (* l l) x))))))))))
(if (<= t -3.675917657008533e-164)
t_3
(if (<= t -3.7962369205500905e-284)
(let* ((t_4 (+ 2.0 (+ (/ 4.0 x) (/ 4.0 (* x x))))))
(/
t_1
(-
(+
(*
(sqrt (/ 1.0 t_4))
(+ (/ (* l l) (* t x)) (/ (* l l) (* t (* x x)))))
(* t (sqrt t_4))))))
(if (<= t 5.986192385954492e-176)
(let* ((t_5 (* (sqrt 2.0) x)))
(/
t_1
(fma t (sqrt 2.0) (fma 2.0 (/ t t_5) (/ (* l l) (* t t_5))))))
(if (<= t 1.61647280189764e+54) t_3 (/ t_1 t_2)))))))))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 t_1 = t * sqrt(2.0);
double t_2 = t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0))));
double tmp;
if (t <= -1.6738301690329368e+35) {
tmp = t_1 / -t_2;
} else {
double t_3 = t_1 / sqrt(fma(4.0, ((t * t) / (x * x)), fma(4.0, ((t * t) / x), fma(2.0, ((l / x) * (l / x)), (2.0 * ((t * t) + ((l * l) / x)))))));
double tmp_1;
if (t <= -3.675917657008533e-164) {
tmp_1 = t_3;
} else if (t <= -3.7962369205500905e-284) {
double t_4 = 2.0 + ((4.0 / x) + (4.0 / (x * x)));
tmp_1 = t_1 / -((sqrt(1.0 / t_4) * (((l * l) / (t * x)) + ((l * l) / (t * (x * x))))) + (t * sqrt(t_4)));
} else if (t <= 5.986192385954492e-176) {
double t_5 = sqrt(2.0) * x;
tmp_1 = t_1 / fma(t, sqrt(2.0), fma(2.0, (t / t_5), ((l * l) / (t * t_5))));
} else if (t <= 1.61647280189764e+54) {
tmp_1 = t_3;
} else {
tmp_1 = t_1 / t_2;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus x



Bits error versus l



Bits error versus t
if t < -1.67383016903293681e35Initial program 43.5
Simplified43.5
Taylor expanded in t around -inf 4.5
Simplified4.5
if -1.67383016903293681e35 < t < -3.67591765700853301e-164 or 5.9861923859544919e-176 < t < 1.61647280189764e54Initial program 30.7
Simplified30.7
Taylor expanded in x around inf 10.8
Simplified10.8
Applied times-frac_binary6410.4
if -3.67591765700853301e-164 < t < -3.7962369205500905e-284Initial program 63.2
Simplified63.2
Taylor expanded in x around inf 38.0
Simplified38.0
Taylor expanded in t around -inf 27.7
Simplified27.7
if -3.7962369205500905e-284 < t < 5.9861923859544919e-176Initial program 62.8
Simplified62.8
Taylor expanded in x around inf 28.9
Simplified28.9
if 1.61647280189764e54 < t Initial program 45.6
Simplified45.6
Taylor expanded in t around inf 3.4
Simplified3.4
Final simplification10.3
herbie shell --seed 2022121
(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)))))