2nthrt (problem 3.4.6)

Percentage Accurate: 53.3% → 85.3%
Time: 59.6s
Alternatives: 18
Speedup: 1.8×

Specification

?
\[\begin{array}{l} \\ {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \end{array} \]
(FPCore (x n)
 :precision binary64
 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
double code(double x, double n) {
	return pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
}
real(8) function code(x, n)
    real(8), intent (in) :: x
    real(8), intent (in) :: n
    code = ((x + 1.0d0) ** (1.0d0 / n)) - (x ** (1.0d0 / n))
end function
public static double code(double x, double n) {
	return Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
}
def code(x, n):
	return math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n))
function code(x, n)
	return Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n)))
end
function tmp = code(x, n)
	tmp = ((x + 1.0) ^ (1.0 / n)) - (x ^ (1.0 / n));
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]
\begin{array}{l}

\\
{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 18 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 53.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \end{array} \]
(FPCore (x n)
 :precision binary64
 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
double code(double x, double n) {
	return pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
}
real(8) function code(x, n)
    real(8), intent (in) :: x
    real(8), intent (in) :: n
    code = ((x + 1.0d0) ** (1.0d0 / n)) - (x ** (1.0d0 / n))
end function
public static double code(double x, double n) {
	return Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
}
def code(x, n):
	return math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n))
function code(x, n)
	return Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n)))
end
function tmp = code(x, n)
	tmp = ((x + 1.0) ^ (1.0 / n)) - (x ^ (1.0 / n));
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]
\begin{array}{l}

\\
{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}
\end{array}

Alternative 1: 85.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;n \leq -34000000:\\ \;\;\;\;\frac{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}{n}\\ \mathbf{elif}\;n \leq 4100:\\ \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\ \mathbf{elif}\;n \leq 1.65 \cdot 10^{+96}:\\ \;\;\;\;\frac{t\_0}{n \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{n} \cdot \log \left(\frac{x + 1}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (let* ((t_0 (pow x (/ 1.0 n))))
   (if (<= n -34000000.0)
     (/
      (+
       (log1p x)
       (- (* 0.5 (/ (- (pow (log1p x) 2.0) (pow (log x) 2.0)) n)) (log x)))
      n)
     (if (<= n 4100.0)
       (- (exp (/ (log1p x) n)) t_0)
       (if (<= n 1.65e+96)
         (/ t_0 (* n x))
         (* (/ 1.0 n) (log (/ (+ x 1.0) x))))))))
double code(double x, double n) {
	double t_0 = pow(x, (1.0 / n));
	double tmp;
	if (n <= -34000000.0) {
		tmp = (log1p(x) + ((0.5 * ((pow(log1p(x), 2.0) - pow(log(x), 2.0)) / n)) - log(x))) / n;
	} else if (n <= 4100.0) {
		tmp = exp((log1p(x) / n)) - t_0;
	} else if (n <= 1.65e+96) {
		tmp = t_0 / (n * x);
	} else {
		tmp = (1.0 / n) * log(((x + 1.0) / x));
	}
	return tmp;
}
public static double code(double x, double n) {
	double t_0 = Math.pow(x, (1.0 / n));
	double tmp;
	if (n <= -34000000.0) {
		tmp = (Math.log1p(x) + ((0.5 * ((Math.pow(Math.log1p(x), 2.0) - Math.pow(Math.log(x), 2.0)) / n)) - Math.log(x))) / n;
	} else if (n <= 4100.0) {
		tmp = Math.exp((Math.log1p(x) / n)) - t_0;
	} else if (n <= 1.65e+96) {
		tmp = t_0 / (n * x);
	} else {
		tmp = (1.0 / n) * Math.log(((x + 1.0) / x));
	}
	return tmp;
}
def code(x, n):
	t_0 = math.pow(x, (1.0 / n))
	tmp = 0
	if n <= -34000000.0:
		tmp = (math.log1p(x) + ((0.5 * ((math.pow(math.log1p(x), 2.0) - math.pow(math.log(x), 2.0)) / n)) - math.log(x))) / n
	elif n <= 4100.0:
		tmp = math.exp((math.log1p(x) / n)) - t_0
	elif n <= 1.65e+96:
		tmp = t_0 / (n * x)
	else:
		tmp = (1.0 / n) * math.log(((x + 1.0) / x))
	return tmp
function code(x, n)
	t_0 = x ^ Float64(1.0 / n)
	tmp = 0.0
	if (n <= -34000000.0)
		tmp = Float64(Float64(log1p(x) + Float64(Float64(0.5 * Float64(Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0)) / n)) - log(x))) / n);
	elseif (n <= 4100.0)
		tmp = Float64(exp(Float64(log1p(x) / n)) - t_0);
	elseif (n <= 1.65e+96)
		tmp = Float64(t_0 / Float64(n * x));
	else
		tmp = Float64(Float64(1.0 / n) * log(Float64(Float64(x + 1.0) / x)));
	end
	return tmp
