Average Error: 33.1 → 11.6
Time: 14.8s
Precision: binary64
\[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
\[\begin{array}{l} t_0 := \frac{\log x}{n}\\ t_1 := e^{t_0}\\ t_2 := {\log x}^{4}\\ t_3 := \frac{\mathsf{log1p}\left(x\right)}{n}\\ t_4 := -\log x\\ t_5 := {\left(\mathsf{log1p}\left(x\right)\right)}^{2}\\ t_6 := \frac{1}{\mathsf{log1p}\left(x\right) + \log x}\\ \mathbf{if}\;n \leq -1.472449740441452 \cdot 10^{+110}:\\ \;\;\;\;\frac{\frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} + {t_4}^{3}}{t_5 + \left(\log x \cdot \log x + \mathsf{log1p}\left(x\right) \cdot \log x\right)}}{n}\\ \mathbf{elif}\;n \leq -1.1389890578733937 \cdot 10^{+84}:\\ \;\;\;\;\frac{\left(\left(\left(\frac{0.9166666666666666}{{x}^{4}} - \frac{\log x}{x \cdot x}\right) + \left(\mathsf{fma}\left(0.5, \frac{t_4}{{x}^{4}}, \frac{1}{x \cdot x}\right) + \frac{\log x}{{x}^{3}} \cdot 0.6666666666666666\right)\right) - \mathsf{fma}\left(2, \frac{t_4}{x}, \frac{1}{{x}^{3}}\right)\right) \cdot t_6}{n}\\ \mathbf{elif}\;n \leq -1.1702538570658833 \cdot 10^{+47}:\\ \;\;\;\;\frac{t_6 \cdot \left(t_5 - \sqrt{t_2}\right)}{n}\\ \mathbf{elif}\;n \leq -5.954878111597585 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{t_1}{x \cdot \left(n \cdot x\right)} + \frac{t_1}{n \cdot \left(n \cdot {x}^{3}\right)}, \mathsf{fma}\left(0.5, \frac{t_1}{x \cdot \left(x \cdot \left(n \cdot n\right)\right)}, \frac{t_1}{n \cdot x}\right) + \frac{t_1}{{x}^{3}} \cdot \left(\frac{0.3333333333333333}{n} + \frac{0.16666666666666666}{{n}^{3}}\right)\right)\\ \mathbf{elif}\;n \leq 169229.69398818014:\\ \;\;\;\;e^{t_3} - t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{t_5}{n \cdot n}, \mathsf{fma}\left(0.041666666666666664, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{4}}{{n}^{4}}, \mathsf{fma}\left(0.16666666666666666, {t_3}^{3}, t_3\right)\right)\right) - \mathsf{fma}\left(0.16666666666666666, {t_0}^{3}, \mathsf{fma}\left(0.5, \frac{{\log x}^{2}}{n \cdot n}, \mathsf{fma}\left(0.041666666666666664, \frac{t_2}{{n}^{4}}, t_0\right)\right)\right)\\ \end{array} \]
(FPCore (x n)
 :precision binary64
 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
(FPCore (x n)
 :precision binary64
 (let* ((t_0 (/ (log x) n))
        (t_1 (exp t_0))
        (t_2 (pow (log x) 4.0))
        (t_3 (/ (log1p x) n))
        (t_4 (- (log x)))
        (t_5 (pow (log1p x) 2.0))
        (t_6 (/ 1.0 (+ (log1p x) (log x)))))
   (if (<= n -1.472449740441452e+110)
     (/
      (/
       (+ (pow (log1p x) 3.0) (pow t_4 3.0))
       (+ t_5 (+ (* (log x) (log x)) (* (log1p x) (log x)))))
      n)
     (if (<= n -1.1389890578733937e+84)
       (/
        (*
         (-
          (+
           (- (/ 0.9166666666666666 (pow x 4.0)) (/ (log x) (* x x)))
           (+
            (fma 0.5 (/ t_4 (pow x 4.0)) (/ 1.0 (* x x)))
            (* (/ (log x) (pow x 3.0)) 0.6666666666666666)))
          (fma 2.0 (/ t_4 x) (/ 1.0 (pow x 3.0))))
         t_6)
        n)
       (if (<= n -1.1702538570658833e+47)
         (/ (* t_6 (- t_5 (sqrt t_2))) n)
         (if (<= n -5.954878111597585e-5)
           (fma
            -0.5
            (+ (/ t_1 (* x (* n x))) (/ t_1 (* n (* n (pow x 3.0)))))
            (+
             (fma 0.5 (/ t_1 (* x (* x (* n n)))) (/ t_1 (* n x)))
             (*
              (/ t_1 (pow x 3.0))
              (+
               (/ 0.3333333333333333 n)
               (/ 0.16666666666666666 (pow n 3.0))))))
           (if (<= n 169229.69398818014)
             (- (exp t_3) t_1)
             (-
              (fma
               0.5
               (/ t_5 (* n n))
               (fma
                0.041666666666666664
                (/ (pow (log1p x) 4.0) (pow n 4.0))
                (fma 0.16666666666666666 (pow t_3 3.0) t_3)))
              (fma
               0.16666666666666666
               (pow t_0 3.0)
               (fma
                0.5
                (/ (pow (log x) 2.0) (* n n))
                (fma 0.041666666666666664 (/ t_2 (pow n 4.0)) t_0)))))))))))
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 t_0 = log(x) / n;
	double t_1 = exp(t_0);
	double t_2 = pow(log(x), 4.0);
	double t_3 = log1p(x) / n;
	double t_4 = -log(x);
	double t_5 = pow(log1p(x), 2.0);
	double t_6 = 1.0 / (log1p(x) + log(x));
	double tmp;
	if (n <= -1.472449740441452e+110) {
		tmp = ((pow(log1p(x), 3.0) + pow(t_4, 3.0)) / (t_5 + ((log(x) * log(x)) + (log1p(x) * log(x))))) / n;
	} else if (n <= -1.1389890578733937e+84) {
		tmp = (((((0.9166666666666666 / pow(x, 4.0)) - (log(x) / (x * x))) + (fma(0.5, (t_4 / pow(x, 4.0)), (1.0 / (x * x))) + ((log(x) / pow(x, 3.0)) * 0.6666666666666666))) - fma(2.0, (t_4 / x), (1.0 / pow(x, 3.0)))) * t_6) / n;
	} else if (n <= -1.1702538570658833e+47) {
		tmp = (t_6 * (t_5 - sqrt(t_2))) / n;
	} else if (n <= -5.954878111597585e-5) {
		tmp = fma(-0.5, ((t_1 / (x * (n * x))) + (t_1 / (n * (n * pow(x, 3.0))))), (fma(0.5, (t_1 / (x * (x * (n * n)))), (t_1 / (n * x))) + ((t_1 / pow(x, 3.0)) * ((0.3333333333333333 / n) + (0.16666666666666666 / pow(n, 3.0))))));
	} else if (n <= 169229.69398818014) {
		tmp = exp(t_3) - t_1;
	} else {
		tmp = fma(0.5, (t_5 / (n * n)), fma(0.041666666666666664, (pow(log1p(x), 4.0) / pow(n, 4.0)), fma(0.16666666666666666, pow(t_3, 3.0), t_3))) - fma(0.16666666666666666, pow(t_0, 3.0), fma(0.5, (pow(log(x), 2.0) / (n * n)), fma(0.041666666666666664, (t_2 / pow(n, 4.0)), t_0)));
	}
	return tmp;
}
function code(x, n)
	return Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n)))
