| Alternative 1 | |
|---|---|
| Error | 9.5 |
| Cost | 27976 |
(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 (sqrt 2.0))) (t_2 (+ 1.0 (/ 2.0 x))))
(if (<= t -1.22e+122)
(- (sqrt (/ (+ -1.0 x) (+ x 1.0))))
(if (<= t 4e+126)
(/
t_1
(sqrt
(+
(/ l (/ x l))
(fma l (/ l x) (* (* t 2.0) (+ (/ t x) (+ t (/ t x))))))))
(/
t_1
(fma
t_1
(sqrt t_2)
(* (/ l (/ (* (sqrt 2.0) (* t x)) l)) (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 = t * sqrt(2.0);
double t_2 = 1.0 + (2.0 / x);
double tmp;
if (t <= -1.22e+122) {
tmp = -sqrt(((-1.0 + x) / (x + 1.0)));
} else if (t <= 4e+126) {
tmp = t_1 / sqrt(((l / (x / l)) + fma(l, (l / x), ((t * 2.0) * ((t / x) + (t + (t / x)))))));
} else {
tmp = t_1 / fma(t_1, sqrt(t_2), ((l / ((sqrt(2.0) * (t * x)) / l)) * 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(t * sqrt(2.0)) t_2 = Float64(1.0 + Float64(2.0 / x)) tmp = 0.0 if (t <= -1.22e+122) tmp = Float64(-sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))); elseif (t <= 4e+126) tmp = Float64(t_1 / sqrt(Float64(Float64(l / Float64(x / l)) + fma(l, Float64(l / x), Float64(Float64(t * 2.0) * Float64(Float64(t / x) + Float64(t + Float64(t / x)))))))); else tmp = Float64(t_1 / fma(t_1, sqrt(t_2), Float64(Float64(l / Float64(Float64(sqrt(2.0) * Float64(t * x)) / l)) * 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[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.22e+122], (-N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 4e+126], N[(t$95$1 / N[Sqrt[N[(N[(l / N[(x / l), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision] + N[(N[(t * 2.0), $MachinePrecision] * N[(N[(t / x), $MachinePrecision] + N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(t$95$1 * N[Sqrt[t$95$2], $MachinePrecision] + N[(N[(l / N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$2), $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 := t \cdot \sqrt{2}\\
t_2 := 1 + \frac{2}{x}\\
\mathbf{if}\;t \leq -1.22 \cdot 10^{+122}:\\
\;\;\;\;-\sqrt{\frac{-1 + x}{x + 1}}\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+126}:\\
\;\;\;\;\frac{t_1}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \left(t \cdot 2\right) \cdot \left(\frac{t}{x} + \left(t + \frac{t}{x}\right)\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{\mathsf{fma}\left(t_1, \sqrt{t_2}, \frac{\ell}{\frac{\sqrt{2} \cdot \left(t \cdot x\right)}{\ell}} \cdot \sqrt{\frac{1}{t_2}}\right)}\\
\end{array}
if t < -1.22e122Initial program 54.3
Simplified54.3
[Start]54.3 | \[ \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-*r/ [<=]54.3 | \[ \color{blue}{\sqrt{2} \cdot \frac{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/ [=>]61.9 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\frac{\left(x + 1\right) \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right)}{x - 1}} - \ell \cdot \ell}}
\] |
associate-*r/ [<=]54.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(x + 1\right) \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}} - \ell \cdot \ell}}
\] |
*-lft-identity [<=]54.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(1 \cdot \left(x + 1\right)\right)} \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1} - \ell \cdot \ell}}
\] |
associate-*r* [<=]54.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{1 \cdot \left(\left(x + 1\right) \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right)} - \ell \cdot \ell}}
\] |
*-commutative [<=]54.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{1 \cdot \color{blue}{\left(\frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1} \cdot \left(x + 1\right)\right)} - \ell \cdot \ell}}
\] |
associate-*r* [=>]54.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right) \cdot \left(x + 1\right)} - \ell \cdot \ell}}
\] |
*-commutative [<=]54.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\left(x + 1\right) \cdot \left(1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}\right)} - \ell \cdot \ell}}
\] |
fma-neg [=>]54.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(x + 1, 1 \cdot \frac{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}{x - 1}, -\ell \cdot \ell\right)}}}
\] |
Taylor expanded in t around inf 61.4
Simplified52.3
[Start]61.4 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\left(1 + x\right) \cdot {t}^{2}}{x - 1}}}
\] |
|---|---|
associate-/l* [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \color{blue}{\frac{1 + x}{\frac{x - 1}{{t}^{2}}}}}}
\] |
+-commutative [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{\color{blue}{x + 1}}{\frac{x - 1}{{t}^{2}}}}}
\] |
sub-neg [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{x + 1}{\frac{\color{blue}{x + \left(-1\right)}}{{t}^{2}}}}}
\] |
metadata-eval [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{x + 1}{\frac{x + \color{blue}{-1}}{{t}^{2}}}}}
\] |
+-commutative [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{x + 1}{\frac{\color{blue}{-1 + x}}{{t}^{2}}}}}
\] |
unpow2 [=>]52.3 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{2 \cdot \frac{x + 1}{\frac{-1 + x}{\color{blue}{t \cdot t}}}}}
\] |
Taylor expanded in t around -inf 2.1
Simplified2.1
[Start]2.1 | \[ -1 \cdot \sqrt{\frac{x - 1}{1 + x}}
\] |
|---|---|
mul-1-neg [=>]2.1 | \[ \color{blue}{-\sqrt{\frac{x - 1}{1 + x}}}
\] |
sub-neg [=>]2.1 | \[ -\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}}
\] |
metadata-eval [=>]2.1 | \[ -\sqrt{\frac{x + \color{blue}{-1}}{1 + x}}
\] |
+-commutative [=>]2.1 | \[ -\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}}
\] |
+-commutative [=>]2.1 | \[ -\sqrt{\frac{-1 + x}{\color{blue}{x + 1}}}
\] |
if -1.22e122 < t < 3.9999999999999997e126Initial program 36.7
Taylor expanded in x around inf 17.3
Simplified17.3
[Start]17.3 | \[ \frac{\sqrt{2} \cdot t}{\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}}}
\] |
|---|---|
associate--l+ [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\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)}}}
\] |
unpow2 [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\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)}}
\] |
associate-/l* [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\frac{\ell}{\frac{x}{\ell}}} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
distribute-lft-out [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
+-commutative [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
unpow2 [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(\color{blue}{t \cdot t} + \frac{{t}^{2}}{x}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
unpow2 [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{\color{blue}{t \cdot t}}{x}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
associate-/l* [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \color{blue}{\frac{t}{\frac{x}{t}}}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
associate-*r/ [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \color{blue}{\frac{-1 \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{x}}\right)}}
\] |
mul-1-neg [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{\color{blue}{-\left({\ell}^{2} + 2 \cdot {t}^{2}\right)}}{x}\right)}}
\] |
+-commutative [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\color{blue}{\left(2 \cdot {t}^{2} + {\ell}^{2}\right)}}{x}\right)}}
\] |
unpow2 [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\left(2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}\right)}{x}\right)}}
\] |
fma-udef [<=]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)}}
\] |
unpow2 [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)}}
\] |
Taylor expanded in l around 0 17.3
Simplified12.9
[Start]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\left(\frac{{\ell}^{2}}{x} + 2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)\right) - -2 \cdot \frac{{t}^{2}}{x}\right)}}
\] |
|---|---|
associate--l+ [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \color{blue}{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right) - -2 \cdot \frac{{t}^{2}}{x}\right)\right)}}}
\] |
unpow2 [=>]17.3 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right) - -2 \cdot \frac{{t}^{2}}{x}\right)\right)}}
\] |
associate-*r/ [<=]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\color{blue}{\ell \cdot \frac{\ell}{x}} + \left(2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right) - -2 \cdot \frac{{t}^{2}}{x}\right)\right)}}
\] |
fma-def [=>]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \color{blue}{\mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right) - -2 \cdot \frac{{t}^{2}}{x}\right)}}}
\] |
cancel-sign-sub-inv [=>]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right) + \left(--2\right) \cdot \frac{{t}^{2}}{x}}\right)}}
\] |
+-commutative [=>]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)} + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
unpow2 [=>]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \left(\color{blue}{t \cdot t} + \frac{{t}^{2}}{x}\right) + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
unpow2 [=>]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \left(t \cdot t + \frac{\color{blue}{t \cdot t}}{x}\right) + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
associate-*r/ [<=]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \left(t \cdot t + \color{blue}{t \cdot \frac{t}{x}}\right) + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
distribute-lft-in [<=]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \color{blue}{\left(t \cdot \left(t + \frac{t}{x}\right)\right)} + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
associate-*r* [=>]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \color{blue}{\left(2 \cdot t\right) \cdot \left(t + \frac{t}{x}\right)} + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
unpow2 [=>]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \left(2 \cdot t\right) \cdot \left(t + \frac{t}{x}\right) + \left(--2\right) \cdot \frac{\color{blue}{t \cdot t}}{x}\right)}}
\] |
associate-*r/ [<=]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \left(2 \cdot t\right) \cdot \left(t + \frac{t}{x}\right) + \left(--2\right) \cdot \color{blue}{\left(t \cdot \frac{t}{x}\right)}\right)}}
\] |
metadata-eval [=>]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \left(2 \cdot t\right) \cdot \left(t + \frac{t}{x}\right) + \color{blue}{2} \cdot \left(t \cdot \frac{t}{x}\right)\right)}}
\] |
associate-*r* [=>]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \left(2 \cdot t\right) \cdot \left(t + \frac{t}{x}\right) + \color{blue}{\left(2 \cdot t\right) \cdot \frac{t}{x}}\right)}}
\] |
distribute-lft-out [=>]12.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \color{blue}{\left(2 \cdot t\right) \cdot \left(\left(t + \frac{t}{x}\right) + \frac{t}{x}\right)}\right)}}
\] |
if 3.9999999999999997e126 < t Initial program 55.6
Taylor expanded in x around inf 56.1
Simplified56.1
[Start]56.1 | \[ \frac{\sqrt{2} \cdot t}{\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}}}
\] |
|---|---|
associate--l+ [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\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)}}}
\] |
unpow2 [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\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)}}
\] |
associate-/l* [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\frac{\ell}{\frac{x}{\ell}}} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
distribute-lft-out [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
+-commutative [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
unpow2 [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(\color{blue}{t \cdot t} + \frac{{t}^{2}}{x}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
unpow2 [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{\color{blue}{t \cdot t}}{x}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
associate-/l* [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \color{blue}{\frac{t}{\frac{x}{t}}}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}
\] |
associate-*r/ [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \color{blue}{\frac{-1 \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{x}}\right)}}
\] |
mul-1-neg [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{\color{blue}{-\left({\ell}^{2} + 2 \cdot {t}^{2}\right)}}{x}\right)}}
\] |
+-commutative [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\color{blue}{\left(2 \cdot {t}^{2} + {\ell}^{2}\right)}}{x}\right)}}
\] |
unpow2 [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\left(2 \cdot {t}^{2} + \color{blue}{\ell \cdot \ell}\right)}{x}\right)}}
\] |
fma-udef [<=]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\color{blue}{\mathsf{fma}\left(2, {t}^{2}, \ell \cdot \ell\right)}}{x}\right)}}
\] |
unpow2 [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(2 \cdot \left(t \cdot t + \frac{t}{\frac{x}{t}}\right) - \frac{-\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)}}
\] |
Taylor expanded in l around 0 56.1
Simplified54.1
[Start]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\left(\frac{{\ell}^{2}}{x} + 2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)\right) - -2 \cdot \frac{{t}^{2}}{x}\right)}}
\] |
|---|---|
associate--l+ [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \color{blue}{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right) - -2 \cdot \frac{{t}^{2}}{x}\right)\right)}}}
\] |
unpow2 [=>]56.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right) - -2 \cdot \frac{{t}^{2}}{x}\right)\right)}}
\] |
associate-*r/ [<=]54.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \left(\color{blue}{\ell \cdot \frac{\ell}{x}} + \left(2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right) - -2 \cdot \frac{{t}^{2}}{x}\right)\right)}}
\] |
fma-def [=>]54.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \color{blue}{\mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right) - -2 \cdot \frac{{t}^{2}}{x}\right)}}}
\] |
cancel-sign-sub-inv [=>]54.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right) + \left(--2\right) \cdot \frac{{t}^{2}}{x}}\right)}}
\] |
+-commutative [=>]54.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \color{blue}{\left({t}^{2} + \frac{{t}^{2}}{x}\right)} + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
unpow2 [=>]54.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \left(\color{blue}{t \cdot t} + \frac{{t}^{2}}{x}\right) + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
unpow2 [=>]54.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \left(t \cdot t + \frac{\color{blue}{t \cdot t}}{x}\right) + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
associate-*r/ [<=]54.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \left(t \cdot t + \color{blue}{t \cdot \frac{t}{x}}\right) + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
distribute-lft-in [<=]54.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, 2 \cdot \color{blue}{\left(t \cdot \left(t + \frac{t}{x}\right)\right)} + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
associate-*r* [=>]54.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \color{blue}{\left(2 \cdot t\right) \cdot \left(t + \frac{t}{x}\right)} + \left(--2\right) \cdot \frac{{t}^{2}}{x}\right)}}
\] |
unpow2 [=>]54.9 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \left(2 \cdot t\right) \cdot \left(t + \frac{t}{x}\right) + \left(--2\right) \cdot \frac{\color{blue}{t \cdot t}}{x}\right)}}
\] |
associate-*r/ [<=]54.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \left(2 \cdot t\right) \cdot \left(t + \frac{t}{x}\right) + \left(--2\right) \cdot \color{blue}{\left(t \cdot \frac{t}{x}\right)}\right)}}
\] |
metadata-eval [=>]54.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \left(2 \cdot t\right) \cdot \left(t + \frac{t}{x}\right) + \color{blue}{2} \cdot \left(t \cdot \frac{t}{x}\right)\right)}}
\] |
associate-*r* [=>]54.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \left(2 \cdot t\right) \cdot \left(t + \frac{t}{x}\right) + \color{blue}{\left(2 \cdot t\right) \cdot \frac{t}{x}}\right)}}
\] |
distribute-lft-out [=>]54.1 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell}{\frac{x}{\ell}} + \mathsf{fma}\left(\ell, \frac{\ell}{x}, \color{blue}{\left(2 \cdot t\right) \cdot \left(\left(t + \frac{t}{x}\right) + \frac{t}{x}\right)}\right)}}
\] |
Taylor expanded in t around inf 13.4
Simplified2.4
[Start]13.4 | \[ \frac{\sqrt{2} \cdot t}{\left(\sqrt{2} \cdot t\right) \cdot \sqrt{1 + 2 \cdot \frac{1}{x}} + \frac{{\ell}^{2}}{\sqrt{2} \cdot \left(t \cdot x\right)} \cdot \sqrt{\frac{1}{1 + 2 \cdot \frac{1}{x}}}}
\] |
|---|---|
fma-def [=>]13.4 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\mathsf{fma}\left(\sqrt{2} \cdot t, \sqrt{1 + 2 \cdot \frac{1}{x}}, \frac{{\ell}^{2}}{\sqrt{2} \cdot \left(t \cdot x\right)} \cdot \sqrt{\frac{1}{1 + 2 \cdot \frac{1}{x}}}\right)}}
\] |
associate-*r/ [=>]13.4 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\sqrt{2} \cdot t, \sqrt{1 + \color{blue}{\frac{2 \cdot 1}{x}}}, \frac{{\ell}^{2}}{\sqrt{2} \cdot \left(t \cdot x\right)} \cdot \sqrt{\frac{1}{1 + 2 \cdot \frac{1}{x}}}\right)}
\] |
metadata-eval [=>]13.4 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\sqrt{2} \cdot t, \sqrt{1 + \frac{\color{blue}{2}}{x}}, \frac{{\ell}^{2}}{\sqrt{2} \cdot \left(t \cdot x\right)} \cdot \sqrt{\frac{1}{1 + 2 \cdot \frac{1}{x}}}\right)}
\] |
unpow2 [=>]13.4 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\sqrt{2} \cdot t, \sqrt{1 + \frac{2}{x}}, \frac{\color{blue}{\ell \cdot \ell}}{\sqrt{2} \cdot \left(t \cdot x\right)} \cdot \sqrt{\frac{1}{1 + 2 \cdot \frac{1}{x}}}\right)}
\] |
associate-/l* [=>]2.4 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\sqrt{2} \cdot t, \sqrt{1 + \frac{2}{x}}, \color{blue}{\frac{\ell}{\frac{\sqrt{2} \cdot \left(t \cdot x\right)}{\ell}}} \cdot \sqrt{\frac{1}{1 + 2 \cdot \frac{1}{x}}}\right)}
\] |
associate-*r/ [=>]2.4 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\sqrt{2} \cdot t, \sqrt{1 + \frac{2}{x}}, \frac{\ell}{\frac{\sqrt{2} \cdot \left(t \cdot x\right)}{\ell}} \cdot \sqrt{\frac{1}{1 + \color{blue}{\frac{2 \cdot 1}{x}}}}\right)}
\] |
metadata-eval [=>]2.4 | \[ \frac{\sqrt{2} \cdot t}{\mathsf{fma}\left(\sqrt{2} \cdot t, \sqrt{1 + \frac{2}{x}}, \frac{\ell}{\frac{\sqrt{2} \cdot \left(t \cdot x\right)}{\ell}} \cdot \sqrt{\frac{1}{1 + \frac{\color{blue}{2}}{x}}}\right)}
\] |
Final simplification9.0
| Alternative 1 | |
|---|---|
| Error | 9.5 |
| Cost | 27976 |
| Alternative 2 | |
|---|---|
| Error | 9.0 |
| Cost | 21192 |
| Alternative 3 | |
|---|---|
| Error | 9.0 |
| Cost | 14408 |
| Alternative 4 | |
|---|---|
| Error | 14.3 |
| Cost | 14280 |
| Alternative 5 | |
|---|---|
| Error | 14.4 |
| Cost | 7504 |
| Alternative 6 | |
|---|---|
| Error | 14.2 |
| Cost | 7504 |
| Alternative 7 | |
|---|---|
| Error | 14.7 |
| Cost | 7376 |
| Alternative 8 | |
|---|---|
| Error | 14.3 |
| Cost | 7376 |
| Alternative 9 | |
|---|---|
| Error | 14.4 |
| Cost | 7376 |
| Alternative 10 | |
|---|---|
| Error | 14.8 |
| Cost | 6984 |
| Alternative 11 | |
|---|---|
| Error | 14.7 |
| Cost | 6984 |
| Alternative 12 | |
|---|---|
| Error | 15.8 |
| Cost | 452 |
| Alternative 13 | |
|---|---|
| Error | 16.0 |
| Cost | 196 |
| Alternative 14 | |
|---|---|
| Error | 39.0 |
| Cost | 64 |
herbie shell --seed 2023083
(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)))))