Average Error: 32.8 → 7.4
Time: 37.0s
Precision: binary64
Cost: 67073
\[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.280852323654058 \cdot 10^{-211}:\\
\;\;\;\;-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\\
\mathbf{elif}\;x \leq 2.2097631365031477 \cdot 10^{-202}:\\
\;\;\;\;\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt{e^{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}}\\
\mathbf{elif}\;x \leq 147972.98971215458:\\
\;\;\;\;-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(\frac{x + 1}{x}\right)}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\end{array}\]
{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}↓
\begin{array}{l}
\mathbf{if}\;x \leq 1.280852323654058 \cdot 10^{-211}:\\
\;\;\;\;-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\\
\mathbf{elif}\;x \leq 2.2097631365031477 \cdot 10^{-202}:\\
\;\;\;\;\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt{e^{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}}\\
\mathbf{elif}\;x \leq 147972.98971215458:\\
\;\;\;\;-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(\frac{x + 1}{x}\right)}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\end{array}(FPCore (x n)
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
↓
(FPCore (x n)
:precision binary64
(if (<= x 1.280852323654058e-211)
(+
(* -0.5 (/ (pow (log x) 2.0) (* n n)))
(-
(+
(+
(* 0.5 (/ (pow (log (+ x 1.0)) 2.0) (* n n)))
(* 0.16666666666666666 (pow (/ (log (+ x 1.0)) n) 3.0)))
(/ (- (log (+ x 1.0)) (log x)) n))
(* 0.16666666666666666 (pow (/ (log x) n) 3.0))))
(if (<= x 2.2097631365031477e-202)
(*
(sqrt (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
(sqrt (exp (log (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n)))))))
(if (<= x 147972.98971215458)
(+
(* -0.5 (/ (pow (log x) 2.0) (* n n)))
(-
(+
(+
(* 0.5 (/ (pow (log (+ x 1.0)) 2.0) (* n n)))
(* 0.16666666666666666 (pow (/ (log (+ x 1.0)) n) 3.0)))
(/ (log (/ (+ x 1.0) x)) n))
(* 0.16666666666666666 (pow (/ (log x) n) 3.0))))
(/ (exp (/ (log x) n)) (* x n))))))double code(double x, double n) {
return pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
}
↓
double code(double x, double n) {
double tmp;
if (x <= 1.280852323654058e-211) {
tmp = (-0.5 * (pow(log(x), 2.0) / (n * n))) + ((((0.5 * (pow(log(x + 1.0), 2.0) / (n * n))) + (0.16666666666666666 * pow((log(x + 1.0) / n), 3.0))) + ((log(x + 1.0) - log(x)) / n)) - (0.16666666666666666 * pow((log(x) / n), 3.0)));
} else if (x <= 2.2097631365031477e-202) {
tmp = sqrt(pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n))) * sqrt(exp(log(pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n)))));
} else if (x <= 147972.98971215458) {
tmp = (-0.5 * (pow(log(x), 2.0) / (n * n))) + ((((0.5 * (pow(log(x + 1.0), 2.0) / (n * n))) + (0.16666666666666666 * pow((log(x + 1.0) / n), 3.0))) + (log((x + 1.0) / x) / n)) - (0.16666666666666666 * pow((log(x) / n), 3.0)));
} else {
tmp = exp(log(x) / n) / (x * n);
}
return tmp;
}
Try it out
Enter valid numbers for all inputs
Alternatives
| Alternative 1 |
|---|
| Error | 58.6 |
|---|
| Cost | 421120 |
|---|
\[\frac{\left(n \cdot n\right) \cdot \left({n}^{3} \cdot \left({\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right)}^{3} + {\left(\frac{\log \left(x + 1\right) - \log x}{n}\right)}^{3}\right) - \left(0.16666666666666666 \cdot {\log x}^{3}\right) \cdot \left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) \cdot \left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n} \cdot \left(\frac{\log \left(x + 1\right) - \log x}{n} + \left({\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3} \cdot -0.16666666666666666 + \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} \cdot -0.5\right)\right)\right)\right) + \left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) \cdot \left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n} \cdot \left(\frac{\log \left(x + 1\right) - \log x}{n} + \left({\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3} \cdot -0.16666666666666666 + \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} \cdot -0.5\right)\right)\right) \cdot \left({n}^{3} \cdot \left(-0.5 \cdot {\log x}^{2}\right)\right)}{\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) \cdot \left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n} \cdot \left(\frac{\log \left(x + 1\right) - \log x}{n} + \left({\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3} \cdot -0.16666666666666666 + \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} \cdot -0.5\right)\right)\right) \cdot {n}^{5}}\]
| Alternative 2 |
|---|
| Error | 55.0 |
|---|
| Cost | 374080 |
|---|
\[\frac{\left(n \cdot n\right) \cdot \left({\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right)}^{3} - {\left(0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)}^{3}\right) + \left(-0.5 \cdot {\log x}^{2}\right) \cdot \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) \cdot \left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) + 0.16666666666666666 \cdot \left({\left(\frac{\log x}{n}\right)}^{3} \cdot \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) + 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\right)\right)}{\left(n \cdot n\right) \cdot \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) \cdot \left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) + 0.16666666666666666 \cdot \left({\left(\frac{\log x}{n}\right)}^{3} \cdot \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) + 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\right)\right)}\]
| Alternative 3 |
|---|
| Error | 55.5 |
|---|
| Cost | 307264 |
|---|
\[\frac{{n}^{3} \cdot \left({\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right)}^{3} + {\left(\frac{\log \left(x + 1\right) - \log x}{n}\right)}^{3}\right) - \left(0.16666666666666666 \cdot {\log x}^{3}\right) \cdot \left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) \cdot \left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n} \cdot \left(\frac{\log \left(x + 1\right) - \log x}{n} + \left({\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3} \cdot -0.16666666666666666 + \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} \cdot -0.5\right)\right)\right)}{{n}^{3} \cdot \left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) \cdot \left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n} \cdot \left(\frac{\log \left(x + 1\right) - \log x}{n} + \left({\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3} \cdot -0.16666666666666666 + \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} \cdot -0.5\right)\right)\right)} + -0.5 \cdot \frac{{\log x}^{2}}{n \cdot n}\]
| Alternative 4 |
|---|
| Error | 50.9 |
|---|
| Cost | 214080 |
|---|
\[\frac{\left(n \cdot n\right) \cdot \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) \cdot \left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) + -0.027777777777777776 \cdot {\left(\frac{\log x}{n}\right)}^{6}\right) + \left(-0.5 \cdot {\log x}^{2}\right) \cdot \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) + 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)}{\left(n \cdot n\right) \cdot \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) + 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)}\]
| Alternative 5 |
|---|
| Error | 30.9 |
|---|
| Cost | 192832 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \sqrt[3]{\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}} \cdot \left(\sqrt[3]{\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}} \cdot \sqrt[3]{\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}}\right)\]
| Alternative 6 |
|---|
| Error | 38.7 |
|---|
| Cost | 146752 |
|---|
\[\left(\left(\left(\frac{e^{\frac{\log x}{n}}}{n \cdot x} + \frac{e^{\frac{\log x}{n}}}{{x}^{3}} \cdot \left(\frac{0.16666666666666666}{{n}^{3}} + \frac{0.3333333333333333}{n}\right)\right) + 0.041666666666666664 \cdot \frac{e^{\frac{\log x}{n}}}{{x}^{4} \cdot {n}^{4}}\right) + \frac{e^{\frac{\log x}{n}}}{n \cdot n} \cdot \left(\frac{0.5}{x \cdot x} + \frac{0.4583333333333333}{{x}^{4}}\right)\right) - \left(\frac{e^{\frac{\log x}{n}}}{{x}^{4}} \cdot \left(\frac{0.25}{n} + \frac{0.25}{{n}^{3}}\right) + 0.5 \cdot \left(\frac{e^{\frac{\log x}{n}}}{x \cdot \left(n \cdot x\right)} + \frac{e^{\frac{\log x}{n}}}{n \cdot \left(n \cdot {x}^{3}\right)}\right)\right)\]
| Alternative 7 |
|---|
| Error | 41.8 |
|---|
| Cost | 132992 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \sqrt{\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}} \cdot \sqrt{\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}}\]
| Alternative 8 |
|---|
| Error | 28.5 |
|---|
| Cost | 112320 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\sqrt[3]{\log \left(x + 1\right) - \log x} \cdot \left(\sqrt[3]{\log \left(x + 1\right) - \log x} \cdot \sqrt[3]{\log \left(x + 1\right) - \log x}\right)}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 9 |
|---|
| Error | 28.2 |
|---|
| Cost | 92736 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\sqrt{\log \left(x + 1\right) - \log x} \cdot \sqrt{\log \left(x + 1\right) - \log x}}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 10 |
|---|
| Error | 35.3 |
|---|
| Cost | 86208 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\left(\log \left(x + 1\right) - 2 \cdot \log \left(\sqrt[3]{x}\right)\right) - \log \left(\sqrt[3]{x}\right)}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 11 |
|---|
| Error | 45.5 |
|---|
| Cost | 79616 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \sqrt[3]{{\left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)}^{3}}\]
| Alternative 12 |
|---|
| Error | 28.2 |
|---|
| Cost | 79616 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\sqrt[3]{{\left(\log \left(x + 1\right) - \log x\right)}^{3}}}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 13 |
|---|
| Error | 28.4 |
|---|
| Cost | 79552 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{e^{\log \left(\log \left(x + 1\right) - \log x\right)}}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 14 |
|---|
| Error | 37.4 |
|---|
| Cost | 73856 |
|---|
\[\left(\left(\frac{e^{\frac{\log x}{n}}}{n \cdot x} + \frac{e^{\frac{\log x}{n}}}{{x}^{3}} \cdot \left(\frac{0.16666666666666666}{{n}^{3}} + \frac{0.3333333333333333}{n}\right)\right) + \frac{e^{\frac{\log x}{n}}}{x \cdot x} \cdot \left(\frac{0.5}{n \cdot n} - \frac{0.5}{n}\right)\right) + -0.5 \cdot \frac{e^{\frac{\log x}{n}}}{n \cdot \left(n \cdot {x}^{3}\right)}\]
| Alternative 15 |
|---|
| Error | 28.2 |
|---|
| Cost | 73216 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\sqrt[3]{{\log \left(\frac{x + 1}{x}\right)}^{3}}}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 16 |
|---|
| Error | 46.1 |
|---|
| Cost | 67648 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\left(\frac{1}{x} + \frac{0.3333333333333333}{{x}^{3}}\right) - \left(\frac{0.5}{x \cdot x} + \frac{0.25}{{x}^{4}}\right)}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 17 |
|---|
| Error | 28.1 |
|---|
| Cost | 66752 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 18 |
|---|
| Error | 28.0 |
|---|
| Cost | 60352 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(\frac{x + 1}{x}\right)}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 19 |
|---|
| Error | 45.1 |
|---|
| Cost | 53824 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\frac{1}{x}}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 20 |
|---|
| Error | 38.2 |
|---|
| Cost | 53376 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(0.5 \cdot \left(\frac{x}{n} \cdot \frac{x}{n}\right) + \frac{\sqrt[3]{{\left(\log \left(x + 1\right) - \log x\right)}^{3}}}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 21 |
|---|
| Error | 33.3 |
|---|
| Cost | 52672 |
|---|
\[\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt{e^{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}}\]
| Alternative 22 |
|---|
| Error | 32.9 |
|---|
| Cost | 52672 |
|---|
\[\left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} + {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}\right) \cdot \left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} - {\left(\sqrt{x}\right)}^{\left(\frac{1}{n}\right)}\right)\]
| Alternative 23 |
|---|
| Error | 17.5 |
|---|
| Cost | 40000 |
|---|
\[\frac{\log \left(x + 1\right)}{n} + \left(\frac{0.5}{n} \cdot \left(\frac{{\log \left(x + 1\right)}^{2}}{n} - \frac{{\log x}^{2}}{n}\right) - \frac{\log x}{n}\right)\]
| Alternative 24 |
|---|
| Error | 32.9 |
|---|
| Cost | 39872 |
|---|
\[\left({x}^{\left(\frac{0.5}{n}\right)} + \sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}}\right) \cdot \left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} - {x}^{\left(\frac{0.5}{n}\right)}\right)\]
| Alternative 25 |
|---|
| Error | 33.3 |
|---|
| Cost | 39872 |
|---|
\[\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\]
| Alternative 26 |
|---|
| Error | 39.7 |
|---|
| Cost | 33216 |
|---|
\[-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} - \left(\frac{\log x}{n} + 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\]
| Alternative 27 |
|---|
| Error | 35.8 |
|---|
| Cost | 27200 |
|---|
\[\frac{e^{\frac{\log x}{n}}}{n \cdot x} + \frac{e^{\frac{\log x}{n}}}{x \cdot x} \cdot \left(\frac{0.5}{n \cdot n} - \frac{0.5}{n}\right)\]
| Alternative 28 |
|---|
| Error | 44.5 |
|---|
| Cost | 27072 |
|---|
\[\frac{{\left(x + 1\right)}^{\left(\frac{2}{n}\right)} - {x}^{\left(\frac{2}{n}\right)}}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + {x}^{\left(\frac{1}{n}\right)}}\]
| Alternative 29 |
|---|
| Error | 40.5 |
|---|
| Cost | 26816 |
|---|
\[\frac{\left(\frac{1}{n} + 0.5 \cdot \frac{{\log x}^{2}}{{n}^{3}}\right) + \frac{\log x}{n \cdot n}}{x}\]
| Alternative 30 |
|---|
| Error | 33.3 |
|---|
| Cost | 26368 |
|---|
\[{\left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{2}\]
| Alternative 31 |
|---|
| Error | 33.3 |
|---|
| Cost | 26304 |
|---|
\[e^{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}\]
| Alternative 32 |
|---|
| Error | 32.9 |
|---|
| Cost | 26304 |
|---|
\[\log \left(e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right)\]
| Alternative 33 |
|---|
| Error | 32.8 |
|---|
| Cost | 13504 |
|---|
\[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
| Alternative 34 |
|---|
| Error | 55.0 |
|---|
| Cost | 13376 |
|---|
\[\frac{x}{n} + \left(1 - e^{\frac{\log x}{n}}\right)\]
| Alternative 35 |
|---|
| Error | 17.2 |
|---|
| Cost | 13248 |
|---|
\[\frac{\log \left(x + 1\right) - \log x}{n}\]
| Alternative 36 |
|---|
| Error | 29.1 |
|---|
| Cost | 13248 |
|---|
\[\frac{e^{\frac{\log x}{n}}}{n \cdot x}\]
| Alternative 37 |
|---|
| Error | 44.3 |
|---|
| Cost | 13120 |
|---|
\[1 - e^{\frac{\log x}{n}}\]
| Alternative 38 |
|---|
| Error | 39.0 |
|---|
| Cost | 64 |
|---|
\[0\]
| Alternative 39 |
|---|
| Error | 56.4 |
|---|
| Cost | 64 |
|---|
\[1\]
| Alternative 40 |
|---|
| Error | 61.9 |
|---|
| Cost | 64 |
|---|
\[-1\]
Error

Derivation
- Split input into 4 regimes
if x < 1.2808523236540581e-211
Initial program 41.8
\[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
Taylor expanded around inf 19.3
\[\leadsto \color{blue}{\left(\frac{\log \left(x + 1\right)}{n} + \left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{{n}^{2}} + 0.16666666666666666 \cdot \frac{{\log \left(x + 1\right)}^{3}}{{n}^{3}}\right)\right) - \left(\frac{\log x}{n} + \left(0.5 \cdot \frac{{\log x}^{2}}{{n}^{2}} + 0.16666666666666666 \cdot \frac{{\log x}^{3}}{{n}^{3}}\right)\right)}\]
Simplified19.3
\[\leadsto \color{blue}{\left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right) + \frac{{\log x}^{2}}{n \cdot n} \cdot -0.5}\]
Simplified19.3
\[\leadsto \color{blue}{-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)}\]
if 1.2808523236540581e-211 < x < 2.20976313650314774e-202
Initial program 41.2
\[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
- Using strategy
rm Applied add-sqr-sqrt_binary64_10042.2
\[\leadsto \color{blue}{\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}}\]
- Using strategy
rm Applied add-exp-log_binary64_11642.2
\[\leadsto \sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt{\color{blue}{e^{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}}}\]
Simplified42.2
\[\leadsto \color{blue}{\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt{e^{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}}}\]
if 2.20976313650314774e-202 < x < 147972.98971215458
Initial program 50.7
\[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
Taylor expanded around inf 10.0
\[\leadsto \color{blue}{\left(\frac{\log \left(x + 1\right)}{n} + \left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{{n}^{2}} + 0.16666666666666666 \cdot \frac{{\log \left(x + 1\right)}^{3}}{{n}^{3}}\right)\right) - \left(\frac{\log x}{n} + \left(0.5 \cdot \frac{{\log x}^{2}}{{n}^{2}} + 0.16666666666666666 \cdot \frac{{\log x}^{3}}{{n}^{3}}\right)\right)}\]
Simplified10.0
\[\leadsto \color{blue}{\left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right) + \frac{{\log x}^{2}}{n \cdot n} \cdot -0.5}\]
- Using strategy
rm Applied diff-log_binary64_17010.0
\[\leadsto \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\color{blue}{\log \left(\frac{x + 1}{x}\right)}}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right) + \frac{{\log x}^{2}}{n \cdot n} \cdot -0.5\]
Simplified10.0
\[\leadsto \color{blue}{-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(\frac{x + 1}{x}\right)}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)}\]
if 147972.98971215458 < x
Initial program 19.9
\[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
Taylor expanded around inf 1.2
\[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{x \cdot n}}\]
Simplified1.2
\[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}}\]
Simplified1.2
\[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{n \cdot x}}\]
- Recombined 4 regimes into one program.
Final simplification7.4
\[\leadsto \begin{array}{l}
\mathbf{if}\;x \leq 1.280852323654058 \cdot 10^{-211}:\\
\;\;\;\;-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(x + 1\right) - \log x}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\\
\mathbf{elif}\;x \leq 2.2097631365031477 \cdot 10^{-202}:\\
\;\;\;\;\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt{e^{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}}\\
\mathbf{elif}\;x \leq 147972.98971215458:\\
\;\;\;\;-0.5 \cdot \frac{{\log x}^{2}}{n \cdot n} + \left(\left(\left(0.5 \cdot \frac{{\log \left(x + 1\right)}^{2}}{n \cdot n} + 0.16666666666666666 \cdot {\left(\frac{\log \left(x + 1\right)}{n}\right)}^{3}\right) + \frac{\log \left(\frac{x + 1}{x}\right)}{n}\right) - 0.16666666666666666 \cdot {\left(\frac{\log x}{n}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\
\end{array}\]
Reproduce
herbie shell --seed 2021022
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))