(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 (+ (/ 4.0 (* x x)) (+ 2.0 (/ 4.0 x))))
(t_2 (* t (- (sqrt t_1))))
(t_3 (* t (sqrt 2.0)))
(t_4
(/
t_3
(fabs
(sqrt
(fma
4.0
(pow (/ t x) 2.0)
(fma
4.0
(* t (/ t x))
(fma
2.0
(pow (/ l x) 2.0)
(* 2.0 (fma t t (* l (/ l x))))))))))))
(if (<= t -7.313146234677325)
(/ t_3 t_2)
(if (<= t -4.598917439395751e-161)
t_4
(if (<= t -1.1070675823535772e-218)
(/
t_3
(-
t_2
(*
(sqrt (/ 1.0 t_1))
(+ (* (/ l x) (/ l t)) (/ (* (/ l x) (/ l x)) t)))))
(if (<= t -1.1119314911646242e-301)
t_4
(if (<= t 2.898770924274869e-166)
(/
t_3
(fma
t
(sqrt 2.0)
(fma
2.0
(/ t (* (sqrt 2.0) x))
(/ l (/ (* (sqrt 2.0) (* t x)) l)))))
(if (<= t 1.7505159449100466e+61)
t_4
(/
t_3
(*
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 = (4.0 / (x * x)) + (2.0 + (4.0 / x));
double t_2 = t * -sqrt(t_1);
double t_3 = t * sqrt(2.0);
double t_4 = t_3 / fabs(sqrt(fma(4.0, pow((t / x), 2.0), fma(4.0, (t * (t / x)), fma(2.0, pow((l / x), 2.0), (2.0 * fma(t, t, (l * (l / x)))))))));
double tmp;
if (t <= -7.313146234677325) {
tmp = t_3 / t_2;
} else if (t <= -4.598917439395751e-161) {
tmp = t_4;
} else if (t <= -1.1070675823535772e-218) {
tmp = t_3 / (t_2 - (sqrt((1.0 / t_1)) * (((l / x) * (l / t)) + (((l / x) * (l / x)) / t))));
} else if (t <= -1.1119314911646242e-301) {
tmp = t_4;
} else if (t <= 2.898770924274869e-166) {
tmp = t_3 / fma(t, sqrt(2.0), fma(2.0, (t / (sqrt(2.0) * x)), (l / ((sqrt(2.0) * (t * x)) / l))));
} else if (t <= 1.7505159449100466e+61) {
tmp = t_4;
} else {
tmp = t_3 / (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(Float64(4.0 / Float64(x * x)) + Float64(2.0 + Float64(4.0 / x))) t_2 = Float64(t * Float64(-sqrt(t_1))) t_3 = Float64(t * sqrt(2.0)) t_4 = Float64(t_3 / abs(sqrt(fma(4.0, (Float64(t / x) ^ 2.0), fma(4.0, Float64(t * Float64(t / x)), fma(2.0, (Float64(l / x) ^ 2.0), Float64(2.0 * fma(t, t, Float64(l * Float64(l / x)))))))))) tmp = 0.0 if (t <= -7.313146234677325) tmp = Float64(t_3 / t_2); elseif (t <= -4.598917439395751e-161) tmp = t_4; elseif (t <= -1.1070675823535772e-218) tmp = Float64(t_3 / Float64(t_2 - Float64(sqrt(Float64(1.0 / t_1)) * Float64(Float64(Float64(l / x) * Float64(l / t)) + Float64(Float64(Float64(l / x) * Float64(l / x)) / t))))); elseif (t <= -1.1119314911646242e-301) tmp = t_4; elseif (t <= 2.898770924274869e-166) tmp = Float64(t_3 / 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 <= 1.7505159449100466e+61) tmp = t_4; else tmp = Float64(t_3 / 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[(N[(4.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * (-N[Sqrt[t$95$1], $MachinePrecision])), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[Abs[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[(2.0 * N[Power[N[(l / x), $MachinePrecision], 2.0], $MachinePrecision] + N[(2.0 * N[(t * t + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.313146234677325], N[(t$95$3 / t$95$2), $MachinePrecision], If[LessEqual[t, -4.598917439395751e-161], t$95$4, If[LessEqual[t, -1.1070675823535772e-218], N[(t$95$3 / N[(t$95$2 - N[(N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(l / x), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(l / x), $MachinePrecision] * N[(l / x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.1119314911646242e-301], t$95$4, If[LessEqual[t, 2.898770924274869e-166], N[(t$95$3 / 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, 1.7505159449100466e+61], t$95$4, N[(t$95$3 / 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 := \frac{4}{x \cdot x} + \left(2 + \frac{4}{x}\right)\\
t_2 := t \cdot \left(-\sqrt{t_1}\right)\\
t_3 := t \cdot \sqrt{2}\\
t_4 := \frac{t_3}{\left|\sqrt{\mathsf{fma}\left(4, {\left(\frac{t}{x}\right)}^{2}, \mathsf{fma}\left(4, t \cdot \frac{t}{x}, \mathsf{fma}\left(2, {\left(\frac{\ell}{x}\right)}^{2}, 2 \cdot \mathsf{fma}\left(t, t, \ell \cdot \frac{\ell}{x}\right)\right)\right)\right)}\right|}\\
\mathbf{if}\;t \leq -7.313146234677325:\\
\;\;\;\;\frac{t_3}{t_2}\\
\mathbf{elif}\;t \leq -4.598917439395751 \cdot 10^{-161}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq -1.1070675823535772 \cdot 10^{-218}:\\
\;\;\;\;\frac{t_3}{t_2 - \sqrt{\frac{1}{t_1}} \cdot \left(\frac{\ell}{x} \cdot \frac{\ell}{t} + \frac{\frac{\ell}{x} \cdot \frac{\ell}{x}}{t}\right)}\\
\mathbf{elif}\;t \leq -1.1119314911646242 \cdot 10^{-301}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq 2.898770924274869 \cdot 10^{-166}:\\
\;\;\;\;\frac{t_3}{\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 1.7505159449100466 \cdot 10^{+61}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;\frac{t_3}{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 < -7.31314623467732527Initial program 41.5
Simplified41.5
Taylor expanded in x around inf 38.8
Simplified38.8
Taylor expanded in t around -inf 5.7
Simplified5.7
if -7.31314623467732527 < t < -4.5989174393957506e-161 or -1.1070675823535772e-218 < t < -1.11193149116462419e-301 or 2.898770924274869e-166 < t < 1.7505159449100466e61Initial program 35.0
Simplified35.0
Taylor expanded in x around inf 14.1
Simplified14.1
Applied egg-rr8.6
Applied egg-rr8.4
if -4.5989174393957506e-161 < t < -1.1070675823535772e-218Initial program 63.2
Simplified63.2
Taylor expanded in x around inf 41.8
Simplified41.8
Taylor expanded in t around -inf 25.9
Simplified22.0
if -1.11193149116462419e-301 < t < 2.898770924274869e-166Initial program 62.7
Simplified62.7
Taylor expanded in x around inf 37.5
Simplified37.5
Taylor expanded in x around inf 26.4
Simplified26.3
if 1.7505159449100466e61 < t Initial program 44.8
Simplified44.8
Taylor expanded in t around inf 3.0
Simplified3.0
Final simplification8.6
herbie shell --seed 2022153
(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)))))