\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}
t_1 := \frac{x}{-1 + x}\\
t_2 := t \cdot \sqrt{2}\\
\mathbf{if}\;t \leq -6.790049380025751 \cdot 10^{-65}:\\
\;\;\;\;\frac{t_2}{-t \cdot \sqrt{2 \cdot \frac{1}{-1 + x} + 2 \cdot t_1}}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \frac{t_2}{\sqrt{\mathsf{fma}\left(2, \frac{\ell \cdot \ell}{x} + t \cdot t, 4 \cdot \frac{t \cdot t}{x}\right)}}\\
\mathbf{if}\;t \leq 1.6105793316811791 \cdot 10^{-264}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 3.3813144302125017 \cdot 10^{-122}:\\
\;\;\;\;\begin{array}{l}
t_4 := \sqrt{2} \cdot x\\
\frac{t_2}{\mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(2, \frac{t}{t_4}, \frac{\ell \cdot \ell}{t \cdot t_4}\right)\right)}
\end{array}\\
\mathbf{elif}\;t \leq 4.810710790881342 \cdot 10^{-47}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t_2}{t \cdot \sqrt{\mathsf{fma}\left(2, t_1, \frac{2}{-1 + x}\right)}}\\
\end{array}\\
\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
(let* ((t_1 (/ x (+ -1.0 x))) (t_2 (* t (sqrt 2.0))))
(if (<= t -6.790049380025751e-65)
(/ t_2 (- (* t (sqrt (+ (* 2.0 (/ 1.0 (+ -1.0 x))) (* 2.0 t_1))))))
(let* ((t_3
(/
t_2
(sqrt
(fma 2.0 (+ (/ (* l l) x) (* t t)) (* 4.0 (/ (* t t) x)))))))
(if (<= t 1.6105793316811791e-264)
t_3
(if (<= t 3.3813144302125017e-122)
(let* ((t_4 (* (sqrt 2.0) x)))
(/
t_2
(fma t (sqrt 2.0) (fma 2.0 (/ t t_4) (/ (* l l) (* t t_4))))))
(if (<= t 4.810710790881342e-47)
t_3
(/ t_2 (* t (sqrt (fma 2.0 t_1 (/ 2.0 (+ -1.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 t_1 = x / (-1.0 + x);
double t_2 = t * sqrt(2.0);
double tmp;
if (t <= -6.790049380025751e-65) {
tmp = t_2 / -(t * sqrt((2.0 * (1.0 / (-1.0 + x))) + (2.0 * t_1)));
} else {
double t_3 = t_2 / sqrt(fma(2.0, (((l * l) / x) + (t * t)), (4.0 * ((t * t) / x))));
double tmp_1;
if (t <= 1.6105793316811791e-264) {
tmp_1 = t_3;
} else if (t <= 3.3813144302125017e-122) {
double t_4 = sqrt(2.0) * x;
tmp_1 = t_2 / fma(t, sqrt(2.0), fma(2.0, (t / t_4), ((l * l) / (t * t_4))));
} else if (t <= 4.810710790881342e-47) {
tmp_1 = t_3;
} else {
tmp_1 = t_2 / (t * sqrt(fma(2.0, t_1, (2.0 / (-1.0 + x)))));
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus x



Bits error versus l



Bits error versus t
if t < -6.79004938002575122e-65Initial program 38.5
Simplified38.5
Taylor expanded in t around -inf 5.9
if -6.79004938002575122e-65 < t < 1.6105793316811791e-264 or 3.38131443021250172e-122 < t < 4.8107107908813422e-47Initial program 47.5
Simplified47.5
Taylor expanded in x around inf 20.2
Simplified20.2
if 1.6105793316811791e-264 < t < 3.38131443021250172e-122Initial program 55.1
Simplified55.1
Taylor expanded in x around inf 22.6
Simplified22.6
if 4.8107107908813422e-47 < t Initial program 39.8
Simplified39.8
Taylor expanded in t around inf 6.2
Simplified6.2
Final simplification11.1
herbie shell --seed 2021352
(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)))))