| Alternative 1 | |
|---|---|
| Accuracy | 99.8% |
| Cost | 26756 |
(FPCore (x) :precision binary64 (- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))
(FPCore (x)
:precision binary64
(let* ((t_0 (/ 0.5 (hypot 1.0 x))) (t_1 (+ 0.5 t_0)) (t_2 (sqrt t_1)))
(if (<= x -0.0025)
(/ (+ 0.5 (/ -0.5 (hypot 1.0 x))) (+ 1.0 t_2))
(if (<= x 0.00235)
(* (* x x) (+ (* (* x x) -0.0859375) 0.125))
(/ (- 1.0 (pow t_1 1.5)) (+ t_0 (+ t_2 1.5)))))))double code(double x) {
return 1.0 - sqrt((0.5 * (1.0 + (1.0 / hypot(1.0, x)))));
}
double code(double x) {
double t_0 = 0.5 / hypot(1.0, x);
double t_1 = 0.5 + t_0;
double t_2 = sqrt(t_1);
double tmp;
if (x <= -0.0025) {
tmp = (0.5 + (-0.5 / hypot(1.0, x))) / (1.0 + t_2);
} else if (x <= 0.00235) {
tmp = (x * x) * (((x * x) * -0.0859375) + 0.125);
} else {
tmp = (1.0 - pow(t_1, 1.5)) / (t_0 + (t_2 + 1.5));
}
return tmp;
}
public static double code(double x) {
return 1.0 - Math.sqrt((0.5 * (1.0 + (1.0 / Math.hypot(1.0, x)))));
}
public static double code(double x) {
double t_0 = 0.5 / Math.hypot(1.0, x);
double t_1 = 0.5 + t_0;
double t_2 = Math.sqrt(t_1);
double tmp;
if (x <= -0.0025) {
tmp = (0.5 + (-0.5 / Math.hypot(1.0, x))) / (1.0 + t_2);
} else if (x <= 0.00235) {
tmp = (x * x) * (((x * x) * -0.0859375) + 0.125);
} else {
tmp = (1.0 - Math.pow(t_1, 1.5)) / (t_0 + (t_2 + 1.5));
}
return tmp;
}
def code(x): return 1.0 - math.sqrt((0.5 * (1.0 + (1.0 / math.hypot(1.0, x)))))
def code(x): t_0 = 0.5 / math.hypot(1.0, x) t_1 = 0.5 + t_0 t_2 = math.sqrt(t_1) tmp = 0 if x <= -0.0025: tmp = (0.5 + (-0.5 / math.hypot(1.0, x))) / (1.0 + t_2) elif x <= 0.00235: tmp = (x * x) * (((x * x) * -0.0859375) + 0.125) else: tmp = (1.0 - math.pow(t_1, 1.5)) / (t_0 + (t_2 + 1.5)) return tmp
function code(x) return Float64(1.0 - sqrt(Float64(0.5 * Float64(1.0 + Float64(1.0 / hypot(1.0, x)))))) end
function code(x) t_0 = Float64(0.5 / hypot(1.0, x)) t_1 = Float64(0.5 + t_0) t_2 = sqrt(t_1) tmp = 0.0 if (x <= -0.0025) tmp = Float64(Float64(0.5 + Float64(-0.5 / hypot(1.0, x))) / Float64(1.0 + t_2)); elseif (x <= 0.00235) tmp = Float64(Float64(x * x) * Float64(Float64(Float64(x * x) * -0.0859375) + 0.125)); else tmp = Float64(Float64(1.0 - (t_1 ^ 1.5)) / Float64(t_0 + Float64(t_2 + 1.5))); end return tmp end
function tmp = code(x) tmp = 1.0 - sqrt((0.5 * (1.0 + (1.0 / hypot(1.0, x))))); end
function tmp_2 = code(x) t_0 = 0.5 / hypot(1.0, x); t_1 = 0.5 + t_0; t_2 = sqrt(t_1); tmp = 0.0; if (x <= -0.0025) tmp = (0.5 + (-0.5 / hypot(1.0, x))) / (1.0 + t_2); elseif (x <= 0.00235) tmp = (x * x) * (((x * x) * -0.0859375) + 0.125); else tmp = (1.0 - (t_1 ^ 1.5)) / (t_0 + (t_2 + 1.5)); end tmp_2 = tmp; end
code[x_] := N[(1.0 - N[Sqrt[N[(0.5 * N[(1.0 + N[(1.0 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[(0.5 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[t$95$1], $MachinePrecision]}, If[LessEqual[x, -0.0025], N[(N[(0.5 + N[(-0.5 / N[Sqrt[1.0 ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00235], N[(N[(x * x), $MachinePrecision] * N[(N[(N[(x * x), $MachinePrecision] * -0.0859375), $MachinePrecision] + 0.125), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Power[t$95$1, 1.5], $MachinePrecision]), $MachinePrecision] / N[(t$95$0 + N[(t$95$2 + 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\begin{array}{l}
t_0 := \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\\
t_1 := 0.5 + t_0\\
t_2 := \sqrt{t_1}\\
\mathbf{if}\;x \leq -0.0025:\\
\;\;\;\;\frac{0.5 + \frac{-0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + t_2}\\
\mathbf{elif}\;x \leq 0.00235:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot -0.0859375 + 0.125\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - {t_1}^{1.5}}{t_0 + \left(t_2 + 1.5\right)}\\
\end{array}
Results
if x < -0.00250000000000000005Initial program 98.4%
Simplified98.4%
[Start]98.4 | \[ 1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\] |
|---|---|
distribute-lft-in [=>]98.4 | \[ 1 - \sqrt{\color{blue}{0.5 \cdot 1 + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}}
\] |
metadata-eval [=>]98.4 | \[ 1 - \sqrt{\color{blue}{0.5} + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}
\] |
associate-*r/ [=>]98.4 | \[ 1 - \sqrt{0.5 + \color{blue}{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}}
\] |
metadata-eval [=>]98.4 | \[ 1 - \sqrt{0.5 + \frac{\color{blue}{0.5}}{\mathsf{hypot}\left(1, x\right)}}
\] |
Applied egg-rr98.4%
[Start]98.4 | \[ 1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}
\] |
|---|---|
sub-neg [=>]98.4 | \[ \color{blue}{1 + \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}
\] |
flip-+ [=>]98.4 | \[ \color{blue}{\frac{1 \cdot 1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}}
\] |
metadata-eval [=>]98.4 | \[ \frac{\color{blue}{1} - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}
\] |
neg-sub0 [=>]98.4 | \[ \frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 - \color{blue}{\left(0 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}}
\] |
metadata-eval [<=]98.4 | \[ \frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 - \left(\color{blue}{\log 1} - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}
\] |
associate--r- [=>]98.4 | \[ \frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{\color{blue}{\left(1 - \log 1\right) + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}
\] |
metadata-eval [=>]98.4 | \[ \frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{\left(1 - \color{blue}{0}\right) + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}
\] |
metadata-eval [=>]98.4 | \[ \frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{\color{blue}{1} + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}
\] |
Simplified99.9%
[Start]98.4 | \[ \frac{1 - \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \left(-\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}
\] |
|---|---|
sqr-neg [=>]98.4 | \[ \frac{1 - \color{blue}{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}
\] |
rem-square-sqrt [=>]99.9 | \[ \frac{1 - \color{blue}{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}
\] |
associate--r+ [=>]99.9 | \[ \frac{\color{blue}{\left(1 - 0.5\right) - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}
\] |
metadata-eval [=>]99.9 | \[ \frac{\color{blue}{0.5} - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}
\] |
if -0.00250000000000000005 < x < 0.00235000000000000009Initial program 53.9%
Simplified53.9%
[Start]53.9 | \[ 1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\] |
|---|---|
distribute-lft-in [=>]53.9 | \[ 1 - \sqrt{\color{blue}{0.5 \cdot 1 + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}}
\] |
metadata-eval [=>]53.9 | \[ 1 - \sqrt{\color{blue}{0.5} + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}
\] |
associate-*r/ [=>]53.9 | \[ 1 - \sqrt{0.5 + \color{blue}{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}}
\] |
metadata-eval [=>]53.9 | \[ 1 - \sqrt{0.5 + \frac{\color{blue}{0.5}}{\mathsf{hypot}\left(1, x\right)}}
\] |
Taylor expanded in x around 0 99.9%
Simplified99.9%
[Start]99.9 | \[ 0.125 \cdot {x}^{2} + -0.0859375 \cdot {x}^{4}
\] |
|---|---|
fma-def [=>]99.9 | \[ \color{blue}{\mathsf{fma}\left(0.125, {x}^{2}, -0.0859375 \cdot {x}^{4}\right)}
\] |
unpow2 [=>]99.9 | \[ \mathsf{fma}\left(0.125, \color{blue}{x \cdot x}, -0.0859375 \cdot {x}^{4}\right)
\] |
Applied egg-rr100.0%
[Start]99.9 | \[ \mathsf{fma}\left(0.125, x \cdot x, -0.0859375 \cdot {x}^{4}\right)
\] |
|---|---|
fma-udef [=>]99.9 | \[ \color{blue}{0.125 \cdot \left(x \cdot x\right) + -0.0859375 \cdot {x}^{4}}
\] |
associate-*r* [=>]100.0 | \[ \color{blue}{\left(0.125 \cdot x\right) \cdot x} + -0.0859375 \cdot {x}^{4}
\] |
Applied egg-rr99.9%
[Start]100.0 | \[ \left(0.125 \cdot x\right) \cdot x + -0.0859375 \cdot {x}^{4}
\] |
|---|---|
+-commutative [=>]100.0 | \[ \color{blue}{-0.0859375 \cdot {x}^{4} + \left(0.125 \cdot x\right) \cdot x}
\] |
*-commutative [=>]100.0 | \[ \color{blue}{{x}^{4} \cdot -0.0859375} + \left(0.125 \cdot x\right) \cdot x
\] |
add-sqr-sqrt [=>]100.0 | \[ \color{blue}{\left(\sqrt{{x}^{4}} \cdot \sqrt{{x}^{4}}\right)} \cdot -0.0859375 + \left(0.125 \cdot x\right) \cdot x
\] |
associate-*l* [=>]100.0 | \[ \color{blue}{\sqrt{{x}^{4}} \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right)} + \left(0.125 \cdot x\right) \cdot x
\] |
sqrt-pow1 [=>]100.0 | \[ \color{blue}{{x}^{\left(\frac{4}{2}\right)}} \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right) + \left(0.125 \cdot x\right) \cdot x
\] |
metadata-eval [=>]100.0 | \[ {x}^{\color{blue}{2}} \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right) + \left(0.125 \cdot x\right) \cdot x
\] |
unpow2 [=>]100.0 | \[ \color{blue}{\left(x \cdot x\right)} \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right) + \left(0.125 \cdot x\right) \cdot x
\] |
associate-*l* [=>]99.9 | \[ \left(x \cdot x\right) \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right) + \color{blue}{0.125 \cdot \left(x \cdot x\right)}
\] |
*-commutative [=>]99.9 | \[ \left(x \cdot x\right) \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375\right) + \color{blue}{\left(x \cdot x\right) \cdot 0.125}
\] |
distribute-lft-out [=>]99.9 | \[ \color{blue}{\left(x \cdot x\right) \cdot \left(\sqrt{{x}^{4}} \cdot -0.0859375 + 0.125\right)}
\] |
sqrt-pow1 [=>]99.9 | \[ \left(x \cdot x\right) \cdot \left(\color{blue}{{x}^{\left(\frac{4}{2}\right)}} \cdot -0.0859375 + 0.125\right)
\] |
metadata-eval [=>]99.9 | \[ \left(x \cdot x\right) \cdot \left({x}^{\color{blue}{2}} \cdot -0.0859375 + 0.125\right)
\] |
unpow2 [=>]99.9 | \[ \left(x \cdot x\right) \cdot \left(\color{blue}{\left(x \cdot x\right)} \cdot -0.0859375 + 0.125\right)
\] |
*-commutative [=>]99.9 | \[ \left(x \cdot x\right) \cdot \left(\color{blue}{-0.0859375 \cdot \left(x \cdot x\right)} + 0.125\right)
\] |
if 0.00235000000000000009 < x Initial program 98.4%
Simplified98.4%
[Start]98.4 | \[ 1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}
\] |
|---|---|
distribute-lft-in [=>]98.4 | \[ 1 - \sqrt{\color{blue}{0.5 \cdot 1 + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}}
\] |
metadata-eval [=>]98.4 | \[ 1 - \sqrt{\color{blue}{0.5} + 0.5 \cdot \frac{1}{\mathsf{hypot}\left(1, x\right)}}
\] |
associate-*r/ [=>]98.4 | \[ 1 - \sqrt{0.5 + \color{blue}{\frac{0.5 \cdot 1}{\mathsf{hypot}\left(1, x\right)}}}
\] |
metadata-eval [=>]98.4 | \[ 1 - \sqrt{0.5 + \frac{\color{blue}{0.5}}{\mathsf{hypot}\left(1, x\right)}}
\] |
Applied egg-rr98.4%
[Start]98.4 | \[ 1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}
\] |
|---|---|
flip3-- [=>]97.5 | \[ \color{blue}{\frac{{1}^{3} - {\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}}{1 \cdot 1 + \left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}}
\] |
div-inv [=>]97.5 | \[ \color{blue}{\left({1}^{3} - {\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}\right) \cdot \frac{1}{1 \cdot 1 + \left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}}
\] |
metadata-eval [=>]97.5 | \[ \left(\color{blue}{1} - {\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}\right) \cdot \frac{1}{1 \cdot 1 + \left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}
\] |
sqrt-pow2 [=>]98.4 | \[ \left(1 - \color{blue}{{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{\left(\frac{3}{2}\right)}}\right) \cdot \frac{1}{1 \cdot 1 + \left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}
\] |
metadata-eval [=>]98.4 | \[ \left(1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{\color{blue}{1.5}}\right) \cdot \frac{1}{1 \cdot 1 + \left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}
\] |
metadata-eval [=>]98.4 | \[ \left(1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}\right) \cdot \frac{1}{\color{blue}{1} + \left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}
\] |
add-sqr-sqrt [<=]98.4 | \[ \left(1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}\right) \cdot \frac{1}{1 + \left(\color{blue}{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)} + 1 \cdot \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}
\] |
*-un-lft-identity [<=]98.4 | \[ \left(1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}\right) \cdot \frac{1}{1 + \left(\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right) + \color{blue}{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\right)}
\] |
associate-+r+ [=>]98.4 | \[ \left(1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}\right) \cdot \frac{1}{\color{blue}{\left(1 + \left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)\right) + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}
\] |
Simplified99.9%
[Start]98.4 | \[ \left(1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}\right) \cdot \frac{1}{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + \left(1.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}
\] |
|---|---|
associate-*r/ [=>]99.9 | \[ \color{blue}{\frac{\left(1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}\right) \cdot 1}{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + \left(1.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}}
\] |
*-rgt-identity [=>]99.9 | \[ \frac{\color{blue}{1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}}}{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + \left(1.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}
\] |
associate-+r+ [=>]99.9 | \[ \frac{1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}}{\color{blue}{\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + 1.5\right) + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}
\] |
+-commutative [=>]99.9 | \[ \frac{1 - {\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{1.5}}{\color{blue}{\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + \left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + 1.5\right)}}
\] |
Final simplification99.9%
| Alternative 1 | |
|---|---|
| Accuracy | 99.8% |
| Cost | 26756 |
| Alternative 2 | |
|---|---|
| Accuracy | 99.9% |
| Cost | 21064 |
| Alternative 3 | |
|---|---|
| Accuracy | 99.9% |
| Cost | 20552 |
| Alternative 4 | |
|---|---|
| Accuracy | 99.0% |
| Cost | 20164 |
| Alternative 5 | |
|---|---|
| Accuracy | 99.0% |
| Cost | 19908 |
| Alternative 6 | |
|---|---|
| Accuracy | 99.1% |
| Cost | 7496 |
| Alternative 7 | |
|---|---|
| Accuracy | 98.7% |
| Cost | 6985 |
| Alternative 8 | |
|---|---|
| Accuracy | 98.7% |
| Cost | 6984 |
| Alternative 9 | |
|---|---|
| Accuracy | 98.0% |
| Cost | 6857 |
| Alternative 10 | |
|---|---|
| Accuracy | 61.4% |
| Cost | 712 |
| Alternative 11 | |
|---|---|
| Accuracy | 61.4% |
| Cost | 712 |
| Alternative 12 | |
|---|---|
| Accuracy | 61.4% |
| Cost | 584 |
| Alternative 13 | |
|---|---|
| Accuracy | 59.7% |
| Cost | 576 |
| Alternative 14 | |
|---|---|
| Accuracy | 13.3% |
| Cost | 64 |
herbie shell --seed 2023133
(FPCore (x)
:name "Given's Rotation SVD example, simplified"
:precision binary64
(- 1.0 (sqrt (* 0.5 (+ 1.0 (/ 1.0 (hypot 1.0 x)))))))