\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 -3.7115896234152697 \cdot 10^{+43}:\\
\;\;\;\;\frac{t_1}{-t_2}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := 2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)\\
t_4 := \frac{t \cdot t}{x}\\
\mathbf{if}\;t \leq -2.391212643882269 \cdot 10^{-84}:\\
\;\;\;\;\frac{t_1}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x \cdot x}, \mathsf{fma}\left(4, t_4, \mathsf{fma}\left(2, \frac{\ell \cdot \ell}{x \cdot x}, t_3\right)\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_5 := 2 + \left(\frac{4}{x} + \frac{4}{x \cdot x}\right)\\
t_6 := -t \cdot \sqrt{t_5}\\
\mathbf{if}\;t \leq -1.8440714154310572 \cdot 10^{-171}:\\
\;\;\;\;\frac{t_1}{t_6}\\
\mathbf{elif}\;t \leq -1.1250698168828552 \cdot 10^{-229}:\\
\;\;\;\;\begin{array}{l}
t_7 := \frac{2}{x} + \frac{2}{x \cdot x}\\
t_8 := \sqrt{\frac{1}{t_7}}\\
\frac{t_1}{\mathsf{fma}\left(2, \frac{t \cdot t}{\left(x \cdot x\right) \cdot \ell} \cdot t_8, \mathsf{fma}\left(\ell, \sqrt{t_7}, t_8 \cdot \left(2 \cdot \frac{t \cdot t}{x \cdot \ell} + \frac{t \cdot t}{\ell}\right)\right)\right)}
\end{array}\\
\mathbf{elif}\;t \leq -5.528925291641549 \cdot 10^{-256}:\\
\;\;\;\;\frac{t_1}{t_6 - \sqrt{\frac{1}{t_5}} \cdot \left(\frac{\ell \cdot \ell}{t \cdot x} + \frac{\ell \cdot \ell}{t \cdot \left(x \cdot x\right)}\right)}\\
\mathbf{elif}\;t \leq 551901859535.9883:\\
\;\;\;\;\frac{t_1}{\sqrt{\mathsf{fma}\left(4, t_4, t_3\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t_2}\\
\end{array}\\
\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 -3.7115896234152697e+43)
(/ t_1 (- t_2))
(let* ((t_3 (* 2.0 (+ (* t t) (/ (* l l) x)))) (t_4 (/ (* t t) x)))
(if (<= t -2.391212643882269e-84)
(/
t_1
(sqrt
(fma
4.0
(/ (* t t) (* x x))
(fma 4.0 t_4 (fma 2.0 (/ (* l l) (* x x)) t_3)))))
(let* ((t_5 (+ 2.0 (+ (/ 4.0 x) (/ 4.0 (* x x)))))
(t_6 (- (* t (sqrt t_5)))))
(if (<= t -1.8440714154310572e-171)
(/ t_1 t_6)
(if (<= t -1.1250698168828552e-229)
(let* ((t_7 (+ (/ 2.0 x) (/ 2.0 (* x x))))
(t_8 (sqrt (/ 1.0 t_7))))
(/
t_1
(fma
2.0
(* (/ (* t t) (* (* x x) l)) t_8)
(fma
l
(sqrt t_7)
(* t_8 (+ (* 2.0 (/ (* t t) (* x l))) (/ (* t t) l)))))))
(if (<= t -5.528925291641549e-256)
(/
t_1
(-
t_6
(*
(sqrt (/ 1.0 t_5))
(+ (/ (* l l) (* t x)) (/ (* l l) (* t (* x x)))))))
(if (<= t 551901859535.9883)
(/ t_1 (sqrt (fma 4.0 t_4 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 <= -3.7115896234152697e+43) {
tmp = t_1 / -t_2;
} else {
double t_3 = 2.0 * ((t * t) + ((l * l) / x));
double t_4 = (t * t) / x;
double tmp_1;
if (t <= -2.391212643882269e-84) {
tmp_1 = t_1 / sqrt(fma(4.0, ((t * t) / (x * x)), fma(4.0, t_4, fma(2.0, ((l * l) / (x * x)), t_3))));
} else {
double t_5 = 2.0 + ((4.0 / x) + (4.0 / (x * x)));
double t_6 = -(t * sqrt(t_5));
double tmp_2;
if (t <= -1.8440714154310572e-171) {
tmp_2 = t_1 / t_6;
} else if (t <= -1.1250698168828552e-229) {
double t_7 = (2.0 / x) + (2.0 / (x * x));
double t_8 = sqrt(1.0 / t_7);
tmp_2 = t_1 / fma(2.0, (((t * t) / ((x * x) * l)) * t_8), fma(l, sqrt(t_7), (t_8 * ((2.0 * ((t * t) / (x * l))) + ((t * t) / l)))));
} else if (t <= -5.528925291641549e-256) {
tmp_2 = t_1 / (t_6 - (sqrt(1.0 / t_5) * (((l * l) / (t * x)) + ((l * l) / (t * (x * x))))));
} else if (t <= 551901859535.9883) {
tmp_2 = t_1 / sqrt(fma(4.0, t_4, t_3));
} else {
tmp_2 = t_1 / t_2;
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus x



Bits error versus l



Bits error versus t
if t < -3.71158962341526972e43Initial program 43.9
Simplified43.9
Taylor expanded in t around -inf 3.7
Simplified3.7
if -3.71158962341526972e43 < t < -2.39121264388226897e-84Initial program 26.4
Simplified26.4
Taylor expanded in x around inf 11.5
Simplified11.5
if -2.39121264388226897e-84 < t < -1.8440714154310572e-171Initial program 35.6
Simplified35.6
Taylor expanded in x around inf 13.7
Simplified13.7
Taylor expanded in t around -inf 23.9
Simplified23.9
if -1.8440714154310572e-171 < t < -1.1250698168828552e-229Initial program 63.0
Simplified63.0
Taylor expanded in x around inf 39.5
Simplified39.5
Taylor expanded in l around inf 37.8
Simplified37.8
if -1.1250698168828552e-229 < t < -5.52892529164154855e-256Initial program 64.0
Simplified64.0
Taylor expanded in x around inf 36.2
Simplified36.2
Taylor expanded in t around -inf 30.7
Simplified30.7
if -5.52892529164154855e-256 < t < 551901859535.9883Initial program 46.5
Simplified46.5
Taylor expanded in x around inf 21.6
Simplified21.6
if 551901859535.9883 < t Initial program 42.1
Simplified42.1
Taylor expanded in t around inf 4.6
Simplified4.6
Final simplification12.3
herbie shell --seed 2022068
(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)))))