\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.2351728058409963 \cdot 10^{-41}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -1.5844530436624705 \cdot 10^{-154}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\
\mathbf{elif}\;t \leq -4.222777320075483 \cdot 10^{-236}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\left(-t \cdot \sqrt{2 + \frac{4}{x}}\right) - \sqrt{\frac{1}{2 + \frac{4}{x}}} \cdot \frac{\ell \cdot \ell}{t \cdot x}}\\
\mathbf{elif}\;t \leq 1.673826578300523 \cdot 10^{-305}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\frac{1}{x}} \cdot \left(\sqrt{2} \cdot \ell\right)}\\
\mathbf{elif}\;t \leq 3.385594735519463 \cdot 10^{-144}:\\
\;\;\;\;\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 2.2674113060888642 \cdot 10^{+126}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{\left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\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.2351728058409963e-41)
(/
(* t (sqrt 2.0))
(- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
(if (<= t -1.5844530436624705e-154)
(/
(* t (sqrt 2.0))
(sqrt
(+ (* 2.0 (/ l (/ x l))) (+ (* 2.0 (* t t)) (* 4.0 (/ (* t t) x))))))
(if (<= t -4.222777320075483e-236)
(/
(* t (sqrt 2.0))
(-
(- (* t (sqrt (+ 2.0 (/ 4.0 x)))))
(* (sqrt (/ 1.0 (+ 2.0 (/ 4.0 x)))) (/ (* l l) (* t x)))))
(if (<= t 1.673826578300523e-305)
(/ (* t (sqrt 2.0)) (* (sqrt (/ 1.0 x)) (* (sqrt 2.0) l)))
(if (<= t 3.385594735519463e-144)
(/
(* 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 2.2674113060888642e+126)
(/
(* t (sqrt 2.0))
(sqrt
(+
(+ (* 2.0 (* t t)) (* 4.0 (/ (* t t) x)))
(* 2.0 (* l (/ l x))))))
(/
(* 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.2351728058409963e-41) {
tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
} else if (t <= -1.5844530436624705e-154) {
tmp = (t * sqrt(2.0)) / sqrt((2.0 * (l / (x / l))) + ((2.0 * (t * t)) + (4.0 * ((t * t) / x))));
} else if (t <= -4.222777320075483e-236) {
tmp = (t * sqrt(2.0)) / (-(t * sqrt(2.0 + (4.0 / x))) - (sqrt(1.0 / (2.0 + (4.0 / x))) * ((l * l) / (t * x))));
} else if (t <= 1.673826578300523e-305) {
tmp = (t * sqrt(2.0)) / (sqrt(1.0 / x) * (sqrt(2.0) * l));
} else if (t <= 3.385594735519463e-144) {
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 <= 2.2674113060888642e+126) {
tmp = (t * sqrt(2.0)) / sqrt(((2.0 * (t * t)) + (4.0 * ((t * t) / x))) + (2.0 * (l * (l / x))));
} 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.2351728058409963e-41Initial program 39.8
Taylor expanded around -inf 6.3
Simplified6.3
if -1.2351728058409963e-41 < t < -1.58445304366247051e-154Initial program 32.6
Taylor expanded around inf 10.0
Simplified10.0
rmApplied associate-/l*_binary64_234.3
if -1.58445304366247051e-154 < t < -4.2227773200754832e-236Initial program 61.6
Taylor expanded around inf 36.4
Simplified36.4
Taylor expanded around -inf 24.2
Simplified24.2
if -4.2227773200754832e-236 < t < 1.67382657830052298e-305Initial program 62.9
Taylor expanded around inf 29.8
Simplified29.8
Taylor expanded around inf 32.7
if 1.67382657830052298e-305 < t < 3.38559473551946292e-144Initial program 60.4
Taylor expanded around inf 24.1
if 3.38559473551946292e-144 < t < 2.26741130608886417e126Initial program 24.5
Taylor expanded around inf 10.7
Simplified10.7
rmApplied *-un-lft-identity_binary64_7810.7
Applied times-frac_binary64_845.1
Simplified5.1
if 2.26741130608886417e126 < t Initial program 55.1
Taylor expanded around inf 2.2
Final simplification9.2
herbie shell --seed 2021044
(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)))))