2nthrt (problem 3.4.6)

Percentage Accurate: 53.0% → 84.4%
Time: 40.9s
Alternatives: 19
Speedup: 13.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 53.0% accurate, 1.0× speedup?

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

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

Alternative 1: 84.4% accurate, 0.2× speedup?

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

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

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

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


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

    1. Initial program 82.1%

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

      \[\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. metadata-evalN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
      14. metadata-evalN/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) \]
      15. /-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) \]
      16. *-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) \]
      17. *-lowering-*.f6492.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. Simplified92.1%

      \[\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. neg-mul-1N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), n\right), x\right) \]
      10. 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) \]
      11. /-lowering-/.f6492.7%

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

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

    if -3.9999999999999999e-154 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000008e-5

    1. Initial program 33.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}{-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. Simplified79.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}} \]

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

    1. Initial program 58.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 84.3% accurate, 0.3× speedup?

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

      1. Initial program 82.1%

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

        \[\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. metadata-evalN/A

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
        14. metadata-evalN/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) \]
        15. /-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) \]
        16. *-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) \]
        17. *-lowering-*.f6492.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. Simplified92.1%

        \[\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. neg-mul-1N/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), n\right), x\right) \]
        10. 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) \]
        11. /-lowering-/.f6492.7%

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

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

      if -3.9999999999999999e-154 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000008e-5

      1. Initial program 33.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{\left(\log \left(1 + x\right) + \frac{1}{2} \cdot \frac{{\log \left(1 + x\right)}^{2}}{n}\right) - \left(\log x + \frac{1}{2} \cdot \frac{{\log x}^{2}}{n}\right)}{n}} \]
      4. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\left(\log \left(1 + x\right) + \frac{1}{2} \cdot \frac{{\log \left(1 + x\right)}^{2}}{n}\right) - \left(\log x + \frac{1}{2} \cdot \frac{{\log x}^{2}}{n}\right)\right), \color{blue}{n}\right) \]
      5. Simplified79.3%

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

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

      1. Initial program 58.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 84.4% accurate, 0.7× speedup?

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

        1. Initial program 82.1%

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

          \[\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. metadata-evalN/A

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
          14. metadata-evalN/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) \]
          15. /-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) \]
          16. *-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) \]
          17. *-lowering-*.f6492.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. Simplified92.1%

          \[\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. neg-mul-1N/A

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), n\right), x\right) \]
          10. 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) \]
          11. /-lowering-/.f6492.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \left(x + 1\right)\right)\right)\right), n\right) \]
          10. +-lowering-+.f6480.4%

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

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

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

        1. Initial program 56.1%

          \[{\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.f6491.5%

            \[\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-rr91.5%

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

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

      Alternative 4: 84.3% accurate, 1.0× speedup?

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

        1. Initial program 82.1%

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

          \[\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. metadata-evalN/A

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
          14. metadata-evalN/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) \]
          15. /-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) \]
          16. *-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) \]
          17. *-lowering-*.f6492.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. Simplified92.1%

          \[\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. neg-mul-1N/A

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), n\right), x\right) \]
          10. 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) \]
          11. /-lowering-/.f6492.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \left(x + 1\right)\right)\right)\right), n\right) \]
          10. +-lowering-+.f6480.4%

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

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

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

        1. Initial program 56.1%

          \[{\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.f6491.5%

            \[\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-rr91.5%

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-154}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-12}:\\ \;\;\;\;\frac{\log \left(\frac{x}{1 + x}\right)}{0 - n}\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \end{array} \]
        9. Add Preprocessing

        Alternative 5: 81.2% accurate, 1.6× speedup?

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

          1. Initial program 82.1%

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

            \[\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. metadata-evalN/A

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
            14. metadata-evalN/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) \]
            15. /-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) \]
            16. *-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) \]
            17. *-lowering-*.f6492.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. Simplified92.1%

            \[\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. neg-mul-1N/A

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), n\right), x\right) \]
            10. 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) \]
            11. /-lowering-/.f6492.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \left(x + 1\right)\right)\right)\right), n\right) \]
            10. +-lowering-+.f6480.4%

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

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

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

          1. Initial program 56.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}{\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-/.f6473.1%

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

            \[\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)} \]
          6. Taylor expanded in n around 0

            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \color{blue}{\left(\frac{1}{2} \cdot \frac{x}{{n}^{2}}\right)}\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
          7. Step-by-step derivation
            1. *-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(\frac{1}{2}, \left(\frac{x}{{n}^{2}}\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(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, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(x, \left({n}^{2}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
            3. 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(\frac{1}{2}, \mathsf{/.f64}\left(x, \left(n \cdot n\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
            4. *-lowering-*.f6473.2%

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

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

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

        Alternative 6: 81.2% accurate, 1.6× speedup?

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

          1. Initial program 82.1%

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

            \[\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. metadata-evalN/A

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
            14. metadata-evalN/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) \]
            15. /-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) \]
            16. *-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) \]
            17. *-lowering-*.f6492.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. Simplified92.1%

            \[\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. neg-mul-1N/A

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), n\right), x\right) \]
            10. 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) \]
            11. /-lowering-/.f6492.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \left(x + 1\right)\right)\right)\right), n\right) \]
            10. +-lowering-+.f6480.4%

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

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

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

          1. Initial program 76.5%

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

            \[\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-/.f6477.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. Simplified77.9%

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

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

          1. Initial program 32.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.f6499.9%

              \[\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-rr99.9%

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(x, n\right)\right), \color{blue}{1}\right) \]
            3. Step-by-step derivation
              1. Simplified72.9%

                \[\leadsto e^{\frac{x}{n}} - \color{blue}{1} \]
            4. Recombined 4 regimes into one program.
            5. Final simplification85.3%

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

            Alternative 7: 81.2% accurate, 1.6× speedup?

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

              1. Initial program 82.1%

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

                \[\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. metadata-evalN/A

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
                14. metadata-evalN/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) \]
                15. /-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) \]
                16. *-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) \]
                17. *-lowering-*.f6492.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. Simplified92.1%

                \[\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. neg-mul-1N/A

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), n\right), x\right) \]
                10. 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) \]
                11. /-lowering-/.f6492.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \left(x + 1\right)\right)\right)\right), n\right) \]
                10. +-lowering-+.f6480.4%

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

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

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

              1. Initial program 56.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}{\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-/.f6473.1%

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

                \[\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)} \]
              6. Taylor expanded in n around 0

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

                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{2}, \left(\frac{x}{{n}^{2}}\right)\right)\right)\right), \mathsf{pow.f64}\left(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, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(x, \left({n}^{2}\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
                3. unpow2N/A

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

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

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

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

            Alternative 8: 81.1% accurate, 1.7× speedup?

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

              1. Initial program 82.1%

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

                \[\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. metadata-evalN/A

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
                14. metadata-evalN/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) \]
                15. /-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) \]
                16. *-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) \]
                17. *-lowering-*.f6492.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. Simplified92.1%

                \[\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. neg-mul-1N/A

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), n\right), x\right) \]
                10. 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) \]
                11. /-lowering-/.f6492.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \left(x + 1\right)\right)\right)\right), n\right) \]
                10. +-lowering-+.f6480.4%

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

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

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

              1. Initial program 76.5%

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

                \[\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. Simplified76.2%

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

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

                1. Initial program 32.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.f6499.9%

                    \[\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-rr99.9%

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

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

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

                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(x, n\right)\right), \color{blue}{1}\right) \]
                  3. Step-by-step derivation
                    1. Simplified72.9%

                      \[\leadsto e^{\frac{x}{n}} - \color{blue}{1} \]
                  4. Recombined 4 regimes into one program.
                  5. Final simplification85.1%

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

                  Alternative 9: 76.4% accurate, 1.7× speedup?

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

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

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                    5. Simplified49.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. sub-negN/A

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

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

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}}\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
                      10. distribute-neg-fracN/A

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

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

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

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

                      \[\leadsto \color{blue}{\frac{\frac{1}{3}}{n \cdot {x}^{3}}} \]
                    10. Step-by-step derivation
                      1. /-lowering-/.f64N/A

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

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

                        \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right) \]
                      4. unpow2N/A

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

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

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

                        \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
                    11. Simplified69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    1. Initial program 76.5%

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

                      \[\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. Simplified76.2%

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

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

                      1. Initial program 32.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.f6499.9%

                          \[\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-rr99.9%

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

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

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

                          \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(x, n\right)\right), \color{blue}{1}\right) \]
                        3. Step-by-step derivation
                          1. Simplified72.9%

                            \[\leadsto e^{\frac{x}{n}} - \color{blue}{1} \]
                        4. Recombined 4 regimes into one program.
                        5. Final simplification72.8%

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

                        Alternative 10: 76.4% accurate, 1.7× speedup?

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

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

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                          5. Simplified49.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. sub-negN/A

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

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

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}}\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
                            10. distribute-neg-fracN/A

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

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

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

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

                            \[\leadsto \color{blue}{\frac{\frac{1}{3}}{n \cdot {x}^{3}}} \]
                          10. Step-by-step derivation
                            1. /-lowering-/.f64N/A

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

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

                              \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right) \]
                            4. unpow2N/A

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

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

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

                              \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
                          11. Simplified69.2%

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

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

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

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                          5. Simplified74.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. log-lowering-log.f64N/A

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

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

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(\left(x + 1\right), x\right)\right), n\right) \]
                            6. +-lowering-+.f6474.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-rr74.9%

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

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

                          1. Initial program 76.5%

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

                            \[\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. Simplified76.2%

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

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

                            1. Initial program 32.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.f6499.9%

                                \[\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-rr99.9%

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

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

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

                                \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{/.f64}\left(x, n\right)\right), \color{blue}{1}\right) \]
                              3. Step-by-step derivation
                                1. Simplified72.9%

                                  \[\leadsto e^{\frac{x}{n}} - \color{blue}{1} \]
                              4. Recombined 4 regimes into one program.
                              5. Final simplification72.8%

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

                              Alternative 11: 59.3% accurate, 1.8× speedup?

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

                                1. Initial program 47.8%

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

                                  \[\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.f6450.6%

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

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

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

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \log x\right), n\right) \]
                                  2. log-lowering-log.f6450.3%

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{log.f64}\left(x\right)\right), n\right) \]
                                8. Simplified50.3%

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

                                if 1.4500000000000001e-240 < x < 3.20000000000000001e-166

                                1. Initial program 61.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.f6433.4%

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                                5. Simplified33.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. sub-negN/A

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

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

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}}\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
                                  10. distribute-neg-fracN/A

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

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\frac{\frac{-1}{2}}{x}\right)\right), x\right), n\right) \]
                                  12. /-lowering-/.f6460.4%

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

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

                                  \[\leadsto \color{blue}{\frac{\frac{1}{3}}{n \cdot {x}^{3}}} \]
                                10. Step-by-step derivation
                                  1. /-lowering-/.f64N/A

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

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

                                    \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right) \]
                                  4. unpow2N/A

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

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

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

                                    \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
                                11. Simplified60.4%

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

                                if 0.880000000000000004 < x < 4.8000000000000002e132

                                1. Initial program 49.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.f6447.5%

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

                                  \[\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. Simplified64.3%

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

                                if 4.8000000000000002e132 < x

                                1. Initial program 88.3%

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

                                  \[\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. Simplified42.2%

                                    \[\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. Simplified88.3%

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

                                        \[\leadsto 0 \]
                                    3. Applied egg-rr88.3%

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.45 \cdot 10^{-240}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-166}:\\ \;\;\;\;\frac{0.3333333333333333}{n \cdot \left(x \cdot \left(x \cdot x\right)\right)}\\ \mathbf{elif}\;x \leq 0.88:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{+132}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} - \frac{\frac{0.25}{n \cdot x} + \frac{-0.3333333333333333}{n}}{x}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                                  6. Add Preprocessing

                                  Alternative 12: 59.7% accurate, 1.8× speedup?

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

                                    1. Initial program 60.5%

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

                                      \[\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. Simplified60.5%

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

                                      if 4.79999999999999975e-122 < x < 0.880000000000000004

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

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

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

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

                                          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \log x\right), n\right) \]
                                        2. log-lowering-log.f6455.3%

                                          \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{log.f64}\left(x\right)\right), n\right) \]
                                      8. Simplified55.3%

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

                                      if 0.880000000000000004 < x < 1.2999999999999999e133

                                      1. Initial program 49.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.f6447.5%

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

                                        \[\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. Simplified64.3%

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

                                      if 1.2999999999999999e133 < x

                                      1. Initial program 88.3%

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

                                        \[\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. Simplified42.2%

                                          \[\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. Simplified88.3%

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

                                              \[\leadsto 0 \]
                                          3. Applied egg-rr88.3%

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

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4.8 \cdot 10^{-122}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 0.88:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+133}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} - \frac{\frac{0.25}{n \cdot x} + \frac{-0.3333333333333333}{n}}{x}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                                        6. Add Preprocessing

                                        Alternative 13: 55.2% accurate, 9.6× speedup?

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

                                          1. Initial program 100.0%

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

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

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

                                            \[\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. sub-negN/A

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}}\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
                                            10. distribute-neg-fracN/A

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\frac{\frac{-1}{2}}{x}\right)\right), x\right), n\right) \]
                                            12. /-lowering-/.f6439.5%

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

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

                                            \[\leadsto \color{blue}{\frac{\frac{1}{3}}{n \cdot {x}^{3}}} \]
                                          10. Step-by-step derivation
                                            1. /-lowering-/.f64N/A

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right) \]
                                            4. unpow2N/A

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

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
                                          11. Simplified71.0%

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

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

                                          1. Initial program 37.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.f6458.3%

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

                                            \[\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. sub-negN/A

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}}\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
                                            10. distribute-neg-fracN/A

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\frac{\frac{-1}{2}}{x}\right)\right), x\right), n\right) \]
                                            12. /-lowering-/.f6449.0%

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{+.f64}\left(1, \left(\frac{\frac{-1}{2}}{x}\right)\right)\right), n\right), x\right) \]
                                            11. /-lowering-/.f6449.0%

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right), \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{-1}{2}, x\right)\right)\right), n\right), x\right) \]
                                          10. Applied egg-rr49.0%

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

                                        Alternative 14: 55.2% accurate, 10.5× speedup?

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

                                          1. Initial program 100.0%

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

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

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

                                            \[\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. sub-negN/A

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}}\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
                                            10. distribute-neg-fracN/A

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\frac{\frac{-1}{2}}{x}\right)\right), x\right), n\right) \]
                                            12. /-lowering-/.f6439.5%

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

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

                                            \[\leadsto \color{blue}{\frac{\frac{1}{3}}{n \cdot {x}^{3}}} \]
                                          10. Step-by-step derivation
                                            1. /-lowering-/.f64N/A

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right) \]
                                            4. unpow2N/A

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

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
                                          11. Simplified71.0%

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

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

                                          1. Initial program 37.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.f6458.3%

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

                                            \[\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. sub-negN/A

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}}\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
                                            10. distribute-neg-fracN/A

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\frac{\frac{-1}{2}}{x}\right)\right), x\right), n\right) \]
                                            12. /-lowering-/.f6449.0%

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

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

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

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{\frac{1}{2} - \frac{1}{3} \cdot \frac{1}{x}}{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{1}{2} - \frac{1}{3} \cdot \frac{1}{x}\right), x\right)\right), x\right), n\right) \]
                                            5. sub-negN/A

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

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

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

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{1}{3}\right)\right), x\right)\right), x\right)\right), x\right), n\right) \]
                                            11. metadata-eval49.0%

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(\frac{-1}{3}, x\right)\right), x\right)\right), x\right), n\right) \]
                                          11. Simplified49.0%

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

                                        Alternative 15: 54.2% accurate, 13.2× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -4:\\ \;\;\;\;\frac{0.3333333333333333}{n \cdot \left(x \cdot \left(x \cdot x\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \end{array} \end{array} \]
                                        (FPCore (x n)
                                         :precision binary64
                                         (if (<= (/ 1.0 n) -4.0)
                                           (/ 0.3333333333333333 (* n (* x (* x x))))
                                           (/ (/ 1.0 x) n)))
                                        double code(double x, double n) {
                                        	double tmp;
                                        	if ((1.0 / n) <= -4.0) {
                                        		tmp = 0.3333333333333333 / (n * (x * (x * x)));
                                        	} 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 ((1.0d0 / n) <= (-4.0d0)) then
                                                tmp = 0.3333333333333333d0 / (n * (x * (x * x)))
                                            else
                                                tmp = (1.0d0 / x) / n
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double x, double n) {
                                        	double tmp;
                                        	if ((1.0 / n) <= -4.0) {
                                        		tmp = 0.3333333333333333 / (n * (x * (x * x)));
                                        	} else {
                                        		tmp = (1.0 / x) / n;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(x, n):
                                        	tmp = 0
                                        	if (1.0 / n) <= -4.0:
                                        		tmp = 0.3333333333333333 / (n * (x * (x * x)))
                                        	else:
                                        		tmp = (1.0 / x) / n
                                        	return tmp
                                        
                                        function code(x, n)
                                        	tmp = 0.0
                                        	if (Float64(1.0 / n) <= -4.0)
                                        		tmp = Float64(0.3333333333333333 / Float64(n * Float64(x * Float64(x * x))));
                                        	else
                                        		tmp = Float64(Float64(1.0 / x) / n);
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(x, n)
                                        	tmp = 0.0;
                                        	if ((1.0 / n) <= -4.0)
                                        		tmp = 0.3333333333333333 / (n * (x * (x * x)));
                                        	else
                                        		tmp = (1.0 / x) / n;
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -4.0], N[(0.3333333333333333 / N[(n * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;\frac{1}{n} \leq -4:\\
                                        \;\;\;\;\frac{0.3333333333333333}{n \cdot \left(x \cdot \left(x \cdot x\right)\right)}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{\frac{1}{x}}{n}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if (/.f64 #s(literal 1 binary64) n) < -4

                                          1. Initial program 100.0%

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

                                            \[\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.f6450.9%

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right), n\right) \]
                                          5. Simplified50.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. sub-negN/A

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3}}{{x}^{2}}\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left({x}^{2}\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \left(x \cdot x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\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(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(x, x\right)\right)\right), \left(\mathsf{neg}\left(\frac{\frac{1}{2}}{x}\right)\right)\right), x\right), n\right) \]
                                            10. distribute-neg-fracN/A

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

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

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

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

                                            \[\leadsto \color{blue}{\frac{\frac{1}{3}}{n \cdot {x}^{3}}} \]
                                          10. Step-by-step derivation
                                            1. /-lowering-/.f64N/A

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right)\right) \]
                                            4. unpow2N/A

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

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
                                          11. Simplified70.6%

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

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

                                          1. Initial program 36.3%

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

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

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

                                            \[\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}{x}\right)}, n\right) \]
                                          7. Step-by-step derivation
                                            1. /-lowering-/.f6447.8%

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, x\right), n\right) \]
                                          8. Simplified47.8%

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

                                        Alternative 16: 46.4% accurate, 17.6× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -2000000000:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \end{array} \end{array} \]
                                        (FPCore (x n)
                                         :precision binary64
                                         (if (<= (/ 1.0 n) -2000000000.0) 0.0 (/ (/ 1.0 x) n)))
                                        double code(double x, double n) {
                                        	double tmp;
                                        	if ((1.0 / n) <= -2000000000.0) {
                                        		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 ((1.0d0 / n) <= (-2000000000.0d0)) 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 ((1.0 / n) <= -2000000000.0) {
                                        		tmp = 0.0;
                                        	} else {
                                        		tmp = (1.0 / x) / n;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(x, n):
                                        	tmp = 0
                                        	if (1.0 / n) <= -2000000000.0:
                                        		tmp = 0.0
                                        	else:
                                        		tmp = (1.0 / x) / n
                                        	return tmp
                                        
                                        function code(x, n)
                                        	tmp = 0.0
                                        	if (Float64(1.0 / n) <= -2000000000.0)
                                        		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 ((1.0 / n) <= -2000000000.0)
                                        		tmp = 0.0;
                                        	else
                                        		tmp = (1.0 / x) / n;
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -2000000000.0], 0.0, N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;\frac{1}{n} \leq -2000000000:\\
                                        \;\;\;\;0\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{\frac{1}{x}}{n}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if (/.f64 #s(literal 1 binary64) n) < -2e9

                                          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. Simplified48.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. Simplified53.5%

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

                                                  \[\leadsto 0 \]
                                              3. Applied egg-rr53.5%

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

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

                                              1. Initial program 37.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.f6458.3%

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

                                                \[\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}{x}\right)}, n\right) \]
                                              7. Step-by-step derivation
                                                1. /-lowering-/.f6447.3%

                                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, x\right), n\right) \]
                                              8. Simplified47.3%

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

                                            Alternative 17: 46.4% accurate, 17.6× speedup?

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

                                              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. Simplified48.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. Simplified53.5%

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

                                                      \[\leadsto 0 \]
                                                  3. Applied egg-rr53.5%

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

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

                                                  1. Initial program 37.1%

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

                                                    \[\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. metadata-evalN/A

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

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

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

                                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \mathsf{pow.f64}\left(x, \left(\frac{\mathsf{neg}\left(1\right)}{n}\right)\right)\right), \left(n \cdot x\right)\right) \]
                                                    14. metadata-evalN/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) \]
                                                    15. /-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) \]
                                                    16. *-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) \]
                                                    17. *-lowering-*.f6443.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. Simplified43.9%

                                                    \[\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. neg-mul-1N/A

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

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

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

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

                                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)}\right), n\right), x\right) \]
                                                    10. 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) \]
                                                    11. /-lowering-/.f6445.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-rr45.5%

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

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

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

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

                                                Alternative 18: 44.1% accurate, 21.1× speedup?

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

                                                  1. Initial program 50.6%

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

                                                    \[\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.f6446.9%

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

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

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

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

                                                  if 1.5000000000000001e131 < x

                                                  1. Initial program 88.3%

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

                                                    \[\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. Simplified42.2%

                                                      \[\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. Simplified88.3%

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

                                                          \[\leadsto 0 \]
                                                      3. Applied egg-rr88.3%

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

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.5 \cdot 10^{+131}:\\ \;\;\;\;\frac{1}{n \cdot x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                                                    6. Add Preprocessing

                                                    Alternative 19: 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 59.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. Simplified40.7%

                                                        \[\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. Simplified33.5%

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

                                                            \[\leadsto 0 \]
                                                        3. Applied egg-rr33.5%

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

                                                        Reproduce

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