(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 (pow (/ t x) 2.0))
(t_3
(fma
4.0
(* t (/ t x))
(* 2.0 (+ (pow (/ l x) 2.0) (fma t t (* l (/ l x))))))))
(if (<= t -9.637691388536258e+147)
(/ t_1 (- (* t (sqrt (+ 2.0 (+ (/ 4.0 x) (/ 4.0 (* x x))))))))
(if (<= t 2.1563523231601638e-303)
(/ t_1 (pow (pow (fma 4.0 t_2 t_3) 0.25) 2.0))
(if (<= t 2.7248008057053303e-191)
(/
t_1
(+ t_1 (+ (* 0.5 (/ (* (sqrt 2.0) (pow l 2.0)) (* t x))) (/ t_1 x))))
(if (<= t 1.0565592753655027e+27)
(/ t_1 (pow (pow (fma 4.0 t_2 (pow (sqrt t_3) 2.0)) 0.25) 2.0))
(/
t_1
(* 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 t_1 = t * sqrt(2.0);
double t_2 = pow((t / x), 2.0);
double t_3 = fma(4.0, (t * (t / x)), (2.0 * (pow((l / x), 2.0) + fma(t, t, (l * (l / x))))));
double tmp;
if (t <= -9.637691388536258e+147) {
tmp = t_1 / -(t * sqrt((2.0 + ((4.0 / x) + (4.0 / (x * x))))));
} else if (t <= 2.1563523231601638e-303) {
tmp = t_1 / pow(pow(fma(4.0, t_2, t_3), 0.25), 2.0);
} else if (t <= 2.7248008057053303e-191) {
tmp = t_1 / (t_1 + ((0.5 * ((sqrt(2.0) * pow(l, 2.0)) / (t * x))) + (t_1 / x)));
} else if (t <= 1.0565592753655027e+27) {
tmp = t_1 / pow(pow(fma(4.0, t_2, pow(sqrt(t_3), 2.0)), 0.25), 2.0);
} else {
tmp = t_1 / (t * sqrt(((2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0))))));
}
return tmp;
}
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function code(x, l, t) t_1 = Float64(t * sqrt(2.0)) t_2 = Float64(t / x) ^ 2.0 t_3 = fma(4.0, Float64(t * Float64(t / x)), Float64(2.0 * Float64((Float64(l / x) ^ 2.0) + fma(t, t, Float64(l * Float64(l / x)))))) tmp = 0.0 if (t <= -9.637691388536258e+147) tmp = Float64(t_1 / Float64(-Float64(t * sqrt(Float64(2.0 + Float64(Float64(4.0 / x) + Float64(4.0 / Float64(x * x)))))))); elseif (t <= 2.1563523231601638e-303) tmp = Float64(t_1 / ((fma(4.0, t_2, t_3) ^ 0.25) ^ 2.0)); elseif (t <= 2.7248008057053303e-191) tmp = Float64(t_1 / Float64(t_1 + Float64(Float64(0.5 * Float64(Float64(sqrt(2.0) * (l ^ 2.0)) / Float64(t * x))) + Float64(t_1 / x)))); elseif (t <= 1.0565592753655027e+27) tmp = Float64(t_1 / ((fma(4.0, t_2, (sqrt(t_3) ^ 2.0)) ^ 0.25) ^ 2.0)); else tmp = Float64(t_1 / Float64(t * sqrt(Float64(Float64(2.0 / Float64(x - 1.0)) + Float64(2.0 * Float64(x / Float64(x - 1.0))))))); end return tmp end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(t / x), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(4.0 * N[(t * N[(t / x), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[Power[N[(l / x), $MachinePrecision], 2.0], $MachinePrecision] + N[(t * t + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.637691388536258e+147], N[(t$95$1 / (-N[(t * N[Sqrt[N[(2.0 + N[(N[(4.0 / x), $MachinePrecision] + N[(4.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[t, 2.1563523231601638e-303], N[(t$95$1 / N[Power[N[Power[N[(4.0 * t$95$2 + t$95$3), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7248008057053303e-191], N[(t$95$1 / N[(t$95$1 + N[(N[(0.5 * N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.0565592753655027e+27], N[(t$95$1 / N[Power[N[Power[N[(4.0 * t$95$2 + N[Power[N[Sqrt[t$95$3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(t * N[Sqrt[N[(N[(2.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\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 := {\left(\frac{t}{x}\right)}^{2}\\
t_3 := \mathsf{fma}\left(4, t \cdot \frac{t}{x}, 2 \cdot \left({\left(\frac{\ell}{x}\right)}^{2} + \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)\right)\\
\mathbf{if}\;t \leq -9.637691388536258 \cdot 10^{+147}:\\
\;\;\;\;\frac{t_1}{-t \cdot \sqrt{2 + \left(\frac{4}{x} + \frac{4}{x \cdot x}\right)}}\\
\mathbf{elif}\;t \leq 2.1563523231601638 \cdot 10^{-303}:\\
\;\;\;\;\frac{t_1}{{\left({\left(\mathsf{fma}\left(4, t_2, t_3\right)\right)}^{0.25}\right)}^{2}}\\
\mathbf{elif}\;t \leq 2.7248008057053303 \cdot 10^{-191}:\\
\;\;\;\;\frac{t_1}{t_1 + \left(0.5 \cdot \frac{\sqrt{2} \cdot {\ell}^{2}}{t \cdot x} + \frac{t_1}{x}\right)}\\
\mathbf{elif}\;t \leq 1.0565592753655027 \cdot 10^{+27}:\\
\;\;\;\;\frac{t_1}{{\left({\left(\mathsf{fma}\left(4, t_2, {\left(\sqrt{t_3}\right)}^{2}\right)\right)}^{0.25}\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t \cdot \sqrt{\frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}}}\\
\end{array}



Bits error versus x



Bits error versus l



Bits error versus t
if t < -9.6376913885362585e147Initial program 60.2
Simplified60.2
Taylor expanded in x around inf 61.2
Simplified61.2
Taylor expanded in t around -inf 1.9
Simplified1.9
if -9.6376913885362585e147 < t < 2.1563523231601638e-303Initial program 35.4
Simplified35.4
Taylor expanded in x around inf 19.1
Simplified19.1
Applied egg-rr17.3
Applied egg-rr12.6
if 2.1563523231601638e-303 < t < 2.7248008057053303e-191Initial program 62.9
Simplified62.9
Taylor expanded in x around inf 37.4
Simplified37.4
Applied egg-rr32.1
Applied egg-rr31.0
Taylor expanded in x around inf 24.7
if 2.7248008057053303e-191 < t < 1.0565592753655027e27Initial program 33.7
Simplified33.7
Taylor expanded in x around inf 13.3
Simplified13.3
Applied egg-rr12.6
Applied egg-rr7.7
if 1.0565592753655027e27 < t Initial program 43.2
Simplified43.2
Taylor expanded in t around inf 4.9
Simplified4.9
Final simplification9.0
herbie shell --seed 2022134
(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)))))