2nthrt (problem 3.4.6)

Percentage Accurate: 53.9% → 85.9%
Time: 39.8s
Alternatives: 21
Speedup: 1.9×

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 21 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.9% 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.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -3.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-16}:\\ \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0}\right)}^{2}\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (let* ((t_0 (pow x (/ 1.0 n))))
   (if (<= (/ 1.0 n) -3.2e-79)
     (/ (/ t_0 n) x)
     (if (<= (/ 1.0 n) 1e-16)
       (/ (log (+ 1.0 (/ 1.0 x))) n)
       (pow (sqrt (- (exp (/ (log1p x) n)) t_0)) 2.0)))))
double code(double x, double n) {
	double t_0 = pow(x, (1.0 / n));
	double tmp;
	if ((1.0 / n) <= -3.2e-79) {
		tmp = (t_0 / n) / x;
	} else if ((1.0 / n) <= 1e-16) {
		tmp = log((1.0 + (1.0 / x))) / n;
	} else {
		tmp = pow(sqrt((exp((log1p(x) / n)) - t_0)), 2.0);
	}
	return tmp;
}
public static double code(double x, double n) {
	double t_0 = Math.pow(x, (1.0 / n));
	double tmp;
	if ((1.0 / n) <= -3.2e-79) {
		tmp = (t_0 / n) / x;
	} else if ((1.0 / n) <= 1e-16) {
		tmp = Math.log((1.0 + (1.0 / x))) / n;
	} else {
		tmp = Math.pow(Math.sqrt((Math.exp((Math.log1p(x) / n)) - t_0)), 2.0);
	}
	return tmp;
}
def code(x, n):
	t_0 = math.pow(x, (1.0 / n))
	tmp = 0
	if (1.0 / n) <= -3.2e-79:
		tmp = (t_0 / n) / x
	elif (1.0 / n) <= 1e-16:
		tmp = math.log((1.0 + (1.0 / x))) / n
	else:
		tmp = math.pow(math.sqrt((math.exp((math.log1p(x) / n)) - t_0)), 2.0)
	return tmp
