\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 := t \cdot \sqrt{2}\\
t_2 := t \cdot \sqrt{\mathsf{fma}\left(2, \frac{x}{x - 1}, \frac{2}{x - 1}\right)}\\
\mathbf{if}\;t \leq -1.0255551743284268 \cdot 10^{+42}:\\
\;\;\;\;\frac{t_1}{-t_2}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \frac{t_1}{\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 -4.687014137306293 \cdot 10^{-169}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -2.9016161173507863 \cdot 10^{-280}:\\
\;\;\;\;\begin{array}{l}
t_4 := 2 + \left(\frac{4}{x} + \left(\frac{4}{{x}^{3}} + \frac{4}{x \cdot x}\right)\right)\\
t_5 := \sqrt{\frac{1}{t_4}}\\
\frac{t_1}{-\mathsf{fma}\left(\frac{\ell \cdot \ell}{t \cdot \left(x \cdot x\right)}, t_5, \mathsf{fma}\left(t, \sqrt{t_4}, t_5 \cdot \left(\frac{\ell \cdot \ell}{t \cdot {x}^{3}} + \frac{\ell \cdot \ell}{t \cdot x}\right)\right)\right)}
\end{array}\\
\mathbf{elif}\;t \leq 3.1941009868290845 \cdot 10^{+58}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t_2}\\
\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 (* t (sqrt 2.0)))
(t_2 (* t (sqrt (fma 2.0 (/ x (- x 1.0)) (/ 2.0 (- x 1.0)))))))
(if (<= t -1.0255551743284268e+42)
(/ t_1 (- t_2))
(let* ((t_3
(/
t_1
(sqrt
(fma 2.0 (+ (/ (* l l) x) (* t t)) (* 4.0 (/ (* t t) x)))))))
(if (<= t -4.687014137306293e-169)
t_3
(if (<= t -2.9016161173507863e-280)
(let* ((t_4
(+
2.0
(+ (/ 4.0 x) (+ (/ 4.0 (pow x 3.0)) (/ 4.0 (* x x))))))
(t_5 (sqrt (/ 1.0 t_4))))
(/
t_1
(-
(fma
(/ (* l l) (* t (* x x)))
t_5
(fma
t
(sqrt t_4)
(*
t_5
(+ (/ (* l l) (* t (pow x 3.0))) (/ (* l l) (* t x)))))))))
(if (<= t 3.1941009868290845e+58) t_3 (/ t_1 t_2))))))))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 = t * sqrt(2.0);
double t_2 = t * sqrt(fma(2.0, (x / (x - 1.0)), (2.0 / (x - 1.0))));
double tmp;
if (t <= -1.0255551743284268e+42) {
tmp = t_1 / -t_2;
} else {
double t_3 = t_1 / sqrt(fma(2.0, (((l * l) / x) + (t * t)), (4.0 * ((t * t) / x))));
double tmp_1;
if (t <= -4.687014137306293e-169) {
tmp_1 = t_3;
} else if (t <= -2.9016161173507863e-280) {
double t_4 = 2.0 + ((4.0 / x) + ((4.0 / pow(x, 3.0)) + (4.0 / (x * x))));
double t_5 = sqrt(1.0 / t_4);
tmp_1 = t_1 / -fma(((l * l) / (t * (x * x))), t_5, fma(t, sqrt(t_4), (t_5 * (((l * l) / (t * pow(x, 3.0))) + ((l * l) / (t * x))))));
} else if (t <= 3.1941009868290845e+58) {
tmp_1 = t_3;
} else {
tmp_1 = t_1 / t_2;
}
tmp = tmp_1;
}
return tmp;
}



Bits error versus x



Bits error versus l



Bits error versus t
if t < -1.02555517432842677e42Initial program 43.6
Simplified43.6
Taylor expanded around -inf 4.1
Simplified4.1
if -1.02555517432842677e42 < t < -4.6870141373062929e-169 or -2.90161611735078629e-280 < t < 3.19410098682908453e58Initial program 38.1
Simplified38.1
Taylor expanded around inf 16.0
Simplified16.0
if -4.6870141373062929e-169 < t < -2.90161611735078629e-280Initial program 63.0
Simplified63.0
Taylor expanded around inf 41.7
Simplified41.7
Taylor expanded around -inf 29.0
Simplified29.0
if 3.19410098682908453e58 < t Initial program 45.3
Simplified45.3
Taylor expanded around inf 2.9
Simplified2.9
Final simplification10.9
herbie shell --seed 2021211
(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)))))