| Alternative 1 | |
|---|---|
| Accuracy | 84.7% |
| Cost | 28244 |
(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 (fma t (+ t (/ t x)) (* l (/ l x))))))
(t_2 (* t (sqrt 2.0)))
(t_3 (/ l (sqrt x))))
(if (<= t -2e+82)
(/ t_2 (* t_2 (- (sqrt (/ (+ x 1.0) (+ x -1.0))))))
(if (<= t -2.8e-160)
t_1
(if (<= t 1.05e-179)
(*
t
(/
(sqrt 2.0)
(hypot (hypot (* (sqrt 2.0) (hypot t (/ t (sqrt x)))) t_3) t_3)))
(if (<= t 4.5e-8) t_1 (sqrt (/ 2.0 (+ 2.0 (/ 4.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 = t / sqrt(fma(t, (t + (t / x)), (l * (l / x))));
double t_2 = t * sqrt(2.0);
double t_3 = l / sqrt(x);
double tmp;
if (t <= -2e+82) {
tmp = t_2 / (t_2 * -sqrt(((x + 1.0) / (x + -1.0))));
} else if (t <= -2.8e-160) {
tmp = t_1;
} else if (t <= 1.05e-179) {
tmp = t * (sqrt(2.0) / hypot(hypot((sqrt(2.0) * hypot(t, (t / sqrt(x)))), t_3), t_3));
} else if (t <= 4.5e-8) {
tmp = t_1;
} else {
tmp = sqrt((2.0 / (2.0 + (4.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(t / sqrt(fma(t, Float64(t + Float64(t / x)), Float64(l * Float64(l / x))))) t_2 = Float64(t * sqrt(2.0)) t_3 = Float64(l / sqrt(x)) tmp = 0.0 if (t <= -2e+82) tmp = Float64(t_2 / Float64(t_2 * Float64(-sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0)))))); elseif (t <= -2.8e-160) tmp = t_1; elseif (t <= 1.05e-179) tmp = Float64(t * Float64(sqrt(2.0) / hypot(hypot(Float64(sqrt(2.0) * hypot(t, Float64(t / sqrt(x)))), t_3), t_3))); elseif (t <= 4.5e-8) tmp = t_1; else tmp = sqrt(Float64(2.0 / Float64(2.0 + Float64(4.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[(t / N[Sqrt[N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(l / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+82], N[(t$95$2 / N[(t$95$2 * (-N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.8e-160], t$95$1, If[LessEqual[t, 1.05e-179], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[Sqrt[N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[t ^ 2 + N[(t / N[Sqrt[x], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] ^ 2 + t$95$3 ^ 2], $MachinePrecision] ^ 2 + t$95$3 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-8], t$95$1, N[Sqrt[N[(2.0 / N[(2.0 + N[(4.0 / x), $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{t}{\sqrt{\mathsf{fma}\left(t, t + \frac{t}{x}, \ell \cdot \frac{\ell}{x}\right)}}\\
t_2 := t \cdot \sqrt{2}\\
t_3 := \frac{\ell}{\sqrt{x}}\\
\mathbf{if}\;t \leq -2 \cdot 10^{+82}:\\
\;\;\;\;\frac{t_2}{t_2 \cdot \left(-\sqrt{\frac{x + 1}{x + -1}}\right)}\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{-160}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-179}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{hypot}\left(\mathsf{hypot}\left(\sqrt{2} \cdot \mathsf{hypot}\left(t, \frac{t}{\sqrt{x}}\right), t_3\right), t_3\right)}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{2}{2 + \frac{4}{x}}}\\
\end{array}
if t < -1.9999999999999999e82Initial program 24.3%
Taylor expanded in t around -inf 94.8%
Simplified94.8%
[Start]94.8 | \[ \frac{\sqrt{2} \cdot t}{-1 \cdot \left(\left(\sqrt{2} \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}\right)}
\] |
|---|---|
mul-1-neg [=>]94.8 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{-\left(\sqrt{2} \cdot t\right) \cdot \sqrt{\frac{1 + x}{x - 1}}}}
\] |
distribute-rgt-neg-in [=>]94.8 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\left(\sqrt{2} \cdot t\right) \cdot \left(-\sqrt{\frac{1 + x}{x - 1}}\right)}}
\] |
*-commutative [<=]94.8 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\left(t \cdot \sqrt{2}\right)} \cdot \left(-\sqrt{\frac{1 + x}{x - 1}}\right)}
\] |
+-commutative [<=]94.8 | \[ \frac{\sqrt{2} \cdot t}{\left(t \cdot \sqrt{2}\right) \cdot \left(-\sqrt{\frac{\color{blue}{x + 1}}{x - 1}}\right)}
\] |
sub-neg [=>]94.8 | \[ \frac{\sqrt{2} \cdot t}{\left(t \cdot \sqrt{2}\right) \cdot \left(-\sqrt{\frac{x + 1}{\color{blue}{x + \left(-1\right)}}}\right)}
\] |
metadata-eval [=>]94.8 | \[ \frac{\sqrt{2} \cdot t}{\left(t \cdot \sqrt{2}\right) \cdot \left(-\sqrt{\frac{x + 1}{x + \color{blue}{-1}}}\right)}
\] |
+-commutative [=>]94.8 | \[ \frac{\sqrt{2} \cdot t}{\left(t \cdot \sqrt{2}\right) \cdot \left(-\sqrt{\frac{x + 1}{\color{blue}{-1 + x}}}\right)}
\] |
if -1.9999999999999999e82 < t < -2.80000000000000016e-160 or 1.0499999999999999e-179 < t < 4.49999999999999993e-8Initial program 51.7%
Simplified51.8%
[Start]51.7 | \[ \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/ [<=]51.8 | \[ \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}
\] |
Taylor expanded in x around inf 82.7%
Simplified82.7%
[Start]82.7 | \[ \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+ [=>]82.7 | \[ \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 [=>]82.7 | \[ \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 [=>]82.7 | \[ \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 [=>]82.7 | \[ \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 [=>]82.7 | \[ \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 [=>]82.7 | \[ \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
\] |
unpow2 [=>]82.7 | \[ \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} + 2 \cdot {t}^{2}}{x}\right)\right)}} \cdot t
\] |
+-commutative [=>]82.7 | \[ \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 \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]82.7 | \[ \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 \color{blue}{\left(t \cdot t\right)} + \ell \cdot \ell}{x}\right)\right)}} \cdot t
\] |
fma-udef [<=]82.7 | \[ \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 \cdot t, \ell \cdot \ell\right)}}{x}\right)\right)}} \cdot t
\] |
Taylor expanded in t around 0 82.2%
Simplified82.2%
[Start]82.2 | \[ \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 [=>]82.2 | \[ \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
\] |
Applied egg-rr89.8%
[Start]82.2 | \[ \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 \cdot \ell}{x}\right)\right)}} \cdot t
\] |
|---|---|
pow1/2 [=>]82.2 | \[ \frac{\sqrt{2}}{\color{blue}{{\left(\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\ell \cdot \ell}{x}\right)\right)\right)}^{0.5}}} \cdot t
\] |
sqr-pow [=>]82.0 | \[ \frac{\sqrt{2}}{\color{blue}{{\left(\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\ell \cdot \ell}{x}\right)\right)\right)}^{\left(\frac{0.5}{2}\right)} \cdot {\left(\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\ell \cdot \ell}{x}\right)\right)\right)}^{\left(\frac{0.5}{2}\right)}}} \cdot t
\] |
Simplified90.1%
[Start]89.8 | \[ \frac{\sqrt{2}}{{\left(\mathsf{fma}\left(2, \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right), \mathsf{fma}\left(\frac{\ell}{x}, \ell, \frac{\ell}{x} \cdot \ell\right)\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(2, \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right), \mathsf{fma}\left(\frac{\ell}{x}, \ell, \frac{\ell}{x} \cdot \ell\right)\right)\right)}^{0.25}} \cdot t
\] |
|---|---|
pow-sqr [=>]90.1 | \[ \frac{\sqrt{2}}{\color{blue}{{\left(\mathsf{fma}\left(2, \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right), \mathsf{fma}\left(\frac{\ell}{x}, \ell, \frac{\ell}{x} \cdot \ell\right)\right)\right)}^{\left(2 \cdot 0.25\right)}}} \cdot t
\] |
metadata-eval [=>]90.1 | \[ \frac{\sqrt{2}}{{\left(\mathsf{fma}\left(2, \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right), \mathsf{fma}\left(\frac{\ell}{x}, \ell, \frac{\ell}{x} \cdot \ell\right)\right)\right)}^{\color{blue}{0.5}}} \cdot t
\] |
unpow1/2 [=>]90.1 | \[ \frac{\sqrt{2}}{\color{blue}{\sqrt{\mathsf{fma}\left(2, \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right), \mathsf{fma}\left(\frac{\ell}{x}, \ell, \frac{\ell}{x} \cdot \ell\right)\right)}}} \cdot t
\] |
fma-udef [=>]90.1 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right) + \mathsf{fma}\left(\frac{\ell}{x}, \ell, \frac{\ell}{x} \cdot \ell\right)}}} \cdot t
\] |
+-commutative [=>]90.1 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{\ell}{x}, \ell, \frac{\ell}{x} \cdot \ell\right) + 2 \cdot \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right)}}} \cdot t
\] |
fma-udef [=>]90.1 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\left(\frac{\ell}{x} \cdot \ell + \frac{\ell}{x} \cdot \ell\right)} + 2 \cdot \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right)}} \cdot t
\] |
count-2 [=>]90.1 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \left(\frac{\ell}{x} \cdot \ell\right)} + 2 \cdot \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right)}} \cdot t
\] |
distribute-lft-out [=>]90.1 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right)\right)}}} \cdot t
\] |
*-commutative [=>]90.1 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\color{blue}{\ell \cdot \frac{\ell}{x}} + \mathsf{fma}\left(\frac{t}{x}, t, t \cdot t\right)\right)}} \cdot t
\] |
fma-udef [=>]90.1 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + \color{blue}{\left(\frac{t}{x} \cdot t + t \cdot t\right)}\right)}} \cdot t
\] |
+-commutative [=>]90.1 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + \color{blue}{\left(t \cdot t + \frac{t}{x} \cdot t\right)}\right)}} \cdot t
\] |
distribute-rgt-out [=>]90.1 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + \color{blue}{t \cdot \left(t + \frac{t}{x}\right)}\right)}} \cdot t
\] |
Applied egg-rr90.3%
[Start]90.1 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + t \cdot \left(t + \frac{t}{x}\right)\right)}} \cdot t
\] |
|---|---|
associate-*l/ [=>]90.0 | \[ \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x} + t \cdot \left(t + \frac{t}{x}\right)\right)}}}
\] |
sqrt-prod [=>]90.4 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\sqrt{2} \cdot \sqrt{\ell \cdot \frac{\ell}{x} + t \cdot \left(t + \frac{t}{x}\right)}}}
\] |
associate-/r* [=>]90.3 | \[ \color{blue}{\frac{\frac{\sqrt{2} \cdot t}{\sqrt{2}}}{\sqrt{\ell \cdot \frac{\ell}{x} + t \cdot \left(t + \frac{t}{x}\right)}}}
\] |
*-commutative [=>]90.3 | \[ \frac{\frac{\color{blue}{t \cdot \sqrt{2}}}{\sqrt{2}}}{\sqrt{\ell \cdot \frac{\ell}{x} + t \cdot \left(t + \frac{t}{x}\right)}}
\] |
+-commutative [=>]90.3 | \[ \frac{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}{\sqrt{\color{blue}{t \cdot \left(t + \frac{t}{x}\right) + \ell \cdot \frac{\ell}{x}}}}
\] |
fma-def [=>]90.3 | \[ \frac{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}{\sqrt{\color{blue}{\mathsf{fma}\left(t, t + \frac{t}{x}, \ell \cdot \frac{\ell}{x}\right)}}}
\] |
Simplified90.5%
[Start]90.3 | \[ \frac{\frac{t \cdot \sqrt{2}}{\sqrt{2}}}{\sqrt{\mathsf{fma}\left(t, t + \frac{t}{x}, \ell \cdot \frac{\ell}{x}\right)}}
\] |
|---|---|
associate-/l* [=>]90.5 | \[ \frac{\color{blue}{\frac{t}{\frac{\sqrt{2}}{\sqrt{2}}}}}{\sqrt{\mathsf{fma}\left(t, t + \frac{t}{x}, \ell \cdot \frac{\ell}{x}\right)}}
\] |
*-inverses [=>]90.5 | \[ \frac{\frac{t}{\color{blue}{1}}}{\sqrt{\mathsf{fma}\left(t, t + \frac{t}{x}, \ell \cdot \frac{\ell}{x}\right)}}
\] |
/-rgt-identity [=>]90.5 | \[ \frac{\color{blue}{t}}{\sqrt{\mathsf{fma}\left(t, t + \frac{t}{x}, \ell \cdot \frac{\ell}{x}\right)}}
\] |
if -2.80000000000000016e-160 < t < 1.0499999999999999e-179Initial program 2.0%
Simplified2.0%
[Start]2.0 | \[ \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/ [<=]2.0 | \[ \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}
\] |
Taylor expanded in x around inf 47.1%
Simplified47.1%
[Start]47.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+ [=>]47.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 [=>]47.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 [=>]47.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 [=>]47.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 [=>]47.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 [=>]47.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
\] |
unpow2 [=>]47.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}{\ell \cdot \ell} + 2 \cdot {t}^{2}}{x}\right)\right)}} \cdot t
\] |
+-commutative [=>]47.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 \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]47.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 \color{blue}{\left(t \cdot t\right)} + \ell \cdot \ell}{x}\right)\right)}} \cdot t
\] |
fma-udef [<=]47.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 \cdot t, \ell \cdot \ell\right)}}{x}\right)\right)}} \cdot t
\] |
Taylor expanded in t around 0 47.1%
Simplified47.1%
[Start]47.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{{\ell}^{2}}{x}\right)\right)}} \cdot t
\] |
|---|---|
unpow2 [=>]47.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}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
Applied egg-rr78.3%
[Start]47.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{\ell \cdot \ell}{x}\right)\right)}} \cdot t
\] |
|---|---|
+-commutative [=>]47.1 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\ell \cdot \ell}{x}\right)\right) + \frac{\ell \cdot \ell}{x}}}} \cdot t
\] |
add-sqr-sqrt [=>]47.1 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\sqrt{2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\ell \cdot \ell}{x}\right)} \cdot \sqrt{2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\ell \cdot \ell}{x}\right)}} + \frac{\ell \cdot \ell}{x}}} \cdot t
\] |
add-sqr-sqrt [=>]47.1 | \[ \frac{\sqrt{2}}{\sqrt{\sqrt{2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\ell \cdot \ell}{x}\right)} \cdot \sqrt{2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\ell \cdot \ell}{x}\right)} + \color{blue}{\sqrt{\frac{\ell \cdot \ell}{x}} \cdot \sqrt{\frac{\ell \cdot \ell}{x}}}}} \cdot t
\] |
hypot-def [=>]47.1 | \[ \frac{\sqrt{2}}{\color{blue}{\mathsf{hypot}\left(\sqrt{2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \left(-\frac{\ell \cdot \ell}{x}\right)}, \sqrt{\frac{\ell \cdot \ell}{x}}\right)}} \cdot t
\] |
if 4.49999999999999993e-8 < t Initial program 35.8%
Simplified35.8%
[Start]35.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/ [<=]35.8 | \[ \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}
\] |
Taylor expanded in x around inf 40.2%
Simplified40.2%
[Start]40.2 | \[ \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+ [=>]40.2 | \[ \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 [=>]40.2 | \[ \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 [=>]40.2 | \[ \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 [=>]40.2 | \[ \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 [=>]40.2 | \[ \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 [=>]40.2 | \[ \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
\] |
unpow2 [=>]40.2 | \[ \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} + 2 \cdot {t}^{2}}{x}\right)\right)}} \cdot t
\] |
+-commutative [=>]40.2 | \[ \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 \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]40.2 | \[ \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 \color{blue}{\left(t \cdot t\right)} + \ell \cdot \ell}{x}\right)\right)}} \cdot t
\] |
fma-udef [<=]40.2 | \[ \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 \cdot t, \ell \cdot \ell\right)}}{x}\right)\right)}} \cdot t
\] |
Taylor expanded in t around -inf 1.6%
Simplified1.6%
[Start]1.6 | \[ \frac{\sqrt{2}}{-1 \cdot \left(t \cdot \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}\right)} \cdot t
\] |
|---|---|
mul-1-neg [=>]1.6 | \[ \frac{\sqrt{2}}{\color{blue}{-t \cdot \sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}}} \cdot t
\] |
distribute-rgt-neg-in [=>]1.6 | \[ \frac{\sqrt{2}}{\color{blue}{t \cdot \left(-\sqrt{2 \cdot \left(1 + \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}\right)}} \cdot t
\] |
distribute-lft-in [=>]1.6 | \[ \frac{\sqrt{2}}{t \cdot \left(-\sqrt{\color{blue}{\left(2 \cdot 1 + 2 \cdot \frac{1}{x}\right)} + 2 \cdot \frac{1}{x}}\right)} \cdot t
\] |
metadata-eval [=>]1.6 | \[ \frac{\sqrt{2}}{t \cdot \left(-\sqrt{\left(\color{blue}{2} + 2 \cdot \frac{1}{x}\right) + 2 \cdot \frac{1}{x}}\right)} \cdot t
\] |
associate-+l+ [=>]1.6 | \[ \frac{\sqrt{2}}{t \cdot \left(-\sqrt{\color{blue}{2 + \left(2 \cdot \frac{1}{x} + 2 \cdot \frac{1}{x}\right)}}\right)} \cdot t
\] |
associate-*r/ [=>]1.6 | \[ \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\color{blue}{\frac{2 \cdot 1}{x}} + 2 \cdot \frac{1}{x}\right)}\right)} \cdot t
\] |
metadata-eval [=>]1.6 | \[ \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{\color{blue}{2}}{x} + 2 \cdot \frac{1}{x}\right)}\right)} \cdot t
\] |
associate-*r/ [=>]1.6 | \[ \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \color{blue}{\frac{2 \cdot 1}{x}}\right)}\right)} \cdot t
\] |
metadata-eval [=>]1.6 | \[ \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{\color{blue}{2}}{x}\right)}\right)} \cdot t
\] |
Applied egg-rr40.3%
[Start]1.6 | \[ \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)} \cdot t
\] |
|---|---|
add-sqr-sqrt [=>]0.0 | \[ \color{blue}{\sqrt{\frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)} \cdot t} \cdot \sqrt{\frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)} \cdot t}}
\] |
sqrt-unprod [=>]90.4 | \[ \color{blue}{\sqrt{\left(\frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)} \cdot t\right) \cdot \left(\frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)} \cdot t\right)}}
\] |
*-commutative [=>]90.4 | \[ \sqrt{\color{blue}{\left(t \cdot \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)}\right)} \cdot \left(\frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)} \cdot t\right)}
\] |
*-commutative [=>]90.4 | \[ \sqrt{\left(t \cdot \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)}\right) \cdot \color{blue}{\left(t \cdot \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)}\right)}}
\] |
swap-sqr [=>]40.3 | \[ \sqrt{\color{blue}{\left(t \cdot t\right) \cdot \left(\frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)} \cdot \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)}\right)}}
\] |
frac-times [=>]40.3 | \[ \sqrt{\left(t \cdot t\right) \cdot \color{blue}{\frac{\sqrt{2} \cdot \sqrt{2}}{\left(t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)\right) \cdot \left(t \cdot \left(-\sqrt{2 + \left(\frac{2}{x} + \frac{2}{x}\right)}\right)\right)}}}
\] |
Simplified90.9%
[Start]40.3 | \[ \sqrt{\left(t \cdot t\right) \cdot \frac{2}{\left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)}}
\] |
|---|---|
associate-*r/ [=>]40.4 | \[ \sqrt{\color{blue}{\frac{\left(t \cdot t\right) \cdot 2}{\left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)}}}
\] |
*-commutative [=>]40.4 | \[ \sqrt{\frac{\left(t \cdot t\right) \cdot 2}{\color{blue}{\left(t \cdot t\right) \cdot \left(2 + \frac{4}{x}\right)}}}
\] |
times-frac [=>]40.6 | \[ \sqrt{\color{blue}{\frac{t \cdot t}{t \cdot t} \cdot \frac{2}{2 + \frac{4}{x}}}}
\] |
*-inverses [=>]90.9 | \[ \sqrt{\color{blue}{1} \cdot \frac{2}{2 + \frac{4}{x}}}
\] |
Final simplification89.4%
| Alternative 1 | |
|---|---|
| Accuracy | 84.7% |
| Cost | 28244 |
| Alternative 2 | |
|---|---|
| Accuracy | 85.2% |
| Cost | 28172 |
| Alternative 3 | |
|---|---|
| Accuracy | 84.0% |
| Cost | 20356 |
| Alternative 4 | |
|---|---|
| Accuracy | 84.0% |
| Cost | 20356 |
| Alternative 5 | |
|---|---|
| Accuracy | 83.8% |
| Cost | 20100 |
| Alternative 6 | |
|---|---|
| Accuracy | 83.9% |
| Cost | 14160 |
| Alternative 7 | |
|---|---|
| Accuracy | 77.9% |
| Cost | 14033 |
| Alternative 8 | |
|---|---|
| Accuracy | 78.0% |
| Cost | 13444 |
| Alternative 9 | |
|---|---|
| Accuracy | 77.7% |
| Cost | 7569 |
| Alternative 10 | |
|---|---|
| Accuracy | 45.7% |
| Cost | 7112 |
| Alternative 11 | |
|---|---|
| Accuracy | 60.6% |
| Cost | 7112 |
| Alternative 12 | |
|---|---|
| Accuracy | 77.5% |
| Cost | 7112 |
| Alternative 13 | |
|---|---|
| Accuracy | 77.8% |
| Cost | 7112 |
| Alternative 14 | |
|---|---|
| Accuracy | 45.7% |
| Cost | 7048 |
| Alternative 15 | |
|---|---|
| Accuracy | 44.4% |
| Cost | 6984 |
| Alternative 16 | |
|---|---|
| Accuracy | 45.5% |
| Cost | 6984 |
| Alternative 17 | |
|---|---|
| Accuracy | 45.3% |
| Cost | 6852 |
| Alternative 18 | |
|---|---|
| Accuracy | 46.1% |
| Cost | 6852 |
| Alternative 19 | |
|---|---|
| Accuracy | 39.2% |
| Cost | 64 |
herbie shell --seed 2023136
(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)))))