\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 -7.544252562526922 \cdot 10^{-07}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq -6.594436387197525 \cdot 10^{-150}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x} + \left(4 \cdot \frac{t \cdot t}{x} + \left(2 \cdot \frac{\ell \cdot \ell}{{x}^{3}} + \left(2 \cdot \left(t \cdot t + \frac{\ell \cdot \ell}{x \cdot x}\right) + 4 \cdot \left(\frac{t \cdot t}{{x}^{3}} + \sqrt[3]{\frac{{t}^{6}}{{x}^{6}}}\right)\right)\right)\right)}}\\
\mathbf{elif}\;t \leq -3.167662387401811 \cdot 10^{-308}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-\left(\sqrt{\frac{1}{2 + \left(4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}} \cdot \frac{{\ell}^{2}}{t \cdot {x}^{2}} + \left(\sqrt{\frac{1}{2 + \left(4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}} \cdot \frac{{\ell}^{2}}{t \cdot x} + \left(\sqrt{\frac{1}{2 + \left(4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}} \cdot \frac{{\ell}^{2}}{t \cdot {x}^{3}} + t \cdot \sqrt{4 \cdot \frac{1}{{x}^{2}} + \left(4 \cdot \frac{1}{x} + \left(2 + 4 \cdot \frac{1}{{x}^{3}}\right)\right)}\right)\right)\right)}\\
\mathbf{elif}\;t \leq 1.903811773111177 \cdot 10^{-183}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{2} + \left(2 \cdot \frac{t}{\sqrt{2} \cdot x} + \frac{\ell \cdot \ell}{t \cdot \left(\sqrt{2} \cdot x\right)}\right)}\\
\mathbf{elif}\;t \leq 2.151441207155239 \cdot 10^{+61}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x} + \left(4 \cdot \frac{t \cdot t}{x} + 2 \cdot \left(t \cdot t\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{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 -7.544252562526922e-07)
(/
(* t (sqrt 2.0))
(- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
(if (<= t -6.594436387197525e-150)
(/
(* t (sqrt 2.0))
(sqrt
(+
(* 2.0 (/ (* l l) x))
(+
(* 4.0 (/ (* t t) x))
(+
(* 2.0 (/ (* l l) (pow x 3.0)))
(+
(* 2.0 (+ (* t t) (/ (* l l) (* x x))))
(*
4.0
(+
(/ (* t t) (pow x 3.0))
(cbrt (/ (pow t 6.0) (pow x 6.0)))))))))))
(if (<= t -3.167662387401811e-308)
(/
(* t (sqrt 2.0))
(-
(+
(*
(sqrt
(/
1.0
(+
2.0
(+
(* 4.0 (/ 1.0 (pow x 2.0)))
(+ (* 4.0 (/ 1.0 x)) (* 4.0 (/ 1.0 (pow x 3.0))))))))
(/ (pow l 2.0) (* t (pow x 2.0))))
(+
(*
(sqrt
(/
1.0
(+
2.0
(+
(* 4.0 (/ 1.0 (pow x 2.0)))
(+ (* 4.0 (/ 1.0 x)) (* 4.0 (/ 1.0 (pow x 3.0))))))))
(/ (pow l 2.0) (* t x)))
(+
(*
(sqrt
(/
1.0
(+
2.0
(+
(* 4.0 (/ 1.0 (pow x 2.0)))
(+ (* 4.0 (/ 1.0 x)) (* 4.0 (/ 1.0 (pow x 3.0))))))))
(/ (pow l 2.0) (* t (pow x 3.0))))
(*
t
(sqrt
(+
(* 4.0 (/ 1.0 (pow x 2.0)))
(+
(* 4.0 (/ 1.0 x))
(+ 2.0 (* 4.0 (/ 1.0 (pow x 3.0)))))))))))))
(if (<= t 1.903811773111177e-183)
(/
(* t (sqrt 2.0))
(+
(* t (sqrt 2.0))
(+
(* 2.0 (/ t (* (sqrt 2.0) x)))
(/ (* l l) (* t (* (sqrt 2.0) x))))))
(if (<= t 2.151441207155239e+61)
(/
(* t (sqrt 2.0))
(sqrt
(+
(* 2.0 (/ (* l l) x))
(+ (* 4.0 (/ (* t t) x)) (* 2.0 (* t t))))))
(/
(* t (sqrt 2.0))
(* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- 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 <= -7.544252562526922e-07) {
tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
} else if (t <= -6.594436387197525e-150) {
tmp = (t * sqrt(2.0)) / sqrt((2.0 * ((l * l) / x)) + ((4.0 * ((t * t) / x)) + ((2.0 * ((l * l) / pow(x, 3.0))) + ((2.0 * ((t * t) + ((l * l) / (x * x)))) + (4.0 * (((t * t) / pow(x, 3.0)) + cbrt(pow(t, 6.0) / pow(x, 6.0))))))));
} else if (t <= -3.167662387401811e-308) {
tmp = (t * sqrt(2.0)) / -((sqrt(1.0 / (2.0 + ((4.0 * (1.0 / pow(x, 2.0))) + ((4.0 * (1.0 / x)) + (4.0 * (1.0 / pow(x, 3.0))))))) * (pow(l, 2.0) / (t * pow(x, 2.0)))) + ((sqrt(1.0 / (2.0 + ((4.0 * (1.0 / pow(x, 2.0))) + ((4.0 * (1.0 / x)) + (4.0 * (1.0 / pow(x, 3.0))))))) * (pow(l, 2.0) / (t * x))) + ((sqrt(1.0 / (2.0 + ((4.0 * (1.0 / pow(x, 2.0))) + ((4.0 * (1.0 / x)) + (4.0 * (1.0 / pow(x, 3.0))))))) * (pow(l, 2.0) / (t * pow(x, 3.0)))) + (t * sqrt((4.0 * (1.0 / pow(x, 2.0))) + ((4.0 * (1.0 / x)) + (2.0 + (4.0 * (1.0 / pow(x, 3.0))))))))));
} else if (t <= 1.903811773111177e-183) {
tmp = (t * sqrt(2.0)) / ((t * sqrt(2.0)) + ((2.0 * (t / (sqrt(2.0) * x))) + ((l * l) / (t * (sqrt(2.0) * x)))));
} else if (t <= 2.151441207155239e+61) {
tmp = (t * sqrt(2.0)) / sqrt((2.0 * ((l * l) / x)) + ((4.0 * ((t * t) / x)) + (2.0 * (t * t))));
} else {
tmp = (t * sqrt(2.0)) / (t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
}
return tmp;
}



Bits error versus x



Bits error versus l



Bits error versus t
Results
if t < -7.5442525625269223e-7Initial program 41.9
Taylor expanded around -inf 4.8
Simplified4.8
if -7.5442525625269223e-7 < t < -6.59443638719752451e-150Initial program 32.5
Taylor expanded around inf 10.4
Simplified10.4
rmApplied add-cbrt-cube_binary64_11410.6
Simplified10.6
if -6.59443638719752451e-150 < t < -3.1676623874018108e-308Initial program 61.4
Taylor expanded around inf 37.9
Simplified37.9
Taylor expanded around -inf 32.1
if -3.1676623874018108e-308 < t < 1.9038117731111768e-183Initial program 62.8
Taylor expanded around inf 26.3
Simplified26.3
if 1.9038117731111768e-183 < t < 2.1514412071552391e61Initial program 31.0
Taylor expanded around inf 12.8
Simplified12.8
if 2.1514412071552391e61 < t Initial program 45.8
Taylor expanded around inf 3.4
Simplified3.4
Final simplification11.0
herbie shell --seed 2021079
(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)))))