end
code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -34000000.0], N[(N[(N[Log[1 + x], $MachinePrecision] + N[(N[(0.5 * N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[n, 4100.0], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[n, 1.65e+96], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / n), $MachinePrecision] * N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;n \leq -34000000:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}{n}\\

\mathbf{elif}\;n \leq 4100:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\

\mathbf{elif}\;n \leq 1.65 \cdot 10^{+96}:\\
\;\;\;\;\frac{t\_0}{n \cdot x}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{n} \cdot \log \left(\frac{x + 1}{x}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if n < -3.4e7

    1. Initial program 30.4%

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in n around inf 79.0%

      \[\leadsto \color{blue}{\frac{\left(\log \left(1 + x\right) + 0.5 \cdot \frac{{\log \left(1 + x\right)}^{2}}{n}\right) - \left(\log x + 0.5 \cdot \frac{{\log x}^{2}}{n}\right)}{n}} \]
    4. Step-by-step derivation
      1. Simplified79.0%

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

      if -3.4e7 < n < 4100

      1. Initial program 82.5%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around 0 82.5%

        \[\leadsto \color{blue}{e^{\frac{\log \left(1 + x\right)}{n}}} - {x}^{\left(\frac{1}{n}\right)} \]
      4. Step-by-step derivation
        1. log1p-define100.0%

          \[\leadsto e^{\frac{\color{blue}{\mathsf{log1p}\left(x\right)}}{n}} - {x}^{\left(\frac{1}{n}\right)} \]
      5. Simplified100.0%

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

      if 4100 < n < 1.64999999999999992e96

      1. Initial program 8.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 69.6%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg69.6%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec69.6%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg69.6%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac69.6%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg69.6%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg69.6%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative69.6%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified69.6%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. *-un-lft-identity69.6%

          \[\leadsto \color{blue}{1 \cdot \frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
        2. div-inv69.6%

          \[\leadsto 1 \cdot \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
        3. exp-to-pow69.6%

          \[\leadsto 1 \cdot \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
        4. *-commutative69.6%

          \[\leadsto 1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{n \cdot x}} \]
      7. Applied egg-rr69.6%

        \[\leadsto \color{blue}{1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
      8. Step-by-step derivation
        1. *-lft-identity69.6%

          \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
        2. *-commutative69.6%

          \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
      9. Simplified69.6%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}} \]

      if 1.64999999999999992e96 < n

      1. Initial program 32.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 88.4%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define88.4%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified88.4%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. div-inv88.5%

          \[\leadsto \color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}} \]
      7. Applied egg-rr88.5%

        \[\leadsto \color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}} \]
      8. Step-by-step derivation
        1. log1p-undefine88.5%

          \[\leadsto \left(\color{blue}{\log \left(1 + x\right)} - \log x\right) \cdot \frac{1}{n} \]
        2. diff-log88.8%

          \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      9. Applied egg-rr88.8%

        \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      10. Step-by-step derivation
        1. +-commutative88.8%

          \[\leadsto \log \left(\frac{\color{blue}{x + 1}}{x}\right) \cdot \frac{1}{n} \]
      11. Simplified88.8%

        \[\leadsto \color{blue}{\log \left(\frac{x + 1}{x}\right)} \cdot \frac{1}{n} \]
    5. Recombined 4 regimes into one program.
    6. Final simplification89.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -34000000:\\ \;\;\;\;\frac{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}{n}\\ \mathbf{elif}\;n \leq 4100:\\ \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;n \leq 1.65 \cdot 10^{+96}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{n} \cdot \log \left(\frac{x + 1}{x}\right)\\ \end{array} \]
    7. Add Preprocessing

    Alternative 2: 85.2% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ t_1 := \log \left(\frac{x + 1}{x}\right)\\ \mathbf{if}\;n \leq -22500000000:\\ \;\;\;\;\frac{t\_1}{n}\\ \mathbf{elif}\;n \leq 5200:\\ \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\ \mathbf{elif}\;n \leq 1.25 \cdot 10^{+96}:\\ \;\;\;\;\frac{t\_0}{n \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{n} \cdot t\_1\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (pow x (/ 1.0 n))) (t_1 (log (/ (+ x 1.0) x))))
       (if (<= n -22500000000.0)
         (/ t_1 n)
         (if (<= n 5200.0)
           (- (exp (/ (log1p x) n)) t_0)
           (if (<= n 1.25e+96) (/ t_0 (* n x)) (* (/ 1.0 n) t_1))))))
    double code(double x, double n) {
    	double t_0 = pow(x, (1.0 / n));
    	double t_1 = log(((x + 1.0) / x));
    	double tmp;
    	if (n <= -22500000000.0) {
    		tmp = t_1 / n;
    	} else if (n <= 5200.0) {
    		tmp = exp((log1p(x) / n)) - t_0;
    	} else if (n <= 1.25e+96) {
    		tmp = t_0 / (n * x);
    	} else {
    		tmp = (1.0 / n) * t_1;
    	}
    	return tmp;
    }
    
    public static double code(double x, double n) {
    	double t_0 = Math.pow(x, (1.0 / n));
    	double t_1 = Math.log(((x + 1.0) / x));
    	double tmp;
    	if (n <= -22500000000.0) {
    		tmp = t_1 / n;
    	} else if (n <= 5200.0) {
    		tmp = Math.exp((Math.log1p(x) / n)) - t_0;
    	} else if (n <= 1.25e+96) {
    		tmp = t_0 / (n * x);
    	} else {
    		tmp = (1.0 / n) * t_1;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = math.pow(x, (1.0 / n))
    	t_1 = math.log(((x + 1.0) / x))
    	tmp = 0
    	if n <= -22500000000.0:
    		tmp = t_1 / n
    	elif n <= 5200.0:
    		tmp = math.exp((math.log1p(x) / n)) - t_0
    	elif n <= 1.25e+96:
    		tmp = t_0 / (n * x)
    	else:
    		tmp = (1.0 / n) * t_1
    	return tmp
    
    function code(x, n)
    	t_0 = x ^ Float64(1.0 / n)
    	t_1 = log(Float64(Float64(x + 1.0) / x))
    	tmp = 0.0
    	if (n <= -22500000000.0)
    		tmp = Float64(t_1 / n);
    	elseif (n <= 5200.0)
    		tmp = Float64(exp(Float64(log1p(x) / n)) - t_0);
    	elseif (n <= 1.25e+96)
    		tmp = Float64(t_0 / Float64(n * x));
    	else
    		tmp = Float64(Float64(1.0 / n) * t_1);
    	end
    	return tmp
    end
    
    code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -22500000000.0], N[(t$95$1 / n), $MachinePrecision], If[LessEqual[n, 5200.0], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[n, 1.25e+96], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / n), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := {x}^{\left(\frac{1}{n}\right)}\\
    t_1 := \log \left(\frac{x + 1}{x}\right)\\
    \mathbf{if}\;n \leq -22500000000:\\
    \;\;\;\;\frac{t\_1}{n}\\
    
    \mathbf{elif}\;n \leq 5200:\\
    \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\
    
    \mathbf{elif}\;n \leq 1.25 \cdot 10^{+96}:\\
    \;\;\;\;\frac{t\_0}{n \cdot x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1}{n} \cdot t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if n < -2.25e10

      1. Initial program 30.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 78.9%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define78.9%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified78.9%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. log1p-undefine78.9%

          \[\leadsto \left(\color{blue}{\log \left(1 + x\right)} - \log x\right) \cdot \frac{1}{n} \]
        2. diff-log78.8%

          \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      7. Applied egg-rr78.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
      8. Step-by-step derivation
        1. +-commutative78.8%

          \[\leadsto \log \left(\frac{\color{blue}{x + 1}}{x}\right) \cdot \frac{1}{n} \]
      9. Simplified78.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{x + 1}{x}\right)}}{n} \]

      if -2.25e10 < n < 5200

      1. Initial program 82.5%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around 0 82.5%

        \[\leadsto \color{blue}{e^{\frac{\log \left(1 + x\right)}{n}}} - {x}^{\left(\frac{1}{n}\right)} \]
      4. Step-by-step derivation
        1. log1p-define100.0%

          \[\leadsto e^{\frac{\color{blue}{\mathsf{log1p}\left(x\right)}}{n}} - {x}^{\left(\frac{1}{n}\right)} \]
      5. Simplified100.0%

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

      if 5200 < n < 1.2500000000000001e96

      1. Initial program 8.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 69.6%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg69.6%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec69.6%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg69.6%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac69.6%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg69.6%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg69.6%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative69.6%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified69.6%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. *-un-lft-identity69.6%

          \[\leadsto \color{blue}{1 \cdot \frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
        2. div-inv69.6%

          \[\leadsto 1 \cdot \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
        3. exp-to-pow69.6%

          \[\leadsto 1 \cdot \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
        4. *-commutative69.6%

          \[\leadsto 1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{n \cdot x}} \]
      7. Applied egg-rr69.6%

        \[\leadsto \color{blue}{1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
      8. Step-by-step derivation
        1. *-lft-identity69.6%

          \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
        2. *-commutative69.6%

          \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
      9. Simplified69.6%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}} \]

      if 1.2500000000000001e96 < n

      1. Initial program 32.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 88.4%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define88.4%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified88.4%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. div-inv88.5%

          \[\leadsto \color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}} \]
      7. Applied egg-rr88.5%

        \[\leadsto \color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}} \]
      8. Step-by-step derivation
        1. log1p-undefine88.5%

          \[\leadsto \left(\color{blue}{\log \left(1 + x\right)} - \log x\right) \cdot \frac{1}{n} \]
        2. diff-log88.8%

          \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      9. Applied egg-rr88.8%

        \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      10. Step-by-step derivation
        1. +-commutative88.8%

          \[\leadsto \log \left(\frac{\color{blue}{x + 1}}{x}\right) \cdot \frac{1}{n} \]
      11. Simplified88.8%

        \[\leadsto \color{blue}{\log \left(\frac{x + 1}{x}\right)} \cdot \frac{1}{n} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification89.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -22500000000:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;n \leq 5200:\\ \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;n \leq 1.25 \cdot 10^{+96}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{n} \cdot \log \left(\frac{x + 1}{x}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 3: 81.9% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{1}{n} \cdot \frac{t\_0}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{t\_0}{n \cdot x}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+187}:\\ \;\;\;\;{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot \left(-x\right)}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (pow x (/ 1.0 n))))
       (if (<= (/ 1.0 n) -1e-33)
         (* (/ 1.0 n) (/ t_0 x))
         (if (<= (/ 1.0 n) 5e-100)
           (/ (log (/ (+ x 1.0) x)) n)
           (if (<= (/ 1.0 n) 5e-36)
             (/ 1.0 (* x (+ n (* 0.5 (/ n x)))))
             (if (<= (/ 1.0 n) 2e-23)
               (/ (- x (log x)) n)
               (if (<= (/ 1.0 n) 0.0002)
                 (/ t_0 (* n x))
                 (if (<= (/ 1.0 n) 1e+187)
                   (- (pow (+ x 1.0) (/ 1.0 n)) t_0)
                   (/
                    (+ -1.0 (/ (+ 0.5 (/ -0.3333333333333333 x)) x))
                    (* n (- x)))))))))))
    double code(double x, double n) {
    	double t_0 = pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -1e-33) {
    		tmp = (1.0 / n) * (t_0 / x);
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5e-36) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 2e-23) {
    		tmp = (x - log(x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = t_0 / (n * x);
    	} else if ((1.0 / n) <= 1e+187) {
    		tmp = pow((x + 1.0), (1.0 / n)) - t_0;
    	} else {
    		tmp = (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x);
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: t_0
        real(8) :: tmp
        t_0 = x ** (1.0d0 / n)
        if ((1.0d0 / n) <= (-1d-33)) then
            tmp = (1.0d0 / n) * (t_0 / x)
        else if ((1.0d0 / n) <= 5d-100) then
            tmp = log(((x + 1.0d0) / x)) / n
        else if ((1.0d0 / n) <= 5d-36) then
            tmp = 1.0d0 / (x * (n + (0.5d0 * (n / x))))
        else if ((1.0d0 / n) <= 2d-23) then
            tmp = (x - log(x)) / n
        else if ((1.0d0 / n) <= 0.0002d0) then
            tmp = t_0 / (n * x)
        else if ((1.0d0 / n) <= 1d+187) then
            tmp = ((x + 1.0d0) ** (1.0d0 / n)) - t_0
        else
            tmp = ((-1.0d0) + ((0.5d0 + ((-0.3333333333333333d0) / x)) / x)) / (n * -x)
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double t_0 = Math.pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -1e-33) {
    		tmp = (1.0 / n) * (t_0 / x);
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = Math.log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5e-36) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 2e-23) {
    		tmp = (x - Math.log(x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = t_0 / (n * x);
    	} else if ((1.0 / n) <= 1e+187) {
    		tmp = Math.pow((x + 1.0), (1.0 / n)) - t_0;
    	} else {
    		tmp = (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x);
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = math.pow(x, (1.0 / n))
    	tmp = 0
    	if (1.0 / n) <= -1e-33:
    		tmp = (1.0 / n) * (t_0 / x)
    	elif (1.0 / n) <= 5e-100:
    		tmp = math.log(((x + 1.0) / x)) / n
    	elif (1.0 / n) <= 5e-36:
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))))
    	elif (1.0 / n) <= 2e-23:
    		tmp = (x - math.log(x)) / n
    	elif (1.0 / n) <= 0.0002:
    		tmp = t_0 / (n * x)
    	elif (1.0 / n) <= 1e+187:
    		tmp = math.pow((x + 1.0), (1.0 / n)) - t_0
    	else:
    		tmp = (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x)
    	return tmp
    
    function code(x, n)
    	t_0 = x ^ Float64(1.0 / n)
    	tmp = 0.0
    	if (Float64(1.0 / n) <= -1e-33)
    		tmp = Float64(Float64(1.0 / n) * Float64(t_0 / x));
    	elseif (Float64(1.0 / n) <= 5e-100)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	elseif (Float64(1.0 / n) <= 5e-36)
    		tmp = Float64(1.0 / Float64(x * Float64(n + Float64(0.5 * Float64(n / x)))));
    	elseif (Float64(1.0 / n) <= 2e-23)
    		tmp = Float64(Float64(x - log(x)) / n);
    	elseif (Float64(1.0 / n) <= 0.0002)
    		tmp = Float64(t_0 / Float64(n * x));
    	elseif (Float64(1.0 / n) <= 1e+187)
    		tmp = Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - t_0);
    	else
    		tmp = Float64(Float64(-1.0 + Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / x)) / Float64(n * Float64(-x)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	t_0 = x ^ (1.0 / n);
    	tmp = 0.0;
    	if ((1.0 / n) <= -1e-33)
    		tmp = (1.0 / n) * (t_0 / x);
    	elseif ((1.0 / n) <= 5e-100)
    		tmp = log(((x + 1.0) / x)) / n;
    	elseif ((1.0 / n) <= 5e-36)
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	elseif ((1.0 / n) <= 2e-23)
    		tmp = (x - log(x)) / n;
    	elseif ((1.0 / n) <= 0.0002)
    		tmp = t_0 / (n * x);
    	elseif ((1.0 / n) <= 1e+187)
    		tmp = ((x + 1.0) ^ (1.0 / n)) - t_0;
    	else
    		tmp = (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-33], N[(N[(1.0 / n), $MachinePrecision] * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-100], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-36], N[(1.0 / N[(x * N[(n + N[(0.5 * N[(n / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-23], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 0.0002], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+187], N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(-1.0 + N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(n * (-x)), $MachinePrecision]), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := {x}^{\left(\frac{1}{n}\right)}\\
    \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\
    \;\;\;\;\frac{1}{n} \cdot \frac{t\_0}{x}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\
    \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\
    \;\;\;\;\frac{x - \log x}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\
    \;\;\;\;\frac{t\_0}{n \cdot x}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 10^{+187}:\\
    \;\;\;\;{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot \left(-x\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 7 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -1.0000000000000001e-33

      1. Initial program 95.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 97.3%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg97.3%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec97.3%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg97.3%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac97.3%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg97.3%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg97.3%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative97.3%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified97.3%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. associate-/r*97.5%

          \[\leadsto \color{blue}{\frac{\frac{e^{\frac{\log x}{n}}}{x}}{n}} \]
        2. div-inv97.5%

          \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x} \cdot \frac{1}{n}} \]
        3. div-inv97.5%

          \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x} \cdot \frac{1}{n} \]
        4. exp-to-pow97.5%

          \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x} \cdot \frac{1}{n} \]
      7. Applied egg-rr97.5%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x} \cdot \frac{1}{n}} \]

      if -1.0000000000000001e-33 < (/.f64 #s(literal 1 binary64) n) < 5.0000000000000001e-100

      1. Initial program 31.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 84.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define84.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. log1p-undefine84.8%

          \[\leadsto \left(\color{blue}{\log \left(1 + x\right)} - \log x\right) \cdot \frac{1}{n} \]
        2. diff-log84.9%

          \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      7. Applied egg-rr84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
      8. Step-by-step derivation
        1. +-commutative84.9%

          \[\leadsto \log \left(\frac{\color{blue}{x + 1}}{x}\right) \cdot \frac{1}{n} \]
      9. Simplified84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{x + 1}{x}\right)}}{n} \]

      if 5.0000000000000001e-100 < (/.f64 #s(literal 1 binary64) n) < 5.00000000000000004e-36

      1. Initial program 12.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 32.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define32.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified32.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. clear-num32.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
        2. inv-pow32.8%

          \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      7. Applied egg-rr32.8%

        \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      8. Step-by-step derivation
        1. unpow-132.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      9. Simplified32.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      10. Taylor expanded in x around inf 81.6%

        \[\leadsto \frac{1}{\color{blue}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}} \]

      if 5.00000000000000004e-36 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999992e-23

      1. Initial program 3.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 83.7%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define83.7%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified83.7%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around 0 84.3%

        \[\leadsto \frac{\color{blue}{x - \log x}}{n} \]

      if 1.99999999999999992e-23 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-4

      1. Initial program 5.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 99.7%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg99.7%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec99.7%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg99.7%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac99.7%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg99.7%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg99.7%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative99.7%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified99.7%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. *-un-lft-identity99.7%

          \[\leadsto \color{blue}{1 \cdot \frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
        2. div-inv99.7%

          \[\leadsto 1 \cdot \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
        3. exp-to-pow99.7%

          \[\leadsto 1 \cdot \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
        4. *-commutative99.7%

          \[\leadsto 1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{n \cdot x}} \]
      7. Applied egg-rr99.7%

        \[\leadsto \color{blue}{1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
      8. Step-by-step derivation
        1. *-lft-identity99.7%

          \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
        2. *-commutative99.7%

          \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
      9. Simplified99.7%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}} \]

      if 2.0000000000000001e-4 < (/.f64 #s(literal 1 binary64) n) < 9.99999999999999907e186

      1. Initial program 78.6%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing

      if 9.99999999999999907e186 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 19.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 7.2%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define7.2%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified7.2%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 83.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Taylor expanded in n around 0 83.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{n \cdot x}} \]
      8. Step-by-step derivation
        1. sub-neg83.9%

          \[\leadsto -1 \cdot \frac{\color{blue}{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} + \left(-1\right)}}{n \cdot x} \]
        2. associate-*r/83.9%

          \[\leadsto -1 \cdot \frac{\color{blue}{\frac{-1 \cdot \left(0.3333333333333333 \cdot \frac{1}{x} - 0.5\right)}{x}} + \left(-1\right)}{n \cdot x} \]
        3. sub-neg83.9%

          \[\leadsto -1 \cdot \frac{\frac{-1 \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{x} + \left(-0.5\right)\right)}}{x} + \left(-1\right)}{n \cdot x} \]
        4. metadata-eval83.9%

          \[\leadsto -1 \cdot \frac{\frac{-1 \cdot \left(0.3333333333333333 \cdot \frac{1}{x} + \color{blue}{-0.5}\right)}{x} + \left(-1\right)}{n \cdot x} \]
        5. distribute-lft-in83.9%

          \[\leadsto -1 \cdot \frac{\frac{\color{blue}{-1 \cdot \left(0.3333333333333333 \cdot \frac{1}{x}\right) + -1 \cdot -0.5}}{x} + \left(-1\right)}{n \cdot x} \]
        6. neg-mul-183.9%

          \[\leadsto -1 \cdot \frac{\frac{\color{blue}{\left(-0.3333333333333333 \cdot \frac{1}{x}\right)} + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
        7. associate-*r/83.9%

          \[\leadsto -1 \cdot \frac{\frac{\left(-\color{blue}{\frac{0.3333333333333333 \cdot 1}{x}}\right) + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
        8. metadata-eval83.9%

          \[\leadsto -1 \cdot \frac{\frac{\left(-\frac{\color{blue}{0.3333333333333333}}{x}\right) + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
        9. distribute-neg-frac83.9%

          \[\leadsto -1 \cdot \frac{\frac{\color{blue}{\frac{-0.3333333333333333}{x}} + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
        10. metadata-eval83.9%

          \[\leadsto -1 \cdot \frac{\frac{\frac{\color{blue}{-0.3333333333333333}}{x} + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
        11. metadata-eval83.9%

          \[\leadsto -1 \cdot \frac{\frac{\frac{-0.3333333333333333}{x} + \color{blue}{0.5}}{x} + \left(-1\right)}{n \cdot x} \]
        12. metadata-eval83.9%

          \[\leadsto -1 \cdot \frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + \color{blue}{-1}}{n \cdot x} \]
        13. *-commutative83.9%

          \[\leadsto -1 \cdot \frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + -1}{\color{blue}{x \cdot n}} \]
      9. Simplified83.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + -1}{x \cdot n}} \]
    3. Recombined 7 regimes into one program.
    4. Final simplification88.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{1}{n} \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+187}:\\ \;\;\;\;{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot \left(-x\right)}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 82.0% accurate, 1.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{1}{n} \cdot \frac{t\_0}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{t\_0}{n \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + x \cdot \left(\frac{1}{n} + \frac{x \cdot -0.5 + 0.5 \cdot \frac{x}{n}}{n}\right)\right) - t\_0\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (pow x (/ 1.0 n))))
       (if (<= (/ 1.0 n) -1e-33)
         (* (/ 1.0 n) (/ t_0 x))
         (if (<= (/ 1.0 n) 5e-100)
           (/ (log (/ (+ x 1.0) x)) n)
           (if (<= (/ 1.0 n) 5e-36)
             (/ 1.0 (* x (+ n (* 0.5 (/ n x)))))
             (if (<= (/ 1.0 n) 2e-23)
               (/ (- x (log x)) n)
               (if (<= (/ 1.0 n) 0.0002)
                 (/ t_0 (* n x))
                 (-
                  (+ 1.0 (* x (+ (/ 1.0 n) (/ (+ (* x -0.5) (* 0.5 (/ x n))) n))))
                  t_0))))))))
    double code(double x, double n) {
    	double t_0 = pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -1e-33) {
    		tmp = (1.0 / n) * (t_0 / x);
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5e-36) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 2e-23) {
    		tmp = (x - log(x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = t_0 / (n * x);
    	} else {
    		tmp = (1.0 + (x * ((1.0 / n) + (((x * -0.5) + (0.5 * (x / n))) / n)))) - t_0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: t_0
        real(8) :: tmp
        t_0 = x ** (1.0d0 / n)
        if ((1.0d0 / n) <= (-1d-33)) then
            tmp = (1.0d0 / n) * (t_0 / x)
        else if ((1.0d0 / n) <= 5d-100) then
            tmp = log(((x + 1.0d0) / x)) / n
        else if ((1.0d0 / n) <= 5d-36) then
            tmp = 1.0d0 / (x * (n + (0.5d0 * (n / x))))
        else if ((1.0d0 / n) <= 2d-23) then
            tmp = (x - log(x)) / n
        else if ((1.0d0 / n) <= 0.0002d0) then
            tmp = t_0 / (n * x)
        else
            tmp = (1.0d0 + (x * ((1.0d0 / n) + (((x * (-0.5d0)) + (0.5d0 * (x / n))) / n)))) - t_0
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double t_0 = Math.pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -1e-33) {
    		tmp = (1.0 / n) * (t_0 / x);
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = Math.log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5e-36) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 2e-23) {
    		tmp = (x - Math.log(x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = t_0 / (n * x);
    	} else {
    		tmp = (1.0 + (x * ((1.0 / n) + (((x * -0.5) + (0.5 * (x / n))) / n)))) - t_0;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = math.pow(x, (1.0 / n))
    	tmp = 0
    	if (1.0 / n) <= -1e-33:
    		tmp = (1.0 / n) * (t_0 / x)
    	elif (1.0 / n) <= 5e-100:
    		tmp = math.log(((x + 1.0) / x)) / n
    	elif (1.0 / n) <= 5e-36:
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))))
    	elif (1.0 / n) <= 2e-23:
    		tmp = (x - math.log(x)) / n
    	elif (1.0 / n) <= 0.0002:
    		tmp = t_0 / (n * x)
    	else:
    		tmp = (1.0 + (x * ((1.0 / n) + (((x * -0.5) + (0.5 * (x / n))) / n)))) - t_0
    	return tmp
    
    function code(x, n)
    	t_0 = x ^ Float64(1.0 / n)
    	tmp = 0.0
    	if (Float64(1.0 / n) <= -1e-33)
    		tmp = Float64(Float64(1.0 / n) * Float64(t_0 / x));
    	elseif (Float64(1.0 / n) <= 5e-100)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	elseif (Float64(1.0 / n) <= 5e-36)
    		tmp = Float64(1.0 / Float64(x * Float64(n + Float64(0.5 * Float64(n / x)))));
    	elseif (Float64(1.0 / n) <= 2e-23)
    		tmp = Float64(Float64(x - log(x)) / n);
    	elseif (Float64(1.0 / n) <= 0.0002)
    		tmp = Float64(t_0 / Float64(n * x));
    	else
    		tmp = Float64(Float64(1.0 + Float64(x * Float64(Float64(1.0 / n) + Float64(Float64(Float64(x * -0.5) + Float64(0.5 * Float64(x / n))) / n)))) - t_0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	t_0 = x ^ (1.0 / n);
    	tmp = 0.0;
    	if ((1.0 / n) <= -1e-33)
    		tmp = (1.0 / n) * (t_0 / x);
    	elseif ((1.0 / n) <= 5e-100)
    		tmp = log(((x + 1.0) / x)) / n;
    	elseif ((1.0 / n) <= 5e-36)
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	elseif ((1.0 / n) <= 2e-23)
    		tmp = (x - log(x)) / n;
    	elseif ((1.0 / n) <= 0.0002)
    		tmp = t_0 / (n * x);
    	else
    		tmp = (1.0 + (x * ((1.0 / n) + (((x * -0.5) + (0.5 * (x / n))) / n)))) - t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-33], N[(N[(1.0 / n), $MachinePrecision] * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-100], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-36], N[(1.0 / N[(x * N[(n + N[(0.5 * N[(n / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-23], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 0.0002], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x * N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(x * -0.5), $MachinePrecision] + N[(0.5 * N[(x / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := {x}^{\left(\frac{1}{n}\right)}\\
    \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\
    \;\;\;\;\frac{1}{n} \cdot \frac{t\_0}{x}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\
    \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\
    \;\;\;\;\frac{x - \log x}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\
    \;\;\;\;\frac{t\_0}{n \cdot x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(1 + x \cdot \left(\frac{1}{n} + \frac{x \cdot -0.5 + 0.5 \cdot \frac{x}{n}}{n}\right)\right) - t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 6 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -1.0000000000000001e-33

      1. Initial program 95.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 97.3%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg97.3%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec97.3%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg97.3%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac97.3%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg97.3%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg97.3%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative97.3%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified97.3%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. associate-/r*97.5%

          \[\leadsto \color{blue}{\frac{\frac{e^{\frac{\log x}{n}}}{x}}{n}} \]
        2. div-inv97.5%

          \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x} \cdot \frac{1}{n}} \]
        3. div-inv97.5%

          \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x} \cdot \frac{1}{n} \]
        4. exp-to-pow97.5%

          \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x} \cdot \frac{1}{n} \]
      7. Applied egg-rr97.5%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x} \cdot \frac{1}{n}} \]

      if -1.0000000000000001e-33 < (/.f64 #s(literal 1 binary64) n) < 5.0000000000000001e-100

      1. Initial program 31.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 84.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define84.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. log1p-undefine84.8%

          \[\leadsto \left(\color{blue}{\log \left(1 + x\right)} - \log x\right) \cdot \frac{1}{n} \]
        2. diff-log84.9%

          \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      7. Applied egg-rr84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
      8. Step-by-step derivation
        1. +-commutative84.9%

          \[\leadsto \log \left(\frac{\color{blue}{x + 1}}{x}\right) \cdot \frac{1}{n} \]
      9. Simplified84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{x + 1}{x}\right)}}{n} \]

      if 5.0000000000000001e-100 < (/.f64 #s(literal 1 binary64) n) < 5.00000000000000004e-36

      1. Initial program 12.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 32.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define32.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified32.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. clear-num32.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
        2. inv-pow32.8%

          \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      7. Applied egg-rr32.8%

        \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      8. Step-by-step derivation
        1. unpow-132.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      9. Simplified32.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      10. Taylor expanded in x around inf 81.6%

        \[\leadsto \frac{1}{\color{blue}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}} \]

      if 5.00000000000000004e-36 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999992e-23

      1. Initial program 3.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 83.7%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define83.7%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified83.7%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around 0 84.3%

        \[\leadsto \frac{\color{blue}{x - \log x}}{n} \]

      if 1.99999999999999992e-23 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-4

      1. Initial program 5.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 99.7%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg99.7%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec99.7%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg99.7%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac99.7%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg99.7%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg99.7%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative99.7%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified99.7%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. *-un-lft-identity99.7%

          \[\leadsto \color{blue}{1 \cdot \frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
        2. div-inv99.7%

          \[\leadsto 1 \cdot \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
        3. exp-to-pow99.7%

          \[\leadsto 1 \cdot \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
        4. *-commutative99.7%

          \[\leadsto 1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{n \cdot x}} \]
      7. Applied egg-rr99.7%

        \[\leadsto \color{blue}{1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
      8. Step-by-step derivation
        1. *-lft-identity99.7%

          \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
        2. *-commutative99.7%

          \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
      9. Simplified99.7%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}} \]

      if 2.0000000000000001e-4 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 52.6%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0 67.1%

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

        \[\leadsto \left(1 + x \cdot \left(\color{blue}{\frac{-0.5 \cdot x + 0.5 \cdot \frac{x}{n}}{n}} + \frac{1}{n}\right)\right) - {x}^{\left(\frac{1}{n}\right)} \]
    3. Recombined 6 regimes into one program.
    4. Final simplification86.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{1}{n} \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + x \cdot \left(\frac{1}{n} + \frac{x \cdot -0.5 + 0.5 \cdot \frac{x}{n}}{n}\right)\right) - {x}^{\left(\frac{1}{n}\right)}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 81.5% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{1}{n} \cdot \frac{t\_0}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{t\_0}{n \cdot x}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+197}:\\ \;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot \left(-x\right)}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (pow x (/ 1.0 n))))
       (if (<= (/ 1.0 n) -1e-33)
         (* (/ 1.0 n) (/ t_0 x))
         (if (<= (/ 1.0 n) 5e-100)
           (/ (log (/ (+ x 1.0) x)) n)
           (if (<= (/ 1.0 n) 5e-36)
             (/ 1.0 (* x (+ n (* 0.5 (/ n x)))))
             (if (<= (/ 1.0 n) 2e-23)
               (/ (- x (log x)) n)
               (if (<= (/ 1.0 n) 0.0002)
                 (/ t_0 (* n x))
                 (if (<= (/ 1.0 n) 1e+197)
                   (- (+ 1.0 (/ x n)) t_0)
                   (/
                    (+ -1.0 (/ (+ 0.5 (/ -0.3333333333333333 x)) x))
                    (* n (- x)))))))))))
    double code(double x, double n) {
    	double t_0 = pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -1e-33) {
    		tmp = (1.0 / n) * (t_0 / x);
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5e-36) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 2e-23) {
    		tmp = (x - log(x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = t_0 / (n * x);
    	} else if ((1.0 / n) <= 1e+197) {
    		tmp = (1.0 + (x / n)) - t_0;
    	} else {
    		tmp = (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x);
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: t_0
        real(8) :: tmp
        t_0 = x ** (1.0d0 / n)
        if ((1.0d0 / n) <= (-1d-33)) then
            tmp = (1.0d0 / n) * (t_0 / x)
        else if ((1.0d0 / n) <= 5d-100) then
            tmp = log(((x + 1.0d0) / x)) / n
        else if ((1.0d0 / n) <= 5d-36) then
            tmp = 1.0d0 / (x * (n + (0.5d0 * (n / x))))
        else if ((1.0d0 / n) <= 2d-23) then
            tmp = (x - log(x)) / n
        else if ((1.0d0 / n) <= 0.0002d0) then
            tmp = t_0 / (n * x)
        else if ((1.0d0 / n) <= 1d+197) then
            tmp = (1.0d0 + (x / n)) - t_0
        else
            tmp = ((-1.0d0) + ((0.5d0 + ((-0.3333333333333333d0) / x)) / x)) / (n * -x)
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double t_0 = Math.pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -1e-33) {
    		tmp = (1.0 / n) * (t_0 / x);
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = Math.log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5e-36) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 2e-23) {
    		tmp = (x - Math.log(x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = t_0 / (n * x);
    	} else if ((1.0 / n) <= 1e+197) {
    		tmp = (1.0 + (x / n)) - t_0;
    	} else {
    		tmp = (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x);
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = math.pow(x, (1.0 / n))
    	tmp = 0
    	if (1.0 / n) <= -1e-33:
    		tmp = (1.0 / n) * (t_0 / x)
    	elif (1.0 / n) <= 5e-100:
    		tmp = math.log(((x + 1.0) / x)) / n
    	elif (1.0 / n) <= 5e-36:
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))))
    	elif (1.0 / n) <= 2e-23:
    		tmp = (x - math.log(x)) / n
    	elif (1.0 / n) <= 0.0002:
    		tmp = t_0 / (n * x)
    	elif (1.0 / n) <= 1e+197:
    		tmp = (1.0 + (x / n)) - t_0
    	else:
    		tmp = (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x)
    	return tmp
    
    function code(x, n)
    	t_0 = x ^ Float64(1.0 / n)
    	tmp = 0.0
    	if (Float64(1.0 / n) <= -1e-33)
    		tmp = Float64(Float64(1.0 / n) * Float64(t_0 / x));
    	elseif (Float64(1.0 / n) <= 5e-100)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	elseif (Float64(1.0 / n) <= 5e-36)
    		tmp = Float64(1.0 / Float64(x * Float64(n + Float64(0.5 * Float64(n / x)))));
    	elseif (Float64(1.0 / n) <= 2e-23)
    		tmp = Float64(Float64(x - log(x)) / n);
    	elseif (Float64(1.0 / n) <= 0.0002)
    		tmp = Float64(t_0 / Float64(n * x));
    	elseif (Float64(1.0 / n) <= 1e+197)
    		tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0);
    	else
    		tmp = Float64(Float64(-1.0 + Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / x)) / Float64(n * Float64(-x)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	t_0 = x ^ (1.0 / n);
    	tmp = 0.0;
    	if ((1.0 / n) <= -1e-33)
    		tmp = (1.0 / n) * (t_0 / x);
    	elseif ((1.0 / n) <= 5e-100)
    		tmp = log(((x + 1.0) / x)) / n;
    	elseif ((1.0 / n) <= 5e-36)
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	elseif ((1.0 / n) <= 2e-23)
    		tmp = (x - log(x)) / n;
    	elseif ((1.0 / n) <= 0.0002)
    		tmp = t_0 / (n * x);
    	elseif ((1.0 / n) <= 1e+197)
    		tmp = (1.0 + (x / n)) - t_0;
    	else
    		tmp = (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-33], N[(N[(1.0 / n), $MachinePrecision] * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-100], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-36], N[(1.0 / N[(x * N[(n + N[(0.5 * N[(n / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-23], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 0.0002], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+197], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(-1.0 + N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(n * (-x)), $MachinePrecision]), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := {x}^{\left(\frac{1}{n}\right)}\\
    \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\
    \;\;\;\;\frac{1}{n} \cdot \frac{t\_0}{x}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\
    \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\
    \;\;\;\;\frac{x - \log x}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\
    \;\;\;\;\frac{t\_0}{n \cdot x}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 10^{+197}:\\
    \;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot \left(-x\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 7 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -1.0000000000000001e-33

      1. Initial program 95.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 97.3%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg97.3%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec97.3%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg97.3%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac97.3%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg97.3%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg97.3%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative97.3%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified97.3%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. associate-/r*97.5%

          \[\leadsto \color{blue}{\frac{\frac{e^{\frac{\log x}{n}}}{x}}{n}} \]
        2. div-inv97.5%

          \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x} \cdot \frac{1}{n}} \]
        3. div-inv97.5%

          \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x} \cdot \frac{1}{n} \]
        4. exp-to-pow97.5%

          \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x} \cdot \frac{1}{n} \]
      7. Applied egg-rr97.5%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x} \cdot \frac{1}{n}} \]

      if -1.0000000000000001e-33 < (/.f64 #s(literal 1 binary64) n) < 5.0000000000000001e-100

      1. Initial program 31.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 84.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define84.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. log1p-undefine84.8%

          \[\leadsto \left(\color{blue}{\log \left(1 + x\right)} - \log x\right) \cdot \frac{1}{n} \]
        2. diff-log84.9%

          \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      7. Applied egg-rr84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
      8. Step-by-step derivation
        1. +-commutative84.9%

          \[\leadsto \log \left(\frac{\color{blue}{x + 1}}{x}\right) \cdot \frac{1}{n} \]
      9. Simplified84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{x + 1}{x}\right)}}{n} \]

      if 5.0000000000000001e-100 < (/.f64 #s(literal 1 binary64) n) < 5.00000000000000004e-36

      1. Initial program 12.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 32.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define32.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified32.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. clear-num32.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
        2. inv-pow32.8%

          \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      7. Applied egg-rr32.8%

        \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      8. Step-by-step derivation
        1. unpow-132.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      9. Simplified32.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      10. Taylor expanded in x around inf 81.6%

        \[\leadsto \frac{1}{\color{blue}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}} \]

      if 5.00000000000000004e-36 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999992e-23

      1. Initial program 3.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 83.7%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define83.7%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified83.7%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around 0 84.3%

        \[\leadsto \frac{\color{blue}{x - \log x}}{n} \]

      if 1.99999999999999992e-23 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-4

      1. Initial program 5.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 99.7%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg99.7%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec99.7%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg99.7%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac99.7%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg99.7%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg99.7%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative99.7%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified99.7%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. *-un-lft-identity99.7%

          \[\leadsto \color{blue}{1 \cdot \frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
        2. div-inv99.7%

          \[\leadsto 1 \cdot \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
        3. exp-to-pow99.7%

          \[\leadsto 1 \cdot \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
        4. *-commutative99.7%

          \[\leadsto 1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{n \cdot x}} \]
      7. Applied egg-rr99.7%

        \[\leadsto \color{blue}{1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
      8. Step-by-step derivation
        1. *-lft-identity99.7%

          \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
        2. *-commutative99.7%

          \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
      9. Simplified99.7%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}} \]

      if 2.0000000000000001e-4 < (/.f64 #s(literal 1 binary64) n) < 9.9999999999999995e196

      1. Initial program 76.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0 65.4%

        \[\leadsto \color{blue}{\left(1 + \frac{x}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]

      if 9.9999999999999995e196 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 15.2%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 7.5%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define7.5%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified7.5%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 87.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Taylor expanded in n around 0 87.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{n \cdot x}} \]
      8. Step-by-step derivation
        1. sub-neg87.9%

          \[\leadsto -1 \cdot \frac{\color{blue}{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} + \left(-1\right)}}{n \cdot x} \]
        2. associate-*r/87.9%

          \[\leadsto -1 \cdot \frac{\color{blue}{\frac{-1 \cdot \left(0.3333333333333333 \cdot \frac{1}{x} - 0.5\right)}{x}} + \left(-1\right)}{n \cdot x} \]
        3. sub-neg87.9%

          \[\leadsto -1 \cdot \frac{\frac{-1 \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{x} + \left(-0.5\right)\right)}}{x} + \left(-1\right)}{n \cdot x} \]
        4. metadata-eval87.9%

          \[\leadsto -1 \cdot \frac{\frac{-1 \cdot \left(0.3333333333333333 \cdot \frac{1}{x} + \color{blue}{-0.5}\right)}{x} + \left(-1\right)}{n \cdot x} \]
        5. distribute-lft-in87.9%

          \[\leadsto -1 \cdot \frac{\frac{\color{blue}{-1 \cdot \left(0.3333333333333333 \cdot \frac{1}{x}\right) + -1 \cdot -0.5}}{x} + \left(-1\right)}{n \cdot x} \]
        6. neg-mul-187.9%

          \[\leadsto -1 \cdot \frac{\frac{\color{blue}{\left(-0.3333333333333333 \cdot \frac{1}{x}\right)} + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
        7. associate-*r/87.9%

          \[\leadsto -1 \cdot \frac{\frac{\left(-\color{blue}{\frac{0.3333333333333333 \cdot 1}{x}}\right) + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
        8. metadata-eval87.9%

          \[\leadsto -1 \cdot \frac{\frac{\left(-\frac{\color{blue}{0.3333333333333333}}{x}\right) + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
        9. distribute-neg-frac87.9%

          \[\leadsto -1 \cdot \frac{\frac{\color{blue}{\frac{-0.3333333333333333}{x}} + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
        10. metadata-eval87.9%

          \[\leadsto -1 \cdot \frac{\frac{\frac{\color{blue}{-0.3333333333333333}}{x} + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
        11. metadata-eval87.9%

          \[\leadsto -1 \cdot \frac{\frac{\frac{-0.3333333333333333}{x} + \color{blue}{0.5}}{x} + \left(-1\right)}{n \cdot x} \]
        12. metadata-eval87.9%

          \[\leadsto -1 \cdot \frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + \color{blue}{-1}}{n \cdot x} \]
        13. *-commutative87.9%

          \[\leadsto -1 \cdot \frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + -1}{\color{blue}{x \cdot n}} \]
      9. Simplified87.9%

        \[\leadsto -1 \cdot \color{blue}{\frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + -1}{x \cdot n}} \]
    3. Recombined 7 regimes into one program.
    4. Final simplification87.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{1}{n} \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+197}:\\ \;\;\;\;\left(1 + \frac{x}{n}\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot \left(-x\right)}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 66.3% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{+223}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\frac{1}{n} \leq -5 \cdot 10^{+124}:\\ \;\;\;\;0\\ \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{\frac{1 + \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x}}{x}}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))))
       (if (<= (/ 1.0 n) -5e+223)
         t_0
         (if (<= (/ 1.0 n) -5e+124)
           0.0
           (if (<= (/ 1.0 n) -1e-33)
             (/ (/ (+ 1.0 (/ (- (* 0.3333333333333333 (/ 1.0 x)) 0.5) x)) x) n)
             (if (<= (/ 1.0 n) 5e-100)
               (/ (log (/ (+ x 1.0) x)) n)
               (if (<= (/ 1.0 n) 0.0002)
                 (/ 1.0 (* x (+ n (* 0.5 (/ n x)))))
                 (if (<= (/ 1.0 n) 1e+165)
                   t_0
                   (/
                    (+
                     (/ 1.0 n)
                     (*
                      (/
                       (+ (* (* n x) -0.5) (* n 0.3333333333333333))
                       (* n (* n x)))
                      (/ 1.0 x)))
                    x)))))))))
    double code(double x, double n) {
    	double t_0 = 1.0 - pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -5e+223) {
    		tmp = t_0;
    	} else if ((1.0 / n) <= -5e+124) {
    		tmp = 0.0;
    	} else if ((1.0 / n) <= -1e-33) {
    		tmp = ((1.0 + (((0.3333333333333333 * (1.0 / x)) - 0.5) / x)) / x) / n;
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 1e+165) {
    		tmp = t_0;
    	} else {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: t_0
        real(8) :: tmp
        t_0 = 1.0d0 - (x ** (1.0d0 / n))
        if ((1.0d0 / n) <= (-5d+223)) then
            tmp = t_0
        else if ((1.0d0 / n) <= (-5d+124)) then
            tmp = 0.0d0
        else if ((1.0d0 / n) <= (-1d-33)) then
            tmp = ((1.0d0 + (((0.3333333333333333d0 * (1.0d0 / x)) - 0.5d0) / x)) / x) / n
        else if ((1.0d0 / n) <= 5d-100) then
            tmp = log(((x + 1.0d0) / x)) / n
        else if ((1.0d0 / n) <= 0.0002d0) then
            tmp = 1.0d0 / (x * (n + (0.5d0 * (n / x))))
        else if ((1.0d0 / n) <= 1d+165) then
            tmp = t_0
        else
            tmp = ((1.0d0 / n) + (((((n * x) * (-0.5d0)) + (n * 0.3333333333333333d0)) / (n * (n * x))) * (1.0d0 / x))) / x
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double t_0 = 1.0 - Math.pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -5e+223) {
    		tmp = t_0;
    	} else if ((1.0 / n) <= -5e+124) {
    		tmp = 0.0;
    	} else if ((1.0 / n) <= -1e-33) {
    		tmp = ((1.0 + (((0.3333333333333333 * (1.0 / x)) - 0.5) / x)) / x) / n;
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = Math.log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 1e+165) {
    		tmp = t_0;
    	} else {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = 1.0 - math.pow(x, (1.0 / n))
    	tmp = 0
    	if (1.0 / n) <= -5e+223:
    		tmp = t_0
    	elif (1.0 / n) <= -5e+124:
    		tmp = 0.0
    	elif (1.0 / n) <= -1e-33:
    		tmp = ((1.0 + (((0.3333333333333333 * (1.0 / x)) - 0.5) / x)) / x) / n
    	elif (1.0 / n) <= 5e-100:
    		tmp = math.log(((x + 1.0) / x)) / n
    	elif (1.0 / n) <= 0.0002:
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))))
    	elif (1.0 / n) <= 1e+165:
    		tmp = t_0
    	else:
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x
    	return tmp
    
    function code(x, n)
    	t_0 = Float64(1.0 - (x ^ Float64(1.0 / n)))
    	tmp = 0.0
    	if (Float64(1.0 / n) <= -5e+223)
    		tmp = t_0;
    	elseif (Float64(1.0 / n) <= -5e+124)
    		tmp = 0.0;
    	elseif (Float64(1.0 / n) <= -1e-33)
    		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(0.3333333333333333 * Float64(1.0 / x)) - 0.5) / x)) / x) / n);
    	elseif (Float64(1.0 / n) <= 5e-100)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	elseif (Float64(1.0 / n) <= 0.0002)
    		tmp = Float64(1.0 / Float64(x * Float64(n + Float64(0.5 * Float64(n / x)))));
    	elseif (Float64(1.0 / n) <= 1e+165)
    		tmp = t_0;
    	else
    		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(Float64(n * x) * -0.5) + Float64(n * 0.3333333333333333)) / Float64(n * Float64(n * x))) * Float64(1.0 / x))) / x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	t_0 = 1.0 - (x ^ (1.0 / n));
    	tmp = 0.0;
    	if ((1.0 / n) <= -5e+223)
    		tmp = t_0;
    	elseif ((1.0 / n) <= -5e+124)
    		tmp = 0.0;
    	elseif ((1.0 / n) <= -1e-33)
    		tmp = ((1.0 + (((0.3333333333333333 * (1.0 / x)) - 0.5) / x)) / x) / n;
    	elseif ((1.0 / n) <= 5e-100)
    		tmp = log(((x + 1.0) / x)) / n;
    	elseif ((1.0 / n) <= 0.0002)
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	elseif ((1.0 / n) <= 1e+165)
    		tmp = t_0;
    	else
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := Block[{t$95$0 = N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e+223], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e+124], 0.0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-33], N[(N[(N[(1.0 + N[(N[(N[(0.3333333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-100], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 0.0002], N[(1.0 / N[(x * N[(n + N[(0.5 * N[(n / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+165], t$95$0, N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(N[(n * x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(n * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
    \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{+223}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;\frac{1}{n} \leq -5 \cdot 10^{+124}:\\
    \;\;\;\;0\\
    
    \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\
    \;\;\;\;\frac{\frac{1 + \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x}}{x}}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\
    \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 6 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -4.99999999999999985e223 or 2.0000000000000001e-4 < (/.f64 #s(literal 1 binary64) n) < 9.99999999999999899e164

      1. Initial program 87.7%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0 70.7%

        \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]

      if -4.99999999999999985e223 < (/.f64 #s(literal 1 binary64) n) < -4.9999999999999996e124

      1. Initial program 100.0%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 69.6%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define69.6%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified69.6%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. add-log-exp96.1%

          \[\leadsto \color{blue}{\log \left(e^{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}}\right)} \]
        2. div-inv96.1%

          \[\leadsto \log \left(e^{\color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}}}\right) \]
        3. exp-prod96.1%

          \[\leadsto \log \color{blue}{\left({\left(e^{\mathsf{log1p}\left(x\right) - \log x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
        4. exp-diff96.1%

          \[\leadsto \log \left({\color{blue}{\left(\frac{e^{\mathsf{log1p}\left(x\right)}}{e^{\log x}}\right)}}^{\left(\frac{1}{n}\right)}\right) \]
        5. add-exp-log29.1%

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

          \[\leadsto \log \left({\left(\frac{e^{\color{blue}{\log \left(1 + x\right)}}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
        7. rem-exp-log96.1%

          \[\leadsto \log \left({\left(\frac{\color{blue}{1 + x}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      7. Applied egg-rr96.1%

        \[\leadsto \color{blue}{\log \left({\left(\frac{1 + x}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      8. Step-by-step derivation
        1. +-commutative96.1%

          \[\leadsto \log \left({\left(\frac{\color{blue}{x + 1}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      9. Simplified96.1%

        \[\leadsto \color{blue}{\log \left({\left(\frac{x + 1}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      10. Taylor expanded in x around inf 72.4%

        \[\leadsto \log \color{blue}{1} \]

      if -4.9999999999999996e124 < (/.f64 #s(literal 1 binary64) n) < -1.0000000000000001e-33

      1. Initial program 88.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 39.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define39.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified39.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 60.8%

        \[\leadsto \frac{\color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{x}}}{n} \]

      if -1.0000000000000001e-33 < (/.f64 #s(literal 1 binary64) n) < 5.0000000000000001e-100

      1. Initial program 31.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 84.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define84.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. log1p-undefine84.8%

          \[\leadsto \left(\color{blue}{\log \left(1 + x\right)} - \log x\right) \cdot \frac{1}{n} \]
        2. diff-log84.9%

          \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      7. Applied egg-rr84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
      8. Step-by-step derivation
        1. +-commutative84.9%

          \[\leadsto \log \left(\frac{\color{blue}{x + 1}}{x}\right) \cdot \frac{1}{n} \]
      9. Simplified84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{x + 1}{x}\right)}}{n} \]

      if 5.0000000000000001e-100 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-4

      1. Initial program 8.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 39.6%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define39.6%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified39.6%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. clear-num39.6%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
        2. inv-pow39.6%

          \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      7. Applied egg-rr39.6%

        \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      8. Step-by-step derivation
        1. unpow-139.6%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      9. Simplified39.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      10. Taylor expanded in x around inf 67.7%

        \[\leadsto \frac{1}{\color{blue}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}} \]

      if 9.99999999999999899e164 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 27.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 7.0%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define7.0%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified7.0%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 75.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Step-by-step derivation
        1. div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
        2. cancel-sign-sub-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} + \left(-0.5\right) \cdot \frac{1}{n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. un-div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\color{blue}{\frac{0.3333333333333333}{n \cdot x}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{\color{blue}{x \cdot n}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        5. un-div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \color{blue}{\frac{-0.5}{n}}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        6. metadata-eval75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{\color{blue}{-0.5}}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      8. Applied egg-rr75.9%

        \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{-0.5}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
      9. Step-by-step derivation
        1. +-commutative75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        2. frac-add80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(x \cdot n\right) + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. *-commutative80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \color{blue}{\left(n \cdot x\right)} + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \color{blue}{\left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      10. Applied egg-rr80.6%

        \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
    3. Recombined 6 regimes into one program.
    4. Final simplification76.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{+223}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq -5 \cdot 10^{+124}:\\ \;\;\;\;0\\ \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{\frac{1 + \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x}}{x}}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 72.9% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{-0.3333333333333333}{n}}{-{x}^{3}}\\ \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+190}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\frac{1}{n} \leq -5 \cdot 10^{+125}:\\ \;\;\;\;0\\ \mathbf{elif}\;\frac{1}{n} \leq -10:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (/ (/ -0.3333333333333333 n) (- (pow x 3.0)))))
       (if (<= (/ 1.0 n) -1e+190)
         t_0
         (if (<= (/ 1.0 n) -5e+125)
           0.0
           (if (<= (/ 1.0 n) -10.0)
             t_0
             (if (<= (/ 1.0 n) 5e-100)
               (/ (log (/ (+ x 1.0) x)) n)
               (if (<= (/ 1.0 n) 0.0002)
                 (/ 1.0 (* x (+ n (* 0.5 (/ n x)))))
                 (if (<= (/ 1.0 n) 1e+165)
                   (- 1.0 (pow x (/ 1.0 n)))
                   (/
                    (+
                     (/ 1.0 n)
                     (*
                      (/
                       (+ (* (* n x) -0.5) (* n 0.3333333333333333))
                       (* n (* n x)))
                      (/ 1.0 x)))
                    x)))))))))
    double code(double x, double n) {
    	double t_0 = (-0.3333333333333333 / n) / -pow(x, 3.0);
    	double tmp;
    	if ((1.0 / n) <= -1e+190) {
    		tmp = t_0;
    	} else if ((1.0 / n) <= -5e+125) {
    		tmp = 0.0;
    	} else if ((1.0 / n) <= -10.0) {
    		tmp = t_0;
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 1e+165) {
    		tmp = 1.0 - pow(x, (1.0 / n));
    	} else {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: t_0
        real(8) :: tmp
        t_0 = ((-0.3333333333333333d0) / n) / -(x ** 3.0d0)
        if ((1.0d0 / n) <= (-1d+190)) then
            tmp = t_0
        else if ((1.0d0 / n) <= (-5d+125)) then
            tmp = 0.0d0
        else if ((1.0d0 / n) <= (-10.0d0)) then
            tmp = t_0
        else if ((1.0d0 / n) <= 5d-100) then
            tmp = log(((x + 1.0d0) / x)) / n
        else if ((1.0d0 / n) <= 0.0002d0) then
            tmp = 1.0d0 / (x * (n + (0.5d0 * (n / x))))
        else if ((1.0d0 / n) <= 1d+165) then
            tmp = 1.0d0 - (x ** (1.0d0 / n))
        else
            tmp = ((1.0d0 / n) + (((((n * x) * (-0.5d0)) + (n * 0.3333333333333333d0)) / (n * (n * x))) * (1.0d0 / x))) / x
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double t_0 = (-0.3333333333333333 / n) / -Math.pow(x, 3.0);
    	double tmp;
    	if ((1.0 / n) <= -1e+190) {
    		tmp = t_0;
    	} else if ((1.0 / n) <= -5e+125) {
    		tmp = 0.0;
    	} else if ((1.0 / n) <= -10.0) {
    		tmp = t_0;
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = Math.log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 1e+165) {
    		tmp = 1.0 - Math.pow(x, (1.0 / n));
    	} else {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = (-0.3333333333333333 / n) / -math.pow(x, 3.0)
    	tmp = 0
    	if (1.0 / n) <= -1e+190:
    		tmp = t_0
    	elif (1.0 / n) <= -5e+125:
    		tmp = 0.0
    	elif (1.0 / n) <= -10.0:
    		tmp = t_0
    	elif (1.0 / n) <= 5e-100:
    		tmp = math.log(((x + 1.0) / x)) / n
    	elif (1.0 / n) <= 0.0002:
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))))
    	elif (1.0 / n) <= 1e+165:
    		tmp = 1.0 - math.pow(x, (1.0 / n))
    	else:
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x
    	return tmp
    
    function code(x, n)
    	t_0 = Float64(Float64(-0.3333333333333333 / n) / Float64(-(x ^ 3.0)))
    	tmp = 0.0
    	if (Float64(1.0 / n) <= -1e+190)
    		tmp = t_0;
    	elseif (Float64(1.0 / n) <= -5e+125)
    		tmp = 0.0;
    	elseif (Float64(1.0 / n) <= -10.0)
    		tmp = t_0;
    	elseif (Float64(1.0 / n) <= 5e-100)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	elseif (Float64(1.0 / n) <= 0.0002)
    		tmp = Float64(1.0 / Float64(x * Float64(n + Float64(0.5 * Float64(n / x)))));
    	elseif (Float64(1.0 / n) <= 1e+165)
    		tmp = Float64(1.0 - (x ^ Float64(1.0 / n)));
    	else
    		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(Float64(n * x) * -0.5) + Float64(n * 0.3333333333333333)) / Float64(n * Float64(n * x))) * Float64(1.0 / x))) / x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	t_0 = (-0.3333333333333333 / n) / -(x ^ 3.0);
    	tmp = 0.0;
    	if ((1.0 / n) <= -1e+190)
    		tmp = t_0;
    	elseif ((1.0 / n) <= -5e+125)
    		tmp = 0.0;
    	elseif ((1.0 / n) <= -10.0)
    		tmp = t_0;
    	elseif ((1.0 / n) <= 5e-100)
    		tmp = log(((x + 1.0) / x)) / n;
    	elseif ((1.0 / n) <= 0.0002)
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	elseif ((1.0 / n) <= 1e+165)
    		tmp = 1.0 - (x ^ (1.0 / n));
    	else
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := Block[{t$95$0 = N[(N[(-0.3333333333333333 / n), $MachinePrecision] / (-N[Power[x, 3.0], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+190], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e+125], 0.0, If[LessEqual[N[(1.0 / n), $MachinePrecision], -10.0], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-100], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 0.0002], N[(1.0 / N[(x * N[(n + N[(0.5 * N[(n / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+165], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(N[(n * x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(n * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{\frac{-0.3333333333333333}{n}}{-{x}^{3}}\\
    \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+190}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;\frac{1}{n} \leq -5 \cdot 10^{+125}:\\
    \;\;\;\;0\\
    
    \mathbf{elif}\;\frac{1}{n} \leq -10:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\
    \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\
    \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 6 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -1.0000000000000001e190 or -4.99999999999999962e125 < (/.f64 #s(literal 1 binary64) n) < -10

      1. Initial program 100.0%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 41.6%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define41.6%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified41.6%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 58.0%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Taylor expanded in x around 0 84.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{-0.3333333333333333}{n \cdot {x}^{3}}} \]
      8. Step-by-step derivation
        1. associate-/r*84.3%

          \[\leadsto -1 \cdot \color{blue}{\frac{\frac{-0.3333333333333333}{n}}{{x}^{3}}} \]
      9. Simplified84.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{\frac{-0.3333333333333333}{n}}{{x}^{3}}} \]

      if -1.0000000000000001e190 < (/.f64 #s(literal 1 binary64) n) < -4.99999999999999962e125

      1. Initial program 100.0%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 72.6%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define72.6%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified72.6%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. add-log-exp93.0%

          \[\leadsto \color{blue}{\log \left(e^{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}}\right)} \]
        2. div-inv93.0%

          \[\leadsto \log \left(e^{\color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}}}\right) \]
        3. exp-prod93.0%

          \[\leadsto \log \color{blue}{\left({\left(e^{\mathsf{log1p}\left(x\right) - \log x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
        4. exp-diff93.0%

          \[\leadsto \log \left({\color{blue}{\left(\frac{e^{\mathsf{log1p}\left(x\right)}}{e^{\log x}}\right)}}^{\left(\frac{1}{n}\right)}\right) \]
        5. add-exp-log22.7%

          \[\leadsto \log \left({\left(\frac{e^{\mathsf{log1p}\left(x\right)}}{\color{blue}{x}}\right)}^{\left(\frac{1}{n}\right)}\right) \]
        6. log1p-undefine22.7%

          \[\leadsto \log \left({\left(\frac{e^{\color{blue}{\log \left(1 + x\right)}}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
        7. rem-exp-log93.0%

          \[\leadsto \log \left({\left(\frac{\color{blue}{1 + x}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      7. Applied egg-rr93.0%

        \[\leadsto \color{blue}{\log \left({\left(\frac{1 + x}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      8. Step-by-step derivation
        1. +-commutative93.0%

          \[\leadsto \log \left({\left(\frac{\color{blue}{x + 1}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      9. Simplified93.0%

        \[\leadsto \color{blue}{\log \left({\left(\frac{x + 1}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      10. Taylor expanded in x around inf 78.9%

        \[\leadsto \log \color{blue}{1} \]

      if -10 < (/.f64 #s(literal 1 binary64) n) < 5.0000000000000001e-100

      1. Initial program 32.0%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 82.5%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define82.5%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified82.5%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. log1p-undefine82.5%

          \[\leadsto \left(\color{blue}{\log \left(1 + x\right)} - \log x\right) \cdot \frac{1}{n} \]
        2. diff-log82.6%

          \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      7. Applied egg-rr82.6%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
      8. Step-by-step derivation
        1. +-commutative82.6%

          \[\leadsto \log \left(\frac{\color{blue}{x + 1}}{x}\right) \cdot \frac{1}{n} \]
      9. Simplified82.6%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{x + 1}{x}\right)}}{n} \]

      if 5.0000000000000001e-100 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-4

      1. Initial program 8.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 39.6%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define39.6%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified39.6%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. clear-num39.6%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
        2. inv-pow39.6%

          \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      7. Applied egg-rr39.6%

        \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      8. Step-by-step derivation
        1. unpow-139.6%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      9. Simplified39.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      10. Taylor expanded in x around inf 67.7%

        \[\leadsto \frac{1}{\color{blue}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}} \]

      if 2.0000000000000001e-4 < (/.f64 #s(literal 1 binary64) n) < 9.99999999999999899e164

      1. Initial program 76.6%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0 67.3%

        \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]

      if 9.99999999999999899e164 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 27.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 7.0%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define7.0%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified7.0%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 75.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Step-by-step derivation
        1. div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
        2. cancel-sign-sub-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} + \left(-0.5\right) \cdot \frac{1}{n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. un-div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\color{blue}{\frac{0.3333333333333333}{n \cdot x}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{\color{blue}{x \cdot n}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        5. un-div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \color{blue}{\frac{-0.5}{n}}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        6. metadata-eval75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{\color{blue}{-0.5}}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      8. Applied egg-rr75.9%

        \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{-0.5}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
      9. Step-by-step derivation
        1. +-commutative75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        2. frac-add80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(x \cdot n\right) + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. *-commutative80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \color{blue}{\left(n \cdot x\right)} + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \color{blue}{\left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      10. Applied egg-rr80.6%

        \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
    3. Recombined 6 regimes into one program.
    4. Final simplification79.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+190}:\\ \;\;\;\;\frac{\frac{-0.3333333333333333}{n}}{-{x}^{3}}\\ \mathbf{elif}\;\frac{1}{n} \leq -5 \cdot 10^{+125}:\\ \;\;\;\;0\\ \mathbf{elif}\;\frac{1}{n} \leq -10:\\ \;\;\;\;\frac{\frac{-0.3333333333333333}{n}}{-{x}^{3}}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 81.9% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ t_1 := \frac{t\_0}{n \cdot x}\\ \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\ \;\;\;\;1 - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (pow x (/ 1.0 n))) (t_1 (/ t_0 (* n x))))
       (if (<= (/ 1.0 n) -1e-33)
         t_1
         (if (<= (/ 1.0 n) 5e-100)
           (/ (log (/ (+ x 1.0) x)) n)
           (if (<= (/ 1.0 n) 5e-36)
             (/ 1.0 (* x (+ n (* 0.5 (/ n x)))))
             (if (<= (/ 1.0 n) 2e-23)
               (/ (- x (log x)) n)
               (if (<= (/ 1.0 n) 0.0002)
                 t_1
                 (if (<= (/ 1.0 n) 1e+165)
                   (- 1.0 t_0)
                   (/
                    (+
                     (/ 1.0 n)
                     (*
                      (/
                       (+ (* (* n x) -0.5) (* n 0.3333333333333333))
                       (* n (* n x)))
                      (/ 1.0 x)))
                    x)))))))))
    double code(double x, double n) {
    	double t_0 = pow(x, (1.0 / n));
    	double t_1 = t_0 / (n * x);
    	double tmp;
    	if ((1.0 / n) <= -1e-33) {
    		tmp = t_1;
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5e-36) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 2e-23) {
    		tmp = (x - log(x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = t_1;
    	} else if ((1.0 / n) <= 1e+165) {
    		tmp = 1.0 - t_0;
    	} else {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: t_0
        real(8) :: t_1
        real(8) :: tmp
        t_0 = x ** (1.0d0 / n)
        t_1 = t_0 / (n * x)
        if ((1.0d0 / n) <= (-1d-33)) then
            tmp = t_1
        else if ((1.0d0 / n) <= 5d-100) then
            tmp = log(((x + 1.0d0) / x)) / n
        else if ((1.0d0 / n) <= 5d-36) then
            tmp = 1.0d0 / (x * (n + (0.5d0 * (n / x))))
        else if ((1.0d0 / n) <= 2d-23) then
            tmp = (x - log(x)) / n
        else if ((1.0d0 / n) <= 0.0002d0) then
            tmp = t_1
        else if ((1.0d0 / n) <= 1d+165) then
            tmp = 1.0d0 - t_0
        else
            tmp = ((1.0d0 / n) + (((((n * x) * (-0.5d0)) + (n * 0.3333333333333333d0)) / (n * (n * x))) * (1.0d0 / x))) / x
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double t_0 = Math.pow(x, (1.0 / n));
    	double t_1 = t_0 / (n * x);
    	double tmp;
    	if ((1.0 / n) <= -1e-33) {
    		tmp = t_1;
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = Math.log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5e-36) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 2e-23) {
    		tmp = (x - Math.log(x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = t_1;
    	} else if ((1.0 / n) <= 1e+165) {
    		tmp = 1.0 - t_0;
    	} else {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = math.pow(x, (1.0 / n))
    	t_1 = t_0 / (n * x)
    	tmp = 0
    	if (1.0 / n) <= -1e-33:
    		tmp = t_1
    	elif (1.0 / n) <= 5e-100:
    		tmp = math.log(((x + 1.0) / x)) / n
    	elif (1.0 / n) <= 5e-36:
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))))
    	elif (1.0 / n) <= 2e-23:
    		tmp = (x - math.log(x)) / n
    	elif (1.0 / n) <= 0.0002:
    		tmp = t_1
    	elif (1.0 / n) <= 1e+165:
    		tmp = 1.0 - t_0
    	else:
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x
    	return tmp
    
    function code(x, n)
    	t_0 = x ^ Float64(1.0 / n)
    	t_1 = Float64(t_0 / Float64(n * x))
    	tmp = 0.0
    	if (Float64(1.0 / n) <= -1e-33)
    		tmp = t_1;
    	elseif (Float64(1.0 / n) <= 5e-100)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	elseif (Float64(1.0 / n) <= 5e-36)
    		tmp = Float64(1.0 / Float64(x * Float64(n + Float64(0.5 * Float64(n / x)))));
    	elseif (Float64(1.0 / n) <= 2e-23)
    		tmp = Float64(Float64(x - log(x)) / n);
    	elseif (Float64(1.0 / n) <= 0.0002)
    		tmp = t_1;
    	elseif (Float64(1.0 / n) <= 1e+165)
    		tmp = Float64(1.0 - t_0);
    	else
    		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(Float64(n * x) * -0.5) + Float64(n * 0.3333333333333333)) / Float64(n * Float64(n * x))) * Float64(1.0 / x))) / x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	t_0 = x ^ (1.0 / n);
    	t_1 = t_0 / (n * x);
    	tmp = 0.0;
    	if ((1.0 / n) <= -1e-33)
    		tmp = t_1;
    	elseif ((1.0 / n) <= 5e-100)
    		tmp = log(((x + 1.0) / x)) / n;
    	elseif ((1.0 / n) <= 5e-36)
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	elseif ((1.0 / n) <= 2e-23)
    		tmp = (x - log(x)) / n;
    	elseif ((1.0 / n) <= 0.0002)
    		tmp = t_1;
    	elseif ((1.0 / n) <= 1e+165)
    		tmp = 1.0 - t_0;
    	else
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-33], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-100], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-36], N[(1.0 / N[(x * N[(n + N[(0.5 * N[(n / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-23], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 0.0002], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+165], N[(1.0 - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(N[(n * x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(n * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := {x}^{\left(\frac{1}{n}\right)}\\
    t_1 := \frac{t\_0}{n \cdot x}\\
    \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\
    \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\
    \;\;\;\;\frac{x - \log x}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\
    \;\;\;\;1 - t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 6 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -1.0000000000000001e-33 or 1.99999999999999992e-23 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-4

      1. Initial program 89.6%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 97.5%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg97.5%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec97.5%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg97.5%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac97.5%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg97.5%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg97.5%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative97.5%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified97.5%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. *-un-lft-identity97.5%

          \[\leadsto \color{blue}{1 \cdot \frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
        2. div-inv97.5%

          \[\leadsto 1 \cdot \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
        3. exp-to-pow97.5%

          \[\leadsto 1 \cdot \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
        4. *-commutative97.5%

          \[\leadsto 1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{n \cdot x}} \]
      7. Applied egg-rr97.5%

        \[\leadsto \color{blue}{1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
      8. Step-by-step derivation
        1. *-lft-identity97.5%

          \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
        2. *-commutative97.5%

          \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
      9. Simplified97.5%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}} \]

      if -1.0000000000000001e-33 < (/.f64 #s(literal 1 binary64) n) < 5.0000000000000001e-100

      1. Initial program 31.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 84.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define84.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. log1p-undefine84.8%

          \[\leadsto \left(\color{blue}{\log \left(1 + x\right)} - \log x\right) \cdot \frac{1}{n} \]
        2. diff-log84.9%

          \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      7. Applied egg-rr84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
      8. Step-by-step derivation
        1. +-commutative84.9%

          \[\leadsto \log \left(\frac{\color{blue}{x + 1}}{x}\right) \cdot \frac{1}{n} \]
      9. Simplified84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{x + 1}{x}\right)}}{n} \]

      if 5.0000000000000001e-100 < (/.f64 #s(literal 1 binary64) n) < 5.00000000000000004e-36

      1. Initial program 12.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 32.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define32.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified32.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. clear-num32.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
        2. inv-pow32.8%

          \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      7. Applied egg-rr32.8%

        \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      8. Step-by-step derivation
        1. unpow-132.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      9. Simplified32.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      10. Taylor expanded in x around inf 81.6%

        \[\leadsto \frac{1}{\color{blue}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}} \]

      if 5.00000000000000004e-36 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999992e-23

      1. Initial program 3.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 83.7%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define83.7%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified83.7%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around 0 84.3%

        \[\leadsto \frac{\color{blue}{x - \log x}}{n} \]

      if 2.0000000000000001e-4 < (/.f64 #s(literal 1 binary64) n) < 9.99999999999999899e164

      1. Initial program 76.6%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0 67.3%

        \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]

      if 9.99999999999999899e164 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 27.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 7.0%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define7.0%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified7.0%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 75.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Step-by-step derivation
        1. div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
        2. cancel-sign-sub-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} + \left(-0.5\right) \cdot \frac{1}{n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. un-div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\color{blue}{\frac{0.3333333333333333}{n \cdot x}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{\color{blue}{x \cdot n}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        5. un-div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \color{blue}{\frac{-0.5}{n}}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        6. metadata-eval75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{\color{blue}{-0.5}}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      8. Applied egg-rr75.9%

        \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{-0.5}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
      9. Step-by-step derivation
        1. +-commutative75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        2. frac-add80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(x \cdot n\right) + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. *-commutative80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \color{blue}{\left(n \cdot x\right)} + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \color{blue}{\left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      10. Applied egg-rr80.6%

        \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
    3. Recombined 6 regimes into one program.
    4. Final simplification86.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 82.0% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{1}{n} \cdot \frac{t\_0}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{t\_0}{n \cdot x}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\ \;\;\;\;1 - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (pow x (/ 1.0 n))))
       (if (<= (/ 1.0 n) -1e-33)
         (* (/ 1.0 n) (/ t_0 x))
         (if (<= (/ 1.0 n) 5e-100)
           (/ (log (/ (+ x 1.0) x)) n)
           (if (<= (/ 1.0 n) 5e-36)
             (/ 1.0 (* x (+ n (* 0.5 (/ n x)))))
             (if (<= (/ 1.0 n) 2e-23)
               (/ (- x (log x)) n)
               (if (<= (/ 1.0 n) 0.0002)
                 (/ t_0 (* n x))
                 (if (<= (/ 1.0 n) 1e+165)
                   (- 1.0 t_0)
                   (/
                    (+
                     (/ 1.0 n)
                     (*
                      (/
                       (+ (* (* n x) -0.5) (* n 0.3333333333333333))
                       (* n (* n x)))
                      (/ 1.0 x)))
                    x)))))))))
    double code(double x, double n) {
    	double t_0 = pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -1e-33) {
    		tmp = (1.0 / n) * (t_0 / x);
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5e-36) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 2e-23) {
    		tmp = (x - log(x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = t_0 / (n * x);
    	} else if ((1.0 / n) <= 1e+165) {
    		tmp = 1.0 - t_0;
    	} else {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: t_0
        real(8) :: tmp
        t_0 = x ** (1.0d0 / n)
        if ((1.0d0 / n) <= (-1d-33)) then
            tmp = (1.0d0 / n) * (t_0 / x)
        else if ((1.0d0 / n) <= 5d-100) then
            tmp = log(((x + 1.0d0) / x)) / n
        else if ((1.0d0 / n) <= 5d-36) then
            tmp = 1.0d0 / (x * (n + (0.5d0 * (n / x))))
        else if ((1.0d0 / n) <= 2d-23) then
            tmp = (x - log(x)) / n
        else if ((1.0d0 / n) <= 0.0002d0) then
            tmp = t_0 / (n * x)
        else if ((1.0d0 / n) <= 1d+165) then
            tmp = 1.0d0 - t_0
        else
            tmp = ((1.0d0 / n) + (((((n * x) * (-0.5d0)) + (n * 0.3333333333333333d0)) / (n * (n * x))) * (1.0d0 / x))) / x
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double t_0 = Math.pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -1e-33) {
    		tmp = (1.0 / n) * (t_0 / x);
    	} else if ((1.0 / n) <= 5e-100) {
    		tmp = Math.log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5e-36) {
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	} else if ((1.0 / n) <= 2e-23) {
    		tmp = (x - Math.log(x)) / n;
    	} else if ((1.0 / n) <= 0.0002) {
    		tmp = t_0 / (n * x);
    	} else if ((1.0 / n) <= 1e+165) {
    		tmp = 1.0 - t_0;
    	} else {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = math.pow(x, (1.0 / n))
    	tmp = 0
    	if (1.0 / n) <= -1e-33:
    		tmp = (1.0 / n) * (t_0 / x)
    	elif (1.0 / n) <= 5e-100:
    		tmp = math.log(((x + 1.0) / x)) / n
    	elif (1.0 / n) <= 5e-36:
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))))
    	elif (1.0 / n) <= 2e-23:
    		tmp = (x - math.log(x)) / n
    	elif (1.0 / n) <= 0.0002:
    		tmp = t_0 / (n * x)
    	elif (1.0 / n) <= 1e+165:
    		tmp = 1.0 - t_0
    	else:
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x
    	return tmp
    
    function code(x, n)
    	t_0 = x ^ Float64(1.0 / n)
    	tmp = 0.0
    	if (Float64(1.0 / n) <= -1e-33)
    		tmp = Float64(Float64(1.0 / n) * Float64(t_0 / x));
    	elseif (Float64(1.0 / n) <= 5e-100)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	elseif (Float64(1.0 / n) <= 5e-36)
    		tmp = Float64(1.0 / Float64(x * Float64(n + Float64(0.5 * Float64(n / x)))));
    	elseif (Float64(1.0 / n) <= 2e-23)
    		tmp = Float64(Float64(x - log(x)) / n);
    	elseif (Float64(1.0 / n) <= 0.0002)
    		tmp = Float64(t_0 / Float64(n * x));
    	elseif (Float64(1.0 / n) <= 1e+165)
    		tmp = Float64(1.0 - t_0);
    	else
    		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(Float64(n * x) * -0.5) + Float64(n * 0.3333333333333333)) / Float64(n * Float64(n * x))) * Float64(1.0 / x))) / x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	t_0 = x ^ (1.0 / n);
    	tmp = 0.0;
    	if ((1.0 / n) <= -1e-33)
    		tmp = (1.0 / n) * (t_0 / x);
    	elseif ((1.0 / n) <= 5e-100)
    		tmp = log(((x + 1.0) / x)) / n;
    	elseif ((1.0 / n) <= 5e-36)
    		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
    	elseif ((1.0 / n) <= 2e-23)
    		tmp = (x - log(x)) / n;
    	elseif ((1.0 / n) <= 0.0002)
    		tmp = t_0 / (n * x);
    	elseif ((1.0 / n) <= 1e+165)
    		tmp = 1.0 - t_0;
    	else
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-33], N[(N[(1.0 / n), $MachinePrecision] * N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-100], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-36], N[(1.0 / N[(x * N[(n + N[(0.5 * N[(n / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-23], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 0.0002], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+165], N[(1.0 - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(N[(n * x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(n * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := {x}^{\left(\frac{1}{n}\right)}\\
    \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\
    \;\;\;\;\frac{1}{n} \cdot \frac{t\_0}{x}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\
    \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\
    \;\;\;\;\frac{x - \log x}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\
    \;\;\;\;\frac{t\_0}{n \cdot x}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\
    \;\;\;\;1 - t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 7 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -1.0000000000000001e-33

      1. Initial program 95.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 97.3%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg97.3%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec97.3%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg97.3%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac97.3%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg97.3%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg97.3%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative97.3%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified97.3%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. associate-/r*97.5%

          \[\leadsto \color{blue}{\frac{\frac{e^{\frac{\log x}{n}}}{x}}{n}} \]
        2. div-inv97.5%

          \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x} \cdot \frac{1}{n}} \]
        3. div-inv97.5%

          \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x} \cdot \frac{1}{n} \]
        4. exp-to-pow97.5%

          \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x} \cdot \frac{1}{n} \]
      7. Applied egg-rr97.5%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x} \cdot \frac{1}{n}} \]

      if -1.0000000000000001e-33 < (/.f64 #s(literal 1 binary64) n) < 5.0000000000000001e-100

      1. Initial program 31.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 84.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define84.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified84.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. log1p-undefine84.8%

          \[\leadsto \left(\color{blue}{\log \left(1 + x\right)} - \log x\right) \cdot \frac{1}{n} \]
        2. diff-log84.9%

          \[\leadsto \color{blue}{\log \left(\frac{1 + x}{x}\right)} \cdot \frac{1}{n} \]
      7. Applied egg-rr84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
      8. Step-by-step derivation
        1. +-commutative84.9%

          \[\leadsto \log \left(\frac{\color{blue}{x + 1}}{x}\right) \cdot \frac{1}{n} \]
      9. Simplified84.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{x + 1}{x}\right)}}{n} \]

      if 5.0000000000000001e-100 < (/.f64 #s(literal 1 binary64) n) < 5.00000000000000004e-36

      1. Initial program 12.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 32.8%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define32.8%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified32.8%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. clear-num32.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
        2. inv-pow32.8%

          \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      7. Applied egg-rr32.8%

        \[\leadsto \color{blue}{{\left(\frac{n}{\mathsf{log1p}\left(x\right) - \log x}\right)}^{-1}} \]
      8. Step-by-step derivation
        1. unpow-132.8%

          \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      9. Simplified32.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{n}{\mathsf{log1p}\left(x\right) - \log x}}} \]
      10. Taylor expanded in x around inf 81.6%

        \[\leadsto \frac{1}{\color{blue}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}} \]

      if 5.00000000000000004e-36 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999992e-23

      1. Initial program 3.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 83.7%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define83.7%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified83.7%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around 0 84.3%

        \[\leadsto \frac{\color{blue}{x - \log x}}{n} \]

      if 1.99999999999999992e-23 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e-4

      1. Initial program 5.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 99.7%

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. mul-1-neg99.7%

          \[\leadsto \frac{e^{\color{blue}{-\frac{\log \left(\frac{1}{x}\right)}{n}}}}{n \cdot x} \]
        2. log-rec99.7%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
        3. mul-1-neg99.7%

          \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
        4. distribute-neg-frac99.7%

          \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
        5. mul-1-neg99.7%

          \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
        6. remove-double-neg99.7%

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        7. *-commutative99.7%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
      5. Simplified99.7%

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. *-un-lft-identity99.7%

          \[\leadsto \color{blue}{1 \cdot \frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
        2. div-inv99.7%

          \[\leadsto 1 \cdot \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
        3. exp-to-pow99.7%

          \[\leadsto 1 \cdot \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
        4. *-commutative99.7%

          \[\leadsto 1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{n \cdot x}} \]
      7. Applied egg-rr99.7%

        \[\leadsto \color{blue}{1 \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
      8. Step-by-step derivation
        1. *-lft-identity99.7%

          \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}} \]
        2. *-commutative99.7%

          \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
      9. Simplified99.7%

        \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}} \]

      if 2.0000000000000001e-4 < (/.f64 #s(literal 1 binary64) n) < 9.99999999999999899e164

      1. Initial program 76.6%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0 67.3%

        \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]

      if 9.99999999999999899e164 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 27.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 7.0%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define7.0%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified7.0%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 75.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Step-by-step derivation
        1. div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
        2. cancel-sign-sub-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} + \left(-0.5\right) \cdot \frac{1}{n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. un-div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\color{blue}{\frac{0.3333333333333333}{n \cdot x}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{\color{blue}{x \cdot n}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        5. un-div-inv75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \color{blue}{\frac{-0.5}{n}}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        6. metadata-eval75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{\color{blue}{-0.5}}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      8. Applied egg-rr75.9%

        \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{-0.5}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
      9. Step-by-step derivation
        1. +-commutative75.9%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        2. frac-add80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(x \cdot n\right) + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. *-commutative80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \color{blue}{\left(n \cdot x\right)} + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative80.6%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \color{blue}{\left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      10. Applied egg-rr80.6%

        \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
    3. Recombined 7 regimes into one program.
    4. Final simplification87.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-33}:\\ \;\;\;\;\frac{1}{n} \cdot \frac{{x}^{\left(\frac{1}{n}\right)}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-100}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-36}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-23}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 0.0002:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{n \cdot x}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+165}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 59.9% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 5.1 \cdot 10^{-267}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-251}:\\ \;\;\;\;\frac{1}{n \cdot x}\\ \mathbf{elif}\;x \leq 0.86:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+200}:\\ \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (if (<= x 5.1e-267)
       (/ (- (log x)) n)
       (if (<= x 1.5e-251)
         (/ 1.0 (* n x))
         (if (<= x 0.86)
           (/ (- x (log x)) n)
           (if (<= x 6.2e+200)
             (/
              (-
               (/ 1.0 n)
               (/
                (+ (/ (- (/ 0.25 (* n x)) (/ 0.3333333333333333 n)) x) (/ 0.5 n))
                x))
              x)
             0.0)))))
    double code(double x, double n) {
    	double tmp;
    	if (x <= 5.1e-267) {
    		tmp = -log(x) / n;
    	} else if (x <= 1.5e-251) {
    		tmp = 1.0 / (n * x);
    	} else if (x <= 0.86) {
    		tmp = (x - log(x)) / n;
    	} else if (x <= 6.2e+200) {
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	} else {
    		tmp = 0.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: tmp
        if (x <= 5.1d-267) then
            tmp = -log(x) / n
        else if (x <= 1.5d-251) then
            tmp = 1.0d0 / (n * x)
        else if (x <= 0.86d0) then
            tmp = (x - log(x)) / n
        else if (x <= 6.2d+200) then
            tmp = ((1.0d0 / n) - (((((0.25d0 / (n * x)) - (0.3333333333333333d0 / n)) / x) + (0.5d0 / n)) / x)) / x
        else
            tmp = 0.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double tmp;
    	if (x <= 5.1e-267) {
    		tmp = -Math.log(x) / n;
    	} else if (x <= 1.5e-251) {
    		tmp = 1.0 / (n * x);
    	} else if (x <= 0.86) {
    		tmp = (x - Math.log(x)) / n;
    	} else if (x <= 6.2e+200) {
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	} else {
    		tmp = 0.0;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	tmp = 0
    	if x <= 5.1e-267:
    		tmp = -math.log(x) / n
    	elif x <= 1.5e-251:
    		tmp = 1.0 / (n * x)
    	elif x <= 0.86:
    		tmp = (x - math.log(x)) / n
    	elif x <= 6.2e+200:
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x
    	else:
    		tmp = 0.0
    	return tmp
    
    function code(x, n)
    	tmp = 0.0
    	if (x <= 5.1e-267)
    		tmp = Float64(Float64(-log(x)) / n);
    	elseif (x <= 1.5e-251)
    		tmp = Float64(1.0 / Float64(n * x));
    	elseif (x <= 0.86)
    		tmp = Float64(Float64(x - log(x)) / n);
    	elseif (x <= 6.2e+200)
    		tmp = Float64(Float64(Float64(1.0 / n) - Float64(Float64(Float64(Float64(Float64(0.25 / Float64(n * x)) - Float64(0.3333333333333333 / n)) / x) + Float64(0.5 / n)) / x)) / x);
    	else
    		tmp = 0.0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	tmp = 0.0;
    	if (x <= 5.1e-267)
    		tmp = -log(x) / n;
    	elseif (x <= 1.5e-251)
    		tmp = 1.0 / (n * x);
    	elseif (x <= 0.86)
    		tmp = (x - log(x)) / n;
    	elseif (x <= 6.2e+200)
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	else
    		tmp = 0.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := If[LessEqual[x, 5.1e-267], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[x, 1.5e-251], N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.86], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 6.2e+200], N[(N[(N[(1.0 / n), $MachinePrecision] - N[(N[(N[(N[(N[(0.25 / N[(n * x), $MachinePrecision]), $MachinePrecision] - N[(0.3333333333333333 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq 5.1 \cdot 10^{-267}:\\
    \;\;\;\;\frac{-\log x}{n}\\
    
    \mathbf{elif}\;x \leq 1.5 \cdot 10^{-251}:\\
    \;\;\;\;\frac{1}{n \cdot x}\\
    
    \mathbf{elif}\;x \leq 0.86:\\
    \;\;\;\;\frac{x - \log x}{n}\\
    
    \mathbf{elif}\;x \leq 6.2 \cdot 10^{+200}:\\
    \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\
    
    \mathbf{else}:\\
    \;\;\;\;0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if x < 5.10000000000000009e-267

      1. Initial program 50.2%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 54.9%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define54.9%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified54.9%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around 0 54.9%

        \[\leadsto \frac{\color{blue}{-1 \cdot \log x}}{n} \]
      7. Step-by-step derivation
        1. neg-mul-154.9%

          \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
      8. Simplified54.9%

        \[\leadsto \frac{\color{blue}{-\log x}}{n} \]

      if 5.10000000000000009e-267 < x < 1.4999999999999999e-251

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define9.5%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified9.5%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around inf 83.9%

        \[\leadsto \color{blue}{\frac{1}{n \cdot x}} \]
      7. Step-by-step derivation
        1. *-commutative83.9%

          \[\leadsto \frac{1}{\color{blue}{x \cdot n}} \]
      8. Simplified83.9%

        \[\leadsto \color{blue}{\frac{1}{x \cdot n}} \]

      if 1.4999999999999999e-251 < x < 0.859999999999999987

      1. Initial program 37.3%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 53.6%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define53.6%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified53.6%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around 0 51.7%

        \[\leadsto \frac{\color{blue}{x - \log x}}{n} \]

      if 0.859999999999999987 < x < 6.19999999999999988e200

      1. Initial program 50.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 47.6%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define47.6%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified47.6%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 68.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{n \cdot x} - 0.3333333333333333 \cdot \frac{1}{n}}{x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Step-by-step derivation
        1. mul-1-neg68.9%

          \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{n \cdot x} - 0.3333333333333333 \cdot \frac{1}{n}}{x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      8. Simplified68.9%

        \[\leadsto \color{blue}{-\frac{\left(-\frac{\left(-\frac{\frac{0.25}{x \cdot n} - \frac{0.3333333333333333}{n}}{x}\right) - \frac{0.5}{n}}{x}\right) - \frac{1}{n}}{x}} \]

      if 6.19999999999999988e200 < x

      1. Initial program 92.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 92.1%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define92.1%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified92.1%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. add-log-exp92.1%

          \[\leadsto \color{blue}{\log \left(e^{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}}\right)} \]
        2. div-inv92.1%

          \[\leadsto \log \left(e^{\color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}}}\right) \]
        3. exp-prod92.1%

          \[\leadsto \log \color{blue}{\left({\left(e^{\mathsf{log1p}\left(x\right) - \log x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
        4. exp-diff92.1%

          \[\leadsto \log \left({\color{blue}{\left(\frac{e^{\mathsf{log1p}\left(x\right)}}{e^{\log x}}\right)}}^{\left(\frac{1}{n}\right)}\right) \]
        5. add-exp-log58.5%

          \[\leadsto \log \left({\left(\frac{e^{\mathsf{log1p}\left(x\right)}}{\color{blue}{x}}\right)}^{\left(\frac{1}{n}\right)}\right) \]
        6. log1p-undefine58.5%

          \[\leadsto \log \left({\left(\frac{e^{\color{blue}{\log \left(1 + x\right)}}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
        7. rem-exp-log92.1%

          \[\leadsto \log \left({\left(\frac{\color{blue}{1 + x}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      7. Applied egg-rr92.1%

        \[\leadsto \color{blue}{\log \left({\left(\frac{1 + x}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      8. Step-by-step derivation
        1. +-commutative92.1%

          \[\leadsto \log \left({\left(\frac{\color{blue}{x + 1}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      9. Simplified92.1%

        \[\leadsto \color{blue}{\log \left({\left(\frac{x + 1}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      10. Taylor expanded in x around inf 92.1%

        \[\leadsto \log \color{blue}{1} \]
    3. Recombined 5 regimes into one program.
    4. Final simplification63.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5.1 \cdot 10^{-267}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-251}:\\ \;\;\;\;\frac{1}{n \cdot x}\\ \mathbf{elif}\;x \leq 0.86:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+200}:\\ \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
    5. Add Preprocessing

    Alternative 11: 59.6% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-\log x}{n}\\ \mathbf{if}\;x \leq 4.5 \cdot 10^{-267}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-251}:\\ \;\;\;\;\frac{1}{n \cdot x}\\ \mathbf{elif}\;x \leq 0.7:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.08 \cdot 10^{+201}:\\ \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (/ (- (log x)) n)))
       (if (<= x 4.5e-267)
         t_0
         (if (<= x 1.5e-251)
           (/ 1.0 (* n x))
           (if (<= x 0.7)
             t_0
             (if (<= x 1.08e+201)
               (/
                (-
                 (/ 1.0 n)
                 (/
                  (+ (/ (- (/ 0.25 (* n x)) (/ 0.3333333333333333 n)) x) (/ 0.5 n))
                  x))
                x)
               0.0))))))
    double code(double x, double n) {
    	double t_0 = -log(x) / n;
    	double tmp;
    	if (x <= 4.5e-267) {
    		tmp = t_0;
    	} else if (x <= 1.5e-251) {
    		tmp = 1.0 / (n * x);
    	} else if (x <= 0.7) {
    		tmp = t_0;
    	} else if (x <= 1.08e+201) {
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	} else {
    		tmp = 0.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: t_0
        real(8) :: tmp
        t_0 = -log(x) / n
        if (x <= 4.5d-267) then
            tmp = t_0
        else if (x <= 1.5d-251) then
            tmp = 1.0d0 / (n * x)
        else if (x <= 0.7d0) then
            tmp = t_0
        else if (x <= 1.08d+201) then
            tmp = ((1.0d0 / n) - (((((0.25d0 / (n * x)) - (0.3333333333333333d0 / n)) / x) + (0.5d0 / n)) / x)) / x
        else
            tmp = 0.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double t_0 = -Math.log(x) / n;
    	double tmp;
    	if (x <= 4.5e-267) {
    		tmp = t_0;
    	} else if (x <= 1.5e-251) {
    		tmp = 1.0 / (n * x);
    	} else if (x <= 0.7) {
    		tmp = t_0;
    	} else if (x <= 1.08e+201) {
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	} else {
    		tmp = 0.0;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = -math.log(x) / n
    	tmp = 0
    	if x <= 4.5e-267:
    		tmp = t_0
    	elif x <= 1.5e-251:
    		tmp = 1.0 / (n * x)
    	elif x <= 0.7:
    		tmp = t_0
    	elif x <= 1.08e+201:
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x
    	else:
    		tmp = 0.0
    	return tmp
    
    function code(x, n)
    	t_0 = Float64(Float64(-log(x)) / n)
    	tmp = 0.0
    	if (x <= 4.5e-267)
    		tmp = t_0;
    	elseif (x <= 1.5e-251)
    		tmp = Float64(1.0 / Float64(n * x));
    	elseif (x <= 0.7)
    		tmp = t_0;
    	elseif (x <= 1.08e+201)
    		tmp = Float64(Float64(Float64(1.0 / n) - Float64(Float64(Float64(Float64(Float64(0.25 / Float64(n * x)) - Float64(0.3333333333333333 / n)) / x) + Float64(0.5 / n)) / x)) / x);
    	else
    		tmp = 0.0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	t_0 = -log(x) / n;
    	tmp = 0.0;
    	if (x <= 4.5e-267)
    		tmp = t_0;
    	elseif (x <= 1.5e-251)
    		tmp = 1.0 / (n * x);
    	elseif (x <= 0.7)
    		tmp = t_0;
    	elseif (x <= 1.08e+201)
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	else
    		tmp = 0.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := Block[{t$95$0 = N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision]}, If[LessEqual[x, 4.5e-267], t$95$0, If[LessEqual[x, 1.5e-251], N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.7], t$95$0, If[LessEqual[x, 1.08e+201], N[(N[(N[(1.0 / n), $MachinePrecision] - N[(N[(N[(N[(N[(0.25 / N[(n * x), $MachinePrecision]), $MachinePrecision] - N[(0.3333333333333333 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{-\log x}{n}\\
    \mathbf{if}\;x \leq 4.5 \cdot 10^{-267}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq 1.5 \cdot 10^{-251}:\\
    \;\;\;\;\frac{1}{n \cdot x}\\
    
    \mathbf{elif}\;x \leq 0.7:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq 1.08 \cdot 10^{+201}:\\
    \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\
    
    \mathbf{else}:\\
    \;\;\;\;0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if x < 4.4999999999999999e-267 or 1.4999999999999999e-251 < x < 0.69999999999999996

      1. Initial program 39.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 53.5%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define53.5%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified53.5%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around 0 51.7%

        \[\leadsto \frac{\color{blue}{-1 \cdot \log x}}{n} \]
      7. Step-by-step derivation
        1. neg-mul-151.7%

          \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
      8. Simplified51.7%

        \[\leadsto \frac{\color{blue}{-\log x}}{n} \]

      if 4.4999999999999999e-267 < x < 1.4999999999999999e-251

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define9.5%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified9.5%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around inf 83.9%

        \[\leadsto \color{blue}{\frac{1}{n \cdot x}} \]
      7. Step-by-step derivation
        1. *-commutative83.9%

          \[\leadsto \frac{1}{\color{blue}{x \cdot n}} \]
      8. Simplified83.9%

        \[\leadsto \color{blue}{\frac{1}{x \cdot n}} \]

      if 0.69999999999999996 < x < 1.08000000000000006e201

      1. Initial program 49.7%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 48.4%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define48.4%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified48.4%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 68.2%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{n \cdot x} - 0.3333333333333333 \cdot \frac{1}{n}}{x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Step-by-step derivation
        1. mul-1-neg68.2%

          \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{n \cdot x} - 0.3333333333333333 \cdot \frac{1}{n}}{x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      8. Simplified68.2%

        \[\leadsto \color{blue}{-\frac{\left(-\frac{\left(-\frac{\frac{0.25}{x \cdot n} - \frac{0.3333333333333333}{n}}{x}\right) - \frac{0.5}{n}}{x}\right) - \frac{1}{n}}{x}} \]

      if 1.08000000000000006e201 < x

      1. Initial program 92.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 92.1%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define92.1%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified92.1%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. add-log-exp92.1%

          \[\leadsto \color{blue}{\log \left(e^{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}}\right)} \]
        2. div-inv92.1%

          \[\leadsto \log \left(e^{\color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}}}\right) \]
        3. exp-prod92.1%

          \[\leadsto \log \color{blue}{\left({\left(e^{\mathsf{log1p}\left(x\right) - \log x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
        4. exp-diff92.1%

          \[\leadsto \log \left({\color{blue}{\left(\frac{e^{\mathsf{log1p}\left(x\right)}}{e^{\log x}}\right)}}^{\left(\frac{1}{n}\right)}\right) \]
        5. add-exp-log58.5%

          \[\leadsto \log \left({\left(\frac{e^{\mathsf{log1p}\left(x\right)}}{\color{blue}{x}}\right)}^{\left(\frac{1}{n}\right)}\right) \]
        6. log1p-undefine58.5%

          \[\leadsto \log \left({\left(\frac{e^{\color{blue}{\log \left(1 + x\right)}}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
        7. rem-exp-log92.1%

          \[\leadsto \log \left({\left(\frac{\color{blue}{1 + x}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      7. Applied egg-rr92.1%

        \[\leadsto \color{blue}{\log \left({\left(\frac{1 + x}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      8. Step-by-step derivation
        1. +-commutative92.1%

          \[\leadsto \log \left({\left(\frac{\color{blue}{x + 1}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      9. Simplified92.1%

        \[\leadsto \color{blue}{\log \left({\left(\frac{x + 1}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      10. Taylor expanded in x around inf 92.1%

        \[\leadsto \log \color{blue}{1} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification62.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4.5 \cdot 10^{-267}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-251}:\\ \;\;\;\;\frac{1}{n \cdot x}\\ \mathbf{elif}\;x \leq 0.7:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 1.08 \cdot 10^{+201}:\\ \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
    5. Add Preprocessing

    Alternative 12: 60.2% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 7.2 \cdot 10^{-242}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 0.9:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{+201}:\\ \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (if (<= x 7.2e-242)
       (- 1.0 (pow x (/ 1.0 n)))
       (if (<= x 0.9)
         (/ (- x (log x)) n)
         (if (<= x 1.75e+201)
           (/
            (-
             (/ 1.0 n)
             (/
              (+ (/ (- (/ 0.25 (* n x)) (/ 0.3333333333333333 n)) x) (/ 0.5 n))
              x))
            x)
           0.0))))
    double code(double x, double n) {
    	double tmp;
    	if (x <= 7.2e-242) {
    		tmp = 1.0 - pow(x, (1.0 / n));
    	} else if (x <= 0.9) {
    		tmp = (x - log(x)) / n;
    	} else if (x <= 1.75e+201) {
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	} else {
    		tmp = 0.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: tmp
        if (x <= 7.2d-242) then
            tmp = 1.0d0 - (x ** (1.0d0 / n))
        else if (x <= 0.9d0) then
            tmp = (x - log(x)) / n
        else if (x <= 1.75d+201) then
            tmp = ((1.0d0 / n) - (((((0.25d0 / (n * x)) - (0.3333333333333333d0 / n)) / x) + (0.5d0 / n)) / x)) / x
        else
            tmp = 0.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double tmp;
    	if (x <= 7.2e-242) {
    		tmp = 1.0 - Math.pow(x, (1.0 / n));
    	} else if (x <= 0.9) {
    		tmp = (x - Math.log(x)) / n;
    	} else if (x <= 1.75e+201) {
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	} else {
    		tmp = 0.0;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	tmp = 0
    	if x <= 7.2e-242:
    		tmp = 1.0 - math.pow(x, (1.0 / n))
    	elif x <= 0.9:
    		tmp = (x - math.log(x)) / n
    	elif x <= 1.75e+201:
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x
    	else:
    		tmp = 0.0
    	return tmp
    
    function code(x, n)
    	tmp = 0.0
    	if (x <= 7.2e-242)
    		tmp = Float64(1.0 - (x ^ Float64(1.0 / n)));
    	elseif (x <= 0.9)
    		tmp = Float64(Float64(x - log(x)) / n);
    	elseif (x <= 1.75e+201)
    		tmp = Float64(Float64(Float64(1.0 / n) - Float64(Float64(Float64(Float64(Float64(0.25 / Float64(n * x)) - Float64(0.3333333333333333 / n)) / x) + Float64(0.5 / n)) / x)) / x);
    	else
    		tmp = 0.0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	tmp = 0.0;
    	if (x <= 7.2e-242)
    		tmp = 1.0 - (x ^ (1.0 / n));
    	elseif (x <= 0.9)
    		tmp = (x - log(x)) / n;
    	elseif (x <= 1.75e+201)
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	else
    		tmp = 0.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := If[LessEqual[x, 7.2e-242], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.9], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 1.75e+201], N[(N[(N[(1.0 / n), $MachinePrecision] - N[(N[(N[(N[(N[(0.25 / N[(n * x), $MachinePrecision]), $MachinePrecision] - N[(0.3333333333333333 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq 7.2 \cdot 10^{-242}:\\
    \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
    
    \mathbf{elif}\;x \leq 0.9:\\
    \;\;\;\;\frac{x - \log x}{n}\\
    
    \mathbf{elif}\;x \leq 1.75 \cdot 10^{+201}:\\
    \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\
    
    \mathbf{else}:\\
    \;\;\;\;0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if x < 7.20000000000000028e-242

      1. Initial program 63.2%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0 63.2%

        \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]

      if 7.20000000000000028e-242 < x < 0.900000000000000022

      1. Initial program 36.0%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 54.4%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define54.4%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified54.4%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around 0 52.5%

        \[\leadsto \frac{\color{blue}{x - \log x}}{n} \]

      if 0.900000000000000022 < x < 1.7500000000000001e201

      1. Initial program 50.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 47.6%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define47.6%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified47.6%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 68.9%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{n \cdot x} - 0.3333333333333333 \cdot \frac{1}{n}}{x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Step-by-step derivation
        1. mul-1-neg68.9%

          \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{n \cdot x} - 0.3333333333333333 \cdot \frac{1}{n}}{x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      8. Simplified68.9%

        \[\leadsto \color{blue}{-\frac{\left(-\frac{\left(-\frac{\frac{0.25}{x \cdot n} - \frac{0.3333333333333333}{n}}{x}\right) - \frac{0.5}{n}}{x}\right) - \frac{1}{n}}{x}} \]

      if 1.7500000000000001e201 < x

      1. Initial program 92.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 92.1%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define92.1%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified92.1%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. add-log-exp92.1%

          \[\leadsto \color{blue}{\log \left(e^{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}}\right)} \]
        2. div-inv92.1%

          \[\leadsto \log \left(e^{\color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}}}\right) \]
        3. exp-prod92.1%

          \[\leadsto \log \color{blue}{\left({\left(e^{\mathsf{log1p}\left(x\right) - \log x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
        4. exp-diff92.1%

          \[\leadsto \log \left({\color{blue}{\left(\frac{e^{\mathsf{log1p}\left(x\right)}}{e^{\log x}}\right)}}^{\left(\frac{1}{n}\right)}\right) \]
        5. add-exp-log58.5%

          \[\leadsto \log \left({\left(\frac{e^{\mathsf{log1p}\left(x\right)}}{\color{blue}{x}}\right)}^{\left(\frac{1}{n}\right)}\right) \]
        6. log1p-undefine58.5%

          \[\leadsto \log \left({\left(\frac{e^{\color{blue}{\log \left(1 + x\right)}}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
        7. rem-exp-log92.1%

          \[\leadsto \log \left({\left(\frac{\color{blue}{1 + x}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      7. Applied egg-rr92.1%

        \[\leadsto \color{blue}{\log \left({\left(\frac{1 + x}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      8. Step-by-step derivation
        1. +-commutative92.1%

          \[\leadsto \log \left({\left(\frac{\color{blue}{x + 1}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      9. Simplified92.1%

        \[\leadsto \color{blue}{\log \left({\left(\frac{x + 1}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      10. Taylor expanded in x around inf 92.1%

        \[\leadsto \log \color{blue}{1} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification63.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 7.2 \cdot 10^{-242}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 0.9:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{+201}:\\ \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
    5. Add Preprocessing

    Alternative 13: 48.4% accurate, 7.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.86:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (if (<= x 0.86)
       (/
        (+
         (/ 1.0 n)
         (*
          (/ (+ (* (* n x) -0.5) (* n 0.3333333333333333)) (* n (* n x)))
          (/ 1.0 x)))
        x)
       (/
        (-
         (/ 1.0 n)
         (/ (+ (/ (- (/ 0.25 (* n x)) (/ 0.3333333333333333 n)) x) (/ 0.5 n)) x))
        x)))
    double code(double x, double n) {
    	double tmp;
    	if (x <= 0.86) {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	} else {
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: tmp
        if (x <= 0.86d0) then
            tmp = ((1.0d0 / n) + (((((n * x) * (-0.5d0)) + (n * 0.3333333333333333d0)) / (n * (n * x))) * (1.0d0 / x))) / x
        else
            tmp = ((1.0d0 / n) - (((((0.25d0 / (n * x)) - (0.3333333333333333d0 / n)) / x) + (0.5d0 / n)) / x)) / x
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double tmp;
    	if (x <= 0.86) {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	} else {
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	tmp = 0
    	if x <= 0.86:
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x
    	else:
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x
    	return tmp
    
    function code(x, n)
    	tmp = 0.0
    	if (x <= 0.86)
    		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(Float64(n * x) * -0.5) + Float64(n * 0.3333333333333333)) / Float64(n * Float64(n * x))) * Float64(1.0 / x))) / x);
    	else
    		tmp = Float64(Float64(Float64(1.0 / n) - Float64(Float64(Float64(Float64(Float64(0.25 / Float64(n * x)) - Float64(0.3333333333333333 / n)) / x) + Float64(0.5 / n)) / x)) / x);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	tmp = 0.0;
    	if (x <= 0.86)
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	else
    		tmp = ((1.0 / n) - (((((0.25 / (n * x)) - (0.3333333333333333 / n)) / x) + (0.5 / n)) / x)) / x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := If[LessEqual[x, 0.86], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(N[(n * x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(n * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] - N[(N[(N[(N[(N[(0.25 / N[(n * x), $MachinePrecision]), $MachinePrecision] - N[(0.3333333333333333 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.5 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq 0.86:\\
    \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 0.859999999999999987

      1. Initial program 41.6%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 52.0%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define52.0%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified52.0%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 34.5%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Step-by-step derivation
        1. div-inv34.5%

          \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
        2. cancel-sign-sub-inv34.5%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} + \left(-0.5\right) \cdot \frac{1}{n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. un-div-inv34.5%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\color{blue}{\frac{0.3333333333333333}{n \cdot x}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative34.5%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{\color{blue}{x \cdot n}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        5. un-div-inv34.5%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \color{blue}{\frac{-0.5}{n}}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        6. metadata-eval34.5%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{\color{blue}{-0.5}}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      8. Applied egg-rr34.5%

        \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{-0.5}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
      9. Step-by-step derivation
        1. +-commutative34.5%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        2. frac-add37.3%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(x \cdot n\right) + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. *-commutative37.3%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \color{blue}{\left(n \cdot x\right)} + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative37.3%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \color{blue}{\left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      10. Applied egg-rr37.3%

        \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]

      if 0.859999999999999987 < x

      1. Initial program 65.5%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 63.7%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define63.7%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified63.7%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 68.3%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{n \cdot x} - 0.3333333333333333 \cdot \frac{1}{n}}{x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Step-by-step derivation
        1. mul-1-neg68.3%

          \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{n \cdot x} - 0.3333333333333333 \cdot \frac{1}{n}}{x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      8. Simplified68.3%

        \[\leadsto \color{blue}{-\frac{\left(-\frac{\left(-\frac{\frac{0.25}{x \cdot n} - \frac{0.3333333333333333}{n}}{x}\right) - \frac{0.5}{n}}{x}\right) - \frac{1}{n}}{x}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification50.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.86:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} - \frac{\frac{\frac{0.25}{n \cdot x} - \frac{0.3333333333333333}{n}}{x} + \frac{0.5}{n}}{x}}{x}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 14: 50.0% accurate, 7.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 4 \cdot 10^{+88}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (if (<= x 4e+88)
       (/
        (+
         (/ 1.0 n)
         (*
          (/ (+ (* (* n x) -0.5) (* n 0.3333333333333333)) (* n (* n x)))
          (/ 1.0 x)))
        x)
       0.0))
    double code(double x, double n) {
    	double tmp;
    	if (x <= 4e+88) {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	} else {
    		tmp = 0.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: tmp
        if (x <= 4d+88) then
            tmp = ((1.0d0 / n) + (((((n * x) * (-0.5d0)) + (n * 0.3333333333333333d0)) / (n * (n * x))) * (1.0d0 / x))) / x
        else
            tmp = 0.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double tmp;
    	if (x <= 4e+88) {
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	} else {
    		tmp = 0.0;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	tmp = 0
    	if x <= 4e+88:
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x
    	else:
    		tmp = 0.0
    	return tmp
    
    function code(x, n)
    	tmp = 0.0
    	if (x <= 4e+88)
    		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(Float64(Float64(n * x) * -0.5) + Float64(n * 0.3333333333333333)) / Float64(n * Float64(n * x))) * Float64(1.0 / x))) / x);
    	else
    		tmp = 0.0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	tmp = 0.0;
    	if (x <= 4e+88)
    		tmp = ((1.0 / n) + (((((n * x) * -0.5) + (n * 0.3333333333333333)) / (n * (n * x))) * (1.0 / x))) / x;
    	else
    		tmp = 0.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := If[LessEqual[x, 4e+88], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(N[(N[(n * x), $MachinePrecision] * -0.5), $MachinePrecision] + N[(n * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq 4 \cdot 10^{+88}:\\
    \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\
    
    \mathbf{else}:\\
    \;\;\;\;0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 3.99999999999999984e88

      1. Initial program 40.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 48.5%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define48.5%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified48.5%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 40.4%

        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
      7. Step-by-step derivation
        1. div-inv40.4%

          \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
        2. cancel-sign-sub-inv40.4%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(0.3333333333333333 \cdot \frac{1}{n \cdot x} + \left(-0.5\right) \cdot \frac{1}{n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. un-div-inv40.4%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\color{blue}{\frac{0.3333333333333333}{n \cdot x}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative40.4%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{\color{blue}{x \cdot n}} + \left(-0.5\right) \cdot \frac{1}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        5. un-div-inv40.4%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \color{blue}{\frac{-0.5}{n}}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        6. metadata-eval40.4%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{\color{blue}{-0.5}}{n}\right) \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      8. Applied egg-rr40.4%

        \[\leadsto -1 \cdot \frac{-1 \cdot \color{blue}{\left(\left(\frac{0.3333333333333333}{x \cdot n} + \frac{-0.5}{n}\right) \cdot \frac{1}{x}\right)} - \frac{1}{n}}{x} \]
      9. Step-by-step derivation
        1. +-commutative40.4%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\left(\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        2. frac-add42.2%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(x \cdot n\right) + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        3. *-commutative42.2%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \color{blue}{\left(n \cdot x\right)} + n \cdot 0.3333333333333333}{n \cdot \left(x \cdot n\right)} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
        4. *-commutative42.2%

          \[\leadsto -1 \cdot \frac{-1 \cdot \left(\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \color{blue}{\left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]
      10. Applied egg-rr42.2%

        \[\leadsto -1 \cdot \frac{-1 \cdot \left(\color{blue}{\frac{-0.5 \cdot \left(n \cdot x\right) + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)}} \cdot \frac{1}{x}\right) - \frac{1}{n}}{x} \]

      if 3.99999999999999984e88 < x

      1. Initial program 79.1%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in n around inf 79.1%

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. log1p-define79.1%

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
      5. Simplified79.1%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. add-log-exp79.1%

          \[\leadsto \color{blue}{\log \left(e^{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}}\right)} \]
        2. div-inv79.1%

          \[\leadsto \log \left(e^{\color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}}}\right) \]
        3. exp-prod79.1%

          \[\leadsto \log \color{blue}{\left({\left(e^{\mathsf{log1p}\left(x\right) - \log x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
        4. exp-diff79.1%

          \[\leadsto \log \left({\color{blue}{\left(\frac{e^{\mathsf{log1p}\left(x\right)}}{e^{\log x}}\right)}}^{\left(\frac{1}{n}\right)}\right) \]
        5. add-exp-log49.6%

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

          \[\leadsto \log \left({\left(\frac{e^{\color{blue}{\log \left(1 + x\right)}}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
        7. rem-exp-log79.1%

          \[\leadsto \log \left({\left(\frac{\color{blue}{1 + x}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      7. Applied egg-rr79.1%

        \[\leadsto \color{blue}{\log \left({\left(\frac{1 + x}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      8. Step-by-step derivation
        1. +-commutative79.1%

          \[\leadsto \log \left({\left(\frac{\color{blue}{x + 1}}{x}\right)}^{\left(\frac{1}{n}\right)}\right) \]
      9. Simplified79.1%

        \[\leadsto \color{blue}{\log \left({\left(\frac{x + 1}{x}\right)}^{\left(\frac{1}{n}\right)}\right)} \]
      10. Taylor expanded in x around inf 79.1%

        \[\leadsto \log \color{blue}{1} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification52.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4 \cdot 10^{+88}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\left(n \cdot x\right) \cdot -0.5 + n \cdot 0.3333333333333333}{n \cdot \left(n \cdot x\right)} \cdot \frac{1}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
    5. Add Preprocessing

    Alternative 15: 47.0% accurate, 14.1× speedup?

    \[\begin{array}{l} \\ \frac{\frac{1}{n} + \frac{-0.5 + \frac{0.3333333333333333}{x}}{n \cdot x}}{x} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (/ (+ (/ 1.0 n) (/ (+ -0.5 (/ 0.3333333333333333 x)) (* n x))) x))
    double code(double x, double n) {
    	return ((1.0 / n) + ((-0.5 + (0.3333333333333333 / x)) / (n * x))) / x;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        code = ((1.0d0 / n) + (((-0.5d0) + (0.3333333333333333d0 / x)) / (n * x))) / x
    end function
    
    public static double code(double x, double n) {
    	return ((1.0 / n) + ((-0.5 + (0.3333333333333333 / x)) / (n * x))) / x;
    }
    
    def code(x, n):
    	return ((1.0 / n) + ((-0.5 + (0.3333333333333333 / x)) / (n * x))) / x
    
    function code(x, n)
    	return Float64(Float64(Float64(1.0 / n) + Float64(Float64(-0.5 + Float64(0.3333333333333333 / x)) / Float64(n * x))) / x)
    end
    
    function tmp = code(x, n)
    	tmp = ((1.0 / n) + ((-0.5 + (0.3333333333333333 / x)) / (n * x))) / x;
    end
    
    code[x_, n_] := N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(-0.5 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{\frac{1}{n} + \frac{-0.5 + \frac{0.3333333333333333}{x}}{n \cdot x}}{x}
    \end{array}
    
    Derivation
    1. Initial program 51.4%

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in n around inf 56.8%

      \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
    4. Step-by-step derivation
      1. log1p-define56.8%

        \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
    5. Simplified56.8%

      \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
    6. Step-by-step derivation
      1. div-inv56.8%

        \[\leadsto \color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}} \]
    7. Applied egg-rr56.8%

      \[\leadsto \color{blue}{\left(\mathsf{log1p}\left(x\right) - \log x\right) \cdot \frac{1}{n}} \]
    8. Taylor expanded in x around inf 35.3%

      \[\leadsto \color{blue}{\frac{\left(\frac{0.3333333333333333}{n \cdot {x}^{2}} + \frac{1}{n}\right) - \frac{0.5}{n \cdot x}}{x}} \]
    9. Step-by-step derivation
      1. +-commutative35.3%

        \[\leadsto \frac{\color{blue}{\left(\frac{1}{n} + \frac{0.3333333333333333}{n \cdot {x}^{2}}\right)} - \frac{0.5}{n \cdot x}}{x} \]
      2. associate--l+35.3%

        \[\leadsto \frac{\color{blue}{\frac{1}{n} + \left(\frac{0.3333333333333333}{n \cdot {x}^{2}} - \frac{0.5}{n \cdot x}\right)}}{x} \]
      3. *-commutative35.3%

        \[\leadsto \frac{\frac{1}{n} + \left(\frac{0.3333333333333333}{\color{blue}{{x}^{2} \cdot n}} - \frac{0.5}{n \cdot x}\right)}{x} \]
      4. unpow235.3%

        \[\leadsto \frac{\frac{1}{n} + \left(\frac{0.3333333333333333}{\color{blue}{\left(x \cdot x\right)} \cdot n} - \frac{0.5}{n \cdot x}\right)}{x} \]
      5. associate-*r*35.3%

        \[\leadsto \frac{\frac{1}{n} + \left(\frac{0.3333333333333333}{\color{blue}{x \cdot \left(x \cdot n\right)}} - \frac{0.5}{n \cdot x}\right)}{x} \]
      6. associate-/r*35.3%

        \[\leadsto \frac{\frac{1}{n} + \left(\color{blue}{\frac{\frac{0.3333333333333333}{x}}{x \cdot n}} - \frac{0.5}{n \cdot x}\right)}{x} \]
      7. metadata-eval35.3%

        \[\leadsto \frac{\frac{1}{n} + \left(\frac{\frac{\color{blue}{0.3333333333333333 \cdot 1}}{x}}{x \cdot n} - \frac{0.5}{n \cdot x}\right)}{x} \]
      8. associate-*r/35.3%

        \[\leadsto \frac{\frac{1}{n} + \left(\frac{\color{blue}{0.3333333333333333 \cdot \frac{1}{x}}}{x \cdot n} - \frac{0.5}{n \cdot x}\right)}{x} \]
      9. *-commutative35.3%

        \[\leadsto \frac{\frac{1}{n} + \left(\frac{0.3333333333333333 \cdot \frac{1}{x}}{\color{blue}{n \cdot x}} - \frac{0.5}{n \cdot x}\right)}{x} \]
      10. div-sub48.3%

        \[\leadsto \frac{\frac{1}{n} + \color{blue}{\frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{n \cdot x}}}{x} \]
      11. sub-neg48.3%

        \[\leadsto \frac{\frac{1}{n} + \frac{\color{blue}{0.3333333333333333 \cdot \frac{1}{x} + \left(-0.5\right)}}{n \cdot x}}{x} \]
      12. associate-*r/48.3%

        \[\leadsto \frac{\frac{1}{n} + \frac{\color{blue}{\frac{0.3333333333333333 \cdot 1}{x}} + \left(-0.5\right)}{n \cdot x}}{x} \]
      13. metadata-eval48.3%

        \[\leadsto \frac{\frac{1}{n} + \frac{\frac{\color{blue}{0.3333333333333333}}{x} + \left(-0.5\right)}{n \cdot x}}{x} \]
      14. metadata-eval48.3%

        \[\leadsto \frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x} + \color{blue}{-0.5}}{n \cdot x}}{x} \]
      15. *-commutative48.3%

        \[\leadsto \frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x} + -0.5}{\color{blue}{x \cdot n}}}{x} \]
    10. Simplified48.3%

      \[\leadsto \color{blue}{\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x} + -0.5}{x \cdot n}}{x}} \]
    11. Final simplification48.3%

      \[\leadsto \frac{\frac{1}{n} + \frac{-0.5 + \frac{0.3333333333333333}{x}}{n \cdot x}}{x} \]
    12. Add Preprocessing

    Alternative 16: 46.5% accurate, 15.1× speedup?

    \[\begin{array}{l} \\ \frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot \left(-x\right)} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (/ (+ -1.0 (/ (+ 0.5 (/ -0.3333333333333333 x)) x)) (* n (- x))))
    double code(double x, double n) {
    	return (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x);
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        code = ((-1.0d0) + ((0.5d0 + ((-0.3333333333333333d0) / x)) / x)) / (n * -x)
    end function
    
    public static double code(double x, double n) {
    	return (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x);
    }
    
    def code(x, n):
    	return (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x)
    
    function code(x, n)
    	return Float64(Float64(-1.0 + Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / x)) / Float64(n * Float64(-x)))
    end
    
    function tmp = code(x, n)
    	tmp = (-1.0 + ((0.5 + (-0.3333333333333333 / x)) / x)) / (n * -x);
    end
    
    code[x_, n_] := N[(N[(-1.0 + N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(n * (-x)), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot \left(-x\right)}
    \end{array}
    
    Derivation
    1. Initial program 51.4%

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in n around inf 56.8%

      \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
    4. Step-by-step derivation
      1. log1p-define56.8%

        \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
    5. Simplified56.8%

      \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
    6. Taylor expanded in x around -inf 48.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
    7. Taylor expanded in n around 0 48.0%

      \[\leadsto -1 \cdot \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{n \cdot x}} \]
    8. Step-by-step derivation
      1. sub-neg48.0%

        \[\leadsto -1 \cdot \frac{\color{blue}{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} + \left(-1\right)}}{n \cdot x} \]
      2. associate-*r/48.0%

        \[\leadsto -1 \cdot \frac{\color{blue}{\frac{-1 \cdot \left(0.3333333333333333 \cdot \frac{1}{x} - 0.5\right)}{x}} + \left(-1\right)}{n \cdot x} \]
      3. sub-neg48.0%

        \[\leadsto -1 \cdot \frac{\frac{-1 \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{x} + \left(-0.5\right)\right)}}{x} + \left(-1\right)}{n \cdot x} \]
      4. metadata-eval48.0%

        \[\leadsto -1 \cdot \frac{\frac{-1 \cdot \left(0.3333333333333333 \cdot \frac{1}{x} + \color{blue}{-0.5}\right)}{x} + \left(-1\right)}{n \cdot x} \]
      5. distribute-lft-in48.0%

        \[\leadsto -1 \cdot \frac{\frac{\color{blue}{-1 \cdot \left(0.3333333333333333 \cdot \frac{1}{x}\right) + -1 \cdot -0.5}}{x} + \left(-1\right)}{n \cdot x} \]
      6. neg-mul-148.0%

        \[\leadsto -1 \cdot \frac{\frac{\color{blue}{\left(-0.3333333333333333 \cdot \frac{1}{x}\right)} + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
      7. associate-*r/48.0%

        \[\leadsto -1 \cdot \frac{\frac{\left(-\color{blue}{\frac{0.3333333333333333 \cdot 1}{x}}\right) + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
      8. metadata-eval48.0%

        \[\leadsto -1 \cdot \frac{\frac{\left(-\frac{\color{blue}{0.3333333333333333}}{x}\right) + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
      9. distribute-neg-frac48.0%

        \[\leadsto -1 \cdot \frac{\frac{\color{blue}{\frac{-0.3333333333333333}{x}} + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
      10. metadata-eval48.0%

        \[\leadsto -1 \cdot \frac{\frac{\frac{\color{blue}{-0.3333333333333333}}{x} + -1 \cdot -0.5}{x} + \left(-1\right)}{n \cdot x} \]
      11. metadata-eval48.0%

        \[\leadsto -1 \cdot \frac{\frac{\frac{-0.3333333333333333}{x} + \color{blue}{0.5}}{x} + \left(-1\right)}{n \cdot x} \]
      12. metadata-eval48.0%

        \[\leadsto -1 \cdot \frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + \color{blue}{-1}}{n \cdot x} \]
      13. *-commutative48.0%

        \[\leadsto -1 \cdot \frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + -1}{\color{blue}{x \cdot n}} \]
    9. Simplified48.0%

      \[\leadsto -1 \cdot \color{blue}{\frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + -1}{x \cdot n}} \]
    10. Final simplification48.0%

      \[\leadsto \frac{-1 + \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{n \cdot \left(-x\right)} \]
    11. Add Preprocessing

    Alternative 17: 40.8% accurate, 42.2× speedup?

    \[\begin{array}{l} \\ \frac{1}{n \cdot x} \end{array} \]
    (FPCore (x n) :precision binary64 (/ 1.0 (* n x)))
    double code(double x, double n) {
    	return 1.0 / (n * x);
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        code = 1.0d0 / (n * x)
    end function
    
    public static double code(double x, double n) {
    	return 1.0 / (n * x);
    }
    
    def code(x, n):
    	return 1.0 / (n * x)
    
    function code(x, n)
    	return Float64(1.0 / Float64(n * x))
    end
    
    function tmp = code(x, n)
    	tmp = 1.0 / (n * x);
    end
    
    code[x_, n_] := N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{1}{n \cdot x}
    \end{array}
    
    Derivation
    1. Initial program 51.4%

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in n around inf 56.8%

      \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
    4. Step-by-step derivation
      1. log1p-define56.8%

        \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
    5. Simplified56.8%

      \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
    6. Taylor expanded in x around inf 42.9%

      \[\leadsto \color{blue}{\frac{1}{n \cdot x}} \]
    7. Step-by-step derivation
      1. *-commutative42.9%

        \[\leadsto \frac{1}{\color{blue}{x \cdot n}} \]
    8. Simplified42.9%

      \[\leadsto \color{blue}{\frac{1}{x \cdot n}} \]
    9. Final simplification42.9%

      \[\leadsto \frac{1}{n \cdot x} \]
    10. Add Preprocessing

    Alternative 18: 41.3% accurate, 42.2× speedup?

    \[\begin{array}{l} \\ \frac{\frac{1}{x}}{n} \end{array} \]
    (FPCore (x n) :precision binary64 (/ (/ 1.0 x) n))
    double code(double x, double n) {
    	return (1.0 / x) / n;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        code = (1.0d0 / x) / n
    end function
    
    public static double code(double x, double n) {
    	return (1.0 / x) / n;
    }
    
    def code(x, n):
    	return (1.0 / x) / n
    
    function code(x, n)
    	return Float64(Float64(1.0 / x) / n)
    end
    
    function tmp = code(x, n)
    	tmp = (1.0 / x) / n;
    end
    
    code[x_, n_] := N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{\frac{1}{x}}{n}
    \end{array}
    
    Derivation
    1. Initial program 51.4%

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in n around inf 56.8%

      \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
    4. Step-by-step derivation
      1. log1p-define56.8%

        \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
    5. Simplified56.8%

      \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
    6. Taylor expanded in x around inf 43.1%

      \[\leadsto \frac{\color{blue}{\frac{1}{x}}}{n} \]
    7. Final simplification43.1%

      \[\leadsto \frac{\frac{1}{x}}{n} \]
    8. Add Preprocessing

    Reproduce

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