2nthrt (problem 3.4.6)

Percentage Accurate: 53.9% → 85.7%
Time: 42.3s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 53.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \end{array} \]
(FPCore (x n)
 :precision binary64
 (- (pow (+ x 1.0) (/ 1.0 n)) (pow x (/ 1.0 n))))
double code(double x, double n) {
	return pow((x + 1.0), (1.0 / n)) - pow(x, (1.0 / n));
}
real(8) function code(x, n)
    real(8), intent (in) :: x
    real(8), intent (in) :: n
    code = ((x + 1.0d0) ** (1.0d0 / n)) - (x ** (1.0d0 / n))
end function
public static double code(double x, double n) {
	return Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
}
def code(x, n):
	return math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n))
function code(x, n)
	return Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n)))
end
function tmp = code(x, n)
	tmp = ((x + 1.0) ^ (1.0 / n)) - (x ^ (1.0 / n));
end
code[x_, n_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 85.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;\frac{1}{n} \leq 5:\\
\;\;\;\;\frac{\frac{{\left({\left(e^{\log x}\right)}^{\left({n}^{-0.5}\right)}\right)}^{\left({n}^{-0.5}\right)}}{x}}{n}\\

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


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

    1. Initial program 92.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 inf

      \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
      3. log-recN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
      4. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
      5. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
      9. exp-to-powN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
      13. *-lowering-*.f6496.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
    5. Simplified96.4%

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

        \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
      3. pow-flipN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
      8. /-lowering-/.f6496.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
    7. Applied egg-rr96.5%

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

    if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51

    1. Initial program 27.1%

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

      \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
      3. log1p-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
      4. log1p-lowering-log1p.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
      5. log-lowering-log.f6482.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
    5. Simplified82.4%

      \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
    6. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
      2. diff-logN/A

        \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{1 + x}{x}\right), n\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{x + 1}{x}\right), n\right) \]
      4. log-lowering-log.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\left(\frac{x + 1}{x}\right)\right), n\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), x\right)\right), n\right) \]
      6. +-lowering-+.f6482.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), x\right)\right), n\right) \]
    7. Applied egg-rr82.6%

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

    if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5

    1. Initial program 4.9%

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

      \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
      3. log-recN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
      4. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
      5. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
      8. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
      9. exp-to-powN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
      13. *-lowering-*.f6477.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
    5. Simplified77.1%

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

        \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
      3. pow-flipN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
      4. distribute-neg-fracN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
      8. /-lowering-/.f6477.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
    7. Applied egg-rr77.3%

      \[\leadsto \color{blue}{\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{x}}{n}} \]
    8. Step-by-step derivation
      1. pow-to-expN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(e^{\log x \cdot \frac{1}{n}}\right), x\right), n\right) \]
      2. exp-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({\left(e^{\log x}\right)}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({\left(e^{\log x}\right)}^{\left({n}^{-1}\right)}\right), x\right), n\right) \]
      4. sqr-powN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({\left(e^{\log x}\right)}^{\left({n}^{\left(\frac{-1}{2}\right)} \cdot {n}^{\left(\frac{-1}{2}\right)}\right)}\right), x\right), n\right) \]
      5. pow-unpowN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({\left({\left(e^{\log x}\right)}^{\left({n}^{\left(\frac{-1}{2}\right)}\right)}\right)}^{\left({n}^{\left(\frac{-1}{2}\right)}\right)}\right), x\right), n\right) \]
      6. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left({\left(e^{\log x}\right)}^{\left({n}^{\left(\frac{-1}{2}\right)}\right)}\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), x\right), n\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\left(e^{\log x}\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), x\right), n\right) \]
      8. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\log x\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), x\right), n\right) \]
      9. log-lowering-log.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{log.f64}\left(x\right)\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), x\right), n\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{log.f64}\left(x\right)\right), \mathsf{pow.f64}\left(n, \left(\frac{-1}{2}\right)\right)\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), x\right), n\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{log.f64}\left(x\right)\right), \mathsf{pow.f64}\left(n, \frac{-1}{2}\right)\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), x\right), n\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{log.f64}\left(x\right)\right), \mathsf{pow.f64}\left(n, \frac{-1}{2}\right)\right), \mathsf{pow.f64}\left(n, \left(\frac{-1}{2}\right)\right)\right), x\right), n\right) \]
      13. metadata-eval77.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(\mathsf{exp.f64}\left(\mathsf{log.f64}\left(x\right)\right), \mathsf{pow.f64}\left(n, \frac{-1}{2}\right)\right), \mathsf{pow.f64}\left(n, \frac{-1}{2}\right)\right), x\right), n\right) \]
    9. Applied egg-rr77.5%

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

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

    1. Initial program 62.0%

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow-to-expN/A

        \[\leadsto \mathsf{\_.f64}\left(\left(e^{\log \left(x + 1\right) \cdot \frac{1}{n}}\right), \mathsf{pow.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      2. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\left(\log \left(x + 1\right) \cdot \frac{1}{n}\right)\right), \mathsf{pow.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      3. un-div-invN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\left(\frac{\log \left(x + 1\right)}{n}\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\log \left(x + 1\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\log \left(1 + x\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      6. log1p-defineN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      7. log1p-lowering-log1p.f64100.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{log1p.f64}\left(x\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
    4. Applied egg-rr100.0%

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

Alternative 2: 85.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 8 \cdot 10^{-269}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 18:\\ \;\;\;\;\frac{\frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n} - \log \left(\frac{x}{x + 1}\right)}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{\left(\frac{1}{x}\right)}^{\left(\frac{-1}{n}\right)}}{x}}{n}\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (if (<= x 8e-269)
   (- 1.0 (pow x (/ 1.0 n)))
   (if (<= x 18.0)
     (/
      (-
       (/
        (+
         (* 0.5 (* (log (* x (+ x 1.0))) (log (/ (+ x 1.0) x))))
         (*
          (- (pow (log1p x) 3.0) (pow (log x) 3.0))
          (/ 0.16666666666666666 n)))
        n)
       (log (/ x (+ x 1.0))))
      n)
     (/ (/ (pow (/ 1.0 x) (/ -1.0 n)) x) n))))
double code(double x, double n) {
	double tmp;
	if (x <= 8e-269) {
		tmp = 1.0 - pow(x, (1.0 / n));
	} else if (x <= 18.0) {
		tmp = ((((0.5 * (log((x * (x + 1.0))) * log(((x + 1.0) / x)))) + ((pow(log1p(x), 3.0) - pow(log(x), 3.0)) * (0.16666666666666666 / n))) / n) - log((x / (x + 1.0)))) / n;
	} else {
		tmp = (pow((1.0 / x), (-1.0 / n)) / x) / n;
	}
	return tmp;
}
public static double code(double x, double n) {
	double tmp;
	if (x <= 8e-269) {
		tmp = 1.0 - Math.pow(x, (1.0 / n));
	} else if (x <= 18.0) {
		tmp = ((((0.5 * (Math.log((x * (x + 1.0))) * Math.log(((x + 1.0) / x)))) + ((Math.pow(Math.log1p(x), 3.0) - Math.pow(Math.log(x), 3.0)) * (0.16666666666666666 / n))) / n) - Math.log((x / (x + 1.0)))) / n;
	} else {
		tmp = (Math.pow((1.0 / x), (-1.0 / n)) / x) / n;
	}
	return tmp;
}
def code(x, n):
	tmp = 0
	if x <= 8e-269:
		tmp = 1.0 - math.pow(x, (1.0 / n))
	elif x <= 18.0:
		tmp = ((((0.5 * (math.log((x * (x + 1.0))) * math.log(((x + 1.0) / x)))) + ((math.pow(math.log1p(x), 3.0) - math.pow(math.log(x), 3.0)) * (0.16666666666666666 / n))) / n) - math.log((x / (x + 1.0)))) / n
	else:
		tmp = (math.pow((1.0 / x), (-1.0 / n)) / x) / n
	return tmp
function code(x, n)
	tmp = 0.0
	if (x <= 8e-269)
		tmp = Float64(1.0 - (x ^ Float64(1.0 / n)));
	elseif (x <= 18.0)
		tmp = Float64(Float64(Float64(Float64(Float64(0.5 * Float64(log(Float64(x * Float64(x + 1.0))) * log(Float64(Float64(x + 1.0) / x)))) + Float64(Float64((log1p(x) ^ 3.0) - (log(x) ^ 3.0)) * Float64(0.16666666666666666 / n))) / n) - log(Float64(x / Float64(x + 1.0)))) / n);
	else
		tmp = Float64(Float64((Float64(1.0 / x) ^ Float64(-1.0 / n)) / x) / n);
	end
	return tmp
end
code[x_, n_] := If[LessEqual[x, 8e-269], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 18.0], N[(N[(N[(N[(N[(0.5 * N[(N[Log[N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[N[Log[1 + x], $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] * N[(0.16666666666666666 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] - N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(N[Power[N[(1.0 / x), $MachinePrecision], N[(-1.0 / n), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 8 \cdot 10^{-269}:\\
\;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 7.9999999999999997e-269

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

      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
    4. Step-by-step derivation
      1. Simplified67.1%

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

      if 7.9999999999999997e-269 < x < 18

      1. Initial program 35.2%

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

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

        \[\leadsto \color{blue}{\frac{\left(\log x - \mathsf{log1p}\left(x\right)\right) - \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) - \frac{-0.16666666666666666}{n} \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{0 - n}} \]
      5. Applied egg-rr84.4%

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

      if 18 < x

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

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6497.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified97.9%

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

          \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
        3. pow-flipN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
        4. distribute-neg-fracN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
        7. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
        8. /-lowering-/.f6499.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
      7. Applied egg-rr99.1%

        \[\leadsto \color{blue}{\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{x}}{n}} \]
      8. Step-by-step derivation
        1. frac-2negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(n\right)}\right)}\right), x\right), n\right) \]
        2. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{-1}{\mathsf{neg}\left(n\right)}\right)}\right), x\right), n\right) \]
        3. div-invN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(-1 \cdot \frac{1}{\mathsf{neg}\left(n\right)}\right)}\right), x\right), n\right) \]
        4. sub0-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(-1 \cdot \frac{1}{0 - n}\right)}\right), x\right), n\right) \]
        5. pow-unpowN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({\left({x}^{-1}\right)}^{\left(\frac{1}{0 - n}\right)}\right), x\right), n\right) \]
        6. inv-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({\left(\frac{1}{x}\right)}^{\left(\frac{1}{0 - n}\right)}\right), x\right), n\right) \]
        7. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\frac{1}{x}\right), \left(\frac{1}{0 - n}\right)\right), x\right), n\right) \]
        8. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, x\right), \left(\frac{1}{0 - n}\right)\right), x\right), n\right) \]
        9. sub0-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, x\right), \left(\frac{1}{\mathsf{neg}\left(n\right)}\right)\right), x\right), n\right) \]
        10. frac-2negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, x\right), \left(\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(n\right)\right)\right)}\right)\right), x\right), n\right) \]
        11. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, x\right), \left(\frac{-1}{\mathsf{neg}\left(\left(\mathsf{neg}\left(n\right)\right)\right)}\right)\right), x\right), n\right) \]
        12. remove-double-negN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, x\right), \left(\frac{-1}{n}\right)\right), x\right), n\right) \]
        13. /-lowering-/.f6499.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, x\right), \mathsf{/.f64}\left(-1, n\right)\right), x\right), n\right) \]
      9. Applied egg-rr99.1%

        \[\leadsto \frac{\frac{\color{blue}{{\left(\frac{1}{x}\right)}^{\left(\frac{-1}{n}\right)}}}{x}}{n} \]
    5. Recombined 3 regimes into one program.
    6. Final simplification88.7%

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

    Alternative 3: 85.7% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -2.5 \cdot 10^{-20}:\\ \;\;\;\;\frac{\frac{t\_0}{x}}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5:\\ \;\;\;\;\frac{\frac{{\left({x}^{\left({n}^{-0.5}\right)}\right)}^{\left({n}^{-0.5}\right)}}{x}}{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) -2.5e-20)
         (/ (/ t_0 x) n)
         (if (<= (/ 1.0 n) 2e-51)
           (/ (log (/ (+ x 1.0) x)) n)
           (if (<= (/ 1.0 n) 5.0)
             (/ (/ (pow (pow x (pow n -0.5)) (pow n -0.5)) 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) <= -2.5e-20) {
    		tmp = (t_0 / x) / n;
    	} else if ((1.0 / n) <= 2e-51) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5.0) {
    		tmp = (pow(pow(x, pow(n, -0.5)), pow(n, -0.5)) / 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) <= -2.5e-20) {
    		tmp = (t_0 / x) / n;
    	} else if ((1.0 / n) <= 2e-51) {
    		tmp = Math.log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5.0) {
    		tmp = (Math.pow(Math.pow(x, Math.pow(n, -0.5)), Math.pow(n, -0.5)) / 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) <= -2.5e-20:
    		tmp = (t_0 / x) / n
    	elif (1.0 / n) <= 2e-51:
    		tmp = math.log(((x + 1.0) / x)) / n
    	elif (1.0 / n) <= 5.0:
    		tmp = (math.pow(math.pow(x, math.pow(n, -0.5)), math.pow(n, -0.5)) / 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) <= -2.5e-20)
    		tmp = Float64(Float64(t_0 / x) / n);
    	elseif (Float64(1.0 / n) <= 2e-51)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	elseif (Float64(1.0 / n) <= 5.0)
    		tmp = Float64(Float64(((x ^ (n ^ -0.5)) ^ (n ^ -0.5)) / 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], -2.5e-20], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], N[(N[(N[Power[N[Power[x, N[Power[n, -0.5], $MachinePrecision]], $MachinePrecision], N[Power[n, -0.5], $MachinePrecision]], $MachinePrecision] / x), $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 -2.5 \cdot 10^{-20}:\\
    \;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5:\\
    \;\;\;\;\frac{\frac{{\left({x}^{\left({n}^{-0.5}\right)}\right)}^{\left({n}^{-0.5}\right)}}{x}}{n}\\
    
    \mathbf{else}:\\
    \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -2.4999999999999999e-20

      1. Initial program 92.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 inf

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6496.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified96.4%

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

          \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
        3. pow-flipN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
        4. distribute-neg-fracN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
        7. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
        8. /-lowering-/.f6496.5%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
      7. Applied egg-rr96.5%

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

      if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51

      1. Initial program 27.1%

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

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
        3. log1p-defineN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
        4. log1p-lowering-log1p.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
        5. log-lowering-log.f6482.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
      5. Simplified82.4%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. diff-logN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{1 + x}{x}\right), n\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{x + 1}{x}\right), n\right) \]
        4. log-lowering-log.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\left(\frac{x + 1}{x}\right)\right), n\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), x\right)\right), n\right) \]
        6. +-lowering-+.f6482.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), x\right)\right), n\right) \]
      7. Applied egg-rr82.6%

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

      if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5

      1. Initial program 4.9%

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

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6477.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified77.1%

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

          \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
        3. pow-flipN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
        4. distribute-neg-fracN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
        7. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
        8. /-lowering-/.f6477.3%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
      7. Applied egg-rr77.3%

        \[\leadsto \color{blue}{\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{x}}{n}} \]
      8. Step-by-step derivation
        1. inv-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left({n}^{-1}\right)}\right), x\right), n\right) \]
        2. sqr-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left({n}^{\left(\frac{-1}{2}\right)} \cdot {n}^{\left(\frac{-1}{2}\right)}\right)}\right), x\right), n\right) \]
        3. pow-unpowN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({\left({x}^{\left({n}^{\left(\frac{-1}{2}\right)}\right)}\right)}^{\left({n}^{\left(\frac{-1}{2}\right)}\right)}\right), x\right), n\right) \]
        4. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left({x}^{\left({n}^{\left(\frac{-1}{2}\right)}\right)}\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), x\right), n\right) \]
        5. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(x, \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), x\right), n\right) \]
        6. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{pow.f64}\left(n, \left(\frac{-1}{2}\right)\right)\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), x\right), n\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{pow.f64}\left(n, \frac{-1}{2}\right)\right), \left({n}^{\left(\frac{-1}{2}\right)}\right)\right), x\right), n\right) \]
        8. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{pow.f64}\left(n, \frac{-1}{2}\right)\right), \mathsf{pow.f64}\left(n, \left(\frac{-1}{2}\right)\right)\right), x\right), n\right) \]
        9. metadata-eval77.5%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{pow.f64}\left(n, \frac{-1}{2}\right)\right), \mathsf{pow.f64}\left(n, \frac{-1}{2}\right)\right), x\right), n\right) \]
      9. Applied egg-rr77.5%

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

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

      1. Initial program 62.0%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. pow-to-expN/A

          \[\leadsto \mathsf{\_.f64}\left(\left(e^{\log \left(x + 1\right) \cdot \frac{1}{n}}\right), \mathsf{pow.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        2. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\left(\log \left(x + 1\right) \cdot \frac{1}{n}\right)\right), \mathsf{pow.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        3. un-div-invN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\left(\frac{\log \left(x + 1\right)}{n}\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\log \left(x + 1\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\log \left(1 + x\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        6. log1p-defineN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        7. log1p-lowering-log1p.f64100.0%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{log1p.f64}\left(x\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. Applied egg-rr100.0%

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

    Alternative 4: 85.6% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -2.5 \cdot 10^{-20}:\\ \;\;\;\;\frac{\frac{t\_0}{x}}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 5:\\ \;\;\;\;\frac{\frac{1}{x \cdot n}}{{x}^{\left(\frac{-1}{n}\right)}}\\ \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) -2.5e-20)
         (/ (/ t_0 x) n)
         (if (<= (/ 1.0 n) 2e-51)
           (/ (log (/ (+ x 1.0) x)) n)
           (if (<= (/ 1.0 n) 5.0)
             (/ (/ 1.0 (* x n)) (pow x (/ -1.0 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) <= -2.5e-20) {
    		tmp = (t_0 / x) / n;
    	} else if ((1.0 / n) <= 2e-51) {
    		tmp = log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5.0) {
    		tmp = (1.0 / (x * n)) / pow(x, (-1.0 / 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) <= -2.5e-20) {
    		tmp = (t_0 / x) / n;
    	} else if ((1.0 / n) <= 2e-51) {
    		tmp = Math.log(((x + 1.0) / x)) / n;
    	} else if ((1.0 / n) <= 5.0) {
    		tmp = (1.0 / (x * n)) / Math.pow(x, (-1.0 / 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) <= -2.5e-20:
    		tmp = (t_0 / x) / n
    	elif (1.0 / n) <= 2e-51:
    		tmp = math.log(((x + 1.0) / x)) / n
    	elif (1.0 / n) <= 5.0:
    		tmp = (1.0 / (x * n)) / math.pow(x, (-1.0 / 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) <= -2.5e-20)
    		tmp = Float64(Float64(t_0 / x) / n);
    	elseif (Float64(1.0 / n) <= 2e-51)
    		tmp = Float64(log(Float64(Float64(x + 1.0) / x)) / n);
    	elseif (Float64(1.0 / n) <= 5.0)
    		tmp = Float64(Float64(1.0 / Float64(x * n)) / (x ^ Float64(-1.0 / 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], -2.5e-20], N[(N[(t$95$0 / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-51], N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5.0], N[(N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision] / N[Power[x, N[(-1.0 / n), $MachinePrecision]], $MachinePrecision]), $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 -2.5 \cdot 10^{-20}:\\
    \;\;\;\;\frac{\frac{t\_0}{x}}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-51}:\\
    \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5:\\
    \;\;\;\;\frac{\frac{1}{x \cdot n}}{{x}^{\left(\frac{-1}{n}\right)}}\\
    
    \mathbf{else}:\\
    \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -2.4999999999999999e-20

      1. Initial program 92.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 inf

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6496.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified96.4%

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

          \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
        3. pow-flipN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
        4. distribute-neg-fracN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
        7. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
        8. /-lowering-/.f6496.5%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
      7. Applied egg-rr96.5%

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

      if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51

      1. Initial program 27.1%

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

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
        3. log1p-defineN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
        4. log1p-lowering-log1p.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
        5. log-lowering-log.f6482.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
      5. Simplified82.4%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. diff-logN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{1 + x}{x}\right), n\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{x + 1}{x}\right), n\right) \]
        4. log-lowering-log.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\left(\frac{x + 1}{x}\right)\right), n\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), x\right)\right), n\right) \]
        6. +-lowering-+.f6482.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), x\right)\right), n\right) \]
      7. Applied egg-rr82.6%

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

      if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5

      1. Initial program 4.9%

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

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6477.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified77.1%

        \[\leadsto \color{blue}{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. associate-/l/N/A

          \[\leadsto \frac{1}{\color{blue}{\left(x \cdot n\right) \cdot {x}^{\left(\frac{-1}{n}\right)}}} \]
        2. associate-/r*N/A

          \[\leadsto \frac{\frac{1}{x \cdot n}}{\color{blue}{{x}^{\left(\frac{-1}{n}\right)}}} \]
        3. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{x \cdot n}\right), \color{blue}{\left({x}^{\left(\frac{-1}{n}\right)}\right)}\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(x \cdot n\right)\right), \left({\color{blue}{x}}^{\left(\frac{-1}{n}\right)}\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, n\right)\right), \left({x}^{\left(\frac{-1}{n}\right)}\right)\right) \]
        6. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, n\right)\right), \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{-1}{n}\right)}\right)\right) \]
        7. /-lowering-/.f6477.3%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{n}\right)\right)\right) \]
      7. Applied egg-rr77.3%

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

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

      1. Initial program 62.0%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. pow-to-expN/A

          \[\leadsto \mathsf{\_.f64}\left(\left(e^{\log \left(x + 1\right) \cdot \frac{1}{n}}\right), \mathsf{pow.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        2. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\left(\log \left(x + 1\right) \cdot \frac{1}{n}\right)\right), \mathsf{pow.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        3. un-div-invN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\left(\frac{\log \left(x + 1\right)}{n}\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\log \left(x + 1\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\log \left(1 + x\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        6. log1p-defineN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        7. log1p-lowering-log1p.f64100.0%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{log1p.f64}\left(x\right), n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. Applied egg-rr100.0%

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

    Alternative 5: 81.5% accurate, 1.4× speedup?

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

      1. Initial program 92.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 inf

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6496.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified96.4%

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

          \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
        3. pow-flipN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
        4. distribute-neg-fracN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
        7. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
        8. /-lowering-/.f6496.5%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
      7. Applied egg-rr96.5%

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

      if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51

      1. Initial program 27.1%

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

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
        3. log1p-defineN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
        4. log1p-lowering-log1p.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
        5. log-lowering-log.f6482.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
      5. Simplified82.4%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. diff-logN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{1 + x}{x}\right), n\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{x + 1}{x}\right), n\right) \]
        4. log-lowering-log.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\left(\frac{x + 1}{x}\right)\right), n\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), x\right)\right), n\right) \]
        6. +-lowering-+.f6482.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), x\right)\right), n\right) \]
      7. Applied egg-rr82.6%

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

      if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5

      1. Initial program 4.9%

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

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6477.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified77.1%

        \[\leadsto \color{blue}{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. associate-/l/N/A

          \[\leadsto \frac{1}{\color{blue}{\left(x \cdot n\right) \cdot {x}^{\left(\frac{-1}{n}\right)}}} \]
        2. associate-/r*N/A

          \[\leadsto \frac{\frac{1}{x \cdot n}}{\color{blue}{{x}^{\left(\frac{-1}{n}\right)}}} \]
        3. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{x \cdot n}\right), \color{blue}{\left({x}^{\left(\frac{-1}{n}\right)}\right)}\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(x \cdot n\right)\right), \left({\color{blue}{x}}^{\left(\frac{-1}{n}\right)}\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, n\right)\right), \left({x}^{\left(\frac{-1}{n}\right)}\right)\right) \]
        6. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, n\right)\right), \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{-1}{n}\right)}\right)\right) \]
        7. /-lowering-/.f6477.3%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{n}\right)\right)\right) \]
      7. Applied egg-rr77.3%

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

      if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187

      1. Initial program 84.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

        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + \frac{x}{n}\right)}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. Step-by-step derivation
        1. *-rgt-identityN/A

          \[\leadsto \mathsf{\_.f64}\left(\left(1 + \frac{x \cdot 1}{n}\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        2. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(\left(1 + x \cdot \frac{1}{n}\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \frac{1}{n}\right)\right), \mathsf{pow.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        4. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{x \cdot 1}{n}\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        5. *-rgt-identityN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{x}{n}\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        6. /-lowering-/.f6484.9%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(x, n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      5. Simplified84.9%

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

      if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 41.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

        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)\right), \mathsf{pow.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\frac{1}{n} + x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{1}{n}\right), \left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        8. +-lowering-+.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{{n}^{2}}\right), \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        9. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{\frac{1}{2} \cdot 1}{{n}^{2}}\right), \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        10. metadata-evalN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{\frac{1}{2}}{{n}^{2}}\right), \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, \left({n}^{2}\right)\right), \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        12. unpow2N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, \left(n \cdot n\right)\right), \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(n, n\right)\right), \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        14. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(n, n\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{n}\right)\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        15. metadata-evalN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(n, n\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{n}\right)\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        16. distribute-neg-fracN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(n, n\right)\right), \left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{n}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        17. metadata-evalN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(n, n\right)\right), \left(\frac{\frac{-1}{2}}{n}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        18. /-lowering-/.f6474.7%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(n, n\right)\right), \mathsf{/.f64}\left(\frac{-1}{2}, n\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      5. Simplified74.7%

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

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

    Alternative 6: 81.2% accurate, 1.5× speedup?

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

      1. Initial program 92.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 inf

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6496.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified96.4%

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

          \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
        3. pow-flipN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
        4. distribute-neg-fracN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
        7. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
        8. /-lowering-/.f6496.5%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
      7. Applied egg-rr96.5%

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

      if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51

      1. Initial program 27.1%

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

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
        3. log1p-defineN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
        4. log1p-lowering-log1p.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
        5. log-lowering-log.f6482.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
      5. Simplified82.4%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. diff-logN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{1 + x}{x}\right), n\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{x + 1}{x}\right), n\right) \]
        4. log-lowering-log.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\left(\frac{x + 1}{x}\right)\right), n\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), x\right)\right), n\right) \]
        6. +-lowering-+.f6482.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), x\right)\right), n\right) \]
      7. Applied egg-rr82.6%

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

      if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5

      1. Initial program 4.9%

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

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6477.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified77.1%

        \[\leadsto \color{blue}{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x \cdot n}} \]
      6. Step-by-step derivation
        1. associate-/l/N/A

          \[\leadsto \frac{1}{\color{blue}{\left(x \cdot n\right) \cdot {x}^{\left(\frac{-1}{n}\right)}}} \]
        2. associate-/r*N/A

          \[\leadsto \frac{\frac{1}{x \cdot n}}{\color{blue}{{x}^{\left(\frac{-1}{n}\right)}}} \]
        3. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{x \cdot n}\right), \color{blue}{\left({x}^{\left(\frac{-1}{n}\right)}\right)}\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(x \cdot n\right)\right), \left({\color{blue}{x}}^{\left(\frac{-1}{n}\right)}\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, n\right)\right), \left({x}^{\left(\frac{-1}{n}\right)}\right)\right) \]
        6. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, n\right)\right), \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{-1}{n}\right)}\right)\right) \]
        7. /-lowering-/.f6477.3%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, \color{blue}{n}\right)\right)\right) \]
      7. Applied egg-rr77.3%

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

      if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187

      1. Initial program 84.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

        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + \frac{x}{n}\right)}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. Step-by-step derivation
        1. *-rgt-identityN/A

          \[\leadsto \mathsf{\_.f64}\left(\left(1 + \frac{x \cdot 1}{n}\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        2. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(\left(1 + x \cdot \frac{1}{n}\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \frac{1}{n}\right)\right), \mathsf{pow.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        4. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{x \cdot 1}{n}\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        5. *-rgt-identityN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{x}{n}\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        6. /-lowering-/.f6484.9%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(x, n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      5. Simplified84.9%

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

      if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 41.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

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
        3. log1p-defineN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
        4. log1p-lowering-log1p.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
        5. log-lowering-log.f646.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
      5. Simplified6.4%

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

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)}, n\right) \]
      7. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}\right), x\right), n\right) \]
        2. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 + \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\left(\frac{\frac{1}{3}}{{x}^{2}}\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
        8. associate-*r/N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right)\right), x\right), n\right) \]
        9. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
        10. /-lowering-/.f6458.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right)\right), x\right), n\right) \]
      8. Simplified58.8%

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

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

    Alternative 7: 81.2% accurate, 1.5× speedup?

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

      1. Initial program 78.8%

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

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6493.5%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified93.5%

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

          \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
        3. pow-flipN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
        4. distribute-neg-fracN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
        7. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
        8. /-lowering-/.f6493.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
      7. Applied egg-rr93.6%

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

      if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51

      1. Initial program 27.1%

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

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
        3. log1p-defineN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
        4. log1p-lowering-log1p.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
        5. log-lowering-log.f6482.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
      5. Simplified82.4%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. diff-logN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{1 + x}{x}\right), n\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{x + 1}{x}\right), n\right) \]
        4. log-lowering-log.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\left(\frac{x + 1}{x}\right)\right), n\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), x\right)\right), n\right) \]
        6. +-lowering-+.f6482.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), x\right)\right), n\right) \]
      7. Applied egg-rr82.6%

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

      if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187

      1. Initial program 84.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

        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + \frac{x}{n}\right)}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. Step-by-step derivation
        1. *-rgt-identityN/A

          \[\leadsto \mathsf{\_.f64}\left(\left(1 + \frac{x \cdot 1}{n}\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        2. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(\left(1 + x \cdot \frac{1}{n}\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(x \cdot \frac{1}{n}\right)\right), \mathsf{pow.f64}\left(\color{blue}{x}, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        4. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{x \cdot 1}{n}\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        5. *-rgt-identityN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{x}{n}\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        6. /-lowering-/.f6484.9%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(x, n\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      5. Simplified84.9%

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

      if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 41.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

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
        3. log1p-defineN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
        4. log1p-lowering-log1p.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
        5. log-lowering-log.f646.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
      5. Simplified6.4%

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

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)}, n\right) \]
      7. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}\right), x\right), n\right) \]
        2. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 + \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\left(\frac{\frac{1}{3}}{{x}^{2}}\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
        8. associate-*r/N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right)\right), x\right), n\right) \]
        9. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
        10. /-lowering-/.f6458.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right)\right), x\right), n\right) \]
      8. Simplified58.8%

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

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

    Alternative 8: 81.1% accurate, 1.6× speedup?

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

      1. Initial program 78.8%

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

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        3. log-recN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        4. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
        5. exp-negN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
        7. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        8. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
        9. exp-to-powN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
        10. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6493.5%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      5. Simplified93.5%

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

          \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
        3. pow-flipN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
        4. distribute-neg-fracN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
        5. metadata-evalN/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
        7. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
        8. /-lowering-/.f6493.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
      7. Applied egg-rr93.6%

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

      if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51

      1. Initial program 27.1%

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

        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
        3. log1p-defineN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
        4. log1p-lowering-log1p.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
        5. log-lowering-log.f6482.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
      5. Simplified82.4%

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
        2. diff-logN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{1 + x}{x}\right), n\right) \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{x + 1}{x}\right), n\right) \]
        4. log-lowering-log.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\left(\frac{x + 1}{x}\right)\right), n\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), x\right)\right), n\right) \]
        6. +-lowering-+.f6482.6%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), x\right)\right), n\right) \]
      7. Applied egg-rr82.6%

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

      if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187

      1. Initial program 84.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

        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. Step-by-step derivation
        1. Simplified84.0%

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

        if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n)

        1. Initial program 41.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

          \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
        4. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
          2. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
          3. log1p-defineN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
          4. log1p-lowering-log1p.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
          5. log-lowering-log.f646.4%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
        5. Simplified6.4%

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

          \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)}, n\right) \]
        7. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}\right), x\right), n\right) \]
          2. associate--l+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 + \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
          4. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\left(\frac{\frac{1}{3}}{{x}^{2}}\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
          5. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
          6. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
          8. associate-*r/N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right)\right), x\right), n\right) \]
          9. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
          10. /-lowering-/.f6458.8%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right)\right), x\right), n\right) \]
        8. Simplified58.8%

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

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

      Alternative 9: 81.1% accurate, 1.6× speedup?

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

        1. Initial program 78.8%

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

          \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
        4. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
          2. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
          3. log-recN/A

            \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
          4. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
          5. exp-negN/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
          6. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
          8. associate-/l*N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
          9. exp-to-powN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
          10. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
          11. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
          12. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
          13. *-lowering-*.f6493.5%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
        5. Simplified93.5%

          \[\leadsto \color{blue}{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x \cdot n}} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{n \cdot \color{blue}{x}} \]
          2. associate-/r*N/A

            \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{n}}{\color{blue}{x}} \]
          3. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{n}\right), \color{blue}{x}\right) \]
          4. pow-flipN/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{n}\right), x\right) \]
          5. distribute-neg-fracN/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{n}\right), x\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{n}\right), x\right) \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), n\right), x\right) \]
          8. pow-lowering-pow.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), n\right), x\right) \]
          9. /-lowering-/.f6493.5%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), n\right), x\right) \]
        7. Applied egg-rr93.5%

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

        if -2.4999999999999999e-20 < (/.f64 #s(literal 1 binary64) n) < 2e-51

        1. Initial program 27.1%

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

          \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
        4. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
          2. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
          3. log1p-defineN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
          4. log1p-lowering-log1p.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
          5. log-lowering-log.f6482.4%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
        5. Simplified82.4%

          \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
          2. diff-logN/A

            \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{1 + x}{x}\right), n\right) \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{x + 1}{x}\right), n\right) \]
          4. log-lowering-log.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\left(\frac{x + 1}{x}\right)\right), n\right) \]
          5. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), x\right)\right), n\right) \]
          6. +-lowering-+.f6482.6%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), x\right)\right), n\right) \]
        7. Applied egg-rr82.6%

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

        if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187

        1. Initial program 84.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

          \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
        4. Step-by-step derivation
          1. Simplified84.0%

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

          if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n)

          1. Initial program 41.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

            \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
          4. Step-by-step derivation
            1. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
            2. --lowering--.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
            3. log1p-defineN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
            4. log1p-lowering-log1p.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
            5. log-lowering-log.f646.4%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
          5. Simplified6.4%

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

            \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)}, n\right) \]
          7. Step-by-step derivation
            1. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}\right), x\right), n\right) \]
            2. associate--l+N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 + \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
            3. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
            4. --lowering--.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\left(\frac{\frac{1}{3}}{{x}^{2}}\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
            5. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
            6. unpow2N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
            7. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
            8. associate-*r/N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right)\right), x\right), n\right) \]
            9. metadata-evalN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
            10. /-lowering-/.f6458.8%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right)\right), x\right), n\right) \]
          8. Simplified58.8%

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

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

        Alternative 10: 66.5% accurate, 1.7× speedup?

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

          1. Initial program 53.1%

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

            \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
          4. Step-by-step derivation
            1. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
            2. --lowering--.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
            3. log1p-defineN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
            4. log1p-lowering-log1p.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
            5. log-lowering-log.f6471.7%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
          5. Simplified71.7%

            \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
          6. Step-by-step derivation
            1. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
            2. diff-logN/A

              \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{1 + x}{x}\right), n\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(\log \left(\frac{x + 1}{x}\right), n\right) \]
            4. log-lowering-log.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\left(\frac{x + 1}{x}\right)\right), n\right) \]
            5. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), x\right)\right), n\right) \]
            6. +-lowering-+.f6471.9%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), x\right)\right), n\right) \]
          7. Applied egg-rr71.9%

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

          if 2e-51 < (/.f64 #s(literal 1 binary64) n) < 5

          1. Initial program 4.9%

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

            \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
          4. Step-by-step derivation
            1. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
            2. mul-1-negN/A

              \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
            3. log-recN/A

              \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
            4. mul-1-negN/A

              \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
            5. exp-negN/A

              \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
            6. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
            8. associate-/l*N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
            9. exp-to-powN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
            10. pow-lowering-pow.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
            11. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
            13. *-lowering-*.f6477.1%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
          5. Simplified77.1%

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

              \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
            3. pow-flipN/A

              \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
            4. distribute-neg-fracN/A

              \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
            5. metadata-evalN/A

              \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
            6. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
            7. pow-lowering-pow.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
            8. /-lowering-/.f6477.3%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
          7. Applied egg-rr77.3%

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

            \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{x}\right)}, n\right) \]
          9. Step-by-step derivation
            1. /-lowering-/.f6457.6%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, x\right), n\right) \]
          10. Simplified57.6%

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

          if 5 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999981e187

          1. Initial program 84.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

            \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
          4. Step-by-step derivation
            1. Simplified84.0%

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

            if 1.99999999999999981e187 < (/.f64 #s(literal 1 binary64) n)

            1. Initial program 41.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

              \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
            4. Step-by-step derivation
              1. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
              2. --lowering--.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
              3. log1p-defineN/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
              4. log1p-lowering-log1p.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
              5. log-lowering-log.f646.4%

                \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
            5. Simplified6.4%

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

              \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)}, n\right) \]
            7. Step-by-step derivation
              1. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}\right), x\right), n\right) \]
              2. associate--l+N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 + \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
              3. +-lowering-+.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
              4. --lowering--.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\left(\frac{\frac{1}{3}}{{x}^{2}}\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
              5. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
              6. unpow2N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
              7. *-lowering-*.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
              8. associate-*r/N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right)\right), x\right), n\right) \]
              9. metadata-evalN/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
              10. /-lowering-/.f6458.8%

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right)\right), x\right), n\right) \]
            8. Simplified58.8%

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

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

          Alternative 11: 59.0% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 10^{-267}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 2.55 \cdot 10^{-40}:\\ \;\;\;\;\frac{\log x}{0 - n}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;\frac{0.16666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right) + n \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + x \cdot -0.5\right) + \left(x \cdot n\right) \cdot \left(x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right) + 1\right)\right)}{n \cdot \left(n \cdot n\right)}\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+53}:\\ \;\;\;\;\frac{\frac{1 + \frac{-0.5 - \frac{\frac{0.25}{x} + -0.3333333333333333}{x}}{x}}{x}}{n}\\ \mathbf{elif}\;x \leq 4 \cdot 10^{+147}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+196}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
          (FPCore (x n)
           :precision binary64
           (if (<= x 1e-267)
             (- 1.0 (pow x (/ 1.0 n)))
             (if (<= x 2.55e-40)
               (/ (log x) (- 0.0 n))
               (if (<= x 1.0)
                 (/
                  (+
                   (* 0.16666666666666666 (* x (* x x)))
                   (*
                    n
                    (+
                     (* (* x x) (+ 0.5 (* x -0.5)))
                     (* (* x n) (+ (* x (+ -0.5 (* x 0.3333333333333333))) 1.0)))))
                  (* n (* n n)))
                 (if (<= x 2.8e+53)
                   (/
                    (/ (+ 1.0 (/ (- -0.5 (/ (+ (/ 0.25 x) -0.3333333333333333) x)) x)) x)
                    n)
                   (if (<= x 4e+147)
                     0.0
                     (if (<= x 5.2e+196) (/ (/ (- 1.0 (/ 0.5 x)) x) n) 0.0)))))))
          double code(double x, double n) {
          	double tmp;
          	if (x <= 1e-267) {
          		tmp = 1.0 - pow(x, (1.0 / n));
          	} else if (x <= 2.55e-40) {
          		tmp = log(x) / (0.0 - n);
          	} else if (x <= 1.0) {
          		tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n));
          	} else if (x <= 2.8e+53) {
          		tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n;
          	} else if (x <= 4e+147) {
          		tmp = 0.0;
          	} else if (x <= 5.2e+196) {
          		tmp = ((1.0 - (0.5 / 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 <= 1d-267) then
                  tmp = 1.0d0 - (x ** (1.0d0 / n))
              else if (x <= 2.55d-40) then
                  tmp = log(x) / (0.0d0 - n)
              else if (x <= 1.0d0) then
                  tmp = ((0.16666666666666666d0 * (x * (x * x))) + (n * (((x * x) * (0.5d0 + (x * (-0.5d0)))) + ((x * n) * ((x * ((-0.5d0) + (x * 0.3333333333333333d0))) + 1.0d0))))) / (n * (n * n))
              else if (x <= 2.8d+53) then
                  tmp = ((1.0d0 + (((-0.5d0) - (((0.25d0 / x) + (-0.3333333333333333d0)) / x)) / x)) / x) / n
              else if (x <= 4d+147) then
                  tmp = 0.0d0
              else if (x <= 5.2d+196) then
                  tmp = ((1.0d0 - (0.5d0 / 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 <= 1e-267) {
          		tmp = 1.0 - Math.pow(x, (1.0 / n));
          	} else if (x <= 2.55e-40) {
          		tmp = Math.log(x) / (0.0 - n);
          	} else if (x <= 1.0) {
          		tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n));
          	} else if (x <= 2.8e+53) {
          		tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n;
          	} else if (x <= 4e+147) {
          		tmp = 0.0;
          	} else if (x <= 5.2e+196) {
          		tmp = ((1.0 - (0.5 / x)) / x) / n;
          	} else {
          		tmp = 0.0;
          	}
          	return tmp;
          }
          
          def code(x, n):
          	tmp = 0
          	if x <= 1e-267:
          		tmp = 1.0 - math.pow(x, (1.0 / n))
          	elif x <= 2.55e-40:
          		tmp = math.log(x) / (0.0 - n)
          	elif x <= 1.0:
          		tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n))
          	elif x <= 2.8e+53:
          		tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n
          	elif x <= 4e+147:
          		tmp = 0.0
          	elif x <= 5.2e+196:
          		tmp = ((1.0 - (0.5 / x)) / x) / n
          	else:
          		tmp = 0.0
          	return tmp
          
          function code(x, n)
          	tmp = 0.0
          	if (x <= 1e-267)
          		tmp = Float64(1.0 - (x ^ Float64(1.0 / n)));
          	elseif (x <= 2.55e-40)
          		tmp = Float64(log(x) / Float64(0.0 - n));
          	elseif (x <= 1.0)
          		tmp = Float64(Float64(Float64(0.16666666666666666 * Float64(x * Float64(x * x))) + Float64(n * Float64(Float64(Float64(x * x) * Float64(0.5 + Float64(x * -0.5))) + Float64(Float64(x * n) * Float64(Float64(x * Float64(-0.5 + Float64(x * 0.3333333333333333))) + 1.0))))) / Float64(n * Float64(n * n)));
          	elseif (x <= 2.8e+53)
          		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(-0.5 - Float64(Float64(Float64(0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n);
          	elseif (x <= 4e+147)
          		tmp = 0.0;
          	elseif (x <= 5.2e+196)
          		tmp = Float64(Float64(Float64(1.0 - Float64(0.5 / x)) / x) / n);
          	else
          		tmp = 0.0;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, n)
          	tmp = 0.0;
          	if (x <= 1e-267)
          		tmp = 1.0 - (x ^ (1.0 / n));
          	elseif (x <= 2.55e-40)
          		tmp = log(x) / (0.0 - n);
          	elseif (x <= 1.0)
          		tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n));
          	elseif (x <= 2.8e+53)
          		tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n;
          	elseif (x <= 4e+147)
          		tmp = 0.0;
          	elseif (x <= 5.2e+196)
          		tmp = ((1.0 - (0.5 / x)) / x) / n;
          	else
          		tmp = 0.0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, n_] := If[LessEqual[x, 1e-267], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.55e-40], N[(N[Log[x], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.0], N[(N[(N[(0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * n), $MachinePrecision] * N[(N[(x * N[(-0.5 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e+53], N[(N[(N[(1.0 + N[(N[(-0.5 - N[(N[(N[(0.25 / x), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 4e+147], 0.0, If[LessEqual[x, 5.2e+196], N[(N[(N[(1.0 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], 0.0]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq 10^{-267}:\\
          \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
          
          \mathbf{elif}\;x \leq 2.55 \cdot 10^{-40}:\\
          \;\;\;\;\frac{\log x}{0 - n}\\
          
          \mathbf{elif}\;x \leq 1:\\
          \;\;\;\;\frac{0.16666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right) + n \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + x \cdot -0.5\right) + \left(x \cdot n\right) \cdot \left(x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right) + 1\right)\right)}{n \cdot \left(n \cdot n\right)}\\
          
          \mathbf{elif}\;x \leq 2.8 \cdot 10^{+53}:\\
          \;\;\;\;\frac{\frac{1 + \frac{-0.5 - \frac{\frac{0.25}{x} + -0.3333333333333333}{x}}{x}}{x}}{n}\\
          
          \mathbf{elif}\;x \leq 4 \cdot 10^{+147}:\\
          \;\;\;\;0\\
          
          \mathbf{elif}\;x \leq 5.2 \cdot 10^{+196}:\\
          \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{x}}{n}\\
          
          \mathbf{else}:\\
          \;\;\;\;0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 6 regimes
          2. if x < 9.9999999999999998e-268

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

              \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
            4. Step-by-step derivation
              1. Simplified67.1%

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

              if 9.9999999999999998e-268 < x < 2.55000000000000019e-40

              1. Initial program 31.8%

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

                \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
              4. Step-by-step derivation
                1. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
                2. --lowering--.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
                3. log1p-defineN/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
                4. log1p-lowering-log1p.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
                5. log-lowering-log.f6459.3%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
              5. Simplified59.3%

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

                \[\leadsto \color{blue}{-1 \cdot \frac{\log x}{n}} \]
              7. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \mathsf{neg}\left(\frac{\log x}{n}\right) \]
                2. neg-lowering-neg.f64N/A

                  \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\log x}{n}\right)\right) \]
                3. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\log x, n\right)\right) \]
                4. log-lowering-log.f6459.3%

                  \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right) \]
              8. Simplified59.3%

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

              if 2.55000000000000019e-40 < x < 1

              1. Initial program 64.7%

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

                \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + x \cdot \left(x \cdot \left(\left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} + x \cdot \left(\left(\frac{1}{6} \cdot \frac{1}{{n}^{3}} + \frac{1}{3} \cdot \frac{1}{n}\right) - \frac{1}{2} \cdot \frac{1}{{n}^{2}}\right)\right) - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
              4. Simplified18.0%

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

                \[\leadsto \color{blue}{\frac{\frac{1}{6} \cdot {x}^{3} + n \cdot \left(n \cdot \left(x \cdot \left(1 + x \cdot \left(\frac{1}{3} \cdot x - \frac{1}{2}\right)\right)\right) + {x}^{2} \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)\right)}{{n}^{3}}} \]
              6. Step-by-step derivation
                1. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{6} \cdot {x}^{3} + n \cdot \left(n \cdot \left(x \cdot \left(1 + x \cdot \left(\frac{1}{3} \cdot x - \frac{1}{2}\right)\right)\right) + {x}^{2} \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)\right)\right), \color{blue}{\left({n}^{3}\right)}\right) \]
              7. Simplified71.3%

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

              if 1 < x < 2.8e53

              1. Initial program 32.1%

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

                \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
              4. Step-by-step derivation
                1. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
                2. --lowering--.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
                3. log1p-defineN/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
                4. log1p-lowering-log1p.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
                5. log-lowering-log.f6426.4%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
              5. Simplified26.4%

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

                \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{x} - \frac{1}{3}}{x} - \frac{1}{2}}{x} - 1}{x}\right)}, n\right) \]
              7. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{x} - \frac{1}{3}}{x} - \frac{1}{2}}{x} - 1}{x}\right)\right), n\right) \]
                2. neg-lowering-neg.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\frac{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{x} - \frac{1}{3}}{x} - \frac{1}{2}}{x} - 1}{x}\right)\right), n\right) \]
                3. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{x} - \frac{1}{3}}{x} - \frac{1}{2}}{x} - 1\right), x\right)\right), n\right) \]
              8. Simplified64.0%

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

              if 2.8e53 < x < 3.9999999999999999e147 or 5.20000000000000024e196 < x

              1. Initial program 81.7%

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

                \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
              4. Step-by-step derivation
                1. Simplified33.8%

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

                  \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                3. Step-by-step derivation
                  1. Simplified81.7%

                    \[\leadsto 1 - \color{blue}{1} \]
                  2. Step-by-step derivation
                    1. metadata-eval81.7%

                      \[\leadsto 0 \]
                  3. Applied egg-rr81.7%

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

                  if 3.9999999999999999e147 < x < 5.20000000000000024e196

                  1. Initial program 44.1%

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

                    \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                  4. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
                    2. --lowering--.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
                    3. log1p-defineN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
                    4. log1p-lowering-log1p.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
                    5. log-lowering-log.f6444.1%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                  5. Simplified44.1%

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

                    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1 - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)}, n\right) \]
                  7. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 - \frac{1}{2} \cdot \frac{1}{x}\right), x\right), n\right) \]
                    2. --lowering--.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
                    3. associate-*r/N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right), x\right), n\right) \]
                    4. metadata-evalN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2}}{x}\right)\right), x\right), n\right) \]
                    5. /-lowering-/.f6478.9%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right), x\right), n\right) \]
                  8. Simplified78.9%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 10^{-267}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 2.55 \cdot 10^{-40}:\\ \;\;\;\;\frac{\log x}{0 - n}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;\frac{0.16666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right) + n \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + x \cdot -0.5\right) + \left(x \cdot n\right) \cdot \left(x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right) + 1\right)\right)}{n \cdot \left(n \cdot n\right)}\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+53}:\\ \;\;\;\;\frac{\frac{1 + \frac{-0.5 - \frac{\frac{0.25}{x} + -0.3333333333333333}{x}}{x}}{x}}{n}\\ \mathbf{elif}\;x \leq 4 \cdot 10^{+147}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+196}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                6. Add Preprocessing

                Alternative 12: 58.4% accurate, 1.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 4.3 \cdot 10^{-41}:\\ \;\;\;\;\frac{\log x}{0 - n}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;\frac{0.16666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right) + n \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + x \cdot -0.5\right) + \left(x \cdot n\right) \cdot \left(x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right) + 1\right)\right)}{n \cdot \left(n \cdot n\right)}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+56}:\\ \;\;\;\;\frac{\frac{1 + \frac{-0.5 - \frac{\frac{0.25}{x} + -0.3333333333333333}{x}}{x}}{x}}{n}\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+151}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{+197}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                (FPCore (x n)
                 :precision binary64
                 (if (<= x 4.3e-41)
                   (/ (log x) (- 0.0 n))
                   (if (<= x 1.0)
                     (/
                      (+
                       (* 0.16666666666666666 (* x (* x x)))
                       (*
                        n
                        (+
                         (* (* x x) (+ 0.5 (* x -0.5)))
                         (* (* x n) (+ (* x (+ -0.5 (* x 0.3333333333333333))) 1.0)))))
                      (* n (* n n)))
                     (if (<= x 2.6e+56)
                       (/
                        (/ (+ 1.0 (/ (- -0.5 (/ (+ (/ 0.25 x) -0.3333333333333333) x)) x)) x)
                        n)
                       (if (<= x 5.2e+151)
                         0.0
                         (if (<= x 4.4e+197) (/ (/ (- 1.0 (/ 0.5 x)) x) n) 0.0))))))
                double code(double x, double n) {
                	double tmp;
                	if (x <= 4.3e-41) {
                		tmp = log(x) / (0.0 - n);
                	} else if (x <= 1.0) {
                		tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n));
                	} else if (x <= 2.6e+56) {
                		tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n;
                	} else if (x <= 5.2e+151) {
                		tmp = 0.0;
                	} else if (x <= 4.4e+197) {
                		tmp = ((1.0 - (0.5 / 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 <= 4.3d-41) then
                        tmp = log(x) / (0.0d0 - n)
                    else if (x <= 1.0d0) then
                        tmp = ((0.16666666666666666d0 * (x * (x * x))) + (n * (((x * x) * (0.5d0 + (x * (-0.5d0)))) + ((x * n) * ((x * ((-0.5d0) + (x * 0.3333333333333333d0))) + 1.0d0))))) / (n * (n * n))
                    else if (x <= 2.6d+56) then
                        tmp = ((1.0d0 + (((-0.5d0) - (((0.25d0 / x) + (-0.3333333333333333d0)) / x)) / x)) / x) / n
                    else if (x <= 5.2d+151) then
                        tmp = 0.0d0
                    else if (x <= 4.4d+197) then
                        tmp = ((1.0d0 - (0.5d0 / 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 <= 4.3e-41) {
                		tmp = Math.log(x) / (0.0 - n);
                	} else if (x <= 1.0) {
                		tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n));
                	} else if (x <= 2.6e+56) {
                		tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n;
                	} else if (x <= 5.2e+151) {
                		tmp = 0.0;
                	} else if (x <= 4.4e+197) {
                		tmp = ((1.0 - (0.5 / x)) / x) / n;
                	} else {
                		tmp = 0.0;
                	}
                	return tmp;
                }
                
                def code(x, n):
                	tmp = 0
                	if x <= 4.3e-41:
                		tmp = math.log(x) / (0.0 - n)
                	elif x <= 1.0:
                		tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n))
                	elif x <= 2.6e+56:
                		tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n
                	elif x <= 5.2e+151:
                		tmp = 0.0
                	elif x <= 4.4e+197:
                		tmp = ((1.0 - (0.5 / x)) / x) / n
                	else:
                		tmp = 0.0
                	return tmp
                
                function code(x, n)
                	tmp = 0.0
                	if (x <= 4.3e-41)
                		tmp = Float64(log(x) / Float64(0.0 - n));
                	elseif (x <= 1.0)
                		tmp = Float64(Float64(Float64(0.16666666666666666 * Float64(x * Float64(x * x))) + Float64(n * Float64(Float64(Float64(x * x) * Float64(0.5 + Float64(x * -0.5))) + Float64(Float64(x * n) * Float64(Float64(x * Float64(-0.5 + Float64(x * 0.3333333333333333))) + 1.0))))) / Float64(n * Float64(n * n)));
                	elseif (x <= 2.6e+56)
                		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(-0.5 - Float64(Float64(Float64(0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n);
                	elseif (x <= 5.2e+151)
                		tmp = 0.0;
                	elseif (x <= 4.4e+197)
                		tmp = Float64(Float64(Float64(1.0 - Float64(0.5 / x)) / x) / n);
                	else
                		tmp = 0.0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, n)
                	tmp = 0.0;
                	if (x <= 4.3e-41)
                		tmp = log(x) / (0.0 - n);
                	elseif (x <= 1.0)
                		tmp = ((0.16666666666666666 * (x * (x * x))) + (n * (((x * x) * (0.5 + (x * -0.5))) + ((x * n) * ((x * (-0.5 + (x * 0.3333333333333333))) + 1.0))))) / (n * (n * n));
                	elseif (x <= 2.6e+56)
                		tmp = ((1.0 + ((-0.5 - (((0.25 / x) + -0.3333333333333333) / x)) / x)) / x) / n;
                	elseif (x <= 5.2e+151)
                		tmp = 0.0;
                	elseif (x <= 4.4e+197)
                		tmp = ((1.0 - (0.5 / x)) / x) / n;
                	else
                		tmp = 0.0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, n_] := If[LessEqual[x, 4.3e-41], N[(N[Log[x], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.0], N[(N[(N[(0.16666666666666666 * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(N[(N[(x * x), $MachinePrecision] * N[(0.5 + N[(x * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * n), $MachinePrecision] * N[(N[(x * N[(-0.5 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.6e+56], N[(N[(N[(1.0 + N[(N[(-0.5 - N[(N[(N[(0.25 / x), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 5.2e+151], 0.0, If[LessEqual[x, 4.4e+197], N[(N[(N[(1.0 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], 0.0]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x \leq 4.3 \cdot 10^{-41}:\\
                \;\;\;\;\frac{\log x}{0 - n}\\
                
                \mathbf{elif}\;x \leq 1:\\
                \;\;\;\;\frac{0.16666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right) + n \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + x \cdot -0.5\right) + \left(x \cdot n\right) \cdot \left(x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right) + 1\right)\right)}{n \cdot \left(n \cdot n\right)}\\
                
                \mathbf{elif}\;x \leq 2.6 \cdot 10^{+56}:\\
                \;\;\;\;\frac{\frac{1 + \frac{-0.5 - \frac{\frac{0.25}{x} + -0.3333333333333333}{x}}{x}}{x}}{n}\\
                
                \mathbf{elif}\;x \leq 5.2 \cdot 10^{+151}:\\
                \;\;\;\;0\\
                
                \mathbf{elif}\;x \leq 4.4 \cdot 10^{+197}:\\
                \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{x}}{n}\\
                
                \mathbf{else}:\\
                \;\;\;\;0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 5 regimes
                2. if x < 4.2999999999999999e-41

                  1. Initial program 39.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

                    \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                  4. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
                    2. --lowering--.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
                    3. log1p-defineN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
                    4. log1p-lowering-log1p.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
                    5. log-lowering-log.f6454.6%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                  5. Simplified54.6%

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

                    \[\leadsto \color{blue}{-1 \cdot \frac{\log x}{n}} \]
                  7. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{neg}\left(\frac{\log x}{n}\right) \]
                    2. neg-lowering-neg.f64N/A

                      \[\leadsto \mathsf{neg.f64}\left(\left(\frac{\log x}{n}\right)\right) \]
                    3. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\log x, n\right)\right) \]
                    4. log-lowering-log.f6454.6%

                      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right) \]
                  8. Simplified54.6%

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

                  if 4.2999999999999999e-41 < x < 1

                  1. Initial program 64.7%

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

                    \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(1 + x \cdot \left(x \cdot \left(\left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} + x \cdot \left(\left(\frac{1}{6} \cdot \frac{1}{{n}^{3}} + \frac{1}{3} \cdot \frac{1}{n}\right) - \frac{1}{2} \cdot \frac{1}{{n}^{2}}\right)\right) - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
                  4. Simplified18.0%

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

                    \[\leadsto \color{blue}{\frac{\frac{1}{6} \cdot {x}^{3} + n \cdot \left(n \cdot \left(x \cdot \left(1 + x \cdot \left(\frac{1}{3} \cdot x - \frac{1}{2}\right)\right)\right) + {x}^{2} \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)\right)}{{n}^{3}}} \]
                  6. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{6} \cdot {x}^{3} + n \cdot \left(n \cdot \left(x \cdot \left(1 + x \cdot \left(\frac{1}{3} \cdot x - \frac{1}{2}\right)\right)\right) + {x}^{2} \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)\right)\right), \color{blue}{\left({n}^{3}\right)}\right) \]
                  7. Simplified71.3%

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

                  if 1 < x < 2.60000000000000011e56

                  1. Initial program 32.1%

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

                    \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                  4. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
                    2. --lowering--.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
                    3. log1p-defineN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
                    4. log1p-lowering-log1p.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
                    5. log-lowering-log.f6426.4%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                  5. Simplified26.4%

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

                    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{x} - \frac{1}{3}}{x} - \frac{1}{2}}{x} - 1}{x}\right)}, n\right) \]
                  7. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{x} - \frac{1}{3}}{x} - \frac{1}{2}}{x} - 1}{x}\right)\right), n\right) \]
                    2. neg-lowering-neg.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\frac{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{x} - \frac{1}{3}}{x} - \frac{1}{2}}{x} - 1}{x}\right)\right), n\right) \]
                    3. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{x} - \frac{1}{3}}{x} - \frac{1}{2}}{x} - 1\right), x\right)\right), n\right) \]
                  8. Simplified64.0%

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

                  if 2.60000000000000011e56 < x < 5.20000000000000026e151 or 4.39999999999999979e197 < x

                  1. Initial program 81.7%

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

                    \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
                  4. Step-by-step derivation
                    1. Simplified33.8%

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

                      \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                    3. Step-by-step derivation
                      1. Simplified81.7%

                        \[\leadsto 1 - \color{blue}{1} \]
                      2. Step-by-step derivation
                        1. metadata-eval81.7%

                          \[\leadsto 0 \]
                      3. Applied egg-rr81.7%

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

                      if 5.20000000000000026e151 < x < 4.39999999999999979e197

                      1. Initial program 44.1%

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

                        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                      4. Step-by-step derivation
                        1. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
                        2. --lowering--.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
                        3. log1p-defineN/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
                        4. log1p-lowering-log1p.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
                        5. log-lowering-log.f6444.1%

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                      5. Simplified44.1%

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

                        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1 - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)}, n\right) \]
                      7. Step-by-step derivation
                        1. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 - \frac{1}{2} \cdot \frac{1}{x}\right), x\right), n\right) \]
                        2. --lowering--.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
                        3. associate-*r/N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right), x\right), n\right) \]
                        4. metadata-evalN/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2}}{x}\right)\right), x\right), n\right) \]
                        5. /-lowering-/.f6478.9%

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right), x\right), n\right) \]
                      8. Simplified78.9%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4.3 \cdot 10^{-41}:\\ \;\;\;\;\frac{\log x}{0 - n}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;\frac{0.16666666666666666 \cdot \left(x \cdot \left(x \cdot x\right)\right) + n \cdot \left(\left(x \cdot x\right) \cdot \left(0.5 + x \cdot -0.5\right) + \left(x \cdot n\right) \cdot \left(x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right) + 1\right)\right)}{n \cdot \left(n \cdot n\right)}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+56}:\\ \;\;\;\;\frac{\frac{1 + \frac{-0.5 - \frac{\frac{0.25}{x} + -0.3333333333333333}{x}}{x}}{x}}{n}\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{+151}:\\ \;\;\;\;0\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{+197}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                    6. Add Preprocessing

                    Alternative 13: 47.4% accurate, 8.4× speedup?

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

                      1. Initial program 35.4%

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

                        \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                      4. Step-by-step derivation
                        1. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
                        2. --lowering--.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
                        3. log1p-defineN/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
                        4. log1p-lowering-log1p.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
                        5. log-lowering-log.f6456.9%

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                      5. Simplified56.9%

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

                        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}\right)}, n\right) \]
                      7. Step-by-step derivation
                        1. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}\right), x\right), n\right) \]
                        2. associate--l+N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(1 + \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
                        3. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}} - \frac{1}{2} \cdot \frac{1}{x}\right)\right), x\right), n\right) \]
                        4. --lowering--.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\left(\frac{\frac{1}{3}}{{x}^{2}}\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
                        5. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
                        6. unpow2N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{1}{2} \cdot \frac{1}{x}\right)\right)\right), x\right), n\right) \]
                        8. associate-*r/N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2} \cdot 1}{x}\right)\right)\right), x\right), n\right) \]
                        9. metadata-evalN/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
                        10. /-lowering-/.f6444.2%

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, x\right)\right)\right), x\right), n\right) \]
                      8. Simplified44.2%

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

                      if -1.7499999999999999e-32 < n < -7.19999999999999982e-306

                      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

                        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
                      4. Step-by-step derivation
                        1. Simplified39.8%

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

                          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                        3. Step-by-step derivation
                          1. Simplified62.7%

                            \[\leadsto 1 - \color{blue}{1} \]
                          2. Step-by-step derivation
                            1. metadata-eval62.7%

                              \[\leadsto 0 \]
                          3. Applied egg-rr62.7%

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

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

                        Alternative 14: 46.6% accurate, 14.0× speedup?

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

                          1. Initial program 26.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

                            \[\leadsto \color{blue}{\frac{\log \left(1 + x\right) - \log x}{n}} \]
                          4. Step-by-step derivation
                            1. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{/.f64}\left(\left(\log \left(1 + x\right) - \log x\right), \color{blue}{n}\right) \]
                            2. --lowering--.f64N/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\log \left(1 + x\right), \log x\right), n\right) \]
                            3. log1p-defineN/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{log1p}\left(x\right)\right), \log x\right), n\right) \]
                            4. log1p-lowering-log1p.f64N/A

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right), n\right) \]
                            5. log-lowering-log.f6474.6%

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                          5. Simplified74.6%

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

                            \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{n \cdot x} - \frac{1}{3} \cdot \frac{1}{n}}{x} - \frac{1}{2} \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                          7. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto \mathsf{neg}\left(\frac{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{n \cdot x} - \frac{1}{3} \cdot \frac{1}{n}}{x} - \frac{1}{2} \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}\right) \]
                            2. neg-lowering-neg.f64N/A

                              \[\leadsto \mathsf{neg.f64}\left(\left(\frac{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{n \cdot x} - \frac{1}{3} \cdot \frac{1}{n}}{x} - \frac{1}{2} \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}\right)\right) \]
                            3. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \frac{-1 \cdot \frac{\frac{1}{4} \cdot \frac{1}{n \cdot x} - \frac{1}{3} \cdot \frac{1}{n}}{x} - \frac{1}{2} \cdot \frac{1}{n}}{x} - \frac{1}{n}\right), x\right)\right) \]
                          8. Simplified46.2%

                            \[\leadsto \color{blue}{-\frac{\left(-\frac{\left(-\frac{\frac{0.25}{x \cdot n} - \frac{0.3333333333333333}{n}}{x}\right) - \frac{0.5}{n}}{x}\right) - \frac{1}{n}}{x}} \]
                          9. Taylor expanded in x around inf

                            \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(\frac{-1}{n}\right)}, x\right)\right) \]
                          10. Step-by-step derivation
                            1. /-lowering-/.f6447.4%

                              \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(-1, n\right), x\right)\right) \]
                          11. Simplified47.4%

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

                          if -9.5 < n < -7.19999999999999982e-306

                          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

                            \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
                          4. Step-by-step derivation
                            1. Simplified41.3%

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

                              \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                            3. Step-by-step derivation
                              1. Simplified61.2%

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

                                  \[\leadsto 0 \]
                              3. Applied egg-rr61.2%

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

                              if -7.19999999999999982e-306 < n

                              1. Initial program 37.7%

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

                                \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
                              4. Step-by-step derivation
                                1. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
                                2. mul-1-negN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
                                3. log-recN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
                                4. mul-1-negN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
                                5. exp-negN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
                                6. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
                                7. *-commutativeN/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
                                8. associate-/l*N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
                                9. exp-to-powN/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
                                10. pow-lowering-pow.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
                                11. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
                                12. *-commutativeN/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
                                13. *-lowering-*.f6429.5%

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
                              5. Simplified29.5%

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

                                  \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
                                2. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
                                3. pow-flipN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
                                4. distribute-neg-fracN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
                                5. metadata-evalN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
                                6. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
                                7. pow-lowering-pow.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
                                8. /-lowering-/.f6430.7%

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
                              7. Applied egg-rr30.7%

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

                                \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{x}\right)}, n\right) \]
                              9. Step-by-step derivation
                                1. /-lowering-/.f6439.0%

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, x\right), n\right) \]
                              10. Simplified39.0%

                                \[\leadsto \frac{\color{blue}{\frac{1}{x}}}{n} \]
                            4. Recombined 3 regimes into one program.
                            5. Final simplification47.4%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -9.5:\\ \;\;\;\;\frac{\frac{1}{n}}{x}\\ \mathbf{elif}\;n \leq -7.2 \cdot 10^{-306}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \end{array} \]
                            6. Add Preprocessing

                            Alternative 15: 46.6% accurate, 14.0× speedup?

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

                              1. Initial program 33.6%

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

                                \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
                              4. Step-by-step derivation
                                1. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
                                2. mul-1-negN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
                                3. log-recN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
                                4. mul-1-negN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
                                5. exp-negN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
                                6. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
                                7. *-commutativeN/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
                                8. associate-/l*N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
                                9. exp-to-powN/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
                                10. pow-lowering-pow.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
                                11. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
                                12. *-commutativeN/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
                                13. *-lowering-*.f6436.7%

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
                              5. Simplified36.7%

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

                                  \[\leadsto \frac{\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}}{\color{blue}{n}} \]
                                2. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{{x}^{\left(\frac{-1}{n}\right)}}}{x}\right), \color{blue}{n}\right) \]
                                3. pow-flipN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\mathsf{neg}\left(\frac{-1}{n}\right)\right)}}{x}\right), n\right) \]
                                4. distribute-neg-fracN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{\mathsf{neg}\left(-1\right)}{n}\right)}}{x}\right), n\right) \]
                                5. metadata-evalN/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{{x}^{\left(\frac{1}{n}\right)}}{x}\right), n\right) \]
                                6. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), x\right), n\right) \]
                                7. pow-lowering-pow.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \left(\frac{1}{n}\right)\right), x\right), n\right) \]
                                8. /-lowering-/.f6437.8%

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), x\right), n\right) \]
                              7. Applied egg-rr37.8%

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

                                \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{1}{x}\right)}, n\right) \]
                              9. Step-by-step derivation
                                1. /-lowering-/.f6442.1%

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, x\right), n\right) \]
                              10. Simplified42.1%

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

                              if -9.5 < n < -4.00000000000000011e-306

                              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

                                \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
                              4. Step-by-step derivation
                                1. Simplified41.3%

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

                                  \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                                3. Step-by-step derivation
                                  1. Simplified61.2%

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

                                      \[\leadsto 0 \]
                                  3. Applied egg-rr61.2%

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

                                Alternative 16: 46.1% accurate, 14.0× speedup?

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

                                  1. Initial program 33.6%

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

                                    \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
                                  4. Step-by-step derivation
                                    1. /-lowering-/.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}\right), \color{blue}{\left(n \cdot x\right)}\right) \]
                                    2. mul-1-negN/A

                                      \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\log \left(\frac{1}{x}\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
                                    3. log-recN/A

                                      \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{\mathsf{neg}\left(\log x\right)}{n}\right)}\right), \left(n \cdot x\right)\right) \]
                                    4. mul-1-negN/A

                                      \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(\frac{-1 \cdot \log x}{n}\right)}\right), \left(n \cdot x\right)\right) \]
                                    5. exp-negN/A

                                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{e^{\frac{-1 \cdot \log x}{n}}}\right), \left(\color{blue}{n} \cdot x\right)\right) \]
                                    6. /-lowering-/.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{-1 \cdot \log x}{n}}\right)\right), \left(\color{blue}{n} \cdot x\right)\right) \]
                                    7. *-commutativeN/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\frac{\log x \cdot -1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
                                    8. associate-/l*N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left(e^{\log x \cdot \frac{-1}{n}}\right)\right), \left(n \cdot x\right)\right) \]
                                    9. exp-to-powN/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \left({x}^{\left(\frac{-1}{n}\right)}\right)\right), \left(n \cdot x\right)\right) \]
                                    10. pow-lowering-pow.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{-1}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
                                    11. /-lowering-/.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(n \cdot x\right)\right) \]
                                    12. *-commutativeN/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
                                    13. *-lowering-*.f6436.7%

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(-1, n\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
                                  5. Simplified36.7%

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

                                    \[\leadsto \color{blue}{\frac{1}{n \cdot x}} \]
                                  7. Step-by-step derivation
                                    1. /-lowering-/.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(n \cdot x\right)}\right) \]
                                    2. *-commutativeN/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \left(x \cdot \color{blue}{n}\right)\right) \]
                                    3. *-lowering-*.f6441.5%

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
                                  8. Simplified41.5%

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

                                  if -1.55000000000000004 < n < -3.2999999999999998e-308

                                  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

                                    \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
                                  4. Step-by-step derivation
                                    1. Simplified41.3%

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

                                      \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                                    3. Step-by-step derivation
                                      1. Simplified61.2%

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

                                          \[\leadsto 0 \]
                                      3. Applied egg-rr61.2%

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

                                    Alternative 17: 30.7% 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 52.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

                                      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
                                    4. Step-by-step derivation
                                      1. Simplified34.6%

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

                                        \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                                      3. Step-by-step derivation
                                        1. Simplified30.3%

                                          \[\leadsto 1 - \color{blue}{1} \]
                                        2. Step-by-step derivation
                                          1. metadata-eval30.3%

                                            \[\leadsto 0 \]
                                        3. Applied egg-rr30.3%

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

                                        Reproduce

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