Average Error: 13.6 → 11.7
Time: 15.3s
Precision: binary64
Cost: 26369
\[10^{-150} < \left|x\right| \land \left|x\right| < 10^{+150}\]
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.9489225518133:\\
\;\;\;\;\sqrt{\left|\frac{p}{x}\right|} \cdot \sqrt{\left|\frac{p}{x}\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{p \cdot \left(p \cdot 4\right) + x \cdot x}}\right)}\\
\end{array}\]
\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}↓
\begin{array}{l}
\mathbf{if}\;x \leq -3.9489225518133:\\
\;\;\;\;\sqrt{\left|\frac{p}{x}\right|} \cdot \sqrt{\left|\frac{p}{x}\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{p \cdot \left(p \cdot 4\right) + x \cdot x}}\right)}\\
\end{array}(FPCore (p x)
:precision binary64
(sqrt (* 0.5 (+ 1.0 (/ x (sqrt (+ (* (* 4.0 p) p) (* x x))))))))
↓
(FPCore (p x)
:precision binary64
(if (<= x -3.9489225518133)
(* (sqrt (fabs (/ p x))) (sqrt (fabs (/ p x))))
(sqrt (* 0.5 (+ 1.0 (/ x (sqrt (+ (* p (* p 4.0)) (* x x)))))))))
double code(double p, double x) {
return sqrt(0.5 * (1.0 + (x / sqrt(((4.0 * p) * p) + (x * x)))));
}
↓
double code(double p, double x) {
double tmp;
if (x <= -3.9489225518133) {
tmp = sqrt(fabs(p / x)) * sqrt(fabs(p / x));
} else {
tmp = sqrt(0.5 * (1.0 + (x / sqrt((p * (p * 4.0)) + (x * x)))));
}
return tmp;
}
Try it out
Enter valid numbers for all inputs
Alternatives
| Alternative 1 |
|---|
| Error | 32.4 |
|---|
| Cost | 26560 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\log \left(e^{\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}}\right)}\right)}\]
| Alternative 2 |
|---|
| Error | 31.7 |
|---|
| Cost | 6976 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{p \cdot -2}\right)}\]
| Alternative 3 |
|---|
| Error | 46.6 |
|---|
| Cost | 19392 |
|---|
\[e^{\log \left(\left|\frac{p}{x}\right|\right)}\]
| Alternative 4 |
|---|
| Error | 28.5 |
|---|
| Cost | 7488 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{p \cdot 2 + 0.25 \cdot \frac{x \cdot x}{p}}\right)}\]
| Alternative 5 |
|---|
| Error | 31.7 |
|---|
| Cost | 6976 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{p \cdot 2}\right)}\]
| Alternative 6 |
|---|
| Error | 51.7 |
|---|
| Cost | 7232 |
|---|
\[\sqrt{0.5 \cdot \left(2 \cdot \frac{p}{\frac{1}{\frac{p}{x \cdot x}}}\right)}\]
| Alternative 7 |
|---|
| Error | 55.8 |
|---|
| Cost | 13248 |
|---|
\[\frac{\sqrt{p}}{\sqrt{\frac{x \cdot x}{p}}}\]
| Alternative 8 |
|---|
| Error | 14.7 |
|---|
| Cost | 33600 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}} \cdot \sqrt{\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}}}\right)}\]
| Alternative 9 |
|---|
| Error | 51.7 |
|---|
| Cost | 7104 |
|---|
\[\sqrt{0.5 \cdot \left(2 \cdot \frac{p}{\frac{x}{\frac{p}{x}}}\right)}\]
| Alternative 10 |
|---|
| Error | 51.7 |
|---|
| Cost | 7104 |
|---|
\[\sqrt{0.5 \cdot \left(2 \cdot \frac{p}{x \cdot \frac{x}{p}}\right)}\]
| Alternative 11 |
|---|
| Error | 45.7 |
|---|
| Cost | 39104 |
|---|
\[\left(\sqrt[3]{\left|\frac{p}{x}\right|} \cdot \sqrt[3]{\left|\frac{p}{x}\right|}\right) \cdot \sqrt[3]{\left|\frac{p}{x}\right|}\]
| Alternative 12 |
|---|
| Error | 16.2 |
|---|
| Cost | 7360 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{x + 2 \cdot \frac{p \cdot p}{x}}\right)}\]
| Alternative 13 |
|---|
| Error | 41.2 |
|---|
| Cost | 6848 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{x}\right)}\]
| Alternative 14 |
|---|
| Error | 15.1 |
|---|
| Cost | 34240 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(\sqrt[3]{p \cdot \left(4 \cdot p\right) + x \cdot x} \cdot \sqrt[3]{p \cdot \left(4 \cdot p\right) + x \cdot x}\right) \cdot \sqrt[3]{p \cdot \left(4 \cdot p\right) + x \cdot x}}}\right)}\]
| Alternative 15 |
|---|
| Error | 28.8 |
|---|
| Cost | 6464 |
|---|
\[\sqrt{0.5}\]
| Alternative 16 |
|---|
| Error | 54.7 |
|---|
| Cost | 19456 |
|---|
\[\sqrt[3]{{\left(\left|\frac{p}{x}\right|\right)}^{3}}\]
| Alternative 17 |
|---|
| Error | 53.3 |
|---|
| Cost | 256 |
|---|
\[\frac{-p}{x}\]
| Alternative 18 |
|---|
| Error | 54.1 |
|---|
| Cost | 33152 |
|---|
\[3 \cdot \left(\frac{\sqrt{0.5}}{\sqrt{2}} \cdot {\left(\frac{p}{x}\right)}^{3}\right) - \frac{\sqrt{0.5} \cdot \sqrt{2}}{\frac{x}{p}}\]
| Alternative 19 |
|---|
| Error | 15.5 |
|---|
| Cost | 47040 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\left(\sqrt[3]{\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}} \cdot \sqrt[3]{\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}}\right) \cdot \sqrt[3]{\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}}}\right)}\]
| Alternative 20 |
|---|
| Error | 51.7 |
|---|
| Cost | 7104 |
|---|
\[\sqrt{0.5 \cdot \left(2 \cdot \frac{p}{\frac{x \cdot x}{p}}\right)}\]
| Alternative 21 |
|---|
| Error | 41.2 |
|---|
| Cost | 6592 |
|---|
\[\sqrt{0.5 \cdot 2}\]
| Alternative 22 |
|---|
| Error | 28.8 |
|---|
| Cost | 6592 |
|---|
\[\sqrt{0.5 \cdot 1}\]
| Alternative 23 |
|---|
| Error | 59.9 |
|---|
| Cost | 6912 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{-x}\right)}\]
| Alternative 24 |
|---|
| Error | 51.7 |
|---|
| Cost | 13504 |
|---|
\[\sqrt{0.5} \cdot \sqrt{2 \cdot \frac{p}{\frac{x \cdot x}{p}}}\]
| Alternative 25 |
|---|
| Error | 13.6 |
|---|
| Cost | 13760 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}\]
| Alternative 26 |
|---|
| Error | 26.4 |
|---|
| Cost | 26624 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\sqrt[3]{{\left(p \cdot \left(4 \cdot p\right) + x \cdot x\right)}^{3}}}}\right)}\]
| Alternative 27 |
|---|
| Error | 28.5 |
|---|
| Cost | 7488 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{p \cdot -2 - 0.25 \cdot \frac{x \cdot x}{p}}\right)}\]
| Alternative 28 |
|---|
| Error | 19.9 |
|---|
| Cost | 26624 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt[3]{{\left(\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}\right)}^{3}}}\right)}\]
| Alternative 29 |
|---|
| Error | 51.7 |
|---|
| Cost | 7104 |
|---|
\[\sqrt{0.5 \cdot \left(2 \cdot \left(\frac{p}{x} \cdot \frac{p}{x}\right)\right)}\]
| Alternative 30 |
|---|
| Error | 53.1 |
|---|
| Cost | 192 |
|---|
\[\frac{p}{x}\]
| Alternative 31 |
|---|
| Error | 16.5 |
|---|
| Cost | 26560 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{e^{\log \left(p \cdot \left(4 \cdot p\right) + x \cdot x\right)}}}\right)}\]
| Alternative 32 |
|---|
| Error | 29.0 |
|---|
| Cost | 14784 |
|---|
\[\sqrt{0.5 \cdot \frac{1 - \frac{x \cdot x}{p \cdot \left(4 \cdot p\right) + x \cdot x}}{1 - \frac{x}{\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}}}}\]
| Alternative 33 |
|---|
| Error | 16.5 |
|---|
| Cost | 26560 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{e^{\log \left(\sqrt{p \cdot \left(4 \cdot p\right) + x \cdot x}\right)}}\right)}\]
| Alternative 34 |
|---|
| Error | 58.1 |
|---|
| Cost | 19904 |
|---|
\[\sqrt{0.5 \cdot \left(2 \cdot \frac{p}{e^{\log \left(\frac{x \cdot x}{p}\right)}}\right)}\]
| Alternative 35 |
|---|
| Error | 45.5 |
|---|
| Cost | 26048 |
|---|
\[\sqrt{\left|\frac{p}{x}\right|} \cdot \sqrt{\left|\frac{p}{x}\right|}\]
| Alternative 36 |
|---|
| Error | 15.0 |
|---|
| Cost | 33600 |
|---|
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\left|\sqrt[3]{p \cdot \left(4 \cdot p\right) + x \cdot x}\right| \cdot \sqrt{\sqrt[3]{p \cdot \left(4 \cdot p\right) + x \cdot x}}}\right)}\]
| Alternative 37 |
|---|
| Error | 53.5 |
|---|
| Cost | 13312 |
|---|
\[-\frac{\sqrt{0.5} \cdot \sqrt{2}}{\frac{x}{p}}\]
| Alternative 38 |
|---|
| Error | 58.4 |
|---|
| Cost | 26112 |
|---|
\[1 - \log \left(e^{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\right)\]
| Alternative 39 |
|---|
| Error | 58.4 |
|---|
| Cost | 58624 |
|---|
\[1 - {\left(\sqrt[3]{\sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)}^{5} \cdot \sqrt[3]{\sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
| Alternative 40 |
|---|
| Error | 58.4 |
|---|
| Cost | 45696 |
|---|
\[1 - \sqrt{0.5 + \frac{\frac{0.5}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(1, x\right)}}}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 41 |
|---|
| Error | 58.4 |
|---|
| Cost | 39360 |
|---|
\[1 - \left|\sqrt[3]{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right| \cdot \sqrt{\sqrt[3]{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 42 |
|---|
| Error | 58.4 |
|---|
| Cost | 26112 |
|---|
\[e^{\log \left(1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}\]
| Alternative 43 |
|---|
| Error | 58.4 |
|---|
| Cost | 45824 |
|---|
\[1 - \sqrt{0.5 + \frac{1}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(1, x\right)}} \cdot \frac{0.5}{\sqrt[3]{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 44 |
|---|
| Error | 58.4 |
|---|
| Cost | 39360 |
|---|
\[1 - \sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 45 |
|---|
| Error | 58.4 |
|---|
| Cost | 32960 |
|---|
\[1 - \sqrt[3]{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt[3]{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 46 |
|---|
| Error | 58.4 |
|---|
| Cost | 84672 |
|---|
\[1 - \left(\sqrt[3]{\sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot \sqrt[3]{\sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right) \cdot {\left(\sqrt[3]{\sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)}^{4}\]
| Alternative 47 |
|---|
| Error | 58.4 |
|---|
| Cost | 32832 |
|---|
\[1 - \sqrt{0.5 + \sqrt{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 48 |
|---|
| Error | 58.4 |
|---|
| Cost | 45952 |
|---|
\[1 - \sqrt{0.5 + \left(\sqrt[3]{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}} \cdot \sqrt[3]{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right) \cdot \sqrt[3]{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 49 |
|---|
| Error | 58.4 |
|---|
| Cost | 26112 |
|---|
\[1 - \sqrt{0.5 + \log \left(e^{\frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}\]
| Alternative 50 |
|---|
| Error | 59.4 |
|---|
| Cost | 65600 |
|---|
\[1 - \frac{\sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt{\sqrt{0.25 - \frac{0.25}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}}}}{\sqrt{\sqrt{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\]
| Alternative 51 |
|---|
| Error | 58.4 |
|---|
| Cost | 72064 |
|---|
\[\log \left(e^{\left(\sqrt[3]{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt[3]{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\right) \cdot \sqrt[3]{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)\]
| Alternative 52 |
|---|
| Error | 58.4 |
|---|
| Cost | 26176 |
|---|
\[1 - \sqrt{\sqrt[3]{{\left(0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3}}}\]
| Alternative 53 |
|---|
| Error | 58.4 |
|---|
| Cost | 32960 |
|---|
\[\log \left(e^{\frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)\]
| Alternative 54 |
|---|
| Error | 58.4 |
|---|
| Cost | 39424 |
|---|
\[1 + \left(-\left|\sqrt[3]{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right|\right) \cdot \sqrt{\sqrt[3]{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 55 |
|---|
| Error | 58.4 |
|---|
| Cost | 26112 |
|---|
\[\log \left(e^{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\right)\]
| Alternative 56 |
|---|
| Error | 58.4 |
|---|
| Cost | 52224 |
|---|
\[1 - {\left(\sqrt[3]{\sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)}^{4} \cdot \sqrt[3]{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 57 |
|---|
| Error | 58.4 |
|---|
| Cost | 39488 |
|---|
\[\left(1 + \sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\right) \cdot \left(1 - \sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\right)\]
| Alternative 58 |
|---|
| Error | 58.4 |
|---|
| Cost | 65088 |
|---|
\[\log \left(\sqrt{e^{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right) + \log \left(\sqrt{e^{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)\]
| Alternative 59 |
|---|
| Error | 58.4 |
|---|
| Cost | 20160 |
|---|
\[\frac{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}{1 + \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 60 |
|---|
| Error | 58.4 |
|---|
| Cost | 39872 |
|---|
\[\frac{1 - {\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}}{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}} + \left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)} + 1.5\right)}\]
| Alternative 61 |
|---|
| Error | 58.4 |
|---|
| Cost | 59264 |
|---|
\[\left(\sqrt[3]{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}} \cdot \sqrt[3]{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\right) \cdot \sqrt[3]{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 62 |
|---|
| Error | 58.4 |
|---|
| Cost | 26176 |
|---|
\[\sqrt[3]{{\left(1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}}\]
| Alternative 63 |
|---|
| Error | 58.4 |
|---|
| Cost | 65216 |
|---|
\[\log \left(\sqrt[3]{e^{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right) \cdot 2 + \log \left(\sqrt[3]{e^{1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)\]
| Alternative 64 |
|---|
| Error | 58.4 |
|---|
| Cost | 58624 |
|---|
\[1 - \sqrt{\sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}} \cdot {\left(\sqrt{\sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)}^{3}\]
| Alternative 65 |
|---|
| Error | 59.5 |
|---|
| Cost | 33152 |
|---|
\[1 - \frac{\sqrt{0.25 - \frac{0.25}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}}}{\sqrt{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 66 |
|---|
| Error | 58.4 |
|---|
| Cost | 39744 |
|---|
\[1 - \frac{\sqrt{{\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3} + 0.125}}{\sqrt{0.25 + \frac{\frac{0.25}{\mathsf{hypot}\left(1, x\right)} + -0.25}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 67 |
|---|
| Error | 59.5 |
|---|
| Cost | 45952 |
|---|
\[\log \left(e^{1 - \frac{\sqrt{0.25 - \frac{0.25}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}}}{\sqrt{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}}\right)\]
| Alternative 68 |
|---|
| Error | 58.4 |
|---|
| Cost | 38976 |
|---|
\[\log \left(e^{1 - \sqrt[3]{{\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}}}\right)\]
| Alternative 69 |
|---|
| Error | 58.4 |
|---|
| Cost | 26176 |
|---|
\[1 - \sqrt[3]{{\left(\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\right)}^{3}}\]
| Alternative 70 |
|---|
| Error | 59.5 |
|---|
| Cost | 26752 |
|---|
\[1 - \sqrt{\frac{0.25 - \frac{0.25}{\mathsf{hypot}\left(1, x\right) \cdot \mathsf{hypot}\left(1, x\right)}}{0.5 - \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 71 |
|---|
| Error | 58.4 |
|---|
| Cost | 33344 |
|---|
\[1 - \sqrt{\frac{{\left(\frac{0.5}{\mathsf{hypot}\left(1, x\right)}\right)}^{3} + 0.125}{0.25 + \frac{\frac{0.25}{\mathsf{hypot}\left(1, x\right)} + -0.25}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 72 |
|---|
| Error | 58.4 |
|---|
| Cost | 45824 |
|---|
\[1 - \sqrt{{\left(\sqrt[3]{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\right)}^{4} \cdot \sqrt[3]{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\]
| Alternative 73 |
|---|
| Error | 58.4 |
|---|
| Cost | 26176 |
|---|
\[1 - {\left(\sqrt{\sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}}\right)}^{2}\]
| Alternative 74 |
|---|
| Error | 58.4 |
|---|
| Cost | 13312 |
|---|
\[1 - \sqrt{0.5 + \frac{0.5}{\mathsf{hypot}\left(1, x\right)}}\]
| Alternative 75 |
|---|
| Error | 58.4 |
|---|
| Cost | 13440 |
|---|
\[1 - \sqrt{0.5 \cdot \left(1 + \frac{1}{\mathsf{hypot}\left(1, x\right)}\right)}\]
Error

Derivation
- Split input into 2 regimes
if x < -3.94892255181329999
Initial program 30.5
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}\]
Taylor expanded around -inf 38.6
\[\leadsto \sqrt{0.5 \cdot \color{blue}{\left(2 \cdot \frac{{p}^{2}}{{x}^{2}}\right)}}\]
Simplified38.2
\[\leadsto \sqrt{0.5 \cdot \color{blue}{\left(2 \cdot \frac{p}{\frac{x \cdot x}{p}}\right)}}\]
- Using strategy
rm Applied add-sqr-sqrt_binary64_10038.3
\[\leadsto \color{blue}{\sqrt{\sqrt{0.5 \cdot \left(2 \cdot \frac{p}{\frac{x \cdot x}{p}}\right)}} \cdot \sqrt{\sqrt{0.5 \cdot \left(2 \cdot \frac{p}{\frac{x \cdot x}{p}}\right)}}}\]
Simplified38.2
\[\leadsto \color{blue}{\sqrt{\left|\frac{p}{x}\right|}} \cdot \sqrt{\sqrt{0.5 \cdot \left(2 \cdot \frac{p}{\frac{x \cdot x}{p}}\right)}}\]
Simplified23.2
\[\leadsto \sqrt{\left|\frac{p}{x}\right|} \cdot \color{blue}{\sqrt{\left|\frac{p}{x}\right|}}\]
if -3.94892255181329999 < x
Initial program 7.7
\[\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{\left(4 \cdot p\right) \cdot p + x \cdot x}}\right)}\]
- Recombined 2 regimes into one program.
Final simplification11.7
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \leq -3.9489225518133:\\
\;\;\;\;\sqrt{\left|\frac{p}{x}\right|} \cdot \sqrt{\left|\frac{p}{x}\right|}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{0.5 \cdot \left(1 + \frac{x}{\sqrt{p \cdot \left(p \cdot 4\right) + x \cdot x}}\right)}\\
\end{array}\]
Reproduce
herbie shell --seed 2021042
(FPCore (p x)
:name "Given's Rotation SVD example"
:precision binary64
:pre (< 1e-150 (fabs x) 1e+150)
(sqrt (* 0.5 (+ 1.0 (/ x (sqrt (+ (* (* 4.0 p) p) (* x x))))))))