function code(x, n)
	t_0 = x ^ Float64(1.0 / n)
	tmp = 0.0
	if (Float64(1.0 / n) <= -3.2e-79)
		tmp = Float64(Float64(t_0 / n) / x);
	elseif (Float64(1.0 / n) <= 1e-16)
		tmp = Float64(log(Float64(1.0 + Float64(1.0 / x))) / n);
	else
		tmp = sqrt(Float64(exp(Float64(log1p(x) / n)) - t_0)) ^ 2.0;
	end
	return 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], -3.2e-79], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-16], N[(N[Log[N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], N[Power[N[Sqrt[N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {x}^{\left(\frac{1}{n}\right)}\\
\mathbf{if}\;\frac{1}{n} \leq -3.2 \cdot 10^{-79}:\\
\;\;\;\;\frac{\frac{t\_0}{n}}{x}\\

\mathbf{elif}\;\frac{1}{n} \leq 10^{-16}:\\
\;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\

\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0}\right)}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 #s(literal 1 binary64) n) < -3.19999999999999988e-79

    1. Initial program 90.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 inf 25.3%

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

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({x}^{\left(\frac{1}{n}\right)}, \frac{\mathsf{fma}\left(0.5, {n}^{-2}, \frac{-0.5}{n}\right)}{x}, \frac{{x}^{\left(\frac{1}{n}\right)}}{n}\right)}{x}} \]
      2. Taylor expanded in x around inf 96.4%

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

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

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

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

          \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
      4. Simplified96.4%

        \[\leadsto \frac{\color{blue}{\frac{e^{\frac{\log x}{n}}}{n}}}{x} \]
      5. Taylor expanded in x around inf 96.4%

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

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

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

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

          \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
        5. *-rgt-identity96.4%

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

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

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

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

      if -3.19999999999999988e-79 < (/.f64 #s(literal 1 binary64) n) < 9.9999999999999998e-17

      1. Initial program 31.8%

        \[{\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 80.0%

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

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

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

          \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(x\right) - \log x\right)\right)}}{n} \]
      7. Applied egg-rr79.4%

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

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

          \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
        3. diff-log80.3%

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

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

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

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

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

      if 9.9999999999999998e-17 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 64.4%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. add-sqr-sqrt64.4%

          \[\leadsto \color{blue}{\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}} \cdot \sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}} \]
        2. pow264.4%

          \[\leadsto \color{blue}{{\left(\sqrt{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{2}} \]
        3. pow-to-exp64.2%

          \[\leadsto {\left(\sqrt{\color{blue}{e^{\log \left(x + 1\right) \cdot \frac{1}{n}}} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{2} \]
        4. un-div-inv64.3%

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

          \[\leadsto {\left(\sqrt{e^{\frac{\log \color{blue}{\left(1 + x\right)}}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{2} \]
        6. log1p-define91.4%

          \[\leadsto {\left(\sqrt{e^{\frac{\color{blue}{\mathsf{log1p}\left(x\right)}}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{2} \]
      4. Applied egg-rr91.4%

        \[\leadsto \color{blue}{{\left(\sqrt{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{2}} \]
    5. Recombined 3 regimes into one program.
    6. Add Preprocessing

    Alternative 2: 87.6% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2200:\\ \;\;\;\;\frac{\left(\mathsf{log1p}\left(x\right) + \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) + 0.16666666666666666 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}}{n}\right) - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{e}^{\left(\frac{\log x}{n}\right)}}{n}}{x}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (if (<= x 2200.0)
       (/
        (-
         (+
          (log1p x)
          (/
           (+
            (* 0.5 (- (pow (log1p x) 2.0) (pow (log x) 2.0)))
            (*
             0.16666666666666666
             (/ (- (pow (log1p x) 3.0) (pow (log x) 3.0)) n)))
           n))
         (log x))
        n)
       (/ (/ (pow E (/ (log x) n)) n) x)))
    double code(double x, double n) {
    	double tmp;
    	if (x <= 2200.0) {
    		tmp = ((log1p(x) + (((0.5 * (pow(log1p(x), 2.0) - pow(log(x), 2.0))) + (0.16666666666666666 * ((pow(log1p(x), 3.0) - pow(log(x), 3.0)) / n))) / n)) - log(x)) / n;
    	} else {
    		tmp = (pow(((double) M_E), (log(x) / n)) / n) / x;
    	}
    	return tmp;
    }
    
    public static double code(double x, double n) {
    	double tmp;
    	if (x <= 2200.0) {
    		tmp = ((Math.log1p(x) + (((0.5 * (Math.pow(Math.log1p(x), 2.0) - Math.pow(Math.log(x), 2.0))) + (0.16666666666666666 * ((Math.pow(Math.log1p(x), 3.0) - Math.pow(Math.log(x), 3.0)) / n))) / n)) - Math.log(x)) / n;
    	} else {
    		tmp = (Math.pow(Math.E, (Math.log(x) / n)) / n) / x;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	tmp = 0
    	if x <= 2200.0:
    		tmp = ((math.log1p(x) + (((0.5 * (math.pow(math.log1p(x), 2.0) - math.pow(math.log(x), 2.0))) + (0.16666666666666666 * ((math.pow(math.log1p(x), 3.0) - math.pow(math.log(x), 3.0)) / n))) / n)) - math.log(x)) / n
    	else:
    		tmp = (math.pow(math.e, (math.log(x) / n)) / n) / x
    	return tmp
    
    function code(x, n)
    	tmp = 0.0
    	if (x <= 2200.0)
    		tmp = Float64(Float64(Float64(log1p(x) + Float64(Float64(Float64(0.5 * Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0))) + Float64(0.16666666666666666 * Float64(Float64((log1p(x) ^ 3.0) - (log(x) ^ 3.0)) / n))) / n)) - log(x)) / n);
    	else
    		tmp = Float64(Float64((exp(1) ^ Float64(log(x) / n)) / n) / x);
    	end
    	return tmp
    end
    
    code[x_, n_] := If[LessEqual[x, 2200.0], N[(N[(N[(N[Log[1 + x], $MachinePrecision] + N[(N[(N[(0.5 * N[(N[Power[N[Log[1 + x], $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.16666666666666666 * N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(N[Power[E, N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq 2200:\\
    \;\;\;\;\frac{\left(\mathsf{log1p}\left(x\right) + \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) + 0.16666666666666666 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}}{n}\right) - \log x}{n}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{{e}^{\left(\frac{\log x}{n}\right)}}{n}}{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < 2200

      1. Initial program 47.8%

        \[{\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 76.8%

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

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

      if 2200 < x

      1. Initial program 67.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 inf 81.8%

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

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({x}^{\left(\frac{1}{n}\right)}, \frac{\mathsf{fma}\left(0.5, {n}^{-2}, \frac{-0.5}{n}\right)}{x}, \frac{{x}^{\left(\frac{1}{n}\right)}}{n}\right)}{x}} \]
        2. Taylor expanded in x around inf 98.7%

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

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

            \[\leadsto \frac{\frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n}}{x} \]
          3. distribute-neg-frac98.7%

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

            \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
        4. Simplified98.7%

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

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

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

          \[\leadsto \frac{\frac{\color{blue}{{\left(e^{1}\right)}^{\left(\frac{\log x}{n}\right)}}}{n}}{x} \]
        7. Step-by-step derivation
          1. *-un-lft-identity98.7%

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

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

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

            \[\leadsto \frac{\frac{{\color{blue}{e}}^{\left(\frac{\log x}{n}\right)}}{n}}{x} \]
        10. Simplified98.7%

          \[\leadsto \frac{\frac{{\color{blue}{e}}^{\left(\frac{\log x}{n}\right)}}{n}}{x} \]
      5. Recombined 2 regimes into one program.
      6. Final simplification86.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2200:\\ \;\;\;\;\frac{\left(\mathsf{log1p}\left(x\right) + \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) + 0.16666666666666666 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}}{n}\right) - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{e}^{\left(\frac{\log x}{n}\right)}}{n}}{x}\\ \end{array} \]
      7. Add Preprocessing

      Alternative 3: 85.9% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -3.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-16}:\\ \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\ \end{array} \end{array} \]
      (FPCore (x n)
       :precision binary64
       (let* ((t_0 (pow x (/ 1.0 n))))
         (if (<= (/ 1.0 n) -3.2e-79)
           (/ (/ t_0 n) x)
           (if (<= (/ 1.0 n) 1e-16)
             (/ (log (+ 1.0 (/ 1.0 x))) n)
             (- (exp (/ (log1p x) n)) t_0)))))
      double code(double x, double n) {
      	double t_0 = pow(x, (1.0 / n));
      	double tmp;
      	if ((1.0 / n) <= -3.2e-79) {
      		tmp = (t_0 / n) / x;
      	} else if ((1.0 / n) <= 1e-16) {
      		tmp = log((1.0 + (1.0 / x))) / n;
      	} else {
      		tmp = exp((log1p(x) / n)) - t_0;
      	}
      	return tmp;
      }
      
      public static double code(double x, double n) {
      	double t_0 = Math.pow(x, (1.0 / n));
      	double tmp;
      	if ((1.0 / n) <= -3.2e-79) {
      		tmp = (t_0 / n) / x;
      	} else if ((1.0 / n) <= 1e-16) {
      		tmp = Math.log((1.0 + (1.0 / x))) / n;
      	} else {
      		tmp = Math.exp((Math.log1p(x) / n)) - t_0;
      	}
      	return tmp;
      }
      
      def code(x, n):
      	t_0 = math.pow(x, (1.0 / n))
      	tmp = 0
      	if (1.0 / n) <= -3.2e-79:
      		tmp = (t_0 / n) / x
      	elif (1.0 / n) <= 1e-16:
      		tmp = math.log((1.0 + (1.0 / x))) / n
      	else:
      		tmp = math.exp((math.log1p(x) / n)) - t_0
      	return tmp
      
      function code(x, n)
      	t_0 = x ^ Float64(1.0 / n)
      	tmp = 0.0
      	if (Float64(1.0 / n) <= -3.2e-79)
      		tmp = Float64(Float64(t_0 / n) / x);
      	elseif (Float64(1.0 / n) <= 1e-16)
      		tmp = Float64(log(Float64(1.0 + Float64(1.0 / x))) / n);
      	else
      		tmp = Float64(exp(Float64(log1p(x) / n)) - t_0);
      	end
      	return 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], -3.2e-79], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-16], N[(N[Log[N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $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 -3.2 \cdot 10^{-79}:\\
      \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
      
      \mathbf{elif}\;\frac{1}{n} \leq 10^{-16}:\\
      \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\
      
      \mathbf{else}:\\
      \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (/.f64 #s(literal 1 binary64) n) < -3.19999999999999988e-79

        1. Initial program 90.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 inf 25.3%

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

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({x}^{\left(\frac{1}{n}\right)}, \frac{\mathsf{fma}\left(0.5, {n}^{-2}, \frac{-0.5}{n}\right)}{x}, \frac{{x}^{\left(\frac{1}{n}\right)}}{n}\right)}{x}} \]
          2. Taylor expanded in x around inf 96.4%

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

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

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

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

              \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
          4. Simplified96.4%

            \[\leadsto \frac{\color{blue}{\frac{e^{\frac{\log x}{n}}}{n}}}{x} \]
          5. Taylor expanded in x around inf 96.4%

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

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

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

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

              \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
            5. *-rgt-identity96.4%

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

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

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

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

          if -3.19999999999999988e-79 < (/.f64 #s(literal 1 binary64) n) < 9.9999999999999998e-17

          1. Initial program 31.8%

            \[{\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 80.0%

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

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

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

              \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(x\right) - \log x\right)\right)}}{n} \]
          7. Applied egg-rr79.4%

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

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

              \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
            3. diff-log80.3%

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

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

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

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

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

          if 9.9999999999999998e-17 < (/.f64 #s(literal 1 binary64) n)

          1. Initial program 64.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 0 64.4%

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

              \[\leadsto e^{\frac{\color{blue}{\mathsf{log1p}\left(x\right)}}{n}} - e^{\frac{\log x}{n}} \]
            2. *-rgt-identity91.4%

              \[\leadsto e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - e^{\frac{\color{blue}{\log x \cdot 1}}{n}} \]
            3. associate-/l*91.3%

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

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

            \[\leadsto \color{blue}{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}} \]
        5. Recombined 3 regimes into one program.
        6. Add Preprocessing

        Alternative 4: 85.9% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -3.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\ \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{x}{n}} - t\_0\\ \end{array} \end{array} \]
        (FPCore (x n)
         :precision binary64
         (let* ((t_0 (pow x (/ 1.0 n))))
           (if (<= (/ 1.0 n) -3.2e-79)
             (/ (/ t_0 n) x)
             (if (<= (/ 1.0 n) 5e-11)
               (/ (log (+ 1.0 (/ 1.0 x))) n)
               (- (exp (/ x n)) t_0)))))
        double code(double x, double n) {
        	double t_0 = pow(x, (1.0 / n));
        	double tmp;
        	if ((1.0 / n) <= -3.2e-79) {
        		tmp = (t_0 / n) / x;
        	} else if ((1.0 / n) <= 5e-11) {
        		tmp = log((1.0 + (1.0 / x))) / n;
        	} else {
        		tmp = exp((x / 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) <= (-3.2d-79)) then
                tmp = (t_0 / n) / x
            else if ((1.0d0 / n) <= 5d-11) then
                tmp = log((1.0d0 + (1.0d0 / x))) / n
            else
                tmp = exp((x / 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) <= -3.2e-79) {
        		tmp = (t_0 / n) / x;
        	} else if ((1.0 / n) <= 5e-11) {
        		tmp = Math.log((1.0 + (1.0 / x))) / n;
        	} else {
        		tmp = Math.exp((x / n)) - t_0;
        	}
        	return tmp;
        }
        
        def code(x, n):
        	t_0 = math.pow(x, (1.0 / n))
        	tmp = 0
        	if (1.0 / n) <= -3.2e-79:
        		tmp = (t_0 / n) / x
        	elif (1.0 / n) <= 5e-11:
        		tmp = math.log((1.0 + (1.0 / x))) / n
        	else:
        		tmp = math.exp((x / n)) - t_0
        	return tmp
        
        function code(x, n)
        	t_0 = x ^ Float64(1.0 / n)
        	tmp = 0.0
        	if (Float64(1.0 / n) <= -3.2e-79)
        		tmp = Float64(Float64(t_0 / n) / x);
        	elseif (Float64(1.0 / n) <= 5e-11)
        		tmp = Float64(log(Float64(1.0 + Float64(1.0 / x))) / n);
        	else
        		tmp = Float64(exp(Float64(x / 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) <= -3.2e-79)
        		tmp = (t_0 / n) / x;
        	elseif ((1.0 / n) <= 5e-11)
        		tmp = log((1.0 + (1.0 / x))) / n;
        	else
        		tmp = exp((x / 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], -3.2e-79], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-11], N[(N[Log[N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(x / n), $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 -3.2 \cdot 10^{-79}:\\
        \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
        
        \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\
        \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\
        
        \mathbf{else}:\\
        \;\;\;\;e^{\frac{x}{n}} - t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (/.f64 #s(literal 1 binary64) n) < -3.19999999999999988e-79

          1. Initial program 90.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 inf 25.3%

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

              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({x}^{\left(\frac{1}{n}\right)}, \frac{\mathsf{fma}\left(0.5, {n}^{-2}, \frac{-0.5}{n}\right)}{x}, \frac{{x}^{\left(\frac{1}{n}\right)}}{n}\right)}{x}} \]
            2. Taylor expanded in x around inf 96.4%

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

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

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

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

                \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
            4. Simplified96.4%

              \[\leadsto \frac{\color{blue}{\frac{e^{\frac{\log x}{n}}}{n}}}{x} \]
            5. Taylor expanded in x around inf 96.4%

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

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

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

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

                \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
              5. *-rgt-identity96.4%

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

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

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

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

            if -3.19999999999999988e-79 < (/.f64 #s(literal 1 binary64) n) < 5.00000000000000018e-11

            1. Initial program 31.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 79.4%

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

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

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

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

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

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

                \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
              3. diff-log79.7%

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

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

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

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

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

            if 5.00000000000000018e-11 < (/.f64 #s(literal 1 binary64) n)

            1. Initial program 66.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 0 66.0%

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

                \[\leadsto e^{\frac{\color{blue}{\mathsf{log1p}\left(x\right)}}{n}} - e^{\frac{\log x}{n}} \]
              2. *-rgt-identity93.8%

                \[\leadsto e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - e^{\frac{\color{blue}{\log x \cdot 1}}{n}} \]
              3. associate-/l*93.8%

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

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

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

              \[\leadsto e^{\frac{\color{blue}{x}}{n}} - {x}^{\left(\frac{1}{n}\right)} \]
          5. Recombined 3 regimes into one program.
          6. Add Preprocessing

          Alternative 5: 66.8% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{+206}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{+24}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\ \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+142}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\frac{0.25}{x \cdot n}}{x} - \frac{0.5}{n}}{x} + \frac{-1}{n}}{x}\\ \end{array} \end{array} \]
          (FPCore (x n)
           :precision binary64
           (let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))))
             (if (<= (/ 1.0 n) -2e+206)
               (/ (log (/ x x)) n)
               (if (<= (/ 1.0 n) -1e+24)
                 t_0
                 (if (<= (/ 1.0 n) 5e-11)
                   (/ (log (+ 1.0 (/ 1.0 x))) n)
                   (if (<= (/ 1.0 n) 2e+142)
                     t_0
                     (/
                      (+ (/ (- (/ (/ 0.25 (* x n)) x) (/ 0.5 n)) x) (/ -1.0 n))
                      x)))))))
          double code(double x, double n) {
          	double t_0 = 1.0 - pow(x, (1.0 / n));
          	double tmp;
          	if ((1.0 / n) <= -2e+206) {
          		tmp = log((x / x)) / n;
          	} else if ((1.0 / n) <= -1e+24) {
          		tmp = t_0;
          	} else if ((1.0 / n) <= 5e-11) {
          		tmp = log((1.0 + (1.0 / x))) / n;
          	} else if ((1.0 / n) <= 2e+142) {
          		tmp = t_0;
          	} else {
          		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / 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 = 1.0d0 - (x ** (1.0d0 / n))
              if ((1.0d0 / n) <= (-2d+206)) then
                  tmp = log((x / x)) / n
              else if ((1.0d0 / n) <= (-1d+24)) then
                  tmp = t_0
              else if ((1.0d0 / n) <= 5d-11) then
                  tmp = log((1.0d0 + (1.0d0 / x))) / n
              else if ((1.0d0 / n) <= 2d+142) then
                  tmp = t_0
              else
                  tmp = (((((0.25d0 / (x * n)) / x) - (0.5d0 / n)) / x) + ((-1.0d0) / n)) / 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) <= -2e+206) {
          		tmp = Math.log((x / x)) / n;
          	} else if ((1.0 / n) <= -1e+24) {
          		tmp = t_0;
          	} else if ((1.0 / n) <= 5e-11) {
          		tmp = Math.log((1.0 + (1.0 / x))) / n;
          	} else if ((1.0 / n) <= 2e+142) {
          		tmp = t_0;
          	} else {
          		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / n)) / x;
          	}
          	return tmp;
          }
          
          def code(x, n):
          	t_0 = 1.0 - math.pow(x, (1.0 / n))
          	tmp = 0
          	if (1.0 / n) <= -2e+206:
          		tmp = math.log((x / x)) / n
          	elif (1.0 / n) <= -1e+24:
          		tmp = t_0
          	elif (1.0 / n) <= 5e-11:
          		tmp = math.log((1.0 + (1.0 / x))) / n
          	elif (1.0 / n) <= 2e+142:
          		tmp = t_0
          	else:
          		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / n)) / 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) <= -2e+206)
          		tmp = Float64(log(Float64(x / x)) / n);
          	elseif (Float64(1.0 / n) <= -1e+24)
          		tmp = t_0;
          	elseif (Float64(1.0 / n) <= 5e-11)
          		tmp = Float64(log(Float64(1.0 + Float64(1.0 / x))) / n);
          	elseif (Float64(1.0 / n) <= 2e+142)
          		tmp = t_0;
          	else
          		tmp = Float64(Float64(Float64(Float64(Float64(Float64(0.25 / Float64(x * n)) / x) - Float64(0.5 / n)) / x) + Float64(-1.0 / n)) / 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) <= -2e+206)
          		tmp = log((x / x)) / n;
          	elseif ((1.0 / n) <= -1e+24)
          		tmp = t_0;
          	elseif ((1.0 / n) <= 5e-11)
          		tmp = log((1.0 + (1.0 / x))) / n;
          	elseif ((1.0 / n) <= 2e+142)
          		tmp = t_0;
          	else
          		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / n)) / 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], -2e+206], N[(N[Log[N[(x / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e+24], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-11], N[(N[Log[N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+142], t$95$0, N[(N[(N[(N[(N[(N[(0.25 / N[(x * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - N[(0.5 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(-1.0 / n), $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 -2 \cdot 10^{+206}:\\
          \;\;\;\;\frac{\log \left(\frac{x}{x}\right)}{n}\\
          
          \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{+24}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\
          \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\
          
          \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+142}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{\frac{\frac{0.25}{x \cdot n}}{x} - \frac{0.5}{n}}{x} + \frac{-1}{n}}{x}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if (/.f64 #s(literal 1 binary64) n) < -2.0000000000000001e206

            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 55.8%

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

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

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

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

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

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

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

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

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

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

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

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

            if -2.0000000000000001e206 < (/.f64 #s(literal 1 binary64) n) < -9.9999999999999998e23 or 5.00000000000000018e-11 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e142

            1. Initial program 93.0%

              \[{\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 69.1%

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

                \[\leadsto 1 - e^{\frac{\color{blue}{\log x \cdot 1}}{n}} \]
              2. associate-/l*69.1%

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

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

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

            if -9.9999999999999998e23 < (/.f64 #s(literal 1 binary64) n) < 5.00000000000000018e-11

            1. Initial program 33.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 77.0%

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

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

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

                \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(x\right) - \log x\right)\right)}}{n} \]
            7. Applied egg-rr76.4%

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

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

                \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
              3. diff-log77.3%

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

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

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

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

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

            if 2.0000000000000001e142 < (/.f64 #s(literal 1 binary64) n)

            1. Initial program 24.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 5.6%

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

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

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

              \[\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-neg0.1%

                \[\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. Simplified0.1%

              \[\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}} \]
            9. Step-by-step derivation
              1. add-sqr-sqrt0.0%

                \[\leadsto \color{blue}{\sqrt{-\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}} \cdot \sqrt{-\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}}} \]
              2. sqrt-unprod78.5%

                \[\leadsto \color{blue}{\sqrt{\left(-\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}\right) \cdot \left(-\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}\right)}} \]
              3. sqr-neg78.5%

                \[\leadsto \sqrt{\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} \cdot \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}}} \]
              4. sqrt-unprod78.5%

                \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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}}} \]
              5. add-sqr-sqrt78.5%

                \[\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}} \]
            10. Applied egg-rr78.5%

              \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x}} \]
            11. Taylor expanded in x around 0 78.5%

              \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{0.25}{n \cdot x}}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x} \]
          3. Recombined 4 regimes into one program.
          4. Final simplification73.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -2 \cdot 10^{+206}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{+24}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\ \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+142}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\frac{0.25}{x \cdot n}}{x} - \frac{0.5}{n}}{x} + \frac{-1}{n}}{x}\\ \end{array} \]
          5. Add Preprocessing

          Alternative 6: 81.6% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -3.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\ \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+142}:\\ \;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\frac{0.25}{x \cdot n}}{x} - \frac{0.5}{n}}{x} + \frac{-1}{n}}{x}\\ \end{array} \end{array} \]
          (FPCore (x n)
           :precision binary64
           (let* ((t_0 (pow x (/ 1.0 n))))
             (if (<= (/ 1.0 n) -3.2e-79)
               (/ (/ t_0 n) x)
               (if (<= (/ 1.0 n) 5e-11)
                 (/ (log (+ 1.0 (/ 1.0 x))) n)
                 (if (<= (/ 1.0 n) 2e+142)
                   (- (+ 1.0 (/ x n)) t_0)
                   (/ (+ (/ (- (/ (/ 0.25 (* x n)) x) (/ 0.5 n)) x) (/ -1.0 n)) x))))))
          double code(double x, double n) {
          	double t_0 = pow(x, (1.0 / n));
          	double tmp;
          	if ((1.0 / n) <= -3.2e-79) {
          		tmp = (t_0 / n) / x;
          	} else if ((1.0 / n) <= 5e-11) {
          		tmp = log((1.0 + (1.0 / x))) / n;
          	} else if ((1.0 / n) <= 2e+142) {
          		tmp = (1.0 + (x / n)) - t_0;
          	} else {
          		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / 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) <= (-3.2d-79)) then
                  tmp = (t_0 / n) / x
              else if ((1.0d0 / n) <= 5d-11) then
                  tmp = log((1.0d0 + (1.0d0 / x))) / n
              else if ((1.0d0 / n) <= 2d+142) then
                  tmp = (1.0d0 + (x / n)) - t_0
              else
                  tmp = (((((0.25d0 / (x * n)) / x) - (0.5d0 / n)) / x) + ((-1.0d0) / 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) <= -3.2e-79) {
          		tmp = (t_0 / n) / x;
          	} else if ((1.0 / n) <= 5e-11) {
          		tmp = Math.log((1.0 + (1.0 / x))) / n;
          	} else if ((1.0 / n) <= 2e+142) {
          		tmp = (1.0 + (x / n)) - t_0;
          	} else {
          		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / n)) / x;
          	}
          	return tmp;
          }
          
          def code(x, n):
          	t_0 = math.pow(x, (1.0 / n))
          	tmp = 0
          	if (1.0 / n) <= -3.2e-79:
          		tmp = (t_0 / n) / x
          	elif (1.0 / n) <= 5e-11:
          		tmp = math.log((1.0 + (1.0 / x))) / n
          	elif (1.0 / n) <= 2e+142:
          		tmp = (1.0 + (x / n)) - t_0
          	else:
          		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / n)) / x
          	return tmp
          
          function code(x, n)
          	t_0 = x ^ Float64(1.0 / n)
          	tmp = 0.0
          	if (Float64(1.0 / n) <= -3.2e-79)
          		tmp = Float64(Float64(t_0 / n) / x);
          	elseif (Float64(1.0 / n) <= 5e-11)
          		tmp = Float64(log(Float64(1.0 + Float64(1.0 / x))) / n);
          	elseif (Float64(1.0 / n) <= 2e+142)
          		tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0);
          	else
          		tmp = Float64(Float64(Float64(Float64(Float64(Float64(0.25 / Float64(x * n)) / x) - Float64(0.5 / n)) / x) + Float64(-1.0 / n)) / x);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, n)
          	t_0 = x ^ (1.0 / n);
          	tmp = 0.0;
          	if ((1.0 / n) <= -3.2e-79)
          		tmp = (t_0 / n) / x;
          	elseif ((1.0 / n) <= 5e-11)
          		tmp = log((1.0 + (1.0 / x))) / n;
          	elseif ((1.0 / n) <= 2e+142)
          		tmp = (1.0 + (x / n)) - t_0;
          	else
          		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / 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], -3.2e-79], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-11], N[(N[Log[N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+142], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.25 / N[(x * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - N[(0.5 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(-1.0 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := {x}^{\left(\frac{1}{n}\right)}\\
          \mathbf{if}\;\frac{1}{n} \leq -3.2 \cdot 10^{-79}:\\
          \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
          
          \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\
          \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\
          
          \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+142}:\\
          \;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{\frac{\frac{0.25}{x \cdot n}}{x} - \frac{0.5}{n}}{x} + \frac{-1}{n}}{x}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if (/.f64 #s(literal 1 binary64) n) < -3.19999999999999988e-79

            1. Initial program 90.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 inf 25.3%

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

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({x}^{\left(\frac{1}{n}\right)}, \frac{\mathsf{fma}\left(0.5, {n}^{-2}, \frac{-0.5}{n}\right)}{x}, \frac{{x}^{\left(\frac{1}{n}\right)}}{n}\right)}{x}} \]
              2. Taylor expanded in x around inf 96.4%

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

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

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

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

                  \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
              4. Simplified96.4%

                \[\leadsto \frac{\color{blue}{\frac{e^{\frac{\log x}{n}}}{n}}}{x} \]
              5. Taylor expanded in x around inf 96.4%

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

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

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

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

                  \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
                5. *-rgt-identity96.4%

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

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

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

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

              if -3.19999999999999988e-79 < (/.f64 #s(literal 1 binary64) n) < 5.00000000000000018e-11

              1. Initial program 31.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 79.4%

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

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

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

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

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

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

                  \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
                3. diff-log79.7%

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

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

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

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

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

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

              1. Initial program 80.3%

                \[{\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 73.5%

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

              if 2.0000000000000001e142 < (/.f64 #s(literal 1 binary64) n)

              1. Initial program 24.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 5.6%

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

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

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

                \[\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-neg0.1%

                  \[\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. Simplified0.1%

                \[\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}} \]
              9. Step-by-step derivation
                1. add-sqr-sqrt0.0%

                  \[\leadsto \color{blue}{\sqrt{-\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}} \cdot \sqrt{-\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}}} \]
                2. sqrt-unprod78.5%

                  \[\leadsto \color{blue}{\sqrt{\left(-\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}\right) \cdot \left(-\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}\right)}} \]
                3. sqr-neg78.5%

                  \[\leadsto \sqrt{\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} \cdot \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}}} \]
                4. sqrt-unprod78.5%

                  \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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}}} \]
                5. add-sqr-sqrt78.5%

                  \[\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}} \]
              10. Applied egg-rr78.5%

                \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x}} \]
              11. Taylor expanded in x around 0 78.5%

                \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{0.25}{n \cdot x}}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x} \]
            5. Recombined 4 regimes into one program.
            6. Final simplification84.7%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -3.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\ \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+142}:\\ \;\;\;\;\left(1 + \frac{x}{n}\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\frac{0.25}{x \cdot n}}{x} - \frac{0.5}{n}}{x} + \frac{-1}{n}}{x}\\ \end{array} \]
            7. Add Preprocessing

            Alternative 7: 81.5% accurate, 1.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -3.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\ \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+142}:\\ \;\;\;\;1 - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\frac{0.25}{x \cdot n}}{x} - \frac{0.5}{n}}{x} + \frac{-1}{n}}{x}\\ \end{array} \end{array} \]
            (FPCore (x n)
             :precision binary64
             (let* ((t_0 (pow x (/ 1.0 n))))
               (if (<= (/ 1.0 n) -3.2e-79)
                 (/ (/ t_0 n) x)
                 (if (<= (/ 1.0 n) 5e-11)
                   (/ (log (+ 1.0 (/ 1.0 x))) n)
                   (if (<= (/ 1.0 n) 2e+142)
                     (- 1.0 t_0)
                     (/ (+ (/ (- (/ (/ 0.25 (* x n)) x) (/ 0.5 n)) x) (/ -1.0 n)) x))))))
            double code(double x, double n) {
            	double t_0 = pow(x, (1.0 / n));
            	double tmp;
            	if ((1.0 / n) <= -3.2e-79) {
            		tmp = (t_0 / n) / x;
            	} else if ((1.0 / n) <= 5e-11) {
            		tmp = log((1.0 + (1.0 / x))) / n;
            	} else if ((1.0 / n) <= 2e+142) {
            		tmp = 1.0 - t_0;
            	} else {
            		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / 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) <= (-3.2d-79)) then
                    tmp = (t_0 / n) / x
                else if ((1.0d0 / n) <= 5d-11) then
                    tmp = log((1.0d0 + (1.0d0 / x))) / n
                else if ((1.0d0 / n) <= 2d+142) then
                    tmp = 1.0d0 - t_0
                else
                    tmp = (((((0.25d0 / (x * n)) / x) - (0.5d0 / n)) / x) + ((-1.0d0) / 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) <= -3.2e-79) {
            		tmp = (t_0 / n) / x;
            	} else if ((1.0 / n) <= 5e-11) {
            		tmp = Math.log((1.0 + (1.0 / x))) / n;
            	} else if ((1.0 / n) <= 2e+142) {
            		tmp = 1.0 - t_0;
            	} else {
            		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / n)) / x;
            	}
            	return tmp;
            }
            
            def code(x, n):
            	t_0 = math.pow(x, (1.0 / n))
            	tmp = 0
            	if (1.0 / n) <= -3.2e-79:
            		tmp = (t_0 / n) / x
            	elif (1.0 / n) <= 5e-11:
            		tmp = math.log((1.0 + (1.0 / x))) / n
            	elif (1.0 / n) <= 2e+142:
            		tmp = 1.0 - t_0
            	else:
            		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / n)) / x
            	return tmp
            
            function code(x, n)
            	t_0 = x ^ Float64(1.0 / n)
            	tmp = 0.0
            	if (Float64(1.0 / n) <= -3.2e-79)
            		tmp = Float64(Float64(t_0 / n) / x);
            	elseif (Float64(1.0 / n) <= 5e-11)
            		tmp = Float64(log(Float64(1.0 + Float64(1.0 / x))) / n);
            	elseif (Float64(1.0 / n) <= 2e+142)
            		tmp = Float64(1.0 - t_0);
            	else
            		tmp = Float64(Float64(Float64(Float64(Float64(Float64(0.25 / Float64(x * n)) / x) - Float64(0.5 / n)) / x) + Float64(-1.0 / n)) / x);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, n)
            	t_0 = x ^ (1.0 / n);
            	tmp = 0.0;
            	if ((1.0 / n) <= -3.2e-79)
            		tmp = (t_0 / n) / x;
            	elseif ((1.0 / n) <= 5e-11)
            		tmp = log((1.0 + (1.0 / x))) / n;
            	elseif ((1.0 / n) <= 2e+142)
            		tmp = 1.0 - t_0;
            	else
            		tmp = (((((0.25 / (x * n)) / x) - (0.5 / n)) / x) + (-1.0 / 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], -3.2e-79], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-11], N[(N[Log[N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+142], N[(1.0 - t$95$0), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.25 / N[(x * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - N[(0.5 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(-1.0 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := {x}^{\left(\frac{1}{n}\right)}\\
            \mathbf{if}\;\frac{1}{n} \leq -3.2 \cdot 10^{-79}:\\
            \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
            
            \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\
            \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\
            
            \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+142}:\\
            \;\;\;\;1 - t\_0\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\frac{\frac{\frac{0.25}{x \cdot n}}{x} - \frac{0.5}{n}}{x} + \frac{-1}{n}}{x}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if (/.f64 #s(literal 1 binary64) n) < -3.19999999999999988e-79

              1. Initial program 90.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 inf 25.3%

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

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({x}^{\left(\frac{1}{n}\right)}, \frac{\mathsf{fma}\left(0.5, {n}^{-2}, \frac{-0.5}{n}\right)}{x}, \frac{{x}^{\left(\frac{1}{n}\right)}}{n}\right)}{x}} \]
                2. Taylor expanded in x around inf 96.4%

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

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

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

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

                    \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
                4. Simplified96.4%

                  \[\leadsto \frac{\color{blue}{\frac{e^{\frac{\log x}{n}}}{n}}}{x} \]
                5. Taylor expanded in x around inf 96.4%

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

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

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

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

                    \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
                  5. *-rgt-identity96.4%

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

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

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

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

                if -3.19999999999999988e-79 < (/.f64 #s(literal 1 binary64) n) < 5.00000000000000018e-11

                1. Initial program 31.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 79.4%

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

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

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

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

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

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

                    \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
                  3. diff-log79.7%

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

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

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

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

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

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

                1. Initial program 80.3%

                  \[{\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 72.7%

                  \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
                4. Step-by-step derivation
                  1. *-rgt-identity72.7%

                    \[\leadsto 1 - e^{\frac{\color{blue}{\log x \cdot 1}}{n}} \]
                  2. associate-/l*72.7%

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

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

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

                if 2.0000000000000001e142 < (/.f64 #s(literal 1 binary64) n)

                1. Initial program 24.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 5.6%

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

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

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

                  \[\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-neg0.1%

                    \[\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. Simplified0.1%

                  \[\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}} \]
                9. Step-by-step derivation
                  1. add-sqr-sqrt0.0%

                    \[\leadsto \color{blue}{\sqrt{-\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}} \cdot \sqrt{-\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}}} \]
                  2. sqrt-unprod78.5%

                    \[\leadsto \color{blue}{\sqrt{\left(-\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}\right) \cdot \left(-\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}\right)}} \]
                  3. sqr-neg78.5%

                    \[\leadsto \sqrt{\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} \cdot \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}}} \]
                  4. sqrt-unprod78.5%

                    \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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}}} \]
                  5. add-sqr-sqrt78.5%

                    \[\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}} \]
                10. Applied egg-rr78.5%

                  \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x}} \]
                11. Taylor expanded in x around 0 78.5%

                  \[\leadsto \frac{\frac{\frac{\color{blue}{\frac{0.25}{n \cdot x}}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x} \]
              5. Recombined 4 regimes into one program.
              6. Final simplification84.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -3.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-11}:\\ \;\;\;\;\frac{\log \left(1 + \frac{1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+142}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\frac{0.25}{x \cdot n}}{x} - \frac{0.5}{n}}{x} + \frac{-1}{n}}{x}\\ \end{array} \]
              7. Add Preprocessing

              Alternative 8: 56.9% accurate, 1.8× speedup?

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

                1. Initial program 44.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 56.7%

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

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

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

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

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

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

                if 1.15e-94 < x < 8.6000000000000002e-7

                1. Initial program 60.0%

                  \[{\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 54.9%

                  \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
                4. Step-by-step derivation
                  1. *-rgt-identity54.9%

                    \[\leadsto 1 - e^{\frac{\color{blue}{\log x \cdot 1}}{n}} \]
                  2. associate-/l*54.9%

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

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

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

                if 8.6000000000000002e-7 < x < 2.20000000000000006e164

                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 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. Step-by-step derivation
                  1. expm1-log1p-u53.6%

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

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

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

                    \[\leadsto \frac{\color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{x}}}{n} \]
                  2. distribute-neg-frac269.3%

                    \[\leadsto \frac{\color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{-x}}}{n} \]
                  3. sub-neg69.3%

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\frac{\frac{\frac{-0.3333333333333333}{x} + \color{blue}{0.5}}{x} + \left(-1\right)}{-x}}{n} \]
                  14. metadata-eval69.3%

                    \[\leadsto \frac{\frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + \color{blue}{-1}}{-x}}{n} \]
                10. Simplified69.3%

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

                if 2.20000000000000006e164 < x

                1. Initial program 83.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 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. Step-by-step derivation
                  1. expm1-log1p-u83.7%

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

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

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

                    \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
                  3. diff-log83.7%

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.15 \cdot 10^{-94}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 8.6 \cdot 10^{-7}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{\frac{0.5 + \frac{-0.3333333333333333}{x}}{x} + -1}{-x}}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x}\right)}{n}\\ \end{array} \]
              5. Add Preprocessing

              Alternative 9: 58.4% accurate, 1.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{-0.5}{n}\\ \mathbf{if}\;x \leq 5 \cdot 10^{-96}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 0.62:\\ \;\;\;\;\frac{\frac{n - \frac{x}{t\_0}}{\frac{x \cdot n}{t\_0}}}{x}\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{+163}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x}\right)}{n}\\ \end{array} \end{array} \]
              (FPCore (x n)
               :precision binary64
               (let* ((t_0 (+ (/ (+ -0.3333333333333333 (/ 0.25 x)) (* x n)) (/ -0.5 n))))
                 (if (<= x 5e-96)
                   (/ (log x) (- n))
                   (if (<= x 0.62)
                     (/ (/ (- n (/ x t_0)) (/ (* x n) t_0)) x)
                     (if (<= x 9.5e+163)
                       (/
                        (/
                         (+
                          1.0
                          (/ (- (/ (+ 0.3333333333333333 (* 0.25 (/ -1.0 x))) x) 0.5) x))
                         x)
                        n)
                       (/ (log (/ x x)) n))))))
              double code(double x, double n) {
              	double t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n);
              	double tmp;
              	if (x <= 5e-96) {
              		tmp = log(x) / -n;
              	} else if (x <= 0.62) {
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x;
              	} else if (x <= 9.5e+163) {
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	} else {
              		tmp = log((x / x)) / n;
              	}
              	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) + (0.25d0 / x)) / (x * n)) + ((-0.5d0) / n)
                  if (x <= 5d-96) then
                      tmp = log(x) / -n
                  else if (x <= 0.62d0) then
                      tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x
                  else if (x <= 9.5d+163) then
                      tmp = ((1.0d0 + ((((0.3333333333333333d0 + (0.25d0 * ((-1.0d0) / x))) / x) - 0.5d0) / x)) / x) / n
                  else
                      tmp = log((x / x)) / n
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double n) {
              	double t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n);
              	double tmp;
              	if (x <= 5e-96) {
              		tmp = Math.log(x) / -n;
              	} else if (x <= 0.62) {
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x;
              	} else if (x <= 9.5e+163) {
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	} else {
              		tmp = Math.log((x / x)) / n;
              	}
              	return tmp;
              }
              
              def code(x, n):
              	t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n)
              	tmp = 0
              	if x <= 5e-96:
              		tmp = math.log(x) / -n
              	elif x <= 0.62:
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x
              	elif x <= 9.5e+163:
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n
              	else:
              		tmp = math.log((x / x)) / n
              	return tmp
              
              function code(x, n)
              	t_0 = Float64(Float64(Float64(-0.3333333333333333 + Float64(0.25 / x)) / Float64(x * n)) + Float64(-0.5 / n))
              	tmp = 0.0
              	if (x <= 5e-96)
              		tmp = Float64(log(x) / Float64(-n));
              	elseif (x <= 0.62)
              		tmp = Float64(Float64(Float64(n - Float64(x / t_0)) / Float64(Float64(x * n) / t_0)) / x);
              	elseif (x <= 9.5e+163)
              		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(Float64(0.3333333333333333 + Float64(0.25 * Float64(-1.0 / x))) / x) - 0.5) / x)) / x) / n);
              	else
              		tmp = Float64(log(Float64(x / x)) / n);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, n)
              	t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n);
              	tmp = 0.0;
              	if (x <= 5e-96)
              		tmp = log(x) / -n;
              	elseif (x <= 0.62)
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x;
              	elseif (x <= 9.5e+163)
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	else
              		tmp = log((x / x)) / n;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, n_] := Block[{t$95$0 = N[(N[(N[(-0.3333333333333333 + N[(0.25 / x), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision] + N[(-0.5 / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 5e-96], N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision], If[LessEqual[x, 0.62], N[(N[(N[(n - N[(x / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(x * n), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 9.5e+163], N[(N[(N[(1.0 + N[(N[(N[(N[(0.3333333333333333 + N[(0.25 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], N[(N[Log[N[(x / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{-0.5}{n}\\
              \mathbf{if}\;x \leq 5 \cdot 10^{-96}:\\
              \;\;\;\;\frac{\log x}{-n}\\
              
              \mathbf{elif}\;x \leq 0.62:\\
              \;\;\;\;\frac{\frac{n - \frac{x}{t\_0}}{\frac{x \cdot n}{t\_0}}}{x}\\
              
              \mathbf{elif}\;x \leq 9.5 \cdot 10^{+163}:\\
              \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\log \left(\frac{x}{x}\right)}{n}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if x < 4.99999999999999995e-96

                1. Initial program 44.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 56.7%

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

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

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

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

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

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

                if 4.99999999999999995e-96 < x < 0.619999999999999996

                1. Initial program 57.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 35.8%

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

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

                  \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
                6. Taylor expanded in x around -inf 0.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-neg0.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. Simplified0.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}} \]
                9. Step-by-step derivation
                  1. add-sqr-sqrt0.4%

                    \[\leadsto \color{blue}{\sqrt{-\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}} \cdot \sqrt{-\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}}} \]
                  2. sqrt-unprod14.1%

                    \[\leadsto \color{blue}{\sqrt{\left(-\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}\right) \cdot \left(-\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}\right)}} \]
                  3. sqr-neg14.1%

                    \[\leadsto \sqrt{\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} \cdot \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}}} \]
                  4. sqrt-unprod9.0%

                    \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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}}} \]
                  5. add-sqr-sqrt36.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}} \]
                10. Applied egg-rr36.3%

                  \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x}} \]
                11. Step-by-step derivation
                  1. clear-num36.3%

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

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

                    \[\leadsto \frac{\frac{\color{blue}{n} - \frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot 1}{\frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot n}}{x} \]
                  4. associate-/l/50.8%

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

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

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{\frac{0.25}{x} + \color{blue}{-0.3333333333333333}}{x \cdot n} - \frac{0.5}{n}} \cdot 1}{\frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot n}}{x} \]
                12. Applied egg-rr50.8%

                  \[\leadsto \frac{\color{blue}{\frac{n - \frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot 1}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}}{x} \]
                13. Step-by-step derivation
                  1. *-rgt-identity50.8%

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{-0.3333333333333333 + \frac{\color{blue}{0.25}}{x}}{x \cdot n} + \left(-\frac{0.5}{n}\right)}}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}{x} \]
                  10. distribute-neg-frac50.8%

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \color{blue}{\frac{-0.5}{n}}}}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}{x} \]
                  11. metadata-eval50.8%

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{\color{blue}{-0.5}}{n}}}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}{x} \]
                14. Simplified50.8%

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

                if 0.619999999999999996 < x < 9.50000000000000053e163

                1. Initial program 51.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 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 71.3%

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

                if 9.50000000000000053e163 < x

                1. Initial program 83.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 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. Step-by-step derivation
                  1. expm1-log1p-u83.7%

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

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

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

                    \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
                  3. diff-log83.7%

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{-96}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 0.62:\\ \;\;\;\;\frac{\frac{n - \frac{x}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{-0.5}{n}}}{\frac{x \cdot n}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{-0.5}{n}}}}{x}\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{+163}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x}\right)}{n}\\ \end{array} \]
              5. Add Preprocessing

              Alternative 10: 54.5% accurate, 1.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{-0.5}{n}\\ \mathbf{if}\;x \leq 1.2 \cdot 10^{-94}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 0.62:\\ \;\;\;\;\frac{\frac{n - \frac{x}{t\_0}}{\frac{x \cdot n}{t\_0}}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \end{array} \]
              (FPCore (x n)
               :precision binary64
               (let* ((t_0 (+ (/ (+ -0.3333333333333333 (/ 0.25 x)) (* x n)) (/ -0.5 n))))
                 (if (<= x 1.2e-94)
                   (/ (log x) (- n))
                   (if (<= x 0.62)
                     (/ (/ (- n (/ x t_0)) (/ (* x n) t_0)) x)
                     (/
                      (/
                       (+ 1.0 (/ (- (/ (+ 0.3333333333333333 (* 0.25 (/ -1.0 x))) x) 0.5) x))
                       x)
                      n)))))
              double code(double x, double n) {
              	double t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n);
              	double tmp;
              	if (x <= 1.2e-94) {
              		tmp = log(x) / -n;
              	} else if (x <= 0.62) {
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x;
              	} else {
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	}
              	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) + (0.25d0 / x)) / (x * n)) + ((-0.5d0) / n)
                  if (x <= 1.2d-94) then
                      tmp = log(x) / -n
                  else if (x <= 0.62d0) then
                      tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x
                  else
                      tmp = ((1.0d0 + ((((0.3333333333333333d0 + (0.25d0 * ((-1.0d0) / x))) / x) - 0.5d0) / x)) / x) / n
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double n) {
              	double t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n);
              	double tmp;
              	if (x <= 1.2e-94) {
              		tmp = Math.log(x) / -n;
              	} else if (x <= 0.62) {
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x;
              	} else {
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	}
              	return tmp;
              }
              
              def code(x, n):
              	t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n)
              	tmp = 0
              	if x <= 1.2e-94:
              		tmp = math.log(x) / -n
              	elif x <= 0.62:
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x
              	else:
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n
              	return tmp
              
              function code(x, n)
              	t_0 = Float64(Float64(Float64(-0.3333333333333333 + Float64(0.25 / x)) / Float64(x * n)) + Float64(-0.5 / n))
              	tmp = 0.0
              	if (x <= 1.2e-94)
              		tmp = Float64(log(x) / Float64(-n));
              	elseif (x <= 0.62)
              		tmp = Float64(Float64(Float64(n - Float64(x / t_0)) / Float64(Float64(x * n) / t_0)) / x);
              	else
              		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(Float64(0.3333333333333333 + Float64(0.25 * Float64(-1.0 / x))) / x) - 0.5) / x)) / x) / n);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, n)
              	t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n);
              	tmp = 0.0;
              	if (x <= 1.2e-94)
              		tmp = log(x) / -n;
              	elseif (x <= 0.62)
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x;
              	else
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, n_] := Block[{t$95$0 = N[(N[(N[(-0.3333333333333333 + N[(0.25 / x), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision] + N[(-0.5 / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.2e-94], N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision], If[LessEqual[x, 0.62], N[(N[(N[(n - N[(x / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(x * n), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(N[(N[(0.3333333333333333 + N[(0.25 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{-0.5}{n}\\
              \mathbf{if}\;x \leq 1.2 \cdot 10^{-94}:\\
              \;\;\;\;\frac{\log x}{-n}\\
              
              \mathbf{elif}\;x \leq 0.62:\\
              \;\;\;\;\frac{\frac{n - \frac{x}{t\_0}}{\frac{x \cdot n}{t\_0}}}{x}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if x < 1.2e-94

                1. Initial program 44.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 56.7%

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

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

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

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

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

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

                if 1.2e-94 < x < 0.619999999999999996

                1. Initial program 57.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 35.8%

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

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

                  \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
                6. Taylor expanded in x around -inf 0.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-neg0.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. Simplified0.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}} \]
                9. Step-by-step derivation
                  1. add-sqr-sqrt0.4%

                    \[\leadsto \color{blue}{\sqrt{-\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}} \cdot \sqrt{-\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}}} \]
                  2. sqrt-unprod14.1%

                    \[\leadsto \color{blue}{\sqrt{\left(-\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}\right) \cdot \left(-\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}\right)}} \]
                  3. sqr-neg14.1%

                    \[\leadsto \sqrt{\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} \cdot \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}}} \]
                  4. sqrt-unprod9.0%

                    \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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}}} \]
                  5. add-sqr-sqrt36.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}} \]
                10. Applied egg-rr36.3%

                  \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x}} \]
                11. Step-by-step derivation
                  1. clear-num36.3%

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

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

                    \[\leadsto \frac{\frac{\color{blue}{n} - \frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot 1}{\frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot n}}{x} \]
                  4. associate-/l/50.8%

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

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

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{\frac{0.25}{x} + \color{blue}{-0.3333333333333333}}{x \cdot n} - \frac{0.5}{n}} \cdot 1}{\frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot n}}{x} \]
                12. Applied egg-rr50.8%

                  \[\leadsto \frac{\color{blue}{\frac{n - \frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot 1}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}}{x} \]
                13. Step-by-step derivation
                  1. *-rgt-identity50.8%

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{-0.3333333333333333 + \frac{\color{blue}{0.25}}{x}}{x \cdot n} + \left(-\frac{0.5}{n}\right)}}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}{x} \]
                  10. distribute-neg-frac50.8%

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \color{blue}{\frac{-0.5}{n}}}}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}{x} \]
                  11. metadata-eval50.8%

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{\color{blue}{-0.5}}{n}}}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}{x} \]
                14. Simplified50.8%

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

                if 0.619999999999999996 < x

                1. Initial program 66.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 66.8%

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.2 \cdot 10^{-94}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 0.62:\\ \;\;\;\;\frac{\frac{n - \frac{x}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{-0.5}{n}}}{\frac{x \cdot n}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{-0.5}{n}}}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \]
              5. Add Preprocessing

              Alternative 11: 49.4% accurate, 5.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{-0.5}{n}\\ \mathbf{if}\;x \leq 0.62:\\ \;\;\;\;\frac{\frac{n - \frac{x}{t\_0}}{\frac{x \cdot n}{t\_0}}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \end{array} \]
              (FPCore (x n)
               :precision binary64
               (let* ((t_0 (+ (/ (+ -0.3333333333333333 (/ 0.25 x)) (* x n)) (/ -0.5 n))))
                 (if (<= x 0.62)
                   (/ (/ (- n (/ x t_0)) (/ (* x n) t_0)) x)
                   (/
                    (/
                     (+ 1.0 (/ (- (/ (+ 0.3333333333333333 (* 0.25 (/ -1.0 x))) x) 0.5) x))
                     x)
                    n))))
              double code(double x, double n) {
              	double t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n);
              	double tmp;
              	if (x <= 0.62) {
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x;
              	} else {
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	}
              	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) + (0.25d0 / x)) / (x * n)) + ((-0.5d0) / n)
                  if (x <= 0.62d0) then
                      tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x
                  else
                      tmp = ((1.0d0 + ((((0.3333333333333333d0 + (0.25d0 * ((-1.0d0) / x))) / x) - 0.5d0) / x)) / x) / n
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double n) {
              	double t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n);
              	double tmp;
              	if (x <= 0.62) {
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x;
              	} else {
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	}
              	return tmp;
              }
              
              def code(x, n):
              	t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n)
              	tmp = 0
              	if x <= 0.62:
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x
              	else:
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n
              	return tmp
              
              function code(x, n)
              	t_0 = Float64(Float64(Float64(-0.3333333333333333 + Float64(0.25 / x)) / Float64(x * n)) + Float64(-0.5 / n))
              	tmp = 0.0
              	if (x <= 0.62)
              		tmp = Float64(Float64(Float64(n - Float64(x / t_0)) / Float64(Float64(x * n) / t_0)) / x);
              	else
              		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(Float64(0.3333333333333333 + Float64(0.25 * Float64(-1.0 / x))) / x) - 0.5) / x)) / x) / n);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, n)
              	t_0 = ((-0.3333333333333333 + (0.25 / x)) / (x * n)) + (-0.5 / n);
              	tmp = 0.0;
              	if (x <= 0.62)
              		tmp = ((n - (x / t_0)) / ((x * n) / t_0)) / x;
              	else
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, n_] := Block[{t$95$0 = N[(N[(N[(-0.3333333333333333 + N[(0.25 / x), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision] + N[(-0.5 / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.62], N[(N[(N[(n - N[(x / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(x * n), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(N[(N[(0.3333333333333333 + N[(0.25 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{-0.5}{n}\\
              \mathbf{if}\;x \leq 0.62:\\
              \;\;\;\;\frac{\frac{n - \frac{x}{t\_0}}{\frac{x \cdot n}{t\_0}}}{x}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < 0.619999999999999996

                1. Initial program 48.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 50.9%

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

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

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

                  \[\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-neg0.8%

                    \[\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. Simplified0.8%

                  \[\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}} \]
                9. Step-by-step derivation
                  1. add-sqr-sqrt0.4%

                    \[\leadsto \color{blue}{\sqrt{-\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}} \cdot \sqrt{-\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}}} \]
                  2. sqrt-unprod8.5%

                    \[\leadsto \color{blue}{\sqrt{\left(-\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}\right) \cdot \left(-\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}\right)}} \]
                  3. sqr-neg8.5%

                    \[\leadsto \sqrt{\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} \cdot \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}}} \]
                  4. sqrt-unprod6.8%

                    \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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}}} \]
                  5. add-sqr-sqrt30.8%

                    \[\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}} \]
                10. Applied egg-rr30.8%

                  \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x}} \]
                11. Step-by-step derivation
                  1. clear-num30.8%

                    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}}} - \frac{1}{n}}{x} \]
                  2. frac-sub34.9%

                    \[\leadsto \frac{\color{blue}{\frac{1 \cdot n - \frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot 1}{\frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot n}}}{x} \]
                  3. *-un-lft-identity34.9%

                    \[\leadsto \frac{\frac{\color{blue}{n} - \frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot 1}{\frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot n}}{x} \]
                  4. associate-/l/34.9%

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

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

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{\frac{0.25}{x} + \color{blue}{-0.3333333333333333}}{x \cdot n} - \frac{0.5}{n}} \cdot 1}{\frac{x}{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}} \cdot n}}{x} \]
                12. Applied egg-rr34.9%

                  \[\leadsto \frac{\color{blue}{\frac{n - \frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot 1}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}}{x} \]
                13. Step-by-step derivation
                  1. *-rgt-identity34.9%

                    \[\leadsto \frac{\frac{n - \color{blue}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}}}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}{x} \]
                  2. sub-neg34.9%

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \color{blue}{\frac{-0.5}{n}}}}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}{x} \]
                  11. metadata-eval34.9%

                    \[\leadsto \frac{\frac{n - \frac{x}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{x \cdot n} + \frac{\color{blue}{-0.5}}{n}}}{\frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{x \cdot n} - \frac{0.5}{n}} \cdot n}}{x} \]
                14. Simplified34.9%

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

                if 0.619999999999999996 < x

                1. Initial program 66.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 66.8%

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

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

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

                  \[\leadsto \frac{\color{blue}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{x} - 0.3333333333333333}{x} - 0.5}{x} - 1}{x}}}{n} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification48.6%

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

              Alternative 12: 49.1% accurate, 5.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{n}}\\ \mathbf{if}\;x \leq 0.45:\\ \;\;\;\;\frac{\frac{\frac{n - 0.5 \cdot t\_0}{n \cdot t\_0}}{x} + \frac{-1}{n}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \end{array} \]
              (FPCore (x n)
               :precision binary64
               (let* ((t_0 (/ x (/ (+ -0.3333333333333333 (/ 0.25 x)) n))))
                 (if (<= x 0.45)
                   (/ (+ (/ (/ (- n (* 0.5 t_0)) (* n t_0)) x) (/ -1.0 n)) x)
                   (/
                    (/
                     (+ 1.0 (/ (- (/ (+ 0.3333333333333333 (* 0.25 (/ -1.0 x))) x) 0.5) x))
                     x)
                    n))))
              double code(double x, double n) {
              	double t_0 = x / ((-0.3333333333333333 + (0.25 / x)) / n);
              	double tmp;
              	if (x <= 0.45) {
              		tmp = ((((n - (0.5 * t_0)) / (n * t_0)) / x) + (-1.0 / n)) / x;
              	} else {
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	}
              	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 / (((-0.3333333333333333d0) + (0.25d0 / x)) / n)
                  if (x <= 0.45d0) then
                      tmp = ((((n - (0.5d0 * t_0)) / (n * t_0)) / x) + ((-1.0d0) / n)) / x
                  else
                      tmp = ((1.0d0 + ((((0.3333333333333333d0 + (0.25d0 * ((-1.0d0) / x))) / x) - 0.5d0) / x)) / x) / n
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double n) {
              	double t_0 = x / ((-0.3333333333333333 + (0.25 / x)) / n);
              	double tmp;
              	if (x <= 0.45) {
              		tmp = ((((n - (0.5 * t_0)) / (n * t_0)) / x) + (-1.0 / n)) / x;
              	} else {
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	}
              	return tmp;
              }
              
              def code(x, n):
              	t_0 = x / ((-0.3333333333333333 + (0.25 / x)) / n)
              	tmp = 0
              	if x <= 0.45:
              		tmp = ((((n - (0.5 * t_0)) / (n * t_0)) / x) + (-1.0 / n)) / x
              	else:
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n
              	return tmp
              
              function code(x, n)
              	t_0 = Float64(x / Float64(Float64(-0.3333333333333333 + Float64(0.25 / x)) / n))
              	tmp = 0.0
              	if (x <= 0.45)
              		tmp = Float64(Float64(Float64(Float64(Float64(n - Float64(0.5 * t_0)) / Float64(n * t_0)) / x) + Float64(-1.0 / n)) / x);
              	else
              		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(Float64(0.3333333333333333 + Float64(0.25 * Float64(-1.0 / x))) / x) - 0.5) / x)) / x) / n);
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, n)
              	t_0 = x / ((-0.3333333333333333 + (0.25 / x)) / n);
              	tmp = 0.0;
              	if (x <= 0.45)
              		tmp = ((((n - (0.5 * t_0)) / (n * t_0)) / x) + (-1.0 / n)) / x;
              	else
              		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, n_] := Block[{t$95$0 = N[(x / N[(N[(-0.3333333333333333 + N[(0.25 / x), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.45], N[(N[(N[(N[(N[(n - N[(0.5 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(n * t$95$0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(-1.0 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(N[(N[(0.3333333333333333 + N[(0.25 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{x}{\frac{-0.3333333333333333 + \frac{0.25}{x}}{n}}\\
              \mathbf{if}\;x \leq 0.45:\\
              \;\;\;\;\frac{\frac{\frac{n - 0.5 \cdot t\_0}{n \cdot t\_0}}{x} + \frac{-1}{n}}{x}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < 0.450000000000000011

                1. Initial program 48.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 50.9%

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

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

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

                  \[\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-neg0.8%

                    \[\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. Simplified0.8%

                  \[\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}} \]
                9. Step-by-step derivation
                  1. add-sqr-sqrt0.4%

                    \[\leadsto \color{blue}{\sqrt{-\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}} \cdot \sqrt{-\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}}} \]
                  2. sqrt-unprod8.5%

                    \[\leadsto \color{blue}{\sqrt{\left(-\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}\right) \cdot \left(-\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}\right)}} \]
                  3. sqr-neg8.5%

                    \[\leadsto \sqrt{\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} \cdot \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}}} \]
                  4. sqrt-unprod6.8%

                    \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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}}} \]
                  5. add-sqr-sqrt30.8%

                    \[\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}} \]
                10. Applied egg-rr30.8%

                  \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x}} \]
                11. Step-by-step derivation
                  1. clear-num30.8%

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

                    \[\leadsto \frac{\frac{\color{blue}{\frac{1 \cdot n - \frac{x}{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}} \cdot 0.5}{\frac{x}{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}} \cdot n}}}{x} - \frac{1}{n}}{x} \]
                  3. *-un-lft-identity34.1%

                    \[\leadsto \frac{\frac{\frac{\color{blue}{n} - \frac{x}{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}} \cdot 0.5}{\frac{x}{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}} \cdot n}}{x} - \frac{1}{n}}{x} \]
                  4. sub-neg34.1%

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

                    \[\leadsto \frac{\frac{\frac{n - \frac{x}{\frac{\frac{0.25}{x} + \color{blue}{-0.3333333333333333}}{n}} \cdot 0.5}{\frac{x}{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}} \cdot n}}{x} - \frac{1}{n}}{x} \]
                  6. sub-neg34.1%

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

                    \[\leadsto \frac{\frac{\frac{n - \frac{x}{\frac{\frac{0.25}{x} + -0.3333333333333333}{n}} \cdot 0.5}{\frac{x}{\frac{\frac{0.25}{x} + \color{blue}{-0.3333333333333333}}{n}} \cdot n}}{x} - \frac{1}{n}}{x} \]
                12. Applied egg-rr34.1%

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

                if 0.450000000000000011 < x

                1. Initial program 66.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 66.8%

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

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

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

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

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

              Alternative 13: 48.8% accurate, 6.6× speedup?

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

                1. Initial program 48.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 50.9%

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

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

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

                  \[\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-neg0.8%

                    \[\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. Simplified0.8%

                  \[\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}} \]
                9. Step-by-step derivation
                  1. add-sqr-sqrt0.4%

                    \[\leadsto \color{blue}{\sqrt{-\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}} \cdot \sqrt{-\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}}} \]
                  2. sqrt-unprod8.5%

                    \[\leadsto \color{blue}{\sqrt{\left(-\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}\right) \cdot \left(-\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}\right)}} \]
                  3. sqr-neg8.5%

                    \[\leadsto \sqrt{\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} \cdot \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}}} \]
                  4. sqrt-unprod6.8%

                    \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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}}} \]
                  5. add-sqr-sqrt30.8%

                    \[\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}} \]
                10. Applied egg-rr30.8%

                  \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x}} \]
                11. Step-by-step derivation
                  1. associate-/l/30.8%

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

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

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

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

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

                if 0.450000000000000011 < x

                1. Initial program 66.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 66.8%

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

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

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

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

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

              Alternative 14: 48.1% accurate, 8.8× speedup?

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

                1. Initial program 48.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 50.9%

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

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

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

                  \[\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-neg0.8%

                    \[\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. Simplified0.8%

                  \[\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}} \]
                9. Step-by-step derivation
                  1. add-sqr-sqrt0.4%

                    \[\leadsto \color{blue}{\sqrt{-\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}} \cdot \sqrt{-\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}}} \]
                  2. sqrt-unprod8.5%

                    \[\leadsto \color{blue}{\sqrt{\left(-\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}\right) \cdot \left(-\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}\right)}} \]
                  3. sqr-neg8.5%

                    \[\leadsto \sqrt{\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} \cdot \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}}} \]
                  4. sqrt-unprod6.8%

                    \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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}}} \]
                  5. add-sqr-sqrt30.8%

                    \[\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}} \]
                10. Applied egg-rr30.8%

                  \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x}} \]
                11. Taylor expanded in n around -inf 30.8%

                  \[\leadsto \frac{\frac{\color{blue}{-1 \cdot \frac{0.5 + -1 \cdot \frac{0.25 \cdot \frac{1}{x} - 0.3333333333333333}{x}}{n}}}{x} - \frac{1}{n}}{x} \]
                12. Step-by-step derivation
                  1. mul-1-neg30.8%

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

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

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

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

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

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

                    \[\leadsto \frac{\frac{\frac{0.5 - \frac{\color{blue}{-0.3333333333333333 + 0.25 \cdot \frac{1}{x}}}{x}}{-n}}{x} - \frac{1}{n}}{x} \]
                  8. associate-*r/30.8%

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

                    \[\leadsto \frac{\frac{\frac{0.5 - \frac{-0.3333333333333333 + \frac{\color{blue}{0.25}}{x}}{x}}{-n}}{x} - \frac{1}{n}}{x} \]
                13. Simplified30.8%

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

                if 0.46000000000000002 < x

                1. Initial program 66.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 66.8%

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

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

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

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

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

              Alternative 15: 47.9% accurate, 8.8× speedup?

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

                1. Initial program 47.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 51.2%

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

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

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

                  \[\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-neg0.8%

                    \[\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. Simplified0.8%

                  \[\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}} \]
                9. Step-by-step derivation
                  1. add-sqr-sqrt0.3%

                    \[\leadsto \color{blue}{\sqrt{-\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}} \cdot \sqrt{-\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}}} \]
                  2. sqrt-unprod8.2%

                    \[\leadsto \color{blue}{\sqrt{\left(-\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}\right) \cdot \left(-\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}\right)}} \]
                  3. sqr-neg8.2%

                    \[\leadsto \sqrt{\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} \cdot \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}}} \]
                  4. sqrt-unprod7.1%

                    \[\leadsto \color{blue}{\sqrt{\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}} \cdot \sqrt{\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}}} \]
                  5. add-sqr-sqrt32.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}} \]
                10. Applied egg-rr32.9%

                  \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}}{x} - \frac{1}{n}}{x}} \]
                11. Taylor expanded in x around 0 32.9%

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

                if 1.4000000000000001e-24 < x

                1. Initial program 65.8%

                  \[{\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 65.1%

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

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

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

                    \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(x\right) - \log x\right)\right)}}{n} \]
                7. Applied egg-rr65.0%

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

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

                    \[\leadsto \frac{\color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{x}}}{n} \]
                  2. distribute-neg-frac260.9%

                    \[\leadsto \frac{\color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{-x}}}{n} \]
                  3. sub-neg60.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.4 \cdot 10^{-24}:\\ \;\;\;\;\frac{\frac{\frac{\frac{0.25}{x \cdot n}}{x} - \frac{0.5}{n}}{x} + \frac{-1}{n}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{0.5 + \frac{-0.3333333333333333}{x}}{x} + -1}{-x}}{n}\\ \end{array} \]
              5. Add Preprocessing

              Alternative 16: 47.4% accurate, 9.2× speedup?

              \[\begin{array}{l} \\ \frac{\frac{x + n \cdot \left(\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}\right)}{x \cdot n}}{x} \end{array} \]
              (FPCore (x n)
               :precision binary64
               (/
                (/
                 (+ x (* n (- (/ (/ (- (/ 0.25 x) 0.3333333333333333) n) x) (/ 0.5 n))))
                 (* x n))
                x))
              double code(double x, double n) {
              	return ((x + (n * (((((0.25 / x) - 0.3333333333333333) / n) / x) - (0.5 / n)))) / (x * n)) / x;
              }
              
              real(8) function code(x, n)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: n
                  code = ((x + (n * (((((0.25d0 / x) - 0.3333333333333333d0) / n) / x) - (0.5d0 / n)))) / (x * n)) / x
              end function
              
              public static double code(double x, double n) {
              	return ((x + (n * (((((0.25 / x) - 0.3333333333333333) / n) / x) - (0.5 / n)))) / (x * n)) / x;
              }
              
              def code(x, n):
              	return ((x + (n * (((((0.25 / x) - 0.3333333333333333) / n) / x) - (0.5 / n)))) / (x * n)) / x
              
              function code(x, n)
              	return Float64(Float64(Float64(x + Float64(n * Float64(Float64(Float64(Float64(Float64(0.25 / x) - 0.3333333333333333) / n) / x) - Float64(0.5 / n)))) / Float64(x * n)) / x)
              end
              
              function tmp = code(x, n)
              	tmp = ((x + (n * (((((0.25 / x) - 0.3333333333333333) / n) / x) - (0.5 / n)))) / (x * n)) / x;
              end
              
              code[x_, n_] := N[(N[(N[(x + N[(n * N[(N[(N[(N[(N[(0.25 / x), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision] - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \frac{\frac{x + n \cdot \left(\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}\right)}{x \cdot n}}{x}
              \end{array}
              
              Derivation
              1. Initial program 56.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 57.8%

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

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

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

                \[\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-neg29.4%

                  \[\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. Simplified29.4%

                \[\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}} \]
              9. Step-by-step derivation
                1. distribute-neg-frac29.4%

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

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

                \[\leadsto -\frac{\color{blue}{\frac{\left(-\left(\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}\right)\right) \cdot n - x \cdot 1}{x \cdot n}}}{x} \]
              11. Final simplification45.2%

                \[\leadsto \frac{\frac{x + n \cdot \left(\frac{\frac{\frac{0.25}{x} - 0.3333333333333333}{n}}{x} - \frac{0.5}{n}\right)}{x \cdot n}}{x} \]
              12. Add Preprocessing

              Alternative 17: 47.2% accurate, 12.4× speedup?

              \[\begin{array}{l} \\ \frac{\frac{1}{n} - \frac{\frac{0.5}{n} - \frac{0.3333333333333333}{x \cdot n}}{x}}{x} \end{array} \]
              (FPCore (x n)
               :precision binary64
               (/ (- (/ 1.0 n) (/ (- (/ 0.5 n) (/ 0.3333333333333333 (* x n))) x)) x))
              double code(double x, double n) {
              	return ((1.0 / n) - (((0.5 / n) - (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 / n) - (0.3333333333333333d0 / (x * n))) / x)) / x
              end function
              
              public static double code(double x, double n) {
              	return ((1.0 / n) - (((0.5 / n) - (0.3333333333333333 / (x * n))) / x)) / x;
              }
              
              def code(x, n):
              	return ((1.0 / n) - (((0.5 / n) - (0.3333333333333333 / (x * n))) / x)) / x
              
              function code(x, n)
              	return Float64(Float64(Float64(1.0 / n) - Float64(Float64(Float64(0.5 / n) - Float64(0.3333333333333333 / Float64(x * n))) / x)) / x)
              end
              
              function tmp = code(x, n)
              	tmp = ((1.0 / n) - (((0.5 / n) - (0.3333333333333333 / (x * n))) / x)) / x;
              end
              
              code[x_, n_] := N[(N[(N[(1.0 / n), $MachinePrecision] - N[(N[(N[(0.5 / n), $MachinePrecision] - N[(0.3333333333333333 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \frac{\frac{1}{n} - \frac{\frac{0.5}{n} - \frac{0.3333333333333333}{x \cdot n}}{x}}{x}
              \end{array}
              
              Derivation
              1. Initial program 56.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 57.8%

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

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

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

                \[\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-neg29.4%

                  \[\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. Simplified29.4%

                \[\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}} \]
              9. Taylor expanded in x around inf 44.2%

                \[\leadsto -\frac{\color{blue}{\frac{0.5 \cdot \frac{1}{n} - 0.3333333333333333 \cdot \frac{1}{n \cdot x}}{x}} - \frac{1}{n}}{x} \]
              10. Step-by-step derivation
                1. associate-*r/44.2%

                  \[\leadsto -\frac{\frac{0.5 \cdot \frac{1}{n} - \color{blue}{\frac{0.3333333333333333 \cdot 1}{n \cdot x}}}{x} - \frac{1}{n}}{x} \]
                2. metadata-eval44.2%

                  \[\leadsto -\frac{\frac{0.5 \cdot \frac{1}{n} - \frac{\color{blue}{0.3333333333333333}}{n \cdot x}}{x} - \frac{1}{n}}{x} \]
                3. associate-*r/44.2%

                  \[\leadsto -\frac{\frac{\color{blue}{\frac{0.5 \cdot 1}{n}} - \frac{0.3333333333333333}{n \cdot x}}{x} - \frac{1}{n}}{x} \]
                4. metadata-eval44.2%

                  \[\leadsto -\frac{\frac{\frac{\color{blue}{0.5}}{n} - \frac{0.3333333333333333}{n \cdot x}}{x} - \frac{1}{n}}{x} \]
                5. *-commutative44.2%

                  \[\leadsto -\frac{\frac{\frac{0.5}{n} - \frac{0.3333333333333333}{\color{blue}{x \cdot n}}}{x} - \frac{1}{n}}{x} \]
              11. Simplified44.2%

                \[\leadsto -\frac{\color{blue}{\frac{\frac{0.5}{n} - \frac{0.3333333333333333}{x \cdot n}}{x}} - \frac{1}{n}}{x} \]
              12. Final simplification44.2%

                \[\leadsto \frac{\frac{1}{n} - \frac{\frac{0.5}{n} - \frac{0.3333333333333333}{x \cdot n}}{x}}{x} \]
              13. Add Preprocessing

              Alternative 18: 47.2% accurate, 15.1× speedup?

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

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

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

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

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

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

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

                  \[\leadsto \frac{\color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{x}}}{n} \]
                2. distribute-neg-frac244.2%

                  \[\leadsto \frac{\color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{-x}}}{n} \]
                3. sub-neg44.2%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + \color{blue}{-1}}{-x}}{n} \]
              10. Simplified44.2%

                \[\leadsto \frac{\color{blue}{\frac{\frac{\frac{-0.3333333333333333}{x} + 0.5}{x} + -1}{-x}}}{n} \]
              11. Final simplification44.2%

                \[\leadsto \frac{\frac{\frac{0.5 + \frac{-0.3333333333333333}{x}}{x} + -1}{-x}}{n} \]
              12. Add Preprocessing

              Alternative 19: 41.0% 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 56.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 57.8%

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

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

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

                \[\leadsto \frac{\color{blue}{\frac{1}{x}}}{n} \]
              7. Add Preprocessing

              Alternative 20: 41.0% accurate, 42.2× speedup?

              \[\begin{array}{l} \\ \frac{\frac{1}{n}}{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(Float64(1.0 / n) / x)
              end
              
              function tmp = code(x, n)
              	tmp = (1.0 / n) / x;
              end
              
              code[x_, n_] := N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \frac{\frac{1}{n}}{x}
              \end{array}
              
              Derivation
              1. Initial program 56.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 inf 36.3%

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

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({x}^{\left(\frac{1}{n}\right)}, \frac{\mathsf{fma}\left(0.5, {n}^{-2}, \frac{-0.5}{n}\right)}{x}, \frac{{x}^{\left(\frac{1}{n}\right)}}{n}\right)}{x}} \]
                2. Taylor expanded in x around inf 61.0%

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

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

                    \[\leadsto \frac{\frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n}}{x} \]
                  3. distribute-neg-frac61.0%

                    \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
                  4. remove-double-neg61.0%

                    \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n}}}}{n}}{x} \]
                4. Simplified61.0%

                  \[\leadsto \frac{\color{blue}{\frac{e^{\frac{\log x}{n}}}{n}}}{x} \]
                5. Taylor expanded in n around inf 40.1%

                  \[\leadsto \frac{\color{blue}{\frac{1}{n}}}{x} \]
                6. Add Preprocessing

                Alternative 21: 40.4% accurate, 42.2× speedup?

                \[\begin{array}{l} \\ \frac{1}{x \cdot 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(1.0 / Float64(x * n))
                end
                
                function tmp = code(x, n)
                	tmp = 1.0 / (x * n);
                end
                
                code[x_, n_] := N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \frac{1}{x \cdot n}
                \end{array}
                
                Derivation
                1. Initial program 56.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 57.8%

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{1}{x \cdot n}} \]
                9. Add Preprocessing

                Reproduce

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