{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\begin{array}{l}
\mathbf{if}\;x \leq 3749.2329152300117:\\
\;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{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 3749.2329152300117) (/ (log (/ (+ x 1.0) x)) n) (/ (pow x (/ 1.0 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 <= 3749.2329152300117) {
tmp = log((x + 1.0) / x) / n;
} else {
tmp = pow(x, (1.0 / n)) / (x * n);
}
return tmp;
}











Bits error versus x











Bits error versus n
Results
| Alternative 1 | |
|---|---|
| Error | 12.6 |
| Cost | 9093 |
| Alternative 2 | |
|---|---|
| Error | 15.6 |
| Cost | 7041 |
| Alternative 3 | |
|---|---|
| Error | 15.8 |
| Cost | 6977 |
| Alternative 4 | |
|---|---|
| Error | 21.7 |
| Cost | 1411 |
| Alternative 5 | |
|---|---|
| Error | 23.6 |
| Cost | 1283 |
| Alternative 6 | |
|---|---|
| Error | 24.1 |
| Cost | 1283 |
| Alternative 7 | |
|---|---|
| Error | 34.0 |
| Cost | 706 |
| Alternative 8 | |
|---|---|
| Error | 56.5 |
| Cost | 64 |

if x < 3749.2329152300117Initial program 47.4
Taylor expanded around inf 13.6
rmApplied diff-log_binary64_17013.6
Simplified13.6
if 3749.2329152300117 < x Initial program 21.0
Taylor expanded around inf 1.5
Simplified1.5
Simplified1.5
Final simplification7.1
herbie shell --seed 2021044
(FPCore (x n)
:name "2nthrt (problem 3.4.6)"
:precision binary64
(- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))