end
function code(x, n)
	t_0 = Float64(log(x) / n)
	t_1 = exp(t_0)
	t_2 = log(x) ^ 4.0
	t_3 = Float64(log1p(x) / n)
	t_4 = Float64(-log(x))
	t_5 = log1p(x) ^ 2.0
	t_6 = Float64(1.0 / Float64(log1p(x) + log(x)))
	tmp = 0.0
	if (n <= -1.472449740441452e+110)
		tmp = Float64(Float64(Float64((log1p(x) ^ 3.0) + (t_4 ^ 3.0)) / Float64(t_5 + Float64(Float64(log(x) * log(x)) + Float64(log1p(x) * log(x))))) / n);
	elseif (n <= -1.1389890578733937e+84)
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(0.9166666666666666 / (x ^ 4.0)) - Float64(log(x) / Float64(x * x))) + Float64(fma(0.5, Float64(t_4 / (x ^ 4.0)), Float64(1.0 / Float64(x * x))) + Float64(Float64(log(x) / (x ^ 3.0)) * 0.6666666666666666))) - fma(2.0, Float64(t_4 / x), Float64(1.0 / (x ^ 3.0)))) * t_6) / n);
	elseif (n <= -1.1702538570658833e+47)
		tmp = Float64(Float64(t_6 * Float64(t_5 - sqrt(t_2))) / n);
	elseif (n <= -5.954878111597585e-5)
		tmp = fma(-0.5, Float64(Float64(t_1 / Float64(x * Float64(n * x))) + Float64(t_1 / Float64(n * Float64(n * (x ^ 3.0))))), Float64(fma(0.5, Float64(t_1 / Float64(x * Float64(x * Float64(n * n)))), Float64(t_1 / Float64(n * x))) + Float64(Float64(t_1 / (x ^ 3.0)) * Float64(Float64(0.3333333333333333 / n) + Float64(0.16666666666666666 / (n ^ 3.0))))));
	elseif (n <= 169229.69398818014)
		tmp = Float64(exp(t_3) - t_1);
	else
		tmp = Float64(fma(0.5, Float64(t_5 / Float64(n * n)), fma(0.041666666666666664, Float64((log1p(x) ^ 4.0) / (n ^ 4.0)), fma(0.16666666666666666, (t_3 ^ 3.0), t_3))) - fma(0.16666666666666666, (t_0 ^ 3.0), fma(0.5, Float64((log(x) ^ 2.0) / Float64(n * n)), fma(0.041666666666666664, Float64(t_2 / (n ^ 4.0)), t_0))));
	end
	return tmp
