\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 -3.5574732430533503 \cdot 10^{-258}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{-t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\mathbf{elif}\;t \leq 2.1538944959529218 \cdot 10^{+71}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\sqrt{2 \cdot \frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t\right) + 4 \cdot \frac{t \cdot t}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{t \cdot \sqrt{\frac{4}{x \cdot x} + \left(\frac{4}{x} + \left(2 + \frac{4}{{x}^{3}}\right)\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 -3.5574732430533503e-258)
(/
(* t (sqrt 2.0))
(- (* t (sqrt (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0))))))))
(if (<= t 2.1538944959529218e+71)
(/
(* t (sqrt 2.0))
(sqrt
(+ (* 2.0 (/ (* l l) x)) (+ (* 2.0 (* t t)) (* 4.0 (/ (* t t) x))))))
(/
(* t (sqrt 2.0))
(*
t
(sqrt
(+ (/ 4.0 (* x x)) (+ (/ 4.0 x) (+ 2.0 (/ 4.0 (pow x 3.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 <= -3.5574732430533503e-258) {
tmp = (t * sqrt(2.0)) / -(t * sqrt((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)))));
} else if (t <= 2.1538944959529218e+71) {
tmp = (t * sqrt(2.0)) / sqrt((2.0 * ((l * l) / x)) + ((2.0 * (t * t)) + (4.0 * ((t * t) / x))));
} else {
tmp = (t * sqrt(2.0)) / (t * sqrt((4.0 / (x * x)) + ((4.0 / x) + (2.0 + (4.0 / pow(x, 3.0))))));
}
return tmp;
}



Bits error versus x



Bits error versus l



Bits error versus t
Results
if t < -3.5574732430533503e-258Initial program 41.1
Taylor expanded around -inf 12.3
Simplified12.3
if -3.5574732430533503e-258 < t < 2.1538944959529218e71Initial program 42.5
Taylor expanded around inf 19.3
Simplified19.3
if 2.1538944959529218e71 < t Initial program 47.1
Taylor expanded around inf 46.6
Simplified46.6
Taylor expanded around inf 3.8
Simplified3.8
Final simplification12.6
herbie shell --seed 2021147
(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)))))