(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 (* (sqrt 2.0) x))
(t_2 (sqrt (+ (/ 2.0 (+ x -1.0)) (* 2.0 (/ x (+ x -1.0))))))
(t_3 (* t (sqrt 2.0)))
(t_4 (/ t_3 (* t (- t_2))))
(t_5
(/
t_3
(sqrt (fma 4.0 (/ (* t t) x) (* 2.0 (fma t t (* l (/ l x)))))))))
(if (<= t -2.6e+39)
t_4
(if (<= t -1.58e-158)
t_5
(if (<= t -2.95e-220)
t_4
(if (<= t 4.5e-187)
(/
t_3
(pow
(pow
(fma
4.0
(* t (/ t x))
(* 2.0 (pow (hypot t (/ l (sqrt x))) 2.0)))
0.25)
2.0))
(if (<= t 5.8e-165)
(/
t_3
(fma (sqrt 2.0) t (fma 2.0 (/ t t_1) (* (/ l t) (/ l t_1)))))
(if (<= t 1.35e+23) t_5 (/ t_3 (* t 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 = sqrt(2.0) * x;
double t_2 = sqrt(((2.0 / (x + -1.0)) + (2.0 * (x / (x + -1.0)))));
double t_3 = t * sqrt(2.0);
double t_4 = t_3 / (t * -t_2);
double t_5 = t_3 / sqrt(fma(4.0, ((t * t) / x), (2.0 * fma(t, t, (l * (l / x))))));
double tmp;
if (t <= -2.6e+39) {
tmp = t_4;
} else if (t <= -1.58e-158) {
tmp = t_5;
} else if (t <= -2.95e-220) {
tmp = t_4;
} else if (t <= 4.5e-187) {
tmp = t_3 / pow(pow(fma(4.0, (t * (t / x)), (2.0 * pow(hypot(t, (l / sqrt(x))), 2.0))), 0.25), 2.0);
} else if (t <= 5.8e-165) {
tmp = t_3 / fma(sqrt(2.0), t, fma(2.0, (t / t_1), ((l / t) * (l / t_1))));
} else if (t <= 1.35e+23) {
tmp = t_5;
} else {
tmp = t_3 / (t * 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(sqrt(2.0) * x) t_2 = sqrt(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 / Float64(t * Float64(-t_2))) t_5 = Float64(t_3 / sqrt(fma(4.0, Float64(Float64(t * t) / x), Float64(2.0 * fma(t, t, Float64(l * Float64(l / x))))))) tmp = 0.0 if (t <= -2.6e+39) tmp = t_4; elseif (t <= -1.58e-158) tmp = t_5; elseif (t <= -2.95e-220) tmp = t_4; elseif (t <= 4.5e-187) tmp = Float64(t_3 / ((fma(4.0, Float64(t * Float64(t / x)), Float64(2.0 * (hypot(t, Float64(l / sqrt(x))) ^ 2.0))) ^ 0.25) ^ 2.0)); elseif (t <= 5.8e-165) tmp = Float64(t_3 / fma(sqrt(2.0), t, fma(2.0, Float64(t / t_1), Float64(Float64(l / t) * Float64(l / t_1))))); elseif (t <= 1.35e+23) tmp = t_5; else tmp = Float64(t_3 / Float64(t * 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[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[(t * (-t$95$2)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 / N[Sqrt[N[(4.0 * N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(t * t + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.6e+39], t$95$4, If[LessEqual[t, -1.58e-158], t$95$5, If[LessEqual[t, -2.95e-220], t$95$4, If[LessEqual[t, 4.5e-187], N[(t$95$3 / N[Power[N[Power[N[(4.0 * N[(t * N[(t / x), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[N[Sqrt[t ^ 2 + N[(l / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e-165], N[(t$95$3 / N[(N[Sqrt[2.0], $MachinePrecision] * t + N[(2.0 * N[(t / t$95$1), $MachinePrecision] + N[(N[(l / t), $MachinePrecision] * N[(l / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+23], t$95$5, N[(t$95$3 / N[(t * t$95$2), $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 := \sqrt{2} \cdot x\\
t_2 := \sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}}\\
t_3 := t \cdot \sqrt{2}\\
t_4 := \frac{t_3}{t \cdot \left(-t_2\right)}\\
t_5 := \frac{t_3}{\sqrt{\mathsf{fma}\left(4, \frac{t \cdot t}{x}, 2 \cdot \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)}}\\
\mathbf{if}\;t \leq -2.6 \cdot 10^{+39}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq -1.58 \cdot 10^{-158}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;t \leq -2.95 \cdot 10^{-220}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-187}:\\
\;\;\;\;\frac{t_3}{{\left({\left(\mathsf{fma}\left(4, t \cdot \frac{t}{x}, 2 \cdot {\left(\mathsf{hypot}\left(t, \frac{\ell}{\sqrt{x}}\right)\right)}^{2}\right)\right)}^{0.25}\right)}^{2}}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{-165}:\\
\;\;\;\;\frac{t_3}{\mathsf{fma}\left(\sqrt{2}, t, \mathsf{fma}\left(2, \frac{t}{t_1}, \frac{\ell}{t} \cdot \frac{\ell}{t_1}\right)\right)}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+23}:\\
\;\;\;\;t_5\\
\mathbf{else}:\\
\;\;\;\;\frac{t_3}{t \cdot t_2}\\
\end{array}



Bits error versus x



Bits error versus l



Bits error versus t
if t < -2.6e39 or -1.57999999999999994e-158 < t < -2.9499999999999998e-220Initial program 46.9
Simplified46.9
Taylor expanded in t around -inf 8.4
Simplified8.4
if -2.6e39 < t < -1.57999999999999994e-158 or 5.8e-165 < t < 1.3499999999999999e23Initial program 30.6
Simplified30.6
Taylor expanded in x around inf 10.1
Simplified10.1
Applied egg-rr5.1
Applied egg-rr5.0
if -2.9499999999999998e-220 < t < 4.4999999999999998e-187Initial program 62.8
Simplified62.8
Taylor expanded in x around inf 33.0
Simplified33.0
Applied egg-rr31.8
Applied egg-rr31.9
if 4.4999999999999998e-187 < t < 5.8e-165Initial program 63.1
Simplified63.2
Taylor expanded in x around inf 43.4
Simplified43.4
Taylor expanded in x around inf 18.1
Simplified17.9
if 1.3499999999999999e23 < t Initial program 41.8
Simplified41.8
Taylor expanded in t around inf 4.5
Simplified4.5
Final simplification9.6
herbie shell --seed 2022160
(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)))))