end
code[x_, n_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]}, Block[{t$95$1 = N[Exp[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Log[x], $MachinePrecision], 4.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]}, Block[{t$95$4 = (-N[Log[x], $MachinePrecision])}, Block[{t$95$5 = N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$6 = N[(1.0 / N[(N[Log[1 + x], $MachinePrecision] + N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.472449740441452e+110], N[(N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 3.0], $MachinePrecision] + N[Power[t$95$4, 3.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$5 + N[(N[(N[Log[x], $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(N[Log[1 + x], $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[n, -1.1389890578733937e+84], N[(N[(N[(N[(N[(N[(0.9166666666666666 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] - N[(N[Log[x], $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[(t$95$4 / N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[x], $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(t$95$4 / x), $MachinePrecision] + N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$6), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[n, -1.1702538570658833e+47], N[(N[(t$95$6 * N[(t$95$5 - N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[n, -5.954878111597585e-5], N[(-0.5 * N[(N[(t$95$1 / N[(x * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / N[(n * N[(n * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[(t$95$1 / N[(x * N[(x * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] * N[(N[(0.3333333333333333 / n), $MachinePrecision] + N[(0.16666666666666666 / N[Power[n, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 169229.69398818014], N[(N[Exp[t$95$3], $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(0.5 * N[(t$95$5 / N[(n * n), $MachinePrecision]), $MachinePrecision] + N[(0.041666666666666664 * N[(N[Power[N[Log[1 + x], $MachinePrecision], 4.0], $MachinePrecision] / N[Power[n, 4.0], $MachinePrecision]), $MachinePrecision] + N[(0.16666666666666666 * N[Power[t$95$3, 3.0], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.16666666666666666 * N[Power[t$95$0, 3.0], $MachinePrecision] + N[(0.5 * N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision] + N[(0.041666666666666664 * N[(t$95$2 / N[Power[n, 4.0], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\begin{array}{l}
t_0 := \frac{\log x}{n}\\
t_1 := e^{t_0}\\
t_2 := {\log x}^{4}\\
t_3 := \frac{\mathsf{log1p}\left(x\right)}{n}\\
t_4 := -\log x\\
t_5 := {\left(\mathsf{log1p}\left(x\right)\right)}^{2}\\
t_6 := \frac{1}{\mathsf{log1p}\left(x\right) + \log x}\\
\mathbf{if}\;n \leq -1.472449740441452 \cdot 10^{+110}:\\
\;\;\;\;\frac{\frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} + {t_4}^{3}}{t_5 + \left(\log x \cdot \log x + \mathsf{log1p}\left(x\right) \cdot \log x\right)}}{n}\\

\mathbf{elif}\;n \leq -1.1389890578733937 \cdot 10^{+84}:\\
\;\;\;\;\frac{\left(\left(\left(\frac{0.9166666666666666}{{x}^{4}} - \frac{\log x}{x \cdot x}\right) + \left(\mathsf{fma}\left(0.5, \frac{t_4}{{x}^{4}}, \frac{1}{x \cdot x}\right) + \frac{\log x}{{x}^{3}} \cdot 0.6666666666666666\right)\right) - \mathsf{fma}\left(2, \frac{t_4}{x}, \frac{1}{{x}^{3}}\right)\right) \cdot t_6}{n}\\

\mathbf{elif}\;n \leq -1.1702538570658833 \cdot 10^{+47}:\\
\;\;\;\;\frac{t_6 \cdot \left(t_5 - \sqrt{t_2}\right)}{n}\\

\mathbf{elif}\;n \leq -5.954878111597585 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{t_1}{x \cdot \left(n \cdot x\right)} + \frac{t_1}{n \cdot \left(n \cdot {x}^{3}\right)}, \mathsf{fma}\left(0.5, \frac{t_1}{x \cdot \left(x \cdot \left(n \cdot n\right)\right)}, \frac{t_1}{n \cdot x}\right) + \frac{t_1}{{x}^{3}} \cdot \left(\frac{0.3333333333333333}{n} + \frac{0.16666666666666666}{{n}^{3}}\right)\right)\\

\mathbf{elif}\;n \leq 169229.69398818014:\\
\;\;\;\;e^{t_3} - t_1\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{t_5}{n \cdot n}, \mathsf{fma}\left(0.041666666666666664, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{4}}{{n}^{4}}, \mathsf{fma}\left(0.16666666666666666, {t_3}^{3}, t_3\right)\right)\right) - \mathsf{fma}\left(0.16666666666666666, {t_0}^{3}, \mathsf{fma}\left(0.5, \frac{{\log x}^{2}}{n \cdot n}, \mathsf{fma}\left(0.041666666666666664, \frac{t_2}{{n}^{4}}, t_0\right)\right)\right)\\


\end{array}

Error

Bits error versus x

Bits error versus n

Derivation

  1. Split input into 6 regimes
  2. if n < -1.4724497404414521e110

    1. Initial program 40.9

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Taylor expanded in n around inf 9.5

      \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
    3. Applied egg-rr9.6

      \[\leadsto \frac{\color{blue}{\frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} + {\left(-\log x\right)}^{3}}{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} + \left(\left(-\log x\right) \cdot \left(-\log x\right) - \mathsf{log1p}\left(x\right) \cdot \left(-\log x\right)\right)}}}{n} \]

    if -1.4724497404414521e110 < n < -1.13898905787339368e84

    1. Initial program 47.4

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Taylor expanded in n around inf 21.0

      \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
    3. Applied egg-rr21.1

      \[\leadsto \frac{\color{blue}{\left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) \cdot \frac{1}{\mathsf{log1p}\left(x\right) + \log x}}}{n} \]
    4. Taylor expanded in x around inf 27.4

      \[\leadsto \frac{\color{blue}{\left(\left(\frac{\log \left(\frac{1}{x}\right)}{{x}^{2}} + \left(0.9166666666666666 \cdot \frac{1}{{x}^{4}} + \left(0.5 \cdot \frac{\log \left(\frac{1}{x}\right)}{{x}^{4}} + \frac{1}{{x}^{2}}\right)\right)\right) - \left(0.6666666666666666 \cdot \frac{\log \left(\frac{1}{x}\right)}{{x}^{3}} + \left(\frac{1}{{x}^{3}} + 2 \cdot \frac{\log \left(\frac{1}{x}\right)}{x}\right)\right)\right)} \cdot \frac{1}{\mathsf{log1p}\left(x\right) + \log x}}{n} \]
    5. Simplified27.4

      \[\leadsto \frac{\color{blue}{\left(\left(\left(\frac{0.9166666666666666}{{x}^{4}} - \frac{\log x}{x \cdot x}\right) + \left(\mathsf{fma}\left(0.5, \frac{-\log x}{{x}^{4}}, \frac{1}{x \cdot x}\right) + \frac{\log x}{{x}^{3}} \cdot 0.6666666666666666\right)\right) - \mathsf{fma}\left(2, \frac{-\log x}{x}, \frac{1}{{x}^{3}}\right)\right)} \cdot \frac{1}{\mathsf{log1p}\left(x\right) + \log x}}{n} \]

    if -1.13898905787339368e84 < n < -1.17025385706588332e47

    1. Initial program 56.0

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Taylor expanded in n around inf 23.9

      \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
    3. Applied egg-rr23.9

      \[\leadsto \frac{\color{blue}{\left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) \cdot \frac{1}{\mathsf{log1p}\left(x\right) + \log x}}}{n} \]
    4. Applied egg-rr25.2

      \[\leadsto \frac{\left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - \color{blue}{\sqrt{{\log x}^{4}}}\right) \cdot \frac{1}{\mathsf{log1p}\left(x\right) + \log x}}{n} \]

    if -1.17025385706588332e47 < n < -5.9548781115975849e-5

    1. Initial program 49.9

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Taylor expanded in x around inf 31.9

      \[\leadsto \color{blue}{\left(0.3333333333333333 \cdot \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot {x}^{3}} + \left(0.5 \cdot \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{{n}^{2} \cdot {x}^{2}} + \left(0.16666666666666666 \cdot \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{{n}^{3} \cdot {x}^{3}} + \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}\right)\right)\right) - \left(0.5 \cdot \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot {x}^{2}} + 0.5 \cdot \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{{n}^{2} \cdot {x}^{3}}\right)} \]
    3. Simplified31.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{e^{\frac{\log x}{n}}}{x \cdot \left(x \cdot n\right)} + \frac{e^{\frac{\log x}{n}}}{n \cdot \left(n \cdot {x}^{3}\right)}, \mathsf{fma}\left(0.5, \frac{e^{\frac{\log x}{n}}}{x \cdot \left(x \cdot \left(n \cdot n\right)\right)}, \frac{e^{\frac{\log x}{n}}}{x \cdot n}\right) + \frac{e^{\frac{\log x}{n}}}{{x}^{3}} \cdot \left(\frac{0.3333333333333333}{n} + \frac{0.16666666666666666}{{n}^{3}}\right)\right)} \]

    if -5.9548781115975849e-5 < n < 169229.69398818014

    1. Initial program 2.0

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Taylor expanded in n around 0 2.0

      \[\leadsto \color{blue}{e^{\frac{\log \left(1 + x\right)}{n}} - e^{\frac{\log x}{n}}} \]
    3. Simplified0.8

      \[\leadsto \color{blue}{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - e^{\frac{\log x}{n}}} \]

    if 169229.69398818014 < n

    1. Initial program 45.2

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Taylor expanded in n around inf 14.9

      \[\leadsto \color{blue}{\left(0.5 \cdot \frac{{\log \left(1 + x\right)}^{2}}{{n}^{2}} + \left(0.041666666666666664 \cdot \frac{{\log \left(1 + x\right)}^{4}}{{n}^{4}} + \left(0.16666666666666666 \cdot \frac{{\log \left(1 + x\right)}^{3}}{{n}^{3}} + \frac{\log \left(1 + x\right)}{n}\right)\right)\right) - \left(0.16666666666666666 \cdot \frac{{\log x}^{3}}{{n}^{3}} + \left(0.5 \cdot \frac{{\log x}^{2}}{{n}^{2}} + \left(0.041666666666666664 \cdot \frac{{\log x}^{4}}{{n}^{4}} + \frac{\log x}{n}\right)\right)\right)} \]
    3. Simplified14.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2}}{n \cdot n}, \mathsf{fma}\left(0.041666666666666664, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{4}}{{n}^{4}}, \mathsf{fma}\left(0.16666666666666666, {\left(\frac{\mathsf{log1p}\left(x\right)}{n}\right)}^{3}, \frac{\mathsf{log1p}\left(x\right)}{n}\right)\right)\right) - \mathsf{fma}\left(0.16666666666666666, {\left(\frac{\log x}{n}\right)}^{3}, \mathsf{fma}\left(0.5, \frac{{\log x}^{2}}{n \cdot n}, \mathsf{fma}\left(0.041666666666666664, \frac{{\log x}^{4}}{{n}^{4}}, \frac{\log x}{n}\right)\right)\right)} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification11.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.472449740441452 \cdot 10^{+110}:\\ \;\;\;\;\frac{\frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} + {\left(-\log x\right)}^{3}}{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} + \left(\log x \cdot \log x + \mathsf{log1p}\left(x\right) \cdot \log x\right)}}{n}\\ \mathbf{elif}\;n \leq -1.1389890578733937 \cdot 10^{+84}:\\ \;\;\;\;\frac{\left(\left(\left(\frac{0.9166666666666666}{{x}^{4}} - \frac{\log x}{x \cdot x}\right) + \left(\mathsf{fma}\left(0.5, \frac{-\log x}{{x}^{4}}, \frac{1}{x \cdot x}\right) + \frac{\log x}{{x}^{3}} \cdot 0.6666666666666666\right)\right) - \mathsf{fma}\left(2, \frac{-\log x}{x}, \frac{1}{{x}^{3}}\right)\right) \cdot \frac{1}{\mathsf{log1p}\left(x\right) + \log x}}{n}\\ \mathbf{elif}\;n \leq -1.1702538570658833 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{1}{\mathsf{log1p}\left(x\right) + \log x} \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - \sqrt{{\log x}^{4}}\right)}{n}\\ \mathbf{elif}\;n \leq -5.954878111597585 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \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)}, \mathsf{fma}\left(0.5, \frac{e^{\frac{\log x}{n}}}{x \cdot \left(x \cdot \left(n \cdot n\right)\right)}, \frac{e^{\frac{\log x}{n}}}{n \cdot x}\right) + \frac{e^{\frac{\log x}{n}}}{{x}^{3}} \cdot \left(\frac{0.3333333333333333}{n} + \frac{0.16666666666666666}{{n}^{3}}\right)\right)\\ \mathbf{elif}\;n \leq 169229.69398818014:\\ \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - e^{\frac{\log x}{n}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2}}{n \cdot n}, \mathsf{fma}\left(0.041666666666666664, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{4}}{{n}^{4}}, \mathsf{fma}\left(0.16666666666666666, {\left(\frac{\mathsf{log1p}\left(x\right)}{n}\right)}^{3}, \frac{\mathsf{log1p}\left(x\right)}{n}\right)\right)\right) - \mathsf{fma}\left(0.16666666666666666, {\left(\frac{\log x}{n}\right)}^{3}, \mathsf{fma}\left(0.5, \frac{{\log x}^{2}}{n \cdot n}, \mathsf{fma}\left(0.041666666666666664, \frac{{\log x}^{4}}{{n}^{4}}, \frac{\log x}{n}\right)\right)\right)\\ \end{array} \]

Reproduce

herbie shell --seed 2022148 
(FPCore (x n)
  :name "2nthrt (problem 3.4.6)"
  :precision binary64
  (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))