| Alternative 1 | |
|---|---|
| Error | 11.6 |
| Cost | 21448 |
(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 (/ (* l l) x))
(t_3 (* 2.0 (+ (* t t) (/ (* t t) x))))
(t_4 (sqrt (/ (+ x 1.0) (+ x -1.0))))
(t_5 (+ 2.0 (+ (/ 2.0 x) (/ 2.0 x)))))
(if (<= t -5.2e+53)
(/ t_1 (* t_1 (- t_4)))
(if (<= t -1.28e-204)
(/ t_1 (sqrt (+ t_2 (+ t_3 (/ (fma l l (* 2.0 (* t t))) x)))))
(if (<= t -2.3e-268)
(*
t
(/
(sqrt 2.0)
(- (fma t (sqrt t_5) (* (sqrt (/ 1.0 t_5)) (* (/ l x) (/ l t)))))))
(if (<= t 1.12e+16)
(* t (/ (sqrt 2.0) (sqrt (+ t_2 (+ t_2 t_3)))))
(/ t_1 (* t_1 t_4))))))))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 = (l * l) / x;
double t_3 = 2.0 * ((t * t) + ((t * t) / x));
double t_4 = sqrt(((x + 1.0) / (x + -1.0)));
double t_5 = 2.0 + ((2.0 / x) + (2.0 / x));
double tmp;
if (t <= -5.2e+53) {
tmp = t_1 / (t_1 * -t_4);
} else if (t <= -1.28e-204) {
tmp = t_1 / sqrt((t_2 + (t_3 + (fma(l, l, (2.0 * (t * t))) / x))));
} else if (t <= -2.3e-268) {
tmp = t * (sqrt(2.0) / -fma(t, sqrt(t_5), (sqrt((1.0 / t_5)) * ((l / x) * (l / t)))));
} else if (t <= 1.12e+16) {
tmp = t * (sqrt(2.0) / sqrt((t_2 + (t_2 + t_3))));
} else {
tmp = t_1 / (t_1 * t_4);
}
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(Float64(l * l) / x) t_3 = Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) t_4 = sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))) t_5 = Float64(2.0 + Float64(Float64(2.0 / x) + Float64(2.0 / x))) tmp = 0.0 if (t <= -5.2e+53) tmp = Float64(t_1 / Float64(t_1 * Float64(-t_4))); elseif (t <= -1.28e-204) tmp = Float64(t_1 / sqrt(Float64(t_2 + Float64(t_3 + Float64(fma(l, l, Float64(2.0 * Float64(t * t))) / x))))); elseif (t <= -2.3e-268) tmp = Float64(t * Float64(sqrt(2.0) / Float64(-fma(t, sqrt(t_5), Float64(sqrt(Float64(1.0 / t_5)) * Float64(Float64(l / x) * Float64(l / t))))))); elseif (t <= 1.12e+16) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_2 + Float64(t_2 + t_3))))); else tmp = Float64(t_1 / Float64(t_1 * t_4)); 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[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(2.0 + N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.2e+53], N[(t$95$1 / N[(t$95$1 * (-t$95$4)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.28e-204], N[(t$95$1 / N[Sqrt[N[(t$95$2 + N[(t$95$3 + N[(N[(l * l + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.3e-268], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / (-N[(t * N[Sqrt[t$95$5], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t$95$5), $MachinePrecision]], $MachinePrecision] * N[(N[(l / x), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e+16], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[(t$95$2 + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(t$95$1 * t$95$4), $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 := \frac{\ell \cdot \ell}{x}\\
t_3 := 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\\
t_4 := \sqrt{\frac{x + 1}{x + -1}}\\
t_5 := 2 + \left(\frac{2}{x} + \frac{2}{x}\right)\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+53}:\\
\;\;\;\;\frac{t_1}{t_1 \cdot \left(-t_4\right)}\\
\mathbf{elif}\;t \leq -1.28 \cdot 10^{-204}:\\
\;\;\;\;\frac{t_1}{\sqrt{t_2 + \left(t_3 + \frac{\mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right)}{x}\right)}}\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-268}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{-\mathsf{fma}\left(t, \sqrt{t_5}, \sqrt{\frac{1}{t_5}} \cdot \left(\frac{\ell}{x} \cdot \frac{\ell}{t}\right)\right)}\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{+16}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_2 + \left(t_2 + t_3\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{t_1 \cdot t_4}\\
\end{array}
if t < -5.19999999999999996e53Initial program 46.4
Simplified46.4
[Start]46.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}}
\] |
|---|---|
*-lft-identity [<=]46.4 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\left(1 \cdot \frac{x + 1}{x - 1}\right)} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
*-lft-identity [=>]46.4 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\frac{x + 1}{x - 1}} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
sub-neg [=>]46.4 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
metadata-eval [=>]46.4 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x + \color{blue}{-1}} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
fma-def [=>]46.4 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x + -1} \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right)} - \ell \cdot \ell}}
\] |
Taylor expanded in t around -inf 4.1
Simplified4.1
[Start]4.1 | \[ \frac{\sqrt{2} \cdot t}{-1 \cdot \left(\left(\sqrt{2} \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}
\] |
|---|---|
associate-*r* [=>]4.1 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\left(-1 \cdot \left(\sqrt{2} \cdot t\right)\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}}
\] |
*-commutative [<=]4.1 | \[ \frac{\sqrt{2} \cdot t}{\left(-1 \cdot \color{blue}{\left(t \cdot \sqrt{2}\right)}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}
\] |
associate-*r* [=>]4.1 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\left(\left(-1 \cdot t\right) \cdot \sqrt{2}\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}}
\] |
neg-mul-1 [<=]4.1 | \[ \frac{\sqrt{2} \cdot t}{\left(\color{blue}{\left(-t\right)} \cdot \sqrt{2}\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}
\] |
*-commutative [<=]4.1 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\left(\sqrt{2} \cdot \left(-t\right)\right)} \cdot \sqrt{\frac{1 + x}{x - 1}}}
\] |
sub-neg [=>]4.1 | \[ \frac{\sqrt{2} \cdot t}{\left(\sqrt{2} \cdot \left(-t\right)\right) \cdot \sqrt{\frac{1 + x}{\color{blue}{x + \left(-1\right)}}}}
\] |
metadata-eval [=>]4.1 | \[ \frac{\sqrt{2} \cdot t}{\left(\sqrt{2} \cdot \left(-t\right)\right) \cdot \sqrt{\frac{1 + x}{x + \color{blue}{-1}}}}
\] |
+-commutative [=>]4.1 | \[ \frac{\sqrt{2} \cdot t}{\left(\sqrt{2} \cdot \left(-t\right)\right) \cdot \sqrt{\frac{\color{blue}{x + 1}}{x + -1}}}
\] |
+-commutative [=>]4.1 | \[ \frac{\sqrt{2} \cdot t}{\left(\sqrt{2} \cdot \left(-t\right)\right) \cdot \sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}}
\] |
if -5.19999999999999996e53 < t < -1.28000000000000004e-204Initial program 33.5
Simplified33.5
[Start]33.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}}
\] |
|---|---|
*-lft-identity [<=]33.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\left(1 \cdot \frac{x + 1}{x - 1}\right)} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
*-lft-identity [=>]33.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\frac{x + 1}{x - 1}} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
sub-neg [=>]33.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
metadata-eval [=>]33.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x + \color{blue}{-1}} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
fma-def [=>]33.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x + -1} \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right)} - \ell \cdot \ell}}
\] |
Taylor expanded in x around inf 13.7
Simplified13.7
[Start]13.7 | \[ \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+ [=>]13.7 | \[ \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 [=>]13.7 | \[ \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)}}
\] |
distribute-lft-out [=>]13.7 | \[ \frac{\sqrt{2} \cdot t}{\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)}}
\] |
unpow2 [=>]13.7 | \[ \frac{\sqrt{2} \cdot t}{\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)}}
\] |
unpow2 [=>]13.7 | \[ \frac{\sqrt{2} \cdot t}{\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)}}
\] |
associate-*r/ [=>]13.7 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \color{blue}{\frac{-1 \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{x}}\right)}}
\] |
mul-1-neg [=>]13.7 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{\color{blue}{-\left({\ell}^{2} + 2 \cdot {t}^{2}\right)}}{x}\right)}}
\] |
unpow2 [=>]13.7 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{-\left(\color{blue}{\ell \cdot \ell} + 2 \cdot {t}^{2}\right)}{x}\right)}}
\] |
unpow2 [=>]13.7 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{-\left(\ell \cdot \ell + 2 \cdot \color{blue}{\left(t \cdot t\right)}\right)}{x}\right)}}
\] |
fma-udef [<=]13.7 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{-\color{blue}{\mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right)}}{x}\right)}}
\] |
if -1.28000000000000004e-204 < t < -2.3000000000000001e-268Initial program 62.6
Simplified62.6
[Start]62.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/ [<=]62.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 [=>]62.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 [=>]62.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
\] |
Taylor expanded in x around inf 34.4
Simplified34.4
[Start]34.4 | \[ \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+ [=>]34.4 | \[ \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 [=>]34.4 | \[ \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 [=>]34.4 | \[ \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 [=>]34.4 | \[ \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 [=>]34.4 | \[ \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 [=>]34.4 | \[ \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 [=>]34.4 | \[ \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 [=>]34.4 | \[ \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 [<=]34.4 | \[ \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 [=>]34.4 | \[ \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 26.6
Simplified26.7
[Start]26.6 | \[ \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 [=>]26.6 | \[ \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 [=>]26.6 | \[ \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 [=>]26.6 | \[ \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 [<=]26.6 | \[ \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 [=>]26.6 | \[ \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 -2.3000000000000001e-268 < t < 1.12e16Initial program 45.3
Simplified45.2
[Start]45.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-*l/ [<=]45.2 | \[ \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 [=>]45.2 | \[ \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 [=>]45.2 | \[ \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 20.8
Simplified20.8
[Start]20.8 | \[ \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+ [=>]20.8 | \[ \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 [=>]20.8 | \[ \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 [=>]20.8 | \[ \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 [=>]20.8 | \[ \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 [=>]20.8 | \[ \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 [=>]20.8 | \[ \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 [=>]20.8 | \[ \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 [=>]20.8 | \[ \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 [<=]20.8 | \[ \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 [=>]20.8 | \[ \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 0 20.9
Simplified20.9
[Start]20.9 | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{{\ell}^{2}}{x}\right)\right)}} \cdot t
\] |
|---|---|
unpow2 [=>]20.9 | \[ \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}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
if 1.12e16 < t Initial program 42.6
Taylor expanded in l around 0 4.6
Final simplification11.2
| Alternative 1 | |
|---|---|
| Error | 11.6 |
| Cost | 21448 |
| Alternative 2 | |
|---|---|
| Error | 11.8 |
| Cost | 20688 |
| Alternative 3 | |
|---|---|
| Error | 11.6 |
| Cost | 20688 |
| Alternative 4 | |
|---|---|
| Error | 12.0 |
| Cost | 15056 |
| Alternative 5 | |
|---|---|
| Error | 12.0 |
| Cost | 15056 |
| Alternative 6 | |
|---|---|
| Error | 14.6 |
| Cost | 14288 |
| Alternative 7 | |
|---|---|
| Error | 14.4 |
| Cost | 14288 |
| Alternative 8 | |
|---|---|
| Error | 15.2 |
| Cost | 14032 |
| Alternative 9 | |
|---|---|
| Error | 14.7 |
| Cost | 14032 |
| Alternative 10 | |
|---|---|
| Error | 15.3 |
| Cost | 13708 |
| Alternative 11 | |
|---|---|
| Error | 15.5 |
| Cost | 13452 |
| Alternative 12 | |
|---|---|
| Error | 33.8 |
| Cost | 6984 |
| Alternative 13 | |
|---|---|
| Error | 33.8 |
| Cost | 6984 |
| Alternative 14 | |
|---|---|
| Error | 34.8 |
| Cost | 6852 |
| Alternative 15 | |
|---|---|
| Error | 34.4 |
| Cost | 6852 |
| Alternative 16 | |
|---|---|
| Error | 36.9 |
| Cost | 836 |
| Alternative 17 | |
|---|---|
| Error | 36.9 |
| Cost | 324 |
| Alternative 18 | |
|---|---|
| Error | 38.7 |
| Cost | 64 |
herbie shell --seed 2023039
(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)))))