(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 (/ l t)))
(t_2 (+ (/ 2.0 x) (+ (/ 2.0 (pow x 3.0)) (/ 2.0 (* x x)))))
(t_3 (sqrt (+ (/ 2.0 (+ x -1.0)) (* 2.0 (/ x (+ x -1.0))))))
(t_4 (* t (sqrt 2.0)))
(t_5 (/ t_4 (* t_3 (- t))))
(t_6
(/
t_4
(sqrt
(fma
4.0
(pow (/ t x) 2.0)
(fma
4.0
(* t (/ t x))
(fma
4.0
(* t (/ t (pow x 3.0)))
(fma
2.0
(pow (/ l x) 2.0)
(fma
2.0
(* l (/ l (pow x 3.0)))
(* 2.0 (fma t t (* l (/ l x))))))))))))
(t_7 (sqrt (/ 1.0 t_2))))
(if (<= t -2.2e+133)
t_5
(if (<= t -2.6e-172)
t_6
(if (<= t -1.02e-221)
t_5
(if (<= t 2.8e-225)
(/
t_4
(+
(* t_7 (+ t_1 (* 2.0 (/ t_1 x))))
(+
(*
t_7
(+
(* 2.0 (/ (* (/ t x) (/ t x)) l))
(* 2.0 (/ t_1 (pow x 3.0)))))
(* l (sqrt t_2)))))
(if (<= t 1.12e-194)
(/
t_4
(fma
t
(sqrt 2.0)
(fma
2.0
(/ t (* (sqrt 2.0) x))
(/ l (/ (* (sqrt 2.0) (* t x)) l)))))
(if (<= t 4e+104) t_6 (/ t_4 (* t t_3))))))))))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 / (l / t);
double t_2 = (2.0 / x) + ((2.0 / pow(x, 3.0)) + (2.0 / (x * x)));
double t_3 = sqrt(((2.0 / (x + -1.0)) + (2.0 * (x / (x + -1.0)))));
double t_4 = t * sqrt(2.0);
double t_5 = t_4 / (t_3 * -t);
double t_6 = t_4 / sqrt(fma(4.0, pow((t / x), 2.0), fma(4.0, (t * (t / x)), fma(4.0, (t * (t / pow(x, 3.0))), fma(2.0, pow((l / x), 2.0), fma(2.0, (l * (l / pow(x, 3.0))), (2.0 * fma(t, t, (l * (l / x))))))))));
double t_7 = sqrt((1.0 / t_2));
double tmp;
if (t <= -2.2e+133) {
tmp = t_5;
} else if (t <= -2.6e-172) {
tmp = t_6;
} else if (t <= -1.02e-221) {
tmp = t_5;
} else if (t <= 2.8e-225) {
tmp = t_4 / ((t_7 * (t_1 + (2.0 * (t_1 / x)))) + ((t_7 * ((2.0 * (((t / x) * (t / x)) / l)) + (2.0 * (t_1 / pow(x, 3.0))))) + (l * sqrt(t_2))));
} else if (t <= 1.12e-194) {
tmp = t_4 / fma(t, sqrt(2.0), fma(2.0, (t / (sqrt(2.0) * x)), (l / ((sqrt(2.0) * (t * x)) / l))));
} else if (t <= 4e+104) {
tmp = t_6;
} else {
tmp = t_4 / (t * t_3);
}
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 / Float64(l / t)) t_2 = Float64(Float64(2.0 / x) + Float64(Float64(2.0 / (x ^ 3.0)) + Float64(2.0 / Float64(x * x)))) t_3 = sqrt(Float64(Float64(2.0 / Float64(x + -1.0)) + Float64(2.0 * Float64(x / Float64(x + -1.0))))) t_4 = Float64(t * sqrt(2.0)) t_5 = Float64(t_4 / Float64(t_3 * Float64(-t))) t_6 = Float64(t_4 / sqrt(fma(4.0, (Float64(t / x) ^ 2.0), fma(4.0, Float64(t * Float64(t / x)), fma(4.0, Float64(t * Float64(t / (x ^ 3.0))), fma(2.0, (Float64(l / x) ^ 2.0), fma(2.0, Float64(l * Float64(l / (x ^ 3.0))), Float64(2.0 * fma(t, t, Float64(l * Float64(l / x))))))))))) t_7 = sqrt(Float64(1.0 / t_2)) tmp = 0.0 if (t <= -2.2e+133) tmp = t_5; elseif (t <= -2.6e-172) tmp = t_6; elseif (t <= -1.02e-221) tmp = t_5; elseif (t <= 2.8e-225) tmp = Float64(t_4 / Float64(Float64(t_7 * Float64(t_1 + Float64(2.0 * Float64(t_1 / x)))) + Float64(Float64(t_7 * Float64(Float64(2.0 * Float64(Float64(Float64(t / x) * Float64(t / x)) / l)) + Float64(2.0 * Float64(t_1 / (x ^ 3.0))))) + Float64(l * sqrt(t_2))))); elseif (t <= 1.12e-194) tmp = Float64(t_4 / fma(t, sqrt(2.0), fma(2.0, Float64(t / Float64(sqrt(2.0) * x)), Float64(l / Float64(Float64(sqrt(2.0) * Float64(t * x)) / l))))); elseif (t <= 4e+104) tmp = t_6; else tmp = Float64(t_4 / Float64(t * t_3)); 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[(l / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 / x), $MachinePrecision] + N[(N[(2.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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$4 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(t$95$3 * (-t)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$4 / N[Sqrt[N[(4.0 * N[Power[N[(t / x), $MachinePrecision], 2.0], $MachinePrecision] + N[(4.0 * N[(t * N[(t / x), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * N[(t / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[Power[N[(l / x), $MachinePrecision], 2.0], $MachinePrecision] + N[(2.0 * N[(l * N[(l / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t * t + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[Sqrt[N[(1.0 / t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -2.2e+133], t$95$5, If[LessEqual[t, -2.6e-172], t$95$6, If[LessEqual[t, -1.02e-221], t$95$5, If[LessEqual[t, 2.8e-225], N[(t$95$4 / N[(N[(t$95$7 * N[(t$95$1 + N[(2.0 * N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$7 * N[(N[(2.0 * N[(N[(N[(t / x), $MachinePrecision] * N[(t / x), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$1 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e-194], N[(t$95$4 / N[(t * N[Sqrt[2.0], $MachinePrecision] + N[(2.0 * N[(t / N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + N[(l / N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e+104], t$95$6, N[(t$95$4 / N[(t * t$95$3), $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 := \frac{t}{\frac{\ell}{t}}\\
t_2 := \frac{2}{x} + \left(\frac{2}{{x}^{3}} + \frac{2}{x \cdot x}\right)\\
t_3 := \sqrt{\frac{2}{x + -1} + 2 \cdot \frac{x}{x + -1}}\\
t_4 := t \cdot \sqrt{2}\\
t_5 := \frac{t_4}{t_3 \cdot \left(-t\right)}\\
t_6 := \frac{t_4}{\sqrt{\mathsf{fma}\left(4, {\left(\frac{t}{x}\right)}^{2}, \mathsf{fma}\left(4, t \cdot \frac{t}{x}, \mathsf{fma}\left(4, t \cdot \frac{t}{{x}^{3}}, \mathsf{fma}\left(2, {\left(\frac{\ell}{x}\right)}^{2}, \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{{x}^{3}}, 2 \cdot \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)\right)\right)\right)\right)}}\\
t_7 := \sqrt{\frac{1}{t_2}}\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{+133}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;t \leq -2.6 \cdot 10^{-172}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t \leq -1.02 \cdot 10^{-221}:\\
\;\;\;\;t_5\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-225}:\\
\;\;\;\;\frac{t_4}{t_7 \cdot \left(t_1 + 2 \cdot \frac{t_1}{x}\right) + \left(t_7 \cdot \left(2 \cdot \frac{\frac{t}{x} \cdot \frac{t}{x}}{\ell} + 2 \cdot \frac{t_1}{{x}^{3}}\right) + \ell \cdot \sqrt{t_2}\right)}\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-194}:\\
\;\;\;\;\frac{t_4}{\mathsf{fma}\left(t, \sqrt{2}, \mathsf{fma}\left(2, \frac{t}{\sqrt{2} \cdot x}, \frac{\ell}{\frac{\sqrt{2} \cdot \left(t \cdot x\right)}{\ell}}\right)\right)}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+104}:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;\frac{t_4}{t \cdot t_3}\\
\end{array}



Bits error versus x



Bits error versus l



Bits error versus t
if t < -2.2e133 or -2.5999999999999998e-172 < t < -1.02e-221Initial program 58.3
Simplified58.3
Taylor expanded in t around -inf 6.9
Simplified6.9
if -2.2e133 < t < -2.5999999999999998e-172 or 1.12000000000000001e-194 < t < 4e104Initial program 28.1
Simplified28.1
Taylor expanded in x around inf 12.3
Simplified12.3
Applied egg-rr6.8
Applied egg-rr6.8
if -1.02e-221 < t < 2.8e-225Initial program 62.9
Simplified62.9
Taylor expanded in x around inf 40.1
Simplified40.1
Taylor expanded in l around inf 32.8
Simplified32.6
if 2.8e-225 < t < 1.12000000000000001e-194Initial program 62.9
Simplified62.9
Taylor expanded in x around inf 42.1
Simplified42.1
Taylor expanded in x around inf 22.0
Simplified21.9
if 4e104 < t Initial program 49.4
Simplified49.4
Taylor expanded in t around inf 2.4
Simplified2.4
Final simplification8.9
herbie shell --seed 2022166
(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)))))