2nthrt (problem 3.4.6)

Percentage Accurate: 53.0% → 85.6%
Time: 43.3s
Alternatives: 15
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 15 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.0% 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.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;\frac{1}{n} \leq 2000000:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) + \left(\frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right)}{n} - \log x\right)}{n}\\

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


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

    1. Initial program 94.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 inf 98.3%

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000031e-10 < (/.f64 #s(literal 1 binary64) n) < 2e6

    1. Initial program 28.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 80.6%

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

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

      if 2e6 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 59.8%

        \[{\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-cube-cbrt59.8%

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

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

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

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

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

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

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

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

    Alternative 2: 85.5% accurate, 0.4× speedup?

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

      1. Initial program 94.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 inf 98.3%

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

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

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

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

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

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

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

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

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

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

      if -5.00000000000000031e-10 < (/.f64 #s(literal 1 binary64) n) < 2e6

      1. Initial program 28.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 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. log1p-undefine80.0%

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

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

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

      if 2e6 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 59.8%

        \[{\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-cube-cbrt59.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)}^{3}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification87.6%

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

    Alternative 3: 85.5% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-10}:\\ \;\;\;\;\frac{t\_0}{n \cdot x}\\ \mathbf{elif}\;\frac{1}{n} \leq 2000000:\\ \;\;\;\;\frac{\log \left(\frac{x + 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) -5e-10)
         (/ t_0 (* n x))
         (if (<= (/ 1.0 n) 2000000.0)
           (/ (log (/ (+ x 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) <= -5e-10) {
    		tmp = t_0 / (n * x);
    	} else if ((1.0 / n) <= 2000000.0) {
    		tmp = log(((x + 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) <= -5e-10) {
    		tmp = t_0 / (n * x);
    	} else if ((1.0 / n) <= 2000000.0) {
    		tmp = Math.log(((x + 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) <= -5e-10:
    		tmp = t_0 / (n * x)
    	elif (1.0 / n) <= 2000000.0:
    		tmp = math.log(((x + 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) <= -5e-10)
    		tmp = Float64(t_0 / Float64(n * x));
    	elseif (Float64(1.0 / n) <= 2000000.0)
    		tmp = Float64(log(Float64(Float64(x + 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], -5e-10], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2000000.0], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $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 -5 \cdot 10^{-10}:\\
    \;\;\;\;\frac{t\_0}{n \cdot x}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 2000000:\\
    \;\;\;\;\frac{\log \left(\frac{x + 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) < -5.00000000000000031e-10

      1. Initial program 94.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 inf 98.3%

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

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

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

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

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

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

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

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

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

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

      if -5.00000000000000031e-10 < (/.f64 #s(literal 1 binary64) n) < 2e6

      1. Initial program 28.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 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. log1p-undefine80.0%

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

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

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

      if 2e6 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 59.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 0 59.8%

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

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

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

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

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

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

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

    Alternative 4: 82.1% accurate, 1.6× speedup?

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

      1. Initial program 94.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 inf 98.3%

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

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

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

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

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

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

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

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

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

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

      if -5.00000000000000031e-10 < (/.f64 #s(literal 1 binary64) n) < 2e6

      1. Initial program 28.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 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. log1p-undefine80.0%

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

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

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

      if 2e6 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 59.8%

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

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

        \[\leadsto \left(1 + x \cdot \color{blue}{\frac{1 + \left(-0.5 \cdot x + 0.5 \cdot \frac{x}{n}\right)}{n}}\right) - {x}^{\left(\frac{1}{n}\right)} \]
      5. Taylor expanded in n around 0 79.4%

        \[\leadsto \left(1 + x \cdot \frac{1 + \color{blue}{0.5 \cdot \frac{x}{n}}}{n}\right) - {x}^{\left(\frac{1}{n}\right)} \]
      6. Step-by-step derivation
        1. associate-*r/79.4%

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

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

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

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

    Alternative 5: 81.0% accurate, 1.6× speedup?

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

      1. Initial program 94.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 inf 98.3%

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

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

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

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

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

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

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

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

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

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

      if -5.00000000000000031e-10 < (/.f64 #s(literal 1 binary64) n) < 5e17

      1. Initial program 28.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 79.5%

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

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

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

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

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

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

      if 5e17 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999998e195

      1. Initial program 78.9%

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

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

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

          \[\leadsto \color{blue}{\left(\frac{x}{n} + 1\right)} + \left(-e^{\frac{\log x}{n}}\right) \]
        3. associate-+l+80.9%

          \[\leadsto \color{blue}{\frac{x}{n} + \left(1 + \left(-e^{\frac{\log x}{n}}\right)\right)} \]
        4. sub-neg80.9%

          \[\leadsto \frac{x}{n} + \color{blue}{\left(1 - e^{\frac{\log x}{n}}\right)} \]
        5. *-rgt-identity80.9%

          \[\leadsto \frac{x}{n} + \left(1 - e^{\frac{\color{blue}{\log x \cdot 1}}{n}}\right) \]
        6. associate-/l*80.9%

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

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

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

      if 4.9999999999999998e195 < (/.f64 #s(literal 1 binary64) n)

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

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 0.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} \]
      7. Taylor expanded in x around -inf 70.0%

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

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

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

          \[\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/70.0%

          \[\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-neg70.0%

          \[\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-eval70.0%

          \[\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-in70.0%

          \[\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-170.0%

          \[\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/70.0%

          \[\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-eval70.0%

          \[\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-frac70.0%

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

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

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

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

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

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

    Alternative 6: 81.1% accurate, 1.7× speedup?

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

      1. Initial program 94.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 inf 98.3%

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

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

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

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

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

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

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

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

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

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

      if -5.00000000000000031e-10 < (/.f64 #s(literal 1 binary64) n) < 5e17

      1. Initial program 28.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 79.5%

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

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

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

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

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

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

      if 5e17 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e178

      1. Initial program 81.9%

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

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

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

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

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

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

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

      1. Initial program 35.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 6.6%

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 0.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} \]
      7. Taylor expanded in x around -inf 68.0%

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

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

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

          \[\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/68.0%

          \[\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-neg68.0%

          \[\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-eval68.0%

          \[\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-in68.0%

          \[\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-168.0%

          \[\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/68.0%

          \[\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-eval68.0%

          \[\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-frac68.0%

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

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

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

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

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

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

    Alternative 7: 67.1% accurate, 1.7× 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^{+227}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+17}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+178}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{x}}{n}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))))
       (if (<= (/ 1.0 n) -2e+227)
         t_0
         (if (<= (/ 1.0 n) 5e+17)
           (/ (log (/ (+ x 1.0) x)) n)
           (if (<= (/ 1.0 n) 2e+178)
             t_0
             (/ (/ (- 1.0 (/ (+ 0.5 (/ -0.3333333333333333 x)) x)) x) n))))))
    double code(double x, double n) {
    	double t_0 = 1.0 - pow(x, (1.0 / n));
    	double tmp;
    	if ((1.0 / n) <= -2e+227) {
    		tmp = t_0;
    	} else if ((1.0 / n) <= 5e+17) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 2e+178) {
    		tmp = t_0;
    	} else {
    		tmp = ((1.0 - ((0.5 + (-0.3333333333333333 / x)) / 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 = 1.0d0 - (x ** (1.0d0 / n))
        if ((1.0d0 / n) <= (-2d+227)) then
            tmp = t_0
        else if ((1.0d0 / n) <= 5d+17) then
            tmp = log(((x + 1.0d0) / x)) / n
        else if ((1.0d0 / n) <= 2d+178) then
            tmp = t_0
        else
            tmp = ((1.0d0 - ((0.5d0 + ((-0.3333333333333333d0) / x)) / x)) / x) / n
        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+227) {
    		tmp = t_0;
    	} else if ((1.0 / n) <= 5e+17) {
    		tmp = Math.log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 2e+178) {
    		tmp = t_0;
    	} else {
    		tmp = ((1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / x) / n;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = 1.0 - math.pow(x, (1.0 / n))
    	tmp = 0
    	if (1.0 / n) <= -2e+227:
    		tmp = t_0
    	elif (1.0 / n) <= 5e+17:
    		tmp = math.log(((x + 1.0) / x)) / n
    	elif (1.0 / n) <= 2e+178:
    		tmp = t_0
    	else:
    		tmp = ((1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / x) / n
    	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+227)
    		tmp = t_0;
    	elseif (Float64(1.0 / n) <= 5e+17)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	elseif (Float64(1.0 / n) <= 2e+178)
    		tmp = t_0;
    	else
    		tmp = Float64(Float64(Float64(1.0 - Float64(Float64(0.5 + Float64(-0.3333333333333333 / x)) / x)) / x) / n);
    	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+227)
    		tmp = t_0;
    	elseif ((1.0 / n) <= 5e+17)
    		tmp = log(((x + 1.0) / x)) / n;
    	elseif ((1.0 / n) <= 2e+178)
    		tmp = t_0;
    	else
    		tmp = ((1.0 - ((0.5 + (-0.3333333333333333 / x)) / x)) / x) / n;
    	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+227], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e+17], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+178], t$95$0, N[(N[(N[(1.0 - N[(N[(0.5 + N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $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^{+227}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+17}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+178}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{1 - \frac{0.5 + \frac{-0.3333333333333333}{x}}{x}}{x}}{n}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -2.0000000000000002e227 or 5e17 < (/.f64 #s(literal 1 binary64) n) < 2.0000000000000001e178

      1. Initial program 90.4%

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

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

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

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

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

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

      if -2.0000000000000002e227 < (/.f64 #s(literal 1 binary64) n) < 5e17

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

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

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

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

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

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

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

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

      1. Initial program 35.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 6.6%

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 0.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} \]
      7. Taylor expanded in x around -inf 68.0%

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

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

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

          \[\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/68.0%

          \[\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-neg68.0%

          \[\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-eval68.0%

          \[\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-in68.0%

          \[\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-168.0%

          \[\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/68.0%

          \[\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-eval68.0%

          \[\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-frac68.0%

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

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

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

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

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

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

    Alternative 8: 61.3% accurate, 1.8× speedup?

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

      1. Initial program 37.4%

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

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

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

          \[\leadsto \color{blue}{\left(\frac{x}{n} + 1\right)} + \left(-e^{\frac{\log x}{n}}\right) \]
        3. associate-+l+37.1%

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

          \[\leadsto \frac{x}{n} + \color{blue}{\left(1 - e^{\frac{\log x}{n}}\right)} \]
        5. *-rgt-identity37.1%

          \[\leadsto \frac{x}{n} + \left(1 - e^{\frac{\color{blue}{\log x \cdot 1}}{n}}\right) \]
        6. associate-/l*37.0%

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

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

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

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

      if 0.880000000000000004 < x < 2.5000000000000001e132

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

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Taylor expanded in x around -inf 63.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} \]
      7. Step-by-step derivation
        1. clear-num62.2%

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

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

        \[\leadsto \color{blue}{{\left(\frac{n}{-\frac{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{\frac{0.25}{x} + -0.3333333333333333}{x}, -0.5\right)}{x}, -1\right)}{x}}\right)}^{-1}} \]
      9. Simplified62.2%

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

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

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

      if 2.5000000000000001e132 < x

      1. Initial program 79.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 79.8%

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

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

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

        \[\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} \]
      7. Taylor expanded in x around 0 79.8%

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

          \[\leadsto \color{blue}{\frac{\frac{-0.25}{n}}{{x}^{4}}} \]
      9. Simplified79.8%

        \[\leadsto \color{blue}{\frac{\frac{-0.25}{n}}{{x}^{4}}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification64.9%

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

    Alternative 9: 57.6% accurate, 1.9× speedup?

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

      1. Initial program 37.4%

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

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

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

          \[\leadsto \color{blue}{\left(\frac{x}{n} + 1\right)} + \left(-e^{\frac{\log x}{n}}\right) \]
        3. associate-+l+37.1%

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

          \[\leadsto \frac{x}{n} + \color{blue}{\left(1 - e^{\frac{\log x}{n}}\right)} \]
        5. *-rgt-identity37.1%

          \[\leadsto \frac{x}{n} + \left(1 - e^{\frac{\color{blue}{\log x \cdot 1}}{n}}\right) \]
        6. associate-/l*37.0%

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

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

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

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

      if 0.900000000000000022 < x

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

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

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

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

        \[\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} \]
      7. Step-by-step derivation
        1. associate-*r/64.4%

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

          \[\leadsto \frac{\frac{-1 \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{x} - 0.3333333333333333}{x} - 0.5}{x}, -1\right)}}{x}}{n} \]
        3. fmm-def64.4%

          \[\leadsto \frac{\frac{-1 \cdot \mathsf{fma}\left(-1, \frac{\color{blue}{\mathsf{fma}\left(-1, \frac{0.25 \cdot \frac{1}{x} - 0.3333333333333333}{x}, -0.5\right)}}{x}, -1\right)}{x}}{n} \]
        4. sub-neg64.4%

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

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

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

          \[\leadsto \frac{\frac{-1 \cdot \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{\frac{0.25}{x} + -0.3333333333333333}{x}, \color{blue}{-0.5}\right)}{x}, -1\right)}{x}}{n} \]
        8. metadata-eval64.4%

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

        \[\leadsto \frac{\color{blue}{\frac{-1 \cdot \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{\frac{0.25}{x} + -0.3333333333333333}{x}, -0.5\right)}{x}, -1\right)}{x}}}{n} \]
      9. Simplified64.4%

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

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

    Alternative 10: 57.3% accurate, 1.9× speedup?

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

      1. Initial program 37.4%

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

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

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

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

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

        \[\leadsto \color{blue}{1 - {x}^{\left(\frac{1}{n}\right)}} \]
      6. Taylor expanded in n around inf 58.1%

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

          \[\leadsto \color{blue}{\frac{-1 \cdot \log x}{n}} \]
        2. neg-mul-158.1%

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

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

      if 0.69999999999999996 < x

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

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

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

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

        \[\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} \]
      7. Step-by-step derivation
        1. associate-*r/64.4%

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

          \[\leadsto \frac{\frac{-1 \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{x} - 0.3333333333333333}{x} - 0.5}{x}, -1\right)}}{x}}{n} \]
        3. fmm-def64.4%

          \[\leadsto \frac{\frac{-1 \cdot \mathsf{fma}\left(-1, \frac{\color{blue}{\mathsf{fma}\left(-1, \frac{0.25 \cdot \frac{1}{x} - 0.3333333333333333}{x}, -0.5\right)}}{x}, -1\right)}{x}}{n} \]
        4. sub-neg64.4%

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

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

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

          \[\leadsto \frac{\frac{-1 \cdot \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{\frac{0.25}{x} + -0.3333333333333333}{x}, \color{blue}{-0.5}\right)}{x}, -1\right)}{x}}{n} \]
        8. metadata-eval64.4%

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

        \[\leadsto \frac{\color{blue}{\frac{-1 \cdot \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{\frac{0.25}{x} + -0.3333333333333333}{x}, -0.5\right)}{x}, -1\right)}{x}}}{n} \]
      9. Simplified64.4%

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

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

    Alternative 11: 45.8% accurate, 12.4× speedup?

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
    6. Taylor expanded in x around -inf 27.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} \]
    7. Taylor expanded in x around -inf 41.1%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}\right) - \frac{1}{n}}{x}} \]
    10. Final simplification41.1%

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

    Alternative 12: 45.8% accurate, 16.2× speedup?

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

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
    6. Taylor expanded in x around -inf 27.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} \]
    7. Taylor expanded in x around -inf 41.1%

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

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

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

        \[\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/41.1%

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

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

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

        \[\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-141.1%

        \[\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/41.1%

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

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

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

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

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

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

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

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

    Alternative 13: 40.3% 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 49.7%

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
    6. Taylor expanded in x around -inf 27.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} \]
    7. Step-by-step derivation
      1. clear-num26.7%

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

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

      \[\leadsto \color{blue}{{\left(\frac{n}{-\frac{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{\frac{0.25}{x} + -0.3333333333333333}{x}, -0.5\right)}{x}, -1\right)}{x}}\right)}^{-1}} \]
    9. Simplified26.7%

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{n}}{x}} \]
    12. Simplified38.0%

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

    Alternative 14: 39.8% accurate, 42.2× speedup?

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{x \cdot n}} \]
    9. Final simplification37.6%

      \[\leadsto \frac{1}{n \cdot x} \]
    10. Add Preprocessing

    Alternative 15: 4.6% accurate, 70.3× speedup?

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{x}{n} + 1\right)} + \left(-e^{\frac{\log x}{n}}\right) \]
      3. associate-+l+23.1%

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

        \[\leadsto \frac{x}{n} + \color{blue}{\left(1 - e^{\frac{\log x}{n}}\right)} \]
      5. *-rgt-identity23.1%

        \[\leadsto \frac{x}{n} + \left(1 - e^{\frac{\color{blue}{\log x \cdot 1}}{n}}\right) \]
      6. associate-/l*23.0%

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

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

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

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

    Reproduce

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