2nthrt (problem 3.4.6)

Percentage Accurate: 53.1% → 92.1%
Time: 41.3s
Alternatives: 19
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 19 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.1% 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: 92.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 320:\\ \;\;\;\;\frac{\log \left(\frac{x}{e^{\mathsf{log1p}\left(x\right) + \frac{\mathsf{fma}\left(0.5, {\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}, \frac{0.16666666666666666 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}\right)}{n}}}\right)}{-n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (if (<= x 320.0)
   (/
    (log
     (/
      x
      (exp
       (+
        (log1p x)
        (/
         (fma
          0.5
          (- (pow (log1p x) 2.0) (pow (log x) 2.0))
          (/
           (* 0.16666666666666666 (- (pow (log1p x) 3.0) (pow (log x) 3.0)))
           n))
         n)))))
    (- n))
   (/ (/ (pow x (/ 1.0 n)) n) x)))
double code(double x, double n) {
	double tmp;
	if (x <= 320.0) {
		tmp = log((x / exp((log1p(x) + (fma(0.5, (pow(log1p(x), 2.0) - pow(log(x), 2.0)), ((0.16666666666666666 * (pow(log1p(x), 3.0) - pow(log(x), 3.0))) / n)) / n))))) / -n;
	} else {
		tmp = (pow(x, (1.0 / n)) / n) / x;
	}
	return tmp;
}
function code(x, n)
	tmp = 0.0
	if (x <= 320.0)
		tmp = Float64(log(Float64(x / exp(Float64(log1p(x) + Float64(fma(0.5, Float64((log1p(x) ^ 2.0) - (log(x) ^ 2.0)), Float64(Float64(0.16666666666666666 * Float64((log1p(x) ^ 3.0) - (log(x) ^ 3.0))) / n)) / n))))) / Float64(-n));
	else
		tmp = Float64(Float64((x ^ Float64(1.0 / n)) / n) / x);
	end
	return tmp
