| Alternative 1 | |
|---|---|
| Error | 9.6 |
| Cost | 8392 |
(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 (/ l (/ x l)))
(t_2 (+ 2.0 (+ (/ 2.0 x) (/ 2.0 x))))
(t_3 (* l (/ l x))))
(if (<= t -1.3e+109)
(+ -1.0 (/ 1.0 x))
(if (<= t -1.35e-177)
(/ t (sqrt (/ (+ t_1 (+ (* 2.0 (+ (* t t) (/ t (/ x t)))) t_3)) 2.0)))
(if (<= t -7.6e-273)
(*
t
(/
(sqrt 2.0)
(- (fma t (sqrt t_2) (* (sqrt (/ 1.0 t_2)) (* (/ l x) (/ l t)))))))
(if (<= t 2.4e+94)
(/ t (sqrt (/ (+ t_1 (+ t_3 (* 2.0 (* t t)))) 2.0)))
(+ 1.0 (/ -1.0 x))))))))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 = l / (x / l);
double t_2 = 2.0 + ((2.0 / x) + (2.0 / x));
double t_3 = l * (l / x);
double tmp;
if (t <= -1.3e+109) {
tmp = -1.0 + (1.0 / x);
} else if (t <= -1.35e-177) {
tmp = t / sqrt(((t_1 + ((2.0 * ((t * t) + (t / (x / t)))) + t_3)) / 2.0));
} else if (t <= -7.6e-273) {
tmp = t * (sqrt(2.0) / -fma(t, sqrt(t_2), (sqrt((1.0 / t_2)) * ((l / x) * (l / t)))));
} else if (t <= 2.4e+94) {
tmp = t / sqrt(((t_1 + (t_3 + (2.0 * (t * t)))) / 2.0));
} else {
tmp = 1.0 + (-1.0 / x);
}
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(l / Float64(x / l)) t_2 = Float64(2.0 + Float64(Float64(2.0 / x) + Float64(2.0 / x))) t_3 = Float64(l * Float64(l / x)) tmp = 0.0 if (t <= -1.3e+109) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= -1.35e-177) tmp = Float64(t / sqrt(Float64(Float64(t_1 + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(t / Float64(x / t)))) + t_3)) / 2.0))); elseif (t <= -7.6e-273) tmp = Float64(t * Float64(sqrt(2.0) / Float64(-fma(t, sqrt(t_2), Float64(sqrt(Float64(1.0 / t_2)) * Float64(Float64(l / x) * Float64(l / t))))))); elseif (t <= 2.4e+94) tmp = Float64(t / sqrt(Float64(Float64(t_1 + Float64(t_3 + Float64(2.0 * Float64(t * t)))) / 2.0))); else tmp = Float64(1.0 + Float64(-1.0 / x)); 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[(l / N[(x / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 + N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.3e+109], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.35e-177], N[(t / N[Sqrt[N[(N[(t$95$1 + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(t / N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -7.6e-273], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / (-N[(t * N[Sqrt[t$95$2], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t$95$2), $MachinePrecision]], $MachinePrecision] * N[(N[(l / x), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e+94], N[(t / N[Sqrt[N[(N[(t$95$1 + N[(t$95$3 + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $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{\ell}{\frac{x}{\ell}}\\
t_2 := 2 + \left(\frac{2}{x} + \frac{2}{x}\right)\\
t_3 := \ell \cdot \frac{\ell}{x}\\
\mathbf{if}\;t \leq -1.3 \cdot 10^{+109}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-177}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{t_1 + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + t_3\right)}{2}}}\\
\mathbf{elif}\;t \leq -7.6 \cdot 10^{-273}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{-\mathsf{fma}\left(t, \sqrt{t_2}, \sqrt{\frac{1}{t_2}} \cdot \left(\frac{\ell}{x} \cdot \frac{\ell}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+94}:\\
\;\;\;\;\frac{t}{\sqrt{\frac{t_1 + \left(t_3 + 2 \cdot \left(t \cdot t\right)\right)}{2}}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
if t < -1.2999999999999999e109Initial program 53.4
Simplified53.4
[Start]53.4 | \[ \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}}
\] |
|---|---|
associate-*l/ [<=]53.4 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
+-commutative [=>]53.4 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\left(2 \cdot \left(t \cdot t\right) + \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
fma-def [=>]53.4 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
Applied egg-rr53.3
Taylor expanded in t around inf 63.0
Taylor expanded in x around -inf 64.0
Simplified2.4
[Start]64.0 | \[ {\left(\sqrt{-1}\right)}^{2} + \frac{1}{x}
\] |
|---|---|
unpow2 [=>]64.0 | \[ \color{blue}{\sqrt{-1} \cdot \sqrt{-1}} + \frac{1}{x}
\] |
rem-square-sqrt [=>]2.4 | \[ \color{blue}{-1} + \frac{1}{x}
\] |
if -1.2999999999999999e109 < t < -1.3500000000000001e-177Initial program 28.5
Simplified28.5
[Start]28.5 | \[ \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}}
\] |
|---|---|
associate-*l/ [<=]28.5 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
+-commutative [=>]28.5 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\left(2 \cdot \left(t \cdot t\right) + \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
fma-def [=>]28.5 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
Applied egg-rr28.3
Taylor expanded in x around inf 11.5
Simplified11.5
[Start]11.5 | \[ \frac{t}{\sqrt{\frac{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}{2}}}
\] |
|---|---|
cancel-sign-sub-inv [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\color{blue}{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}}{2}}}
\] |
associate-+l+ [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\color{blue}{\frac{{\ell}^{2}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}{2}}}
\] |
unpow2 [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
associate-/l* [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\color{blue}{\frac{\ell}{\frac{x}{\ell}}} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
distribute-lft-out [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
+-commutative [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)} + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
unpow2 [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(\color{blue}{t \cdot t} + \frac{{t}^{2}}{x}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
unpow2 [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{\color{blue}{t \cdot t}}{x}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
associate-/l* [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \color{blue}{\frac{t}{\frac{x}{t}}}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
metadata-eval [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \color{blue}{1} \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
+-commutative [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x}\right)}{2}}}
\] |
unpow2 [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x}\right)}{2}}}
\] |
fma-def [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)}{2}}}
\] |
unpow2 [=>]11.5 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)}{2}}}
\] |
Taylor expanded in l around inf 11.8
Simplified6.8
[Start]11.8 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \frac{{\ell}^{2}}{x}\right)}{2}}}
\] |
|---|---|
unpow2 [=>]11.8 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \frac{\color{blue}{\ell \cdot \ell}}{x}\right)}{2}}}
\] |
associate-*r/ [<=]6.8 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \color{blue}{\ell \cdot \frac{\ell}{x}}\right)}{2}}}
\] |
if -1.3500000000000001e-177 < t < -7.6000000000000007e-273Initial program 63.4
Simplified63.4
[Start]63.4 | \[ \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}}
\] |
|---|---|
associate-*l/ [<=]63.4 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
+-commutative [=>]63.4 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\left(2 \cdot \left(t \cdot t\right) + \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
fma-def [=>]63.4 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
Taylor expanded in x around inf 35.1
Simplified35.1
[Start]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}} \cdot t
\] |
|---|---|
associate--l+ [=>]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{{\ell}^{2}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}} \cdot t
\] |
unpow2 [=>]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
distribute-lft-out [=>]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{\color{blue}{t \cdot t}}{x} + {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + \color{blue}{t \cdot t}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
mul-1-neg [=>]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \color{blue}{\left(-\frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}\right)}} \cdot t
\] |
+-commutative [=>]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
fma-udef [<=]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]35.1 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)\right)}} \cdot t
\] |
Taylor expanded in t around -inf 23.5
Simplified23.6
[Start]23.5 | \[ \frac{\sqrt{2}}{-1 \cdot \left(\frac{{\ell}^{2}}{t \cdot x} \cdot \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}}\right) + -1 \cdot \left(t \cdot \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}\right)} \cdot t
\] |
|---|---|
*-commutative [=>]23.5 | \[ \frac{\sqrt{2}}{-1 \cdot \color{blue}{\left(\sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)} + -1 \cdot \left(t \cdot \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}\right)} \cdot t
\] |
*-commutative [=>]23.5 | \[ \frac{\sqrt{2}}{-1 \cdot \left(\sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right) + -1 \cdot \color{blue}{\left(\sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t\right)}} \cdot t
\] |
distribute-lft-out [=>]23.5 | \[ \frac{\sqrt{2}}{\color{blue}{-1 \cdot \left(\sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x} + \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t\right)}} \cdot t
\] |
+-commutative [<=]23.5 | \[ \frac{\sqrt{2}}{-1 \cdot \color{blue}{\left(\sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t + \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)}} \cdot t
\] |
mul-1-neg [=>]23.5 | \[ \frac{\sqrt{2}}{\color{blue}{-\left(\sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}} \cdot t + \sqrt{\frac{1}{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}} \cdot \frac{{\ell}^{2}}{t \cdot x}\right)}} \cdot t
\] |
if -7.6000000000000007e-273 < t < 2.39999999999999983e94Initial program 39.8
Simplified39.7
[Start]39.8 | \[ \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}}
\] |
|---|---|
associate-*l/ [<=]39.7 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
+-commutative [=>]39.7 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\left(2 \cdot \left(t \cdot t\right) + \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
fma-def [=>]39.7 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
Applied egg-rr39.6
Taylor expanded in x around inf 18.9
Simplified18.9
[Start]18.9 | \[ \frac{t}{\sqrt{\frac{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}{2}}}
\] |
|---|---|
cancel-sign-sub-inv [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\color{blue}{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}}{2}}}
\] |
associate-+l+ [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\color{blue}{\frac{{\ell}^{2}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}{2}}}
\] |
unpow2 [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
associate-/l* [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\color{blue}{\frac{\ell}{\frac{x}{\ell}}} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
distribute-lft-out [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
+-commutative [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)} + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
unpow2 [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(\color{blue}{t \cdot t} + \frac{{t}^{2}}{x}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
unpow2 [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{\color{blue}{t \cdot t}}{x}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
associate-/l* [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \color{blue}{\frac{t}{\frac{x}{t}}}\right) + \left(--1\right) \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
metadata-eval [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \color{blue}{1} \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}{2}}}
\] |
+-commutative [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{\color{blue}{2 \cdot {t}^{2} + {\ell}^{2}}}{x}\right)}{2}}}
\] |
unpow2 [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}}{x}\right)}{2}}}
\] |
fma-def [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)}{2}}}
\] |
unpow2 [=>]18.9 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + 1 \cdot \frac{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)}{2}}}
\] |
Taylor expanded in l around inf 19.2
Simplified15.3
[Start]19.2 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \frac{{\ell}^{2}}{x}\right)}{2}}}
\] |
|---|---|
unpow2 [=>]19.2 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \frac{\color{blue}{\ell \cdot \ell}}{x}\right)}{2}}}
\] |
associate-*r/ [<=]15.3 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) + \color{blue}{\ell \cdot \frac{\ell}{x}}\right)}{2}}}
\] |
Taylor expanded in x around inf 15.3
Simplified15.3
[Start]15.3 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot {t}^{2} + \ell \cdot \frac{\ell}{x}\right)}{2}}}
\] |
|---|---|
unpow2 [=>]15.3 | \[ \frac{t}{\sqrt{\frac{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \color{blue}{\left(t \cdot t\right)} + \ell \cdot \frac{\ell}{x}\right)}{2}}}
\] |
if 2.39999999999999983e94 < t Initial program 49.6
Simplified49.6
[Start]49.6 | \[ \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}}
\] |
|---|---|
associate-*l/ [<=]49.6 | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
+-commutative [=>]49.6 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\left(2 \cdot \left(t \cdot t\right) + \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
fma-def [=>]49.6 | \[ \frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)} - \ell \cdot \ell}} \cdot t
\] |
Applied egg-rr49.5
Taylor expanded in t around inf 2.6
Taylor expanded in x around inf 3.1
Final simplification8.9
| Alternative 1 | |
|---|---|
| Error | 9.6 |
| Cost | 8392 |
| Alternative 2 | |
|---|---|
| Error | 9.6 |
| Cost | 8272 |
| Alternative 3 | |
|---|---|
| Error | 15.0 |
| Cost | 7880 |
| Alternative 4 | |
|---|---|
| Error | 15.0 |
| Cost | 7368 |
| Alternative 5 | |
|---|---|
| Error | 14.7 |
| Cost | 7048 |
| Alternative 6 | |
|---|---|
| Error | 15.6 |
| Cost | 452 |
| Alternative 7 | |
|---|---|
| Error | 15.4 |
| Cost | 452 |
| Alternative 8 | |
|---|---|
| Error | 15.8 |
| Cost | 196 |
| Alternative 9 | |
|---|---|
| Error | 39.2 |
| Cost | 64 |
herbie shell --seed 2023060
(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)))))