\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.2355922938525035 \cdot 10^{-14}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq 1.4103104255098325 \cdot 10^{-306}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x} + \left(4 \cdot \left(\frac{t \cdot t}{x} + \frac{t \cdot t}{x \cdot x}\right) + 2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x \cdot x}\right)\right)}}\\
\mathbf{elif}\;t \leq 4.969032022124603 \cdot 10^{-187}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{{\ell}^{2}}{t \cdot \left(\sqrt{2} \cdot x\right)}\right)}\\
\mathbf{elif}\;t \leq 7.170885642611102 \cdot 10^{-46}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{{\ell}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{x} + \left(4 \cdot \frac{{t}^{2}}{{x}^{2}} + \left(2 \cdot {t}^{2} + 2 \cdot \frac{{\ell}^{2}}{{x}^{2}}\right)\right)\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.2355922938525035e-14)
(/
(* t (sqrt 2.0))
(- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
(if (<= t 1.4103104255098325e-306)
(/
(* t (sqrt 2.0))
(sqrt
(+
(* 2.0 (/ (* l l) x))
(+
(* 4.0 (+ (/ (* t t) x) (/ (* t t) (* x x))))
(* 2.0 (+ (* t t) (/ (* l l) (* x x))))))))
(if (<= t 4.969032022124603e-187)
(/
(* t (sqrt 2.0))
(+
(* t (sqrt 2.0))
(+
(* 2.0 (/ t (* (sqrt 2.0) x)))
(/ (pow l 2.0) (* t (* (sqrt 2.0) x))))))
(if (<= t 7.170885642611102e-46)
(/
(* t (sqrt 2.0))
(sqrt
(+
(* 2.0 (/ (pow l 2.0) x))
(+
(* 4.0 (/ (pow t 2.0) x))
(+
(* 4.0 (/ (pow t 2.0) (pow x 2.0)))
(+ (* 2.0 (pow t 2.0)) (* 2.0 (/ (pow l 2.0) (pow x 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.2355922938525035e-14) {
tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
} else if (t <= 1.4103104255098325e-306) {
tmp = (t * sqrt(2.0)) / sqrt((2.0 * ((l * l) / x)) + ((4.0 * (((t * t) / x) + ((t * t) / (x * x)))) + (2.0 * ((t * t) + ((l * l) / (x * x))))));
} else if (t <= 4.969032022124603e-187) {
tmp = (t * sqrt(2.0)) / ((t * sqrt(2.0)) + ((2.0 * (t / (sqrt(2.0) * x))) + (pow(l, 2.0) / (t * (sqrt(2.0) * x)))));
} else if (t <= 7.170885642611102e-46) {
tmp = (t * sqrt(2.0)) / sqrt((2.0 * (pow(l, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / x)) + ((4.0 * (pow(t, 2.0) / pow(x, 2.0))) + ((2.0 * pow(t, 2.0)) + (2.0 * (pow(l, 2.0) / pow(x, 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.235592293852503e-14Initial program 40.7
Taylor expanded around -inf 4.9
Simplified4.9
if -1.235592293852503e-14 < t < 1.4103104255098325e-306Initial program 46.8
Taylor expanded around inf 23.2
Simplified23.3
if 1.4103104255098325e-306 < t < 4.9690320221246032e-187Initial program 62.7
Taylor expanded around inf 26.9
if 4.9690320221246032e-187 < t < 7.17088564261110234e-46Initial program 38.9
Taylor expanded around inf 14.6
if 7.17088564261110234e-46 < t Initial program 39.1
Taylor expanded around inf 6.0
Final simplification11.6
herbie shell --seed 2021024
(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)))))