(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 (+ 2.0 (/ 4.0 x)))
(t_2 (+ (/ 2.0 (- x 1.0)) (* 2.0 (/ x (- x 1.0)))))
(t_3 (* t (sqrt 2.0)))
(t_4
(/
t_3
(sqrt (fma 4.0 (/ (* t t) x) (* 2.0 (fma (/ l x) l (* t t))))))))
(if (<= t -2.2811553775868558e+86)
(/ t_3 (- (* t (sqrt t_2))))
(if (<= t -1.2161892777935289e-133)
t_4
(if (<= t -2.979893054166405e-202)
(/
t_3
(- (fma t (sqrt t_1) (* (/ (* l l) (* t x)) (sqrt (/ 1.0 t_1))))))
(if (<= t -1.8036204212416754e-274)
t_4
(if (<= t 2.9547856466284326e-160)
(/
t_3
(fma
(sqrt 2.0)
t
(fma
2.0
(/ t (* (sqrt 2.0) x))
(/ (* l l) (* (sqrt 2.0) (* t x))))))
(if (<= t 4.039007145470636e+143)
t_4
(* (sqrt 2.0) (sqrt (/ 1.0 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 = 2.0 + (4.0 / x);
double t_2 = (2.0 / (x - 1.0)) + (2.0 * (x / (x - 1.0)));
double t_3 = t * sqrt(2.0);
double t_4 = t_3 / sqrt(fma(4.0, ((t * t) / x), (2.0 * fma((l / x), l, (t * t)))));
double tmp;
if (t <= -2.2811553775868558e+86) {
tmp = t_3 / -(t * sqrt(t_2));
} else if (t <= -1.2161892777935289e-133) {
tmp = t_4;
} else if (t <= -2.979893054166405e-202) {
tmp = t_3 / -fma(t, sqrt(t_1), (((l * l) / (t * x)) * sqrt((1.0 / t_1))));
} else if (t <= -1.8036204212416754e-274) {
tmp = t_4;
} else if (t <= 2.9547856466284326e-160) {
tmp = t_3 / fma(sqrt(2.0), t, fma(2.0, (t / (sqrt(2.0) * x)), ((l * l) / (sqrt(2.0) * (t * x)))));
} else if (t <= 4.039007145470636e+143) {
tmp = t_4;
} else {
tmp = sqrt(2.0) * sqrt((1.0 / t_2));
}
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(2.0 + Float64(4.0 / x)) t_2 = Float64(Float64(2.0 / Float64(x - 1.0)) + Float64(2.0 * Float64(x / Float64(x - 1.0)))) t_3 = Float64(t * sqrt(2.0)) t_4 = Float64(t_3 / sqrt(fma(4.0, Float64(Float64(t * t) / x), Float64(2.0 * fma(Float64(l / x), l, Float64(t * t)))))) tmp = 0.0 if (t <= -2.2811553775868558e+86) tmp = Float64(t_3 / Float64(-Float64(t * sqrt(t_2)))); elseif (t <= -1.2161892777935289e-133) tmp = t_4; elseif (t <= -2.979893054166405e-202) tmp = Float64(t_3 / Float64(-fma(t, sqrt(t_1), Float64(Float64(Float64(l * l) / Float64(t * x)) * sqrt(Float64(1.0 / t_1)))))); elseif (t <= -1.8036204212416754e-274) tmp = t_4; elseif (t <= 2.9547856466284326e-160) tmp = Float64(t_3 / fma(sqrt(2.0), t, fma(2.0, Float64(t / Float64(sqrt(2.0) * x)), Float64(Float64(l * l) / Float64(sqrt(2.0) * Float64(t * x)))))); elseif (t <= 4.039007145470636e+143) tmp = t_4; else tmp = Float64(sqrt(2.0) * sqrt(Float64(1.0 / t_2))); 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[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(x / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[Sqrt[N[(4.0 * N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(N[(l / x), $MachinePrecision] * l + N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2811553775868558e+86], N[(t$95$3 / (-N[(t * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[t, -1.2161892777935289e-133], t$95$4, If[LessEqual[t, -2.979893054166405e-202], N[(t$95$3 / (-N[(t * N[Sqrt[t$95$1], $MachinePrecision] + N[(N[(N[(l * l), $MachinePrecision] / N[(t * x), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[t, -1.8036204212416754e-274], t$95$4, If[LessEqual[t, 2.9547856466284326e-160], N[(t$95$3 / N[(N[Sqrt[2.0], $MachinePrecision] * t + N[(2.0 * N[(t / N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.039007145470636e+143], t$95$4, N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$2), $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 := 2 + \frac{4}{x}\\
t_2 := \frac{2}{x - 1} + 2 \cdot \frac{x}{x - 1}\\
t_3 := t \cdot \sqrt{2}\\
t_4 := \frac{t_3}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(\frac{\ell}{x}, \ell, t \cdot t\right)\right)}}\\
\mathbf{if}\;t \leq -2.2811553775868558 \cdot 10^{+86}:\\
\;\;\;\;\frac{t_3}{-t \cdot \sqrt{t_2}}\\
\mathbf{elif}\;t \leq -1.2161892777935289 \cdot 10^{-133}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq -2.979893054166405 \cdot 10^{-202}:\\
\;\;\;\;\frac{t_3}{-\mathsf{fma}\left(t, \sqrt{t_1}, \frac{\ell \cdot \ell}{t \cdot x} \cdot \sqrt{\frac{1}{t_1}}\right)}\\
\mathbf{elif}\;t \leq -1.8036204212416754 \cdot 10^{-274}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 2.9547856466284326 \cdot 10^{-160}:\\
\;\;\;\;\frac{t_3}{\mathsf{fma}\left(\sqrt{2}, t, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \frac{\ell \cdot \ell}{\sqrt{2} \cdot \left(t \cdot x\right)}\right)\right)}\\
\mathbf{elif}\;t \leq 4.039007145470636 \cdot 10^{+143}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \sqrt{\frac{1}{t_2}}\\
\end{array}



Bits error versus x



Bits error versus l



Bits error versus t
if t < -2.2811553775868558e86Initial program 49.0
Simplified49.0
Taylor expanded in t around -inf 2.9
Simplified2.9
if -2.2811553775868558e86 < t < -1.21618927779352889e-133 or -2.9798930541664051e-202 < t < -1.80362042124167537e-274 or 2.95478564662843265e-160 < t < 4.03900714547063611e143Initial program 28.6
Simplified28.6
Taylor expanded in x around inf 12.0
Simplified12.0
Applied egg-rr7.4
Applied egg-rr7.4
if -1.21618927779352889e-133 < t < -2.9798930541664051e-202Initial program 52.9
Simplified52.9
Taylor expanded in x around inf 26.2
Simplified26.2
Taylor expanded in t around -inf 21.6
Simplified21.6
if -1.80362042124167537e-274 < t < 2.95478564662843265e-160Initial program 62.4
Simplified62.4
Taylor expanded in x around inf 34.0
Simplified34.0
Taylor expanded in x around inf 28.9
Simplified28.9
if 4.03900714547063611e143 < t Initial program 58.8
Simplified58.8
Taylor expanded in t around inf 2.6
Simplified2.6
Final simplification8.8
herbie shell --seed 2022133
(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)))))