\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 -8.421989759483264 \cdot 10^{+63}:\\
\;\;\;\;\frac{t}{\sqrt{2 \cdot \left(\frac{1}{x + -1} + \frac{x}{x + -1}\right)} \cdot \frac{-t}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq -8.753971576230512 \cdot 10^{-164}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\frac{2}{\frac{1}{\frac{\ell}{\frac{x}{\ell}}}} + \sqrt{4 \cdot \left(\frac{t}{\frac{x}{t}} + \frac{t}{x} \cdot \frac{t}{x}\right) + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x \cdot x}{\ell}}\right)} \cdot \sqrt{4 \cdot \left(\frac{t}{x} \cdot \left(t + \frac{t}{x}\right)\right) + 2 \cdot \left(t \cdot t + \frac{\ell}{x} \cdot \frac{\ell}{x}\right)}}}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq -9.937225512484842 \cdot 10^{-284}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\frac{\frac{4}{x}}{x} + \left(2 + \frac{4}{x}\right)} \cdot \left(-t\right) - \sqrt{\frac{1}{\frac{\frac{4}{x}}{x} + \left(2 + \frac{4}{x}\right)}} \cdot \left(\frac{\ell}{x} \cdot \frac{\ell}{t} + \frac{\frac{\ell}{x} \cdot \frac{\ell}{x}}{t}\right)}{\sqrt{2}}}\\
\mathbf{elif}\;t \leq 1.094632978090295 \cdot 10^{-158}:\\
\;\;\;\;\frac{t}{2 \cdot \frac{t}{x \cdot {\left(\sqrt{2}\right)}^{2}} + \left(t + \frac{{\ell}^{2}}{t \cdot \left(x \cdot {\left(\sqrt{2}\right)}^{2}\right)}\right)}\\
\mathbf{elif}\;t \leq 3.1287133522825756 \cdot 10^{+147}:\\
\;\;\;\;\frac{t}{\frac{\sqrt{\frac{2}{\frac{1}{\frac{\ell}{\frac{x}{\ell}}}} + \sqrt{4 \cdot \left(\frac{t}{\frac{x}{t}} + \frac{t}{x} \cdot \frac{t}{x}\right) + 2 \cdot \left(t \cdot t + \frac{\ell}{\frac{x \cdot x}{\ell}}\right)} \cdot \sqrt{4 \cdot \left(\frac{t}{x} \cdot \left(t + \frac{t}{x}\right)\right) + 2 \cdot \left(t \cdot t + \frac{\ell}{x} \cdot \frac{\ell}{x}\right)}}}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{t}{x} + \left(t + \frac{\frac{\ell}{\frac{t}{\ell}}}{2 \cdot x}\right)}\\
\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 -8.421989759483264e+63)
(/
t
(*
(sqrt (* 2.0 (+ (/ 1.0 (+ x -1.0)) (/ x (+ x -1.0)))))
(/ (- t) (sqrt 2.0))))
(if (<= t -8.753971576230512e-164)
(/
t
(/
(sqrt
(+
(/ 2.0 (/ 1.0 (/ l (/ x l))))
(*
(sqrt
(+
(* 4.0 (+ (/ t (/ x t)) (* (/ t x) (/ t x))))
(* 2.0 (+ (* t t) (/ l (/ (* x x) l))))))
(sqrt
(+
(* 4.0 (* (/ t x) (+ t (/ t x))))
(* 2.0 (+ (* t t) (* (/ l x) (/ l x)))))))))
(sqrt 2.0)))
(if (<= t -9.937225512484842e-284)
(/
t
(/
(-
(* (sqrt (+ (/ (/ 4.0 x) x) (+ 2.0 (/ 4.0 x)))) (- t))
(*
(sqrt (/ 1.0 (+ (/ (/ 4.0 x) x) (+ 2.0 (/ 4.0 x)))))
(+ (* (/ l x) (/ l t)) (/ (* (/ l x) (/ l x)) t))))
(sqrt 2.0)))
(if (<= t 1.094632978090295e-158)
(/
t
(+
(* 2.0 (/ t (* x (pow (sqrt 2.0) 2.0))))
(+ t (/ (pow l 2.0) (* t (* x (pow (sqrt 2.0) 2.0)))))))
(if (<= t 3.1287133522825756e+147)
(/
t
(/
(sqrt
(+
(/ 2.0 (/ 1.0 (/ l (/ x l))))
(*
(sqrt
(+
(* 4.0 (+ (/ t (/ x t)) (* (/ t x) (/ t x))))
(* 2.0 (+ (* t t) (/ l (/ (* x x) l))))))
(sqrt
(+
(* 4.0 (* (/ t x) (+ t (/ t x))))
(* 2.0 (+ (* t t) (* (/ l x) (/ l x)))))))))
(sqrt 2.0)))
(/ t (+ (/ t x) (+ t (/ (/ l (/ t l)) (* 2.0 x)))))))))))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.421989759483264e+63) {
tmp = t / (sqrt(2.0 * ((1.0 / (x + -1.0)) + (x / (x + -1.0)))) * (-t / sqrt(2.0)));
} else if (t <= -8.753971576230512e-164) {
tmp = t / (sqrt((2.0 / (1.0 / (l / (x / l)))) + (sqrt((4.0 * ((t / (x / t)) + ((t / x) * (t / x)))) + (2.0 * ((t * t) + (l / ((x * x) / l))))) * sqrt((4.0 * ((t / x) * (t + (t / x)))) + (2.0 * ((t * t) + ((l / x) * (l / x))))))) / sqrt(2.0));
} else if (t <= -9.937225512484842e-284) {
tmp = t / (((sqrt(((4.0 / x) / x) + (2.0 + (4.0 / x))) * -t) - (sqrt(1.0 / (((4.0 / x) / x) + (2.0 + (4.0 / x)))) * (((l / x) * (l / t)) + (((l / x) * (l / x)) / t)))) / sqrt(2.0));
} else if (t <= 1.094632978090295e-158) {
tmp = t / ((2.0 * (t / (x * pow(sqrt(2.0), 2.0)))) + (t + (pow(l, 2.0) / (t * (x * pow(sqrt(2.0), 2.0))))));
} else if (t <= 3.1287133522825756e+147) {
tmp = t / (sqrt((2.0 / (1.0 / (l / (x / l)))) + (sqrt((4.0 * ((t / (x / t)) + ((t / x) * (t / x)))) + (2.0 * ((t * t) + (l / ((x * x) / l))))) * sqrt((4.0 * ((t / x) * (t + (t / x)))) + (2.0 * ((t * t) + ((l / x) * (l / x))))))) / sqrt(2.0));
} else {
tmp = t / ((t / x) + (t + ((l / (t / l)) / (2.0 * x))));
}
return tmp;
}



Bits error versus x



Bits error versus l



Bits error versus t
Results
if t < -8.421989759483264e63Initial program 46.5
Simplified46.5
Taylor expanded around -inf 3.6
Simplified3.6
if -8.421989759483264e63 < t < -8.7539715762305119e-164 or 1.094632978090295e-158 < t < 3.12871335228257563e147Initial program 26.1
Simplified26.1
Taylor expanded around inf 10.1
Simplified9.7
rmApplied clear-num_binary64_779.7
Simplified5.0
rmApplied add-sqr-sqrt_binary64_1005.0
Simplified5.0
if -8.7539715762305119e-164 < t < -9.93722551248484173e-284Initial program 62.4
Simplified62.4
Taylor expanded around inf 40.6
Simplified36.1
Taylor expanded around -inf 29.5
Simplified24.6
if -9.93722551248484173e-284 < t < 1.094632978090295e-158Initial program 62.5
Simplified62.5
Taylor expanded around inf 28.1
if 3.12871335228257563e147 < t Initial program 60.7
Simplified60.7
Taylor expanded around inf 14.6
Simplified4.3
Final simplification8.5
herbie shell --seed 2021176
(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)))))