| Alternative 1 | |
|---|---|
| Accuracy | 84.6% |
| Cost | 20356 |
(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 (/ 1.0 (fma t (+ t (/ t x)) (/ l (/ x l))))))))
(if (<= t -1.12e+39)
(- (sqrt (/ (- 1.0 x) (- -1.0 x))))
(if (<= t -1.55e-268)
t_1
(if (<= t 6.5e-293)
(/ (* t (sqrt 2.0)) (* l (sqrt (+ (/ 2.0 (* x x)) (/ 2.0 x)))))
(if (<= t 6.5e+43) t_1 1.0))))))double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
double code(double x, double l, double t) {
double t_1 = t * sqrt((1.0 / fma(t, (t + (t / x)), (l / (x / l)))));
double tmp;
if (t <= -1.12e+39) {
tmp = -sqrt(((1.0 - x) / (-1.0 - x)));
} else if (t <= -1.55e-268) {
tmp = t_1;
} else if (t <= 6.5e-293) {
tmp = (t * sqrt(2.0)) / (l * sqrt(((2.0 / (x * x)) + (2.0 / x))));
} else if (t <= 6.5e+43) {
tmp = t_1;
} else {
tmp = 1.0;
}
return tmp;
}
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function code(x, l, t) t_1 = Float64(t * sqrt(Float64(1.0 / fma(t, Float64(t + Float64(t / x)), Float64(l / Float64(x / l)))))) tmp = 0.0 if (t <= -1.12e+39) tmp = Float64(-sqrt(Float64(Float64(1.0 - x) / Float64(-1.0 - x)))); elseif (t <= -1.55e-268) tmp = t_1; elseif (t <= 6.5e-293) tmp = Float64(Float64(t * sqrt(2.0)) / Float64(l * sqrt(Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x))))); elseif (t <= 6.5e+43) tmp = t_1; else tmp = 1.0; end return tmp end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[Sqrt[N[(1.0 / N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision] + N[(l / N[(x / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.12e+39], (-N[Sqrt[N[(N[(1.0 - x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -1.55e-268], t$95$1, If[LessEqual[t, 6.5e-293], N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[Sqrt[N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e+43], t$95$1, 1.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}}
\begin{array}{l}
t_1 := t \cdot \sqrt{\frac{1}{\mathsf{fma}\left(t, t + \frac{t}{x}, \frac{\ell}{\frac{x}{\ell}}\right)}}\\
\mathbf{if}\;t \leq -1.12 \cdot 10^{+39}:\\
\;\;\;\;-\sqrt{\frac{1 - x}{-1 - x}}\\
\mathbf{elif}\;t \leq -1.55 \cdot 10^{-268}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-293}:\\
\;\;\;\;\frac{t \cdot \sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{2}{x}}}\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+43}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
if t < -1.12e39Initial program 33.1%
Simplified33.1%
[Start]33.1 | \[ \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/ [<=]33.1 | \[ \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}}}
\] |
fma-neg [=>]33.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}}
\] |
+-commutative [=>]33.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \color{blue}{2 \cdot \left(t \cdot t\right) + \ell \cdot \ell}, -\ell \cdot \ell\right)}}
\] |
fma-def [=>]33.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}, -\ell \cdot \ell\right)}}
\] |
distribute-rgt-neg-in [=>]33.1 | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \color{blue}{\ell \cdot \left(-\ell\right)}\right)}}
\] |
Taylor expanded in t around -inf 92.2%
Simplified92.2%
[Start]92.2 | \[ \sqrt{2} \cdot \left(-1 \cdot \left(\sqrt{0.5} \cdot \sqrt{\frac{x - 1}{1 + x}}\right)\right)
\] |
|---|---|
mul-1-neg [=>]92.2 | \[ \sqrt{2} \cdot \color{blue}{\left(-\sqrt{0.5} \cdot \sqrt{\frac{x - 1}{1 + x}}\right)}
\] |
*-commutative [=>]92.2 | \[ \sqrt{2} \cdot \left(-\color{blue}{\sqrt{\frac{x - 1}{1 + x}} \cdot \sqrt{0.5}}\right)
\] |
sub-neg [=>]92.2 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
metadata-eval [=>]92.2 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{x + \color{blue}{-1}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
+-commutative [=>]92.2 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{\color{blue}{-1 + x}}{1 + x}} \cdot \sqrt{0.5}\right)
\] |
+-commutative [=>]92.2 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{-1 + x}{\color{blue}{x + 1}}} \cdot \sqrt{0.5}\right)
\] |
Applied egg-rr93.6%
[Start]92.2 | \[ \sqrt{2} \cdot \left(-\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right)
\] |
|---|---|
distribute-rgt-neg-out [=>]92.2 | \[ \color{blue}{-\sqrt{2} \cdot \left(\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right)}
\] |
neg-sub0 [=>]92.2 | \[ \color{blue}{0 - \sqrt{2} \cdot \left(\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right)}
\] |
metadata-eval [<=]92.2 | \[ \color{blue}{\log 1} - \sqrt{2} \cdot \left(\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right)
\] |
*-commutative [=>]92.2 | \[ \log 1 - \sqrt{2} \cdot \color{blue}{\left(\sqrt{0.5} \cdot \sqrt{\frac{-1 + x}{x + 1}}\right)}
\] |
*-commutative [<=]92.2 | \[ \log 1 - \sqrt{2} \cdot \color{blue}{\left(\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right)}
\] |
add-sqr-sqrt [=>]92.2 | \[ \log 1 - \sqrt{2} \cdot \color{blue}{\left(\sqrt{\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}} \cdot \sqrt{\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}}\right)}
\] |
sqrt-unprod [=>]92.2 | \[ \log 1 - \sqrt{2} \cdot \color{blue}{\sqrt{\left(\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right) \cdot \left(\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right)}}
\] |
sqr-neg [<=]92.2 | \[ \log 1 - \sqrt{2} \cdot \sqrt{\color{blue}{\left(-\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right) \cdot \left(-\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right)}}
\] |
sqrt-unprod [<=]0.0 | \[ \log 1 - \sqrt{2} \cdot \color{blue}{\left(\sqrt{-\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}} \cdot \sqrt{-\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}}\right)}
\] |
add-sqr-sqrt [<=]1.6 | \[ \log 1 - \sqrt{2} \cdot \color{blue}{\left(-\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right)}
\] |
expm1-log1p-u [=>]0.1 | \[ \log 1 - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \left(-\sqrt{\frac{-1 + x}{x + 1}} \cdot \sqrt{0.5}\right)\right)\right)}
\] |
Simplified93.6%
[Start]93.6 | \[ \left(0 - e^{\mathsf{log1p}\left(\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}\right)}\right) + 1
\] |
|---|---|
associate-+l- [=>]93.6 | \[ \color{blue}{0 - \left(e^{\mathsf{log1p}\left(\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}\right)} - 1\right)}
\] |
expm1-def [=>]93.6 | \[ 0 - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}\right)\right)}
\] |
expm1-log1p [=>]93.6 | \[ 0 - \color{blue}{\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}}
\] |
sub0-neg [=>]93.6 | \[ \color{blue}{-\sqrt{2 \cdot \left(\frac{1 - x}{-1 - x} \cdot 0.5\right)}}
\] |
*-commutative [=>]93.6 | \[ -\sqrt{2 \cdot \color{blue}{\left(0.5 \cdot \frac{1 - x}{-1 - x}\right)}}
\] |
associate-*r* [=>]93.6 | \[ -\sqrt{\color{blue}{\left(2 \cdot 0.5\right) \cdot \frac{1 - x}{-1 - x}}}
\] |
metadata-eval [=>]93.6 | \[ -\sqrt{\color{blue}{1} \cdot \frac{1 - x}{-1 - x}}
\] |
associate-*r/ [=>]93.6 | \[ -\sqrt{\color{blue}{\frac{1 \cdot \left(1 - x\right)}{-1 - x}}}
\] |
if -1.12e39 < t < -1.5499999999999999e-268 or 6.50000000000000033e-293 < t < 6.4999999999999998e43Initial program 37.5%
Simplified37.6%
[Start]37.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/ [<=]37.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 [=>]37.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 [=>]37.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 72.2%
Simplified72.2%
[Start]72.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+ [=>]72.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 [=>]72.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 [=>]72.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 [=>]72.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 [=>]72.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 [=>]72.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
\] |
+-commutative [=>]72.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}^{2}}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]72.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 {t}^{2} + \color{blue}{\ell \cdot \ell}}{x}\right)\right)}} \cdot t
\] |
fma-udef [<=]72.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}^{2}, \ell \cdot \ell\right)}}{x}\right)\right)}} \cdot t
\] |
unpow2 [=>]72.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{\mathsf{fma}\left(2, \color{blue}{t \cdot t}, \ell \cdot \ell\right)}{x}\right)\right)}} \cdot t
\] |
Taylor expanded in t around 0 71.9%
Simplified71.9%
[Start]71.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 [=>]71.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
\] |
Applied egg-rr78.2%
[Start]71.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 \cdot \ell}{x}\right)\right)}} \cdot t
\] |
|---|---|
pow1/2 [=>]71.9 | \[ \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 [=>]71.7 | \[ \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
\] |
Simplified78.4%
[Start]78.2 | \[ \frac{\sqrt{2}}{{\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{0.25} \cdot {\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{0.25}} \cdot t
\] |
|---|---|
pow-sqr [=>]78.4 | \[ \frac{\sqrt{2}}{\color{blue}{{\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{\left(2 \cdot 0.25\right)}}} \cdot t
\] |
metadata-eval [=>]78.4 | \[ \frac{\sqrt{2}}{{\left(\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)\right)}^{\color{blue}{0.5}}} \cdot t
\] |
unpow1/2 [=>]78.4 | \[ \frac{\sqrt{2}}{\color{blue}{\sqrt{\frac{\ell}{x} \cdot \ell + \mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right)}}} \cdot t
\] |
+-commutative [=>]78.4 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(2, \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right), \frac{\ell}{x} \cdot \ell\right) + \frac{\ell}{x} \cdot \ell}}} \cdot t
\] |
fma-udef [=>]78.4 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\left(2 \cdot \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right) + \frac{\ell}{x} \cdot \ell\right)} + \frac{\ell}{x} \cdot \ell}} \cdot t
\] |
associate-+l+ [=>]78.4 | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{2 \cdot \mathsf{fma}\left(t, t, \frac{t}{x} \cdot t\right) + \left(\frac{\ell}{x} \cdot \ell + \frac{\ell}{x} \cdot \ell\right)}}} \cdot t
\] |
fma-udef [=>]78.4 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \color{blue}{\left(t \cdot t + \frac{t}{x} \cdot t\right)} + \left(\frac{\ell}{x} \cdot \ell + \frac{\ell}{x} \cdot \ell\right)}} \cdot t
\] |
distribute-rgt-out [=>]78.4 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \color{blue}{\left(t \cdot \left(t + \frac{t}{x}\right)\right)} + \left(\frac{\ell}{x} \cdot \ell + \frac{\ell}{x} \cdot \ell\right)}} \cdot t
\] |
count-2 [=>]78.4 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \color{blue}{2 \cdot \left(\frac{\ell}{x} \cdot \ell\right)}}} \cdot t
\] |
*-commutative [=>]78.4 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{x}\right)}}} \cdot t
\] |
Applied egg-rr77.7%
[Start]78.4 | \[ \frac{\sqrt{2}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}} \cdot t
\] |
|---|---|
sqrt-undiv [=>]77.7 | \[ \color{blue}{\sqrt{\frac{2}{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + 2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}} \cdot t
\] |
distribute-lft-out [=>]77.7 | \[ \sqrt{\frac{2}{\color{blue}{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right) + \ell \cdot \frac{\ell}{x}\right)}}} \cdot t
\] |
associate-/r* [=>]77.7 | \[ \sqrt{\color{blue}{\frac{\frac{2}{2}}{t \cdot \left(t + \frac{t}{x}\right) + \ell \cdot \frac{\ell}{x}}}} \cdot t
\] |
metadata-eval [=>]77.7 | \[ \sqrt{\frac{\color{blue}{1}}{t \cdot \left(t + \frac{t}{x}\right) + \ell \cdot \frac{\ell}{x}}} \cdot t
\] |
fma-def [=>]77.7 | \[ \sqrt{\frac{1}{\color{blue}{\mathsf{fma}\left(t, t + \frac{t}{x}, \ell \cdot \frac{\ell}{x}\right)}}} \cdot t
\] |
*-commutative [=>]77.7 | \[ \sqrt{\frac{1}{\mathsf{fma}\left(t, t + \frac{t}{x}, \color{blue}{\frac{\ell}{x} \cdot \ell}\right)}} \cdot t
\] |
associate-/r/ [<=]77.7 | \[ \sqrt{\frac{1}{\mathsf{fma}\left(t, t + \frac{t}{x}, \color{blue}{\frac{\ell}{\frac{x}{\ell}}}\right)}} \cdot t
\] |
if -1.5499999999999999e-268 < t < 6.50000000000000033e-293Initial program 2.3%
Taylor expanded in l around inf 3.5%
Simplified3.5%
[Start]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) - 1\right) \cdot {\ell}^{2}}}
\] |
|---|---|
sub-neg [=>]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\left(\left(\frac{x}{x - 1} + \frac{1}{x - 1}\right) + \left(-1\right)\right)} \cdot {\ell}^{2}}}
\] |
sub-neg [=>]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\left(\frac{x}{\color{blue}{x + \left(-1\right)}} + \frac{1}{x - 1}\right) + \left(-1\right)\right) \cdot {\ell}^{2}}}
\] |
metadata-eval [=>]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\left(\frac{x}{x + \color{blue}{-1}} + \frac{1}{x - 1}\right) + \left(-1\right)\right) \cdot {\ell}^{2}}}
\] |
+-commutative [=>]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\left(\frac{x}{\color{blue}{-1 + x}} + \frac{1}{x - 1}\right) + \left(-1\right)\right) \cdot {\ell}^{2}}}
\] |
sub-neg [=>]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\left(\frac{x}{-1 + x} + \frac{1}{\color{blue}{x + \left(-1\right)}}\right) + \left(-1\right)\right) \cdot {\ell}^{2}}}
\] |
metadata-eval [=>]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\left(\frac{x}{-1 + x} + \frac{1}{x + \color{blue}{-1}}\right) + \left(-1\right)\right) \cdot {\ell}^{2}}}
\] |
+-commutative [=>]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\left(\frac{x}{-1 + x} + \frac{1}{\color{blue}{-1 + x}}\right) + \left(-1\right)\right) \cdot {\ell}^{2}}}
\] |
metadata-eval [=>]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\left(\frac{x}{-1 + x} + \frac{1}{-1 + x}\right) + \color{blue}{-1}\right) \cdot {\ell}^{2}}}
\] |
unpow2 [=>]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\left(\frac{x}{-1 + x} + \frac{1}{-1 + x}\right) + -1\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)}}}
\] |
Applied egg-rr1.2%
[Start]3.5 | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\left(\left(\frac{x}{-1 + x} + \frac{1}{-1 + x}\right) + -1\right) \cdot \left(\ell \cdot \ell\right)}}
\] |
|---|---|
expm1-log1p-u [=>]3.5 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{\left(\left(\frac{x}{-1 + x} + \frac{1}{-1 + x}\right) + -1\right) \cdot \left(\ell \cdot \ell\right)}\right)\right)}}
\] |
expm1-udef [=>]2.5 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{\left(\left(\frac{x}{-1 + x} + \frac{1}{-1 + x}\right) + -1\right) \cdot \left(\ell \cdot \ell\right)}\right)} - 1}}
\] |
Simplified3.2%
[Start]1.2 | \[ \frac{\sqrt{2} \cdot t}{e^{\mathsf{log1p}\left(\ell \cdot \sqrt{-1 + \frac{-1}{1 - x} \cdot \left(x + 1\right)}\right)} - 1}
\] |
|---|---|
expm1-def [=>]1.9 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\ell \cdot \sqrt{-1 + \frac{-1}{1 - x} \cdot \left(x + 1\right)}\right)\right)}}
\] |
expm1-log1p [=>]3.2 | \[ \frac{\sqrt{2} \cdot t}{\color{blue}{\ell \cdot \sqrt{-1 + \frac{-1}{1 - x} \cdot \left(x + 1\right)}}}
\] |
associate-*l/ [=>]3.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{-1 + \color{blue}{\frac{-1 \cdot \left(x + 1\right)}{1 - x}}}}
\] |
+-commutative [=>]3.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{-1 + \frac{-1 \cdot \color{blue}{\left(1 + x\right)}}{1 - x}}}
\] |
distribute-lft-in [=>]3.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{-1 + \frac{\color{blue}{-1 \cdot 1 + -1 \cdot x}}{1 - x}}}
\] |
metadata-eval [=>]3.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{-1 + \frac{\color{blue}{-1} + -1 \cdot x}{1 - x}}}
\] |
neg-mul-1 [<=]3.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{-1 + \frac{-1 + \color{blue}{\left(-x\right)}}{1 - x}}}
\] |
neg-sub0 [=>]3.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{-1 + \frac{-1 + \color{blue}{\left(0 - x\right)}}{1 - x}}}
\] |
associate-+r- [=>]3.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{-1 + \frac{\color{blue}{\left(-1 + 0\right) - x}}{1 - x}}}
\] |
metadata-eval [=>]3.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{-1 + \frac{\color{blue}{-1} - x}{1 - x}}}
\] |
Taylor expanded in x around inf 49.2%
Simplified49.2%
[Start]49.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{2 \cdot \frac{1}{{x}^{2}} + 2 \cdot \frac{1}{x}}}
\] |
|---|---|
associate-*r/ [=>]49.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\color{blue}{\frac{2 \cdot 1}{{x}^{2}}} + 2 \cdot \frac{1}{x}}}
\] |
metadata-eval [=>]49.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\frac{\color{blue}{2}}{{x}^{2}} + 2 \cdot \frac{1}{x}}}
\] |
unpow2 [=>]49.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\frac{2}{\color{blue}{x \cdot x}} + 2 \cdot \frac{1}{x}}}
\] |
associate-*r/ [=>]49.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \color{blue}{\frac{2 \cdot 1}{x}}}}
\] |
metadata-eval [=>]49.2 | \[ \frac{\sqrt{2} \cdot t}{\ell \cdot \sqrt{\frac{2}{x \cdot x} + \frac{\color{blue}{2}}{x}}}
\] |
if 6.4999999999999998e43 < t Initial program 31.3%
Simplified31.4%
[Start]31.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/ [<=]31.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/ [=>]12.7 | \[ \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/ [<=]31.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 [<=]31.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* [<=]31.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 [<=]31.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* [=>]31.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 [<=]31.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 [=>]31.4 | \[ \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 x around inf 89.7%
Applied egg-rr91.1%
[Start]89.7 | \[ \sqrt{2} \cdot \sqrt{0.5}
\] |
|---|---|
sqrt-unprod [=>]91.1 | \[ \color{blue}{\sqrt{2 \cdot 0.5}}
\] |
metadata-eval [=>]91.1 | \[ \sqrt{\color{blue}{1}}
\] |
metadata-eval [=>]91.1 | \[ \color{blue}{1}
\] |
Final simplification84.3%
| Alternative 1 | |
|---|---|
| Accuracy | 84.6% |
| Cost | 20356 |
| Alternative 2 | |
|---|---|
| Accuracy | 84.7% |
| Cost | 14408 |
| Alternative 3 | |
|---|---|
| Accuracy | 84.3% |
| Cost | 14024 |
| Alternative 4 | |
|---|---|
| Accuracy | 77.2% |
| Cost | 13768 |
| Alternative 5 | |
|---|---|
| Accuracy | 77.3% |
| Cost | 13768 |
| Alternative 6 | |
|---|---|
| Accuracy | 76.7% |
| Cost | 7240 |
| Alternative 7 | |
|---|---|
| Accuracy | 77.0% |
| Cost | 7240 |
| Alternative 8 | |
|---|---|
| Accuracy | 77.2% |
| Cost | 7240 |
| Alternative 9 | |
|---|---|
| Accuracy | 76.1% |
| Cost | 7048 |
| Alternative 10 | |
|---|---|
| Accuracy | 76.3% |
| Cost | 6984 |
| Alternative 11 | |
|---|---|
| Accuracy | 76.1% |
| Cost | 6984 |
| Alternative 12 | |
|---|---|
| Accuracy | 76.0% |
| Cost | 836 |
| Alternative 13 | |
|---|---|
| Accuracy | 75.5% |
| Cost | 452 |
| Alternative 14 | |
|---|---|
| Accuracy | 75.9% |
| Cost | 452 |
| Alternative 15 | |
|---|---|
| Accuracy | 75.2% |
| Cost | 196 |
| Alternative 16 | |
|---|---|
| Accuracy | 38.4% |
| Cost | 64 |
herbie shell --seed 2023140
(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)))))