end
code[x_, n_] := If[LessEqual[x, 320.0], N[(N[Log[N[(x / N[Exp[N[(N[Log[1 + x], $MachinePrecision] + 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] + N[(N[(0.16666666666666666 * N[(N[Power[N[Log[1 + x], $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-n)), $MachinePrecision], N[(N[(N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 320:\\
\;\;\;\;\frac{\log \left(\frac{x}{e^{\mathsf{log1p}\left(x\right) + \frac{\mathsf{fma}\left(0.5, {\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}, \frac{0.16666666666666666 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}\right)}{n}}}\right)}{-n}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 320

    1. Initial program 42.3%

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

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

      \[\leadsto \color{blue}{\frac{\log x - \left(\mathsf{log1p}\left(x\right) + \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) + 0.16666666666666666 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}}{n}\right)}{-n}} \]
    5. Step-by-step derivation
      1. add-log-exp87.1%

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

        \[\leadsto \frac{\color{blue}{\log \left(\frac{x}{e^{\mathsf{log1p}\left(x\right) + \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) + 0.16666666666666666 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}}{n}}}\right)}}{-n} \]
    6. Applied egg-rr87.1%

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

    if 320 < x

    1. Initial program 73.2%

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

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

        \[\leadsto \color{blue}{\frac{\frac{e^{-\frac{-\log x}{n}}}{n} + e^{-\frac{-\log x}{n}} \cdot \frac{\frac{0.5}{{n}^{2}} - \frac{0.5}{n}}{x}}{x}} \]
      2. Taylor expanded in x around inf 99.3%

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

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

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

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

          \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
        5. neg-mul-199.3%

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

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

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

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

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

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

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

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

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

    Alternative 2: 86.1% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ t_1 := \sqrt{t\_0}\\ \mathbf{if}\;\frac{1}{n} \leq -8 \cdot 10^{-31}:\\ \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, -t\_1, e^{\frac{\mathsf{log1p}\left(x\right)}{n}}\right)\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (pow x (/ 1.0 n))) (t_1 (sqrt t_0)))
       (if (<= (/ 1.0 n) -8e-31)
         (/ (/ t_0 n) x)
         (if (<= (/ 1.0 n) 2e-18)
           (/ (log (/ (+ x 1.0) x)) n)
           (fma t_1 (- t_1) (exp (/ (log1p x) n)))))))
    double code(double x, double n) {
    	double t_0 = pow(x, (1.0 / n));
    	double t_1 = sqrt(t_0);
    	double tmp;
    	if ((1.0 / n) <= -8e-31) {
    		tmp = (t_0 / n) / x;
    	} else if ((1.0 / n) <= 2e-18) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else {
    		tmp = fma(t_1, -t_1, exp((log1p(x) / n)));
    	}
    	return tmp;
    }
    
    function code(x, n)
    	t_0 = x ^ Float64(1.0 / n)
    	t_1 = sqrt(t_0)
    	tmp = 0.0
    	if (Float64(1.0 / n) <= -8e-31)
    		tmp = Float64(Float64(t_0 / n) / x);
    	elseif (Float64(1.0 / n) <= 2e-18)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	else
    		tmp = fma(t_1, Float64(-t_1), exp(Float64(log1p(x) / n)));
    	end
    	return tmp
    end
    
    code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[t$95$0], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -8e-31], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-18], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], N[(t$95$1 * (-t$95$1) + N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := {x}^{\left(\frac{1}{n}\right)}\\
    t_1 := \sqrt{t\_0}\\
    \mathbf{if}\;\frac{1}{n} \leq -8 \cdot 10^{-31}:\\
    \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(t\_1, -t\_1, e^{\frac{\mathsf{log1p}\left(x\right)}{n}}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -8.000000000000001e-31

      1. Initial program 90.1%

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

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

          \[\leadsto \color{blue}{\frac{\frac{e^{-\frac{-\log x}{n}}}{n} + e^{-\frac{-\log x}{n}} \cdot \frac{\frac{0.5}{{n}^{2}} - \frac{0.5}{n}}{x}}{x}} \]
        2. Taylor expanded in x around inf 95.6%

          \[\leadsto \frac{\color{blue}{\frac{e^{-\frac{\log \left(\frac{1}{x}\right)}{n}}}{n}}}{x} \]
        3. Step-by-step derivation
          1. distribute-frac-neg295.6%

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

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

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

            \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
          5. neg-mul-195.6%

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

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

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

            \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
          9. *-rgt-identity95.6%

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

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

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

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

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

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

        1. Initial program 34.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 82.5%

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

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

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

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

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

        1. Initial program 47.5%

          \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. sub-neg47.5%

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

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

            \[\leadsto \left(-\color{blue}{{x}^{\left(\frac{\frac{1}{n}}{2}\right)} \cdot {x}^{\left(\frac{\frac{1}{n}}{2}\right)}}\right) + {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \]
          4. distribute-rgt-neg-in47.5%

            \[\leadsto \color{blue}{{x}^{\left(\frac{\frac{1}{n}}{2}\right)} \cdot \left(-{x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right)} + {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \]
          5. fma-define47.6%

            \[\leadsto \color{blue}{\mathsf{fma}\left({x}^{\left(\frac{\frac{1}{n}}{2}\right)}, -{x}^{\left(\frac{\frac{1}{n}}{2}\right)}, {\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)} \]
          6. sqrt-pow147.6%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\sqrt{{x}^{\left(\frac{1}{n}\right)}}}, -{x}^{\left(\frac{\frac{1}{n}}{2}\right)}, {\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right) \]
          7. sqrt-pow147.6%

            \[\leadsto \mathsf{fma}\left(\sqrt{{x}^{\left(\frac{1}{n}\right)}}, -\color{blue}{\sqrt{{x}^{\left(\frac{1}{n}\right)}}}, {\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right) \]
          8. pow-to-exp47.6%

            \[\leadsto \mathsf{fma}\left(\sqrt{{x}^{\left(\frac{1}{n}\right)}}, -\sqrt{{x}^{\left(\frac{1}{n}\right)}}, \color{blue}{e^{\log \left(x + 1\right) \cdot \frac{1}{n}}}\right) \]
          9. un-div-inv47.6%

            \[\leadsto \mathsf{fma}\left(\sqrt{{x}^{\left(\frac{1}{n}\right)}}, -\sqrt{{x}^{\left(\frac{1}{n}\right)}}, e^{\color{blue}{\frac{\log \left(x + 1\right)}{n}}}\right) \]
          10. +-commutative47.6%

            \[\leadsto \mathsf{fma}\left(\sqrt{{x}^{\left(\frac{1}{n}\right)}}, -\sqrt{{x}^{\left(\frac{1}{n}\right)}}, e^{\frac{\log \color{blue}{\left(1 + x\right)}}{n}}\right) \]
          11. log1p-define97.2%

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

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

      Alternative 3: 86.1% accurate, 0.7× speedup?

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

        1. Initial program 90.1%

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

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

            \[\leadsto \color{blue}{\frac{\frac{e^{-\frac{-\log x}{n}}}{n} + e^{-\frac{-\log x}{n}} \cdot \frac{\frac{0.5}{{n}^{2}} - \frac{0.5}{n}}{x}}{x}} \]
          2. Taylor expanded in x around inf 95.6%

            \[\leadsto \frac{\color{blue}{\frac{e^{-\frac{\log \left(\frac{1}{x}\right)}{n}}}{n}}}{x} \]
          3. Step-by-step derivation
            1. distribute-frac-neg295.6%

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

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

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

              \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
            5. neg-mul-195.6%

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

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

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

              \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
            9. *-rgt-identity95.6%

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

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

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

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

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

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

          1. Initial program 34.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 82.5%

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

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

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

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

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

          1. Initial program 47.5%

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

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

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

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

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

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

            \[\leadsto \color{blue}{{\left(e^{1}\right)}^{\left(\frac{\mathsf{log1p}\left(x\right)}{n}\right)}} - {x}^{\left(\frac{1}{n}\right)} \]
          8. Step-by-step derivation
            1. exp-1-e97.2%

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

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

        Alternative 4: 86.2% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -8 \cdot 10^{-31}:\\ \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\ \;\;\;\;\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) -8e-31)
             (/ (/ t_0 n) x)
             (if (<= (/ 1.0 n) 2e-18)
               (/ (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) <= -8e-31) {
        		tmp = (t_0 / n) / x;
        	} else if ((1.0 / n) <= 2e-18) {
        		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) <= -8e-31) {
        		tmp = (t_0 / n) / x;
        	} else if ((1.0 / n) <= 2e-18) {
        		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) <= -8e-31:
        		tmp = (t_0 / n) / x
        	elif (1.0 / n) <= 2e-18:
        		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) <= -8e-31)
        		tmp = Float64(Float64(t_0 / n) / x);
        	elseif (Float64(1.0 / n) <= 2e-18)
        		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], -8e-31], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-18], 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 -8 \cdot 10^{-31}:\\
        \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
        
        \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\
        \;\;\;\;\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) < -8.000000000000001e-31

          1. Initial program 90.1%

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

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

              \[\leadsto \color{blue}{\frac{\frac{e^{-\frac{-\log x}{n}}}{n} + e^{-\frac{-\log x}{n}} \cdot \frac{\frac{0.5}{{n}^{2}} - \frac{0.5}{n}}{x}}{x}} \]
            2. Taylor expanded in x around inf 95.6%

              \[\leadsto \frac{\color{blue}{\frac{e^{-\frac{\log \left(\frac{1}{x}\right)}{n}}}{n}}}{x} \]
            3. Step-by-step derivation
              1. distribute-frac-neg295.6%

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

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

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

                \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
              5. neg-mul-195.6%

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

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

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

                \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
              9. *-rgt-identity95.6%

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

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

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

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

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

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

            1. Initial program 34.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 82.5%

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

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

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

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

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

            1. Initial program 47.5%

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

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

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

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

          Alternative 5: 82.3% accurate, 0.9× speedup?

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

            1. Initial program 90.1%

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

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

                \[\leadsto \color{blue}{\frac{\frac{e^{-\frac{-\log x}{n}}}{n} + e^{-\frac{-\log x}{n}} \cdot \frac{\frac{0.5}{{n}^{2}} - \frac{0.5}{n}}{x}}{x}} \]
              2. Taylor expanded in x around inf 95.6%

                \[\leadsto \frac{\color{blue}{\frac{e^{-\frac{\log \left(\frac{1}{x}\right)}{n}}}{n}}}{x} \]
              3. Step-by-step derivation
                1. distribute-frac-neg295.6%

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

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

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

                  \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
                5. neg-mul-195.6%

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

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

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

                  \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
                9. *-rgt-identity95.6%

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

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

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

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

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

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

              1. Initial program 34.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 82.5%

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

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

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

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

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

              1. Initial program 73.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 78.5%

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

              if 4.99999999999999976e157 < (/.f64 #s(literal 1 binary64) n)

              1. Initial program 28.0%

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

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

                \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{-0.16666666666666666 \cdot \frac{{\log x}^{3}}{n} - 0.5 \cdot {\log x}^{2}}{n} - -1 \cdot \log x}{n}} \]
              5. Taylor expanded in n around 0 74.7%

                \[\leadsto \color{blue}{-0.16666666666666666 \cdot \frac{{\log x}^{3}}{{n}^{3}}} \]
              6. Step-by-step derivation
                1. cube-div74.7%

                  \[\leadsto -0.16666666666666666 \cdot \color{blue}{{\left(\frac{\log x}{n}\right)}^{3}} \]
              7. Simplified74.7%

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

            Alternative 6: 86.1% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -8 \cdot 10^{-31}:\\ \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{else}:\\ \;\;\;\;{e}^{\left(\frac{x}{n}\right)} - t\_0\\ \end{array} \end{array} \]
            (FPCore (x n)
             :precision binary64
             (let* ((t_0 (pow x (/ 1.0 n))))
               (if (<= (/ 1.0 n) -8e-31)
                 (/ (/ t_0 n) x)
                 (if (<= (/ 1.0 n) 2e-18)
                   (/ (log (/ (+ x 1.0) x)) n)
                   (- (pow E (/ x n)) t_0)))))
            double code(double x, double n) {
            	double t_0 = pow(x, (1.0 / n));
            	double tmp;
            	if ((1.0 / n) <= -8e-31) {
            		tmp = (t_0 / n) / x;
            	} else if ((1.0 / n) <= 2e-18) {
            		tmp = log(((x + 1.0) / x)) / n;
            	} else {
            		tmp = pow(((double) M_E), (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) <= -8e-31) {
            		tmp = (t_0 / n) / x;
            	} else if ((1.0 / n) <= 2e-18) {
            		tmp = Math.log(((x + 1.0) / x)) / n;
            	} else {
            		tmp = Math.pow(Math.E, (x / n)) - t_0;
            	}
            	return tmp;
            }
            
            def code(x, n):
            	t_0 = math.pow(x, (1.0 / n))
            	tmp = 0
            	if (1.0 / n) <= -8e-31:
            		tmp = (t_0 / n) / x
            	elif (1.0 / n) <= 2e-18:
            		tmp = math.log(((x + 1.0) / x)) / n
            	else:
            		tmp = math.pow(math.e, (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) <= -8e-31)
            		tmp = Float64(Float64(t_0 / n) / x);
            	elseif (Float64(1.0 / n) <= 2e-18)
            		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
            	else
            		tmp = Float64((exp(1) ^ Float64(x / n)) - t_0);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, n)
            	t_0 = x ^ (1.0 / n);
            	tmp = 0.0;
            	if ((1.0 / n) <= -8e-31)
            		tmp = (t_0 / n) / x;
            	elseif ((1.0 / n) <= 2e-18)
            		tmp = log(((x + 1.0) / x)) / n;
            	else
            		tmp = (2.71828182845904523536 ^ (x / n)) - t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -8e-31], N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-18], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], N[(N[Power[E, N[(x / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := {x}^{\left(\frac{1}{n}\right)}\\
            \mathbf{if}\;\frac{1}{n} \leq -8 \cdot 10^{-31}:\\
            \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
            
            \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\
            \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
            
            \mathbf{else}:\\
            \;\;\;\;{e}^{\left(\frac{x}{n}\right)} - t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (/.f64 #s(literal 1 binary64) n) < -8.000000000000001e-31

              1. Initial program 90.1%

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

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

                  \[\leadsto \color{blue}{\frac{\frac{e^{-\frac{-\log x}{n}}}{n} + e^{-\frac{-\log x}{n}} \cdot \frac{\frac{0.5}{{n}^{2}} - \frac{0.5}{n}}{x}}{x}} \]
                2. Taylor expanded in x around inf 95.6%

                  \[\leadsto \frac{\color{blue}{\frac{e^{-\frac{\log \left(\frac{1}{x}\right)}{n}}}{n}}}{x} \]
                3. Step-by-step derivation
                  1. distribute-frac-neg295.6%

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

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

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

                    \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
                  5. neg-mul-195.6%

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

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

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

                    \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
                  9. *-rgt-identity95.6%

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

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

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

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

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

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

                1. Initial program 34.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 82.5%

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

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

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

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

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

                1. Initial program 47.5%

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

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

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

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

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

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

                  \[\leadsto \color{blue}{{\left(e^{1}\right)}^{\left(\frac{\mathsf{log1p}\left(x\right)}{n}\right)}} - {x}^{\left(\frac{1}{n}\right)} \]
                8. Step-by-step derivation
                  1. exp-1-e97.2%

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

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

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

              Alternative 7: 86.1% accurate, 1.0× speedup?

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

                1. Initial program 90.1%

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

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

                    \[\leadsto \color{blue}{\frac{\frac{e^{-\frac{-\log x}{n}}}{n} + e^{-\frac{-\log x}{n}} \cdot \frac{\frac{0.5}{{n}^{2}} - \frac{0.5}{n}}{x}}{x}} \]
                  2. Taylor expanded in x around inf 95.6%

                    \[\leadsto \frac{\color{blue}{\frac{e^{-\frac{\log \left(\frac{1}{x}\right)}{n}}}{n}}}{x} \]
                  3. Step-by-step derivation
                    1. distribute-frac-neg295.6%

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

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

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

                      \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
                    5. neg-mul-195.6%

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

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

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

                      \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
                    9. *-rgt-identity95.6%

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

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

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

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

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

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

                  1. Initial program 34.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 82.5%

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

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

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

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

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

                  1. Initial program 47.5%

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

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

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

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

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

                Alternative 8: 82.2% accurate, 1.6× speedup?

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

                  1. Initial program 90.1%

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

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

                      \[\leadsto \color{blue}{\frac{\frac{e^{-\frac{-\log x}{n}}}{n} + e^{-\frac{-\log x}{n}} \cdot \frac{\frac{0.5}{{n}^{2}} - \frac{0.5}{n}}{x}}{x}} \]
                    2. Taylor expanded in x around inf 95.6%

                      \[\leadsto \frac{\color{blue}{\frac{e^{-\frac{\log \left(\frac{1}{x}\right)}{n}}}{n}}}{x} \]
                    3. Step-by-step derivation
                      1. distribute-frac-neg295.6%

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

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

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

                        \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
                      5. neg-mul-195.6%

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

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

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

                        \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
                      9. *-rgt-identity95.6%

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

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

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

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

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

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

                    1. Initial program 34.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 82.5%

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

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

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

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

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

                    1. Initial program 73.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 78.5%

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

                    if 4.99999999999999976e157 < (/.f64 #s(literal 1 binary64) n)

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

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

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

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

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

                      \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{-1 \cdot \frac{-1 \cdot \frac{1.1666666666666667 \cdot \frac{1}{x} - 1}{x} - 1}{x}}\right)}{n} \]
                  5. Recombined 4 regimes into one program.
                  6. Final simplification86.1%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -8 \cdot 10^{-31}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{+157}:\\ \;\;\;\;\left(1 + \frac{x}{n}\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{expm1}\left(\frac{1 + \frac{-1 + 1.1666666666666667 \cdot \frac{1}{x}}{x}}{x}\right)}{n}\\ \end{array} \]
                  7. Add Preprocessing

                  Alternative 9: 60.0% accurate, 1.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -50000000:\\ \;\;\;\;\frac{0.3333333333333333}{n \cdot {x}^{3}}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-262}:\\ \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\ \;\;\;\;\log x \cdot \frac{-1}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+144}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{log1p}\left(x + -1\right)}{-n}\\ \end{array} \end{array} \]
                  (FPCore (x n)
                   :precision binary64
                   (if (<= (/ 1.0 n) -50000000.0)
                     (/ 0.3333333333333333 (* n (pow x 3.0)))
                     (if (<= (/ 1.0 n) 2e-262)
                       (/ 1.0 (* x (+ n (* 0.5 (/ n x)))))
                       (if (<= (/ 1.0 n) 2e-18)
                         (* (log x) (/ -1.0 n))
                         (if (<= (/ 1.0 n) 1e+144)
                           (- 1.0 (pow x (/ 1.0 n)))
                           (/ (log1p (+ x -1.0)) (- n)))))))
                  double code(double x, double n) {
                  	double tmp;
                  	if ((1.0 / n) <= -50000000.0) {
                  		tmp = 0.3333333333333333 / (n * pow(x, 3.0));
                  	} else if ((1.0 / n) <= 2e-262) {
                  		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
                  	} else if ((1.0 / n) <= 2e-18) {
                  		tmp = log(x) * (-1.0 / n);
                  	} else if ((1.0 / n) <= 1e+144) {
                  		tmp = 1.0 - pow(x, (1.0 / n));
                  	} else {
                  		tmp = log1p((x + -1.0)) / -n;
                  	}
                  	return tmp;
                  }
                  
                  public static double code(double x, double n) {
                  	double tmp;
                  	if ((1.0 / n) <= -50000000.0) {
                  		tmp = 0.3333333333333333 / (n * Math.pow(x, 3.0));
                  	} else if ((1.0 / n) <= 2e-262) {
                  		tmp = 1.0 / (x * (n + (0.5 * (n / x))));
                  	} else if ((1.0 / n) <= 2e-18) {
                  		tmp = Math.log(x) * (-1.0 / n);
                  	} else if ((1.0 / n) <= 1e+144) {
                  		tmp = 1.0 - Math.pow(x, (1.0 / n));
                  	} else {
                  		tmp = Math.log1p((x + -1.0)) / -n;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, n):
                  	tmp = 0
                  	if (1.0 / n) <= -50000000.0:
                  		tmp = 0.3333333333333333 / (n * math.pow(x, 3.0))
                  	elif (1.0 / n) <= 2e-262:
                  		tmp = 1.0 / (x * (n + (0.5 * (n / x))))
                  	elif (1.0 / n) <= 2e-18:
                  		tmp = math.log(x) * (-1.0 / n)
                  	elif (1.0 / n) <= 1e+144:
                  		tmp = 1.0 - math.pow(x, (1.0 / n))
                  	else:
                  		tmp = math.log1p((x + -1.0)) / -n
                  	return tmp
                  
                  function code(x, n)
                  	tmp = 0.0
                  	if (Float64(1.0 / n) <= -50000000.0)
                  		tmp = Float64(0.3333333333333333 / Float64(n * (x ^ 3.0)));
                  	elseif (Float64(1.0 / n) <= 2e-262)
                  		tmp = Float64(1.0 / Float64(x * Float64(n + Float64(0.5 * Float64(n / x)))));
                  	elseif (Float64(1.0 / n) <= 2e-18)
                  		tmp = Float64(log(x) * Float64(-1.0 / n));
                  	elseif (Float64(1.0 / n) <= 1e+144)
                  		tmp = Float64(1.0 - (x ^ Float64(1.0 / n)));
                  	else
                  		tmp = Float64(log1p(Float64(x + -1.0)) / Float64(-n));
                  	end
                  	return tmp
                  end
                  
                  code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -50000000.0], N[(0.3333333333333333 / N[(n * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-262], N[(1.0 / N[(x * N[(n + N[(0.5 * N[(n / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-18], N[(N[Log[x], $MachinePrecision] * N[(-1.0 / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+144], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Log[1 + N[(x + -1.0), $MachinePrecision]], $MachinePrecision] / (-n)), $MachinePrecision]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;\frac{1}{n} \leq -50000000:\\
                  \;\;\;\;\frac{0.3333333333333333}{n \cdot {x}^{3}}\\
                  
                  \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-262}:\\
                  \;\;\;\;\frac{1}{x \cdot \left(n + 0.5 \cdot \frac{n}{x}\right)}\\
                  
                  \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\
                  \;\;\;\;\log x \cdot \frac{-1}{n}\\
                  
                  \mathbf{elif}\;\frac{1}{n} \leq 10^{+144}:\\
                  \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\mathsf{log1p}\left(x + -1\right)}{-n}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 5 regimes
                  2. if (/.f64 #s(literal 1 binary64) n) < -5e7

                    1. Initial program 100.0%

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

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

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

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

                    if -5e7 < (/.f64 #s(literal 1 binary64) n) < 2.00000000000000002e-262

                    1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

                    1. Initial program 25.5%

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

                      \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                    4. Taylor expanded in x around 0 58.2%

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

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

                      \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
                    7. Step-by-step derivation
                      1. div-inv58.3%

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

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

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

                    1. Initial program 76.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 76.7%

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

                    if 1.00000000000000002e144 < (/.f64 #s(literal 1 binary64) n)

                    1. Initial program 29.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 5.7%

                      \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                    4. Taylor expanded in x around 0 5.7%

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

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

                      \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
                    7. Step-by-step derivation
                      1. log1p-expm1-u65.4%

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

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

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

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

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

                  Alternative 10: 81.8% accurate, 1.6× speedup?

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

                    1. Initial program 90.1%

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

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

                        \[\leadsto \color{blue}{\frac{\frac{e^{-\frac{-\log x}{n}}}{n} + e^{-\frac{-\log x}{n}} \cdot \frac{\frac{0.5}{{n}^{2}} - \frac{0.5}{n}}{x}}{x}} \]
                      2. Taylor expanded in x around inf 95.6%

                        \[\leadsto \frac{\color{blue}{\frac{e^{-\frac{\log \left(\frac{1}{x}\right)}{n}}}{n}}}{x} \]
                      3. Step-by-step derivation
                        1. distribute-frac-neg295.6%

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

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

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

                          \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
                        5. neg-mul-195.6%

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

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

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

                          \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
                        9. *-rgt-identity95.6%

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

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

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

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

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

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

                      1. Initial program 34.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 82.5%

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

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

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

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

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

                      1. Initial program 73.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 78.5%

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

                      if 4.99999999999999976e157 < (/.f64 #s(literal 1 binary64) n)

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

                        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                      4. Taylor expanded in x around 0 5.8%

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

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

                        \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
                      7. Step-by-step derivation
                        1. log1p-expm1-u66.6%

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

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

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

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

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

                    Alternative 11: 81.7% accurate, 1.7× speedup?

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

                      1. Initial program 90.1%

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

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

                          \[\leadsto \color{blue}{\frac{\frac{e^{-\frac{-\log x}{n}}}{n} + e^{-\frac{-\log x}{n}} \cdot \frac{\frac{0.5}{{n}^{2}} - \frac{0.5}{n}}{x}}{x}} \]
                        2. Taylor expanded in x around inf 95.6%

                          \[\leadsto \frac{\color{blue}{\frac{e^{-\frac{\log \left(\frac{1}{x}\right)}{n}}}{n}}}{x} \]
                        3. Step-by-step derivation
                          1. distribute-frac-neg295.6%

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

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

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

                            \[\leadsto \frac{\frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n}}{x} \]
                          5. neg-mul-195.6%

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

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

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

                            \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
                          9. *-rgt-identity95.6%

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

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

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

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

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

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

                        1. Initial program 34.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 82.5%

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

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

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

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

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

                        1. Initial program 76.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 76.7%

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

                        if 1.00000000000000002e144 < (/.f64 #s(literal 1 binary64) n)

                        1. Initial program 29.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 5.7%

                          \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                        4. Taylor expanded in x around 0 5.7%

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

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

                          \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
                        7. Step-by-step derivation
                          1. log1p-expm1-u65.4%

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

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

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

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

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

                      Alternative 12: 74.6% accurate, 1.7× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-5}:\\ \;\;\;\;\frac{0.3333333333333333}{n \cdot {x}^{3}}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+144}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{log1p}\left(x + -1\right)}{-n}\\ \end{array} \end{array} \]
                      (FPCore (x n)
                       :precision binary64
                       (if (<= (/ 1.0 n) -5e-5)
                         (/ 0.3333333333333333 (* n (pow x 3.0)))
                         (if (<= (/ 1.0 n) 2e-18)
                           (/ (log (/ (+ x 1.0) x)) n)
                           (if (<= (/ 1.0 n) 1e+144)
                             (- 1.0 (pow x (/ 1.0 n)))
                             (/ (log1p (+ x -1.0)) (- n))))))
                      double code(double x, double n) {
                      	double tmp;
                      	if ((1.0 / n) <= -5e-5) {
                      		tmp = 0.3333333333333333 / (n * pow(x, 3.0));
                      	} else if ((1.0 / n) <= 2e-18) {
                      		tmp = log(((x + 1.0) / x)) / n;
                      	} else if ((1.0 / n) <= 1e+144) {
                      		tmp = 1.0 - pow(x, (1.0 / n));
                      	} else {
                      		tmp = log1p((x + -1.0)) / -n;
                      	}
                      	return tmp;
                      }
                      
                      public static double code(double x, double n) {
                      	double tmp;
                      	if ((1.0 / n) <= -5e-5) {
                      		tmp = 0.3333333333333333 / (n * Math.pow(x, 3.0));
                      	} else if ((1.0 / n) <= 2e-18) {
                      		tmp = Math.log(((x + 1.0) / x)) / n;
                      	} else if ((1.0 / n) <= 1e+144) {
                      		tmp = 1.0 - Math.pow(x, (1.0 / n));
                      	} else {
                      		tmp = Math.log1p((x + -1.0)) / -n;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, n):
                      	tmp = 0
                      	if (1.0 / n) <= -5e-5:
                      		tmp = 0.3333333333333333 / (n * math.pow(x, 3.0))
                      	elif (1.0 / n) <= 2e-18:
                      		tmp = math.log(((x + 1.0) / x)) / n
                      	elif (1.0 / n) <= 1e+144:
                      		tmp = 1.0 - math.pow(x, (1.0 / n))
                      	else:
                      		tmp = math.log1p((x + -1.0)) / -n
                      	return tmp
                      
                      function code(x, n)
                      	tmp = 0.0
                      	if (Float64(1.0 / n) <= -5e-5)
                      		tmp = Float64(0.3333333333333333 / Float64(n * (x ^ 3.0)));
                      	elseif (Float64(1.0 / n) <= 2e-18)
                      		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
                      	elseif (Float64(1.0 / n) <= 1e+144)
                      		tmp = Float64(1.0 - (x ^ Float64(1.0 / n)));
                      	else
                      		tmp = Float64(log1p(Float64(x + -1.0)) / Float64(-n));
                      	end
                      	return tmp
                      end
                      
                      code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-5], N[(0.3333333333333333 / N[(n * N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-18], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+144], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Log[1 + N[(x + -1.0), $MachinePrecision]], $MachinePrecision] / (-n)), $MachinePrecision]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-5}:\\
                      \;\;\;\;\frac{0.3333333333333333}{n \cdot {x}^{3}}\\
                      
                      \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-18}:\\
                      \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
                      
                      \mathbf{elif}\;\frac{1}{n} \leq 10^{+144}:\\
                      \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{\mathsf{log1p}\left(x + -1\right)}{-n}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if (/.f64 #s(literal 1 binary64) n) < -5.00000000000000024e-5

                        1. Initial program 98.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 52.0%

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

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

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

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

                        1. Initial program 34.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 80.0%

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

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

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

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

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

                        1. Initial program 76.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 76.7%

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

                        if 1.00000000000000002e144 < (/.f64 #s(literal 1 binary64) n)

                        1. Initial program 29.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 5.7%

                          \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                        4. Taylor expanded in x around 0 5.7%

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

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

                          \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
                        7. Step-by-step derivation
                          1. log1p-expm1-u65.4%

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

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

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

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

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

                      Alternative 13: 59.6% accurate, 1.9× speedup?

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

                        1. Initial program 42.6%

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

                          \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                        4. Taylor expanded in x around 0 50.2%

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

                            \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
                        6. Simplified50.2%

                          \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
                        7. Step-by-step derivation
                          1. div-inv50.2%

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

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

                        if 0.34999999999999998 < x < 1.90000000000000008e118

                        1. Initial program 46.5%

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

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

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

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

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

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

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

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

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

                        if 1.90000000000000008e118 < x

                        1. Initial program 88.5%

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

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

                          \[\leadsto 1 - \color{blue}{1} \]
                        5. Step-by-step derivation
                          1. metadata-eval88.5%

                            \[\leadsto \color{blue}{0} \]
                        6. Applied egg-rr88.5%

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

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

                      Alternative 14: 59.7% accurate, 1.9× speedup?

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

                        1. Initial program 42.6%

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

                          \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                        4. Taylor expanded in x around 0 50.2%

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

                            \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
                        6. Simplified50.2%

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

                        if 0.34999999999999998 < x < 2.3499999999999999e118

                        1. Initial program 46.5%

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

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

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

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

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

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

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

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

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

                        if 2.3499999999999999e118 < x

                        1. Initial program 88.5%

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

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

                          \[\leadsto 1 - \color{blue}{1} \]
                        5. Step-by-step derivation
                          1. metadata-eval88.5%

                            \[\leadsto \color{blue}{0} \]
                        6. Applied egg-rr88.5%

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

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

                      Alternative 15: 49.7% accurate, 10.5× speedup?

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

                        1. Initial program 43.5%

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

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

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

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

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

                        if 1.95e118 < x

                        1. Initial program 88.5%

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

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

                          \[\leadsto 1 - \color{blue}{1} \]
                        5. Step-by-step derivation
                          1. metadata-eval88.5%

                            \[\leadsto \color{blue}{0} \]
                        6. Applied egg-rr88.5%

                          \[\leadsto \color{blue}{0} \]
                      3. Recombined 2 regimes into one program.
                      4. Final simplification54.0%

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

                      Alternative 16: 49.4% accurate, 11.7× speedup?

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

                        1. Initial program 43.5%

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

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

                          \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                        5. Taylor expanded in n around -inf 41.3%

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

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

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

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

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

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

                            \[\leadsto \frac{1 - \frac{0.5 + \color{blue}{\frac{-0.3333333333333333}{x}}}{x}}{n \cdot x} \]
                          7. metadata-eval41.3%

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

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

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

                        if 2.1e118 < x

                        1. Initial program 88.5%

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

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

                          \[\leadsto 1 - \color{blue}{1} \]
                        5. Step-by-step derivation
                          1. metadata-eval88.5%

                            \[\leadsto \color{blue}{0} \]
                        6. Applied egg-rr88.5%

                          \[\leadsto \color{blue}{0} \]
                      3. Recombined 2 regimes into one program.
                      4. Add Preprocessing

                      Alternative 17: 46.4% accurate, 17.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -50000000:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n}}{x}\\ \end{array} \end{array} \]
                      (FPCore (x n)
                       :precision binary64
                       (if (<= (/ 1.0 n) -50000000.0) 0.0 (/ (/ 1.0 n) x)))
                      double code(double x, double n) {
                      	double tmp;
                      	if ((1.0 / n) <= -50000000.0) {
                      		tmp = 0.0;
                      	} else {
                      		tmp = (1.0 / n) / x;
                      	}
                      	return tmp;
                      }
                      
                      real(8) function code(x, n)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: n
                          real(8) :: tmp
                          if ((1.0d0 / n) <= (-50000000.0d0)) then
                              tmp = 0.0d0
                          else
                              tmp = (1.0d0 / n) / x
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double n) {
                      	double tmp;
                      	if ((1.0 / n) <= -50000000.0) {
                      		tmp = 0.0;
                      	} else {
                      		tmp = (1.0 / n) / x;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, n):
                      	tmp = 0
                      	if (1.0 / n) <= -50000000.0:
                      		tmp = 0.0
                      	else:
                      		tmp = (1.0 / n) / x
                      	return tmp
                      
                      function code(x, n)
                      	tmp = 0.0
                      	if (Float64(1.0 / n) <= -50000000.0)
                      		tmp = 0.0;
                      	else
                      		tmp = Float64(Float64(1.0 / n) / x);
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, n)
                      	tmp = 0.0;
                      	if ((1.0 / n) <= -50000000.0)
                      		tmp = 0.0;
                      	else
                      		tmp = (1.0 / n) / x;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -50000000.0], 0.0, N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\frac{1}{n} \leq -50000000:\\
                      \;\;\;\;0\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{\frac{1}{n}}{x}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (/.f64 #s(literal 1 binary64) n) < -5e7

                        1. Initial program 100.0%

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

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

                          \[\leadsto 1 - \color{blue}{1} \]
                        5. Step-by-step derivation
                          1. metadata-eval50.8%

                            \[\leadsto \color{blue}{0} \]
                        6. Applied egg-rr50.8%

                          \[\leadsto \color{blue}{0} \]

                        if -5e7 < (/.f64 #s(literal 1 binary64) n)

                        1. Initial program 36.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 63.3%

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

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

                          \[\leadsto \frac{\color{blue}{\frac{1}{n}}}{x} \]
                      3. Recombined 2 regimes into one program.
                      4. Add Preprocessing

                      Alternative 18: 43.5% accurate, 21.1× speedup?

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

                        1. Initial program 43.5%

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

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

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

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

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

                        if 1.8e118 < x

                        1. Initial program 88.5%

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

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

                          \[\leadsto 1 - \color{blue}{1} \]
                        5. Step-by-step derivation
                          1. metadata-eval88.5%

                            \[\leadsto \color{blue}{0} \]
                        6. Applied egg-rr88.5%

                          \[\leadsto \color{blue}{0} \]
                      3. Recombined 2 regimes into one program.
                      4. Add Preprocessing

                      Alternative 19: 30.2% accurate, 211.0× speedup?

                      \[\begin{array}{l} \\ 0 \end{array} \]
                      (FPCore (x n) :precision binary64 0.0)
                      double code(double x, double n) {
                      	return 0.0;
                      }
                      
                      real(8) function code(x, n)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: n
                          code = 0.0d0
                      end function
                      
                      public static double code(double x, double n) {
                      	return 0.0;
                      }
                      
                      def code(x, n):
                      	return 0.0
                      
                      function code(x, n)
                      	return 0.0
                      end
                      
                      function tmp = code(x, n)
                      	tmp = 0.0;
                      end
                      
                      code[x_, n_] := 0.0
                      
                      \begin{array}{l}
                      
                      \\
                      0
                      \end{array}
                      
                      Derivation
                      1. Initial program 55.6%

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

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

                        \[\leadsto 1 - \color{blue}{1} \]
                      5. Step-by-step derivation
                        1. metadata-eval33.5%

                          \[\leadsto \color{blue}{0} \]
                      6. Applied egg-rr33.5%

                        \[\leadsto \color{blue}{0} \]
                      7. Add Preprocessing

                      Reproduce

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