2nthrt (problem 3.4.6)

Percentage Accurate: 53.9% → 86.1%
Time: 42.5s
Alternatives: 20
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 53.9% accurate, 1.0× speedup?

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

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

Alternative 1: 86.1% accurate, 0.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\


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

    1. Initial program 33.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}{-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. Simplified83.5%

      \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]

    if 13500 < x

    1. Initial program 61.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.f6461.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-rr61.1%

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

      \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
    6. 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. exp-lowering-exp.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\log x, n\right)\right)\right)\right), \left(n \cdot x\right)\right) \]
      11. log-lowering-log.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
      13. *-lowering-*.f6499.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
    7. Simplified99.3%

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

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

Alternative 2: 85.8% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\


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

    1. Initial program 33.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}{-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. Simplified83.3%

      \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
    5. Applied egg-rr83.3%

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

    if 7e8 < x

    1. Initial program 61.7%

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

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

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

      \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
    6. 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. exp-lowering-exp.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\log x, n\right)\right)\right)\right), \left(n \cdot x\right)\right) \]
      11. log-lowering-log.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
      13. *-lowering-*.f6499.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
    7. Simplified99.6%

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

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

Alternative 3: 85.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.36:\\ \;\;\;\;\frac{\frac{{\log x}^{2} \cdot -0.5 + \frac{{\log x}^{3} \cdot -0.16666666666666666}{n}}{n} - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (if (<= x 0.36)
   (/
    (-
     (/
      (+
       (* (pow (log x) 2.0) -0.5)
       (/ (* (pow (log x) 3.0) -0.16666666666666666) n))
      n)
     (log x))
    n)
   (/ (exp (/ (log x) n)) (* x n))))
double code(double x, double n) {
	double tmp;
	if (x <= 0.36) {
		tmp = ((((pow(log(x), 2.0) * -0.5) + ((pow(log(x), 3.0) * -0.16666666666666666) / n)) / n) - log(x)) / n;
	} else {
		tmp = exp((log(x) / n)) / (x * n);
	}
	return tmp;
}
real(8) function code(x, n)
    real(8), intent (in) :: x
    real(8), intent (in) :: n
    real(8) :: tmp
    if (x <= 0.36d0) then
        tmp = (((((log(x) ** 2.0d0) * (-0.5d0)) + (((log(x) ** 3.0d0) * (-0.16666666666666666d0)) / n)) / n) - log(x)) / n
    else
        tmp = exp((log(x) / n)) / (x * n)
    end if
    code = tmp
end function
public static double code(double x, double n) {
	double tmp;
	if (x <= 0.36) {
		tmp = ((((Math.pow(Math.log(x), 2.0) * -0.5) + ((Math.pow(Math.log(x), 3.0) * -0.16666666666666666) / n)) / n) - Math.log(x)) / n;
	} else {
		tmp = Math.exp((Math.log(x) / n)) / (x * n);
	}
	return tmp;
}
def code(x, n):
	tmp = 0
	if x <= 0.36:
		tmp = ((((math.pow(math.log(x), 2.0) * -0.5) + ((math.pow(math.log(x), 3.0) * -0.16666666666666666) / n)) / n) - math.log(x)) / n
	else:
		tmp = math.exp((math.log(x) / n)) / (x * n)
	return tmp
function code(x, n)
	tmp = 0.0
	if (x <= 0.36)
		tmp = Float64(Float64(Float64(Float64(Float64((log(x) ^ 2.0) * -0.5) + Float64(Float64((log(x) ^ 3.0) * -0.16666666666666666) / n)) / n) - log(x)) / n);
	else
		tmp = Float64(exp(Float64(log(x) / n)) / Float64(x * n));
	end
	return tmp
end
function tmp_2 = code(x, n)
	tmp = 0.0;
	if (x <= 0.36)
		tmp = (((((log(x) ^ 2.0) * -0.5) + (((log(x) ^ 3.0) * -0.16666666666666666) / n)) / n) - log(x)) / n;
	else
		tmp = exp((log(x) / n)) / (x * n);
	end
	tmp_2 = tmp;
end
code[x_, n_] := If[LessEqual[x, 0.36], N[(N[(N[(N[(N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision] + N[(N[(N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.36:\\
\;\;\;\;\frac{\frac{{\log x}^{2} \cdot -0.5 + \frac{{\log x}^{3} \cdot -0.16666666666666666}{n}}{n} - \log x}{n}\\

\mathbf{else}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{x \cdot n}\\


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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\frac{-0.16666666666666666 \cdot {\log x}^{3}}{n \cdot n} - \log x\right) - \frac{{\log x}^{2} \cdot 0.5}{n}}{n}} \]
      5. Taylor expanded in n around -inf

        \[\leadsto \color{blue}{-1 \cdot \frac{\log x + -1 \cdot \frac{\frac{-1}{2} \cdot {\log x}^{2} + \frac{-1}{6} \cdot \frac{{\log x}^{3}}{n}}{n}}{n}} \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(\frac{\log x + -1 \cdot \frac{\frac{-1}{2} \cdot {\log x}^{2} + \frac{-1}{6} \cdot \frac{{\log x}^{3}}{n}}{n}}{n}\right) \]
        2. distribute-neg-frac2N/A

          \[\leadsto \frac{\log x + -1 \cdot \frac{\frac{-1}{2} \cdot {\log x}^{2} + \frac{-1}{6} \cdot \frac{{\log x}^{3}}{n}}{n}}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
        3. mul-1-negN/A

          \[\leadsto \frac{\log x + -1 \cdot \frac{\frac{-1}{2} \cdot {\log x}^{2} + \frac{-1}{6} \cdot \frac{{\log x}^{3}}{n}}{n}}{-1 \cdot \color{blue}{n}} \]
        4. /-lowering-/.f64N/A

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

        \[\leadsto \color{blue}{\frac{\log x - \frac{-0.5 \cdot {\log x}^{2} + \frac{{\log x}^{3} \cdot -0.16666666666666666}{n}}{n}}{-n}} \]

      if 0.35999999999999999 < x

      1. Initial program 61.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.f6461.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-rr61.1%

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

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      6. 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. exp-lowering-exp.f64N/A

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\log x, n\right)\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. log-lowering-log.f64N/A

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6499.3%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      7. Simplified99.3%

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

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

    Alternative 4: 86.2% accurate, 0.6× speedup?

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

      1. Initial program 65.2%

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

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

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

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      6. 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. exp-lowering-exp.f64N/A

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\log x, n\right)\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. log-lowering-log.f64N/A

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6484.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      7. Simplified84.4%

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

      if -3.99999999999999983e-103 < (/.f64 #s(literal 1 binary64) n) < 9.9999999999999992e-72

      1. Initial program 27.2%

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

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

        \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
      5. Applied egg-rr69.3%

        \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
      6. Taylor expanded in n around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
      7. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
        2. distribute-neg-frac2N/A

          \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
        3. mul-1-negN/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
        8. mul-1-negN/A

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
      8. Simplified84.9%

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

      if 1.99999999999999991e-6 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 36.4%

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 82.6% accurate, 0.9× speedup?

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

      1. Initial program 65.2%

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

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

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

        \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
      6. 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. exp-lowering-exp.f64N/A

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\log x, n\right)\right)\right)\right), \left(n \cdot x\right)\right) \]
        11. log-lowering-log.f64N/A

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right)\right)\right), \left(x \cdot \color{blue}{n}\right)\right) \]
        13. *-lowering-*.f6484.4%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right)\right)\right), \mathsf{*.f64}\left(x, \color{blue}{n}\right)\right) \]
      7. Simplified84.4%

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

      if -3.99999999999999983e-103 < (/.f64 #s(literal 1 binary64) n) < 9.9999999999999992e-72

      1. Initial program 27.2%

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

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

        \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
      5. Applied egg-rr69.3%

        \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
      6. Taylor expanded in n around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
      7. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
        2. distribute-neg-frac2N/A

          \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
        3. mul-1-negN/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
        8. mul-1-negN/A

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
      8. Simplified84.9%

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

      if 1.99999999999999991e-6 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 36.4%

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

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

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

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

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

    Alternative 6: 82.6% accurate, 1.5× speedup?

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

      1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.99999999999999983e-103 < (/.f64 #s(literal 1 binary64) n) < 9.9999999999999992e-72

      1. Initial program 27.2%

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

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

        \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
      5. Applied egg-rr69.3%

        \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
      6. Taylor expanded in n around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
      7. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
        2. distribute-neg-frac2N/A

          \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
        3. mul-1-negN/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
        8. mul-1-negN/A

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
      8. Simplified84.9%

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

      if 1.99999999999999991e-6 < (/.f64 #s(literal 1 binary64) n)

      1. Initial program 36.4%

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

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

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

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

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

    Alternative 7: 81.7% accurate, 1.5× speedup?

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

      1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.99999999999999983e-103 < (/.f64 #s(literal 1 binary64) n) < 9.9999999999999992e-72

      1. Initial program 27.2%

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

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

        \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
      5. Applied egg-rr69.3%

        \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
      6. Taylor expanded in n around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
      7. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
        2. distribute-neg-frac2N/A

          \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
        3. mul-1-negN/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
        8. mul-1-negN/A

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
      8. Simplified84.9%

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

      if 1.99999999999999991e-6 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999999e119

      1. Initial program 80.6%

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

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

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

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

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

      1. Initial program 16.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 \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{/.f64}\left(1, n\right)\right), \color{blue}{1}\right) \]
      4. Step-by-step derivation
        1. Simplified6.2%

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

          \[\leadsto \color{blue}{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)} \]
        3. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\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) \]
          2. +-commutativeN/A

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

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

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

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

            \[\leadsto \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}} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)}\right)\right)\right)\right) \]
          7. +-lowering-+.f64N/A

            \[\leadsto \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), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)}\right)\right)\right)\right) \]
          8. associate-*r/N/A

            \[\leadsto \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(\color{blue}{\frac{1}{2} \cdot \frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto \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(\color{blue}{\frac{1}{2}} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right) \]
          10. /-lowering-/.f64N/A

            \[\leadsto \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(\color{blue}{\frac{1}{2} \cdot \frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
          11. unpow2N/A

            \[\leadsto \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 \color{blue}{\frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f64N/A

            \[\leadsto \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 \color{blue}{\frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
          13. associate-*r/N/A

            \[\leadsto \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) \]
          14. metadata-evalN/A

            \[\leadsto \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) \]
          15. distribute-neg-fracN/A

            \[\leadsto \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)}{\color{blue}{n}}\right)\right)\right)\right)\right) \]
          16. metadata-evalN/A

            \[\leadsto \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) \]
          17. /-lowering-/.f6482.6%

            \[\leadsto \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}, \color{blue}{n}\right)\right)\right)\right)\right) \]
        4. Simplified82.6%

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

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

      Alternative 8: 75.6% accurate, 1.6× speedup?

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

        1. Initial program 34.8%

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

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

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

            \[\leadsto \color{blue}{-1 \cdot \frac{\log x}{n}} \]
          3. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{neg}\left(\frac{\log x}{n}\right) \]
            2. neg-lowering-neg.f64N/A

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

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

              \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right) \]
          4. Simplified63.4%

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

          if 1.59999999999999988e-162 < x < 7.49999999999999971e-39

          1. Initial program 21.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-/.f6435.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. Simplified35.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 inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(x, x\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \mathsf{*.f64}\left(x, n\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(1, x\right)\right), \mathsf{*.f64}\left(n, \left({x}^{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{1}{2} \cdot \color{blue}{\frac{1}{n}}\right)\right)\right)\right)\right) \]
            15. unpow2N/A

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

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

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

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

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

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

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

          if 7.49999999999999971e-39 < x

          1. Initial program 60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 9: 67.4% accurate, 1.7× speedup?

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

          1. Initial program 46.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}{-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. Simplified76.2%

            \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
          5. Applied egg-rr60.5%

            \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
          6. Taylor expanded in n around inf

            \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
            2. distribute-neg-frac2N/A

              \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
            3. mul-1-negN/A

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
            8. mul-1-negN/A

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
          8. Simplified68.5%

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

          if 1.8e-9 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999999e119

          1. Initial program 68.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 + \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-/.f6461.0%

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

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

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

          1. Initial program 16.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 \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{/.f64}\left(1, n\right)\right), \color{blue}{1}\right) \]
          4. Step-by-step derivation
            1. Simplified6.2%

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

              \[\leadsto \color{blue}{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)} \]
            3. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\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) \]
              2. +-commutativeN/A

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

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

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

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

                \[\leadsto \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}} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)}\right)\right)\right)\right) \]
              7. +-lowering-+.f64N/A

                \[\leadsto \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), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)}\right)\right)\right)\right) \]
              8. associate-*r/N/A

                \[\leadsto \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(\color{blue}{\frac{1}{2} \cdot \frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
              9. metadata-evalN/A

                \[\leadsto \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(\color{blue}{\frac{1}{2}} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right) \]
              10. /-lowering-/.f64N/A

                \[\leadsto \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(\color{blue}{\frac{1}{2} \cdot \frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
              11. unpow2N/A

                \[\leadsto \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 \color{blue}{\frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
              12. *-lowering-*.f64N/A

                \[\leadsto \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 \color{blue}{\frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
              13. associate-*r/N/A

                \[\leadsto \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) \]
              14. metadata-evalN/A

                \[\leadsto \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) \]
              15. distribute-neg-fracN/A

                \[\leadsto \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)}{\color{blue}{n}}\right)\right)\right)\right)\right) \]
              16. metadata-evalN/A

                \[\leadsto \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) \]
              17. /-lowering-/.f6482.6%

                \[\leadsto \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}, \color{blue}{n}\right)\right)\right)\right)\right) \]
            4. Simplified82.6%

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

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

          Alternative 10: 67.3% accurate, 1.8× speedup?

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

            1. Initial program 46.5%

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

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

              \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
            5. Applied egg-rr60.2%

              \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
            6. Taylor expanded in n around inf

              \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
            7. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
              2. distribute-neg-frac2N/A

                \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
              3. mul-1-negN/A

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
              8. mul-1-negN/A

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

                \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
            8. Simplified68.2%

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

            if 2.00000000000000012e-9 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999999e119

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

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

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

              1. Initial program 16.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 \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{/.f64}\left(1, n\right)\right), \color{blue}{1}\right) \]
              4. Step-by-step derivation
                1. Simplified6.2%

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

                  \[\leadsto \color{blue}{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)} \]
                3. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\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) \]
                  2. +-commutativeN/A

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

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

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

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

                    \[\leadsto \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}} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)}\right)\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \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), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)}\right)\right)\right)\right) \]
                  8. associate-*r/N/A

                    \[\leadsto \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(\color{blue}{\frac{1}{2} \cdot \frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \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(\color{blue}{\frac{1}{2}} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right) \]
                  10. /-lowering-/.f64N/A

                    \[\leadsto \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(\color{blue}{\frac{1}{2} \cdot \frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
                  11. unpow2N/A

                    \[\leadsto \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 \color{blue}{\frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
                  12. *-lowering-*.f64N/A

                    \[\leadsto \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 \color{blue}{\frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
                  13. associate-*r/N/A

                    \[\leadsto \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) \]
                  14. metadata-evalN/A

                    \[\leadsto \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) \]
                  15. distribute-neg-fracN/A

                    \[\leadsto \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)}{\color{blue}{n}}\right)\right)\right)\right)\right) \]
                  16. metadata-evalN/A

                    \[\leadsto \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) \]
                  17. /-lowering-/.f6482.6%

                    \[\leadsto \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}, \color{blue}{n}\right)\right)\right)\right)\right) \]
                4. Simplified82.6%

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

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

              Alternative 11: 67.3% accurate, 1.8× speedup?

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

                1. Initial program 46.5%

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

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

                  \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
                5. Applied egg-rr60.2%

                  \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
                6. Taylor expanded in n around inf

                  \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
                7. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
                  2. distribute-neg-frac2N/A

                    \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
                  3. mul-1-negN/A

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
                  8. mul-1-negN/A

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

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
                8. Simplified68.2%

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

                    \[\leadsto \frac{\log \left(\frac{1}{\frac{1 + x}{x}}\right)}{\mathsf{neg}\left(n\right)} \]
                  2. log-recN/A

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

                    \[\leadsto \frac{\mathsf{neg}\left(\left(\log \left(1 + x\right) - \log x\right)\right)}{\mathsf{neg}\left(n\right)} \]
                  4. frac-2negN/A

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

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

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

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

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

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

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

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

                if 2.00000000000000012e-9 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999999e119

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

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

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

                  1. Initial program 16.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 \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{/.f64}\left(1, n\right)\right), \color{blue}{1}\right) \]
                  4. Step-by-step derivation
                    1. Simplified6.2%

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

                      \[\leadsto \color{blue}{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)} \]
                    3. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{\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) \]
                      2. +-commutativeN/A

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

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

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

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

                        \[\leadsto \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}} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)}\right)\right)\right)\right) \]
                      7. +-lowering-+.f64N/A

                        \[\leadsto \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), \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{n}\right)\right)}\right)\right)\right)\right) \]
                      8. associate-*r/N/A

                        \[\leadsto \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(\color{blue}{\frac{1}{2} \cdot \frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
                      9. metadata-evalN/A

                        \[\leadsto \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(\color{blue}{\frac{1}{2}} \cdot \frac{1}{n}\right)\right)\right)\right)\right)\right) \]
                      10. /-lowering-/.f64N/A

                        \[\leadsto \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(\color{blue}{\frac{1}{2} \cdot \frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
                      11. unpow2N/A

                        \[\leadsto \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 \color{blue}{\frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
                      12. *-lowering-*.f64N/A

                        \[\leadsto \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 \color{blue}{\frac{1}{n}}\right)\right)\right)\right)\right)\right) \]
                      13. associate-*r/N/A

                        \[\leadsto \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) \]
                      14. metadata-evalN/A

                        \[\leadsto \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) \]
                      15. distribute-neg-fracN/A

                        \[\leadsto \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)}{\color{blue}{n}}\right)\right)\right)\right)\right) \]
                      16. metadata-evalN/A

                        \[\leadsto \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) \]
                      17. /-lowering-/.f6482.6%

                        \[\leadsto \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}, \color{blue}{n}\right)\right)\right)\right)\right) \]
                    4. Simplified82.6%

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

                  Alternative 12: 59.9% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(x - \log x\right)}, n\right) \]
                    10. 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.f6458.9%

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

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

                    if 0.849999999999999978 < x < 2.4e219

                    1. Initial program 51.3%

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

                        \[\leadsto {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \color{blue}{\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)} \]
                      2. flip3-+N/A

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

                        \[\leadsto \left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} + {\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)}^{3}\right) \cdot \color{blue}{\frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)}} \]
                      4. cube-negN/A

                        \[\leadsto \left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} + \left(\mathsf{neg}\left({\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right)\right)\right) \cdot \frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)} \]
                      5. sub-negN/A

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

                        \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} - {\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right), \color{blue}{\left(\frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)}\right)}\right) \]
                    4. Applied egg-rr19.5%

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\left(3 \cdot \log \left(1 + x\right) - 3 \cdot \log x\right), \color{blue}{n}\right)\right) \]
                      3. distribute-lft-out--N/A

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

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(3, \mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right)\right), n\right)\right) \]
                      8. log-lowering-log.f6452.1%

                        \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(3, \mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right)\right), n\right)\right) \]
                    7. Simplified52.1%

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

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

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

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

                    if 2.4e219 < x

                    1. Initial program 96.1%

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

                      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
                    4. Step-by-step derivation
                      1. Simplified55.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. Simplified96.1%

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

                            \[\leadsto 0 \]
                        3. Applied egg-rr96.1%

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

                      Alternative 13: 59.7% accurate, 1.9× speedup?

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

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

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

                            \[\leadsto \color{blue}{-1 \cdot \frac{\log x}{n}} \]
                          3. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto \mathsf{neg}\left(\frac{\log x}{n}\right) \]
                            2. neg-lowering-neg.f64N/A

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

                              \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\log x, n\right)\right) \]
                            4. log-lowering-log.f6458.8%

                              \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{log.f64}\left(x\right), n\right)\right) \]
                          4. Simplified58.8%

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

                          if 0.599999999999999978 < x < 8.00000000000000066e218

                          1. Initial program 51.3%

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

                              \[\leadsto {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \color{blue}{\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)} \]
                            2. flip3-+N/A

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

                              \[\leadsto \left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} + {\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)}^{3}\right) \cdot \color{blue}{\frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)}} \]
                            4. cube-negN/A

                              \[\leadsto \left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} + \left(\mathsf{neg}\left({\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right)\right)\right) \cdot \frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)} \]
                            5. sub-negN/A

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

                              \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} - {\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right), \color{blue}{\left(\frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)}\right)}\right) \]
                          4. Applied egg-rr19.5%

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\left(3 \cdot \log \left(1 + x\right) - 3 \cdot \log x\right), \color{blue}{n}\right)\right) \]
                            3. distribute-lft-out--N/A

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

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(3, \mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right)\right), n\right)\right) \]
                            8. log-lowering-log.f6452.1%

                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(3, \mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right)\right), n\right)\right) \]
                          7. Simplified52.1%

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

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

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

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

                          if 8.00000000000000066e218 < x

                          1. Initial program 96.1%

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

                            \[\leadsto \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
                          4. Step-by-step derivation
                            1. Simplified55.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. Simplified96.1%

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

                                  \[\leadsto 0 \]
                              3. Applied egg-rr96.1%

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.6:\\ \;\;\;\;0 - \frac{\log x}{n}\\ \mathbf{elif}\;x \leq 8 \cdot 10^{+218}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{3}{n} + \frac{\frac{1}{x \cdot n} + \frac{-1.5}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                            6. Add Preprocessing

                            Alternative 14: 48.6% accurate, 7.3× speedup?

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

                              1. Initial program 30.2%

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

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

                                \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
                              5. Applied egg-rr61.4%

                                \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
                              6. Taylor expanded in n around inf

                                \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
                              7. Step-by-step derivation
                                1. mul-1-negN/A

                                  \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
                                2. distribute-neg-frac2N/A

                                  \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
                                3. mul-1-negN/A

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

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

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

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

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
                                8. mul-1-negN/A

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

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

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

                                \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{3} \cdot \frac{1}{n \cdot x} - \frac{1}{2} \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                              10. Step-by-step derivation
                                1. associate-*r/N/A

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

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

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

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

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

                                  \[\leadsto \frac{\frac{\frac{1}{3} \cdot \frac{1}{n \cdot x} - \frac{1}{2} \cdot \frac{1}{n}}{x} + \frac{1}{n}}{x} \]
                                7. /-lowering-/.f64N/A

                                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{1}{3} \cdot \frac{1}{n \cdot x} - \frac{1}{2} \cdot \frac{1}{n}}{x} + \frac{1}{n}\right), \color{blue}{x}\right) \]
                              11. Simplified46.9%

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

                              if -1.0499999999999999e-6 < n < -1.36e-301

                              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. Simplified44.6%

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

                                  \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                                3. Step-by-step derivation
                                  1. Simplified57.8%

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

                                      \[\leadsto 0 \]
                                  3. Applied egg-rr57.8%

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

                                  if -1.36e-301 < n

                                  1. Initial program 24.9%

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

                                      \[\leadsto {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \color{blue}{\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)} \]
                                    2. flip3-+N/A

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

                                      \[\leadsto \left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} + {\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)}^{3}\right) \cdot \color{blue}{\frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)}} \]
                                    4. cube-negN/A

                                      \[\leadsto \left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} + \left(\mathsf{neg}\left({\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right)\right)\right) \cdot \frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)} \]
                                    5. sub-negN/A

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

                                      \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} - {\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right), \color{blue}{\left(\frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)}\right)}\right) \]
                                  4. Applied egg-rr21.1%

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

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

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

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\left(3 \cdot \log \left(1 + x\right) - 3 \cdot \log x\right), \color{blue}{n}\right)\right) \]
                                    3. distribute-lft-out--N/A

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

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

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

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

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(3, \mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right)\right), n\right)\right) \]
                                    8. log-lowering-log.f6448.5%

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(3, \mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right)\right), n\right)\right) \]
                                  7. Simplified48.5%

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

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

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

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

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.05 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{\frac{0.3333333333333333}{n}}{x}}{x}}{x}\\ \mathbf{elif}\;n \leq -1.36 \cdot 10^{-301}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\frac{3}{n} + \frac{\frac{1}{x \cdot n} + \frac{-1.5}{n}}{x}}{x}\\ \end{array} \]
                                6. Add Preprocessing

                                Alternative 15: 48.6% accurate, 7.8× speedup?

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

                                  1. Initial program 27.2%

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

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

                                    \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
                                  5. Applied egg-rr60.5%

                                    \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
                                  6. Taylor expanded in n around inf

                                    \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
                                  7. Step-by-step derivation
                                    1. mul-1-negN/A

                                      \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
                                    2. distribute-neg-frac2N/A

                                      \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
                                    3. mul-1-negN/A

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

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

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

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

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
                                    8. mul-1-negN/A

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

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
                                  8. Simplified60.9%

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

                                    \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{\frac{1}{3} \cdot \frac{1}{n \cdot x} - \frac{1}{2} \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                                  10. Step-by-step derivation
                                    1. associate-*r/N/A

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

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

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

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

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

                                      \[\leadsto \frac{\frac{\frac{1}{3} \cdot \frac{1}{n \cdot x} - \frac{1}{2} \cdot \frac{1}{n}}{x} + \frac{1}{n}}{x} \]
                                    7. /-lowering-/.f64N/A

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

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

                                  if -1.0499999999999999e-6 < n < -1.36e-301

                                  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. Simplified44.6%

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

                                      \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                                    3. Step-by-step derivation
                                      1. Simplified57.8%

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

                                          \[\leadsto 0 \]
                                      3. Applied egg-rr57.8%

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.05 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{\frac{0.3333333333333333}{n}}{x}}{x}}{x}\\ \mathbf{elif}\;n \leq -1.36 \cdot 10^{-301}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{\frac{0.3333333333333333}{n}}{x}}{x}}{x}\\ \end{array} \]
                                    6. Add Preprocessing

                                    Alternative 16: 48.6% accurate, 9.2× speedup?

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

                                      1. Initial program 27.2%

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

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

                                        \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
                                      5. Applied egg-rr60.5%

                                        \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
                                      6. Taylor expanded in n around inf

                                        \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
                                      7. Step-by-step derivation
                                        1. mul-1-negN/A

                                          \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
                                        2. distribute-neg-frac2N/A

                                          \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
                                        3. mul-1-negN/A

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

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

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

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

                                          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
                                        8. mul-1-negN/A

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

                                          \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
                                      8. Simplified60.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1 \cdot \frac{\frac{1}{3} \cdot \frac{1}{x} - \frac{1}{2}}{x} - 1}{x}\right), \mathsf{neg.f64}\left(n\right)\right) \]
                                      11. Simplified47.4%

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

                                      if -1.15e-6 < n < -1.2199999999999999e-301

                                      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. Simplified44.6%

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

                                          \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                                        3. Step-by-step derivation
                                          1. Simplified57.8%

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

                                              \[\leadsto 0 \]
                                          3. Applied egg-rr57.8%

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

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.15 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333}{x} - 0.5}{x}}{x}}{n}\\ \mathbf{elif}\;n \leq -1.22 \cdot 10^{-301}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \]
                                        6. Add Preprocessing

                                        Alternative 17: 46.8% accurate, 14.0× speedup?

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

                                          1. Initial program 30.2%

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

                                              \[\leadsto {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \color{blue}{\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)} \]
                                            2. flip3-+N/A

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

                                              \[\leadsto \left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} + {\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)}^{3}\right) \cdot \color{blue}{\frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)}} \]
                                            4. cube-negN/A

                                              \[\leadsto \left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} + \left(\mathsf{neg}\left({\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right)\right)\right) \cdot \frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)} \]
                                            5. sub-negN/A

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

                                              \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)}^{3} - {\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right), \color{blue}{\left(\frac{1}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} + \left(\left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right) - {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \cdot \left(\mathsf{neg}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)\right)}\right)}\right) \]
                                          4. Applied egg-rr29.0%

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

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

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

                                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\left(3 \cdot \log \left(1 + x\right) - 3 \cdot \log x\right), \color{blue}{n}\right)\right) \]
                                            3. distribute-lft-out--N/A

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

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

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

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

                                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(3, \mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \log x\right)\right), n\right)\right) \]
                                            8. log-lowering-log.f6475.7%

                                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(3, \mathsf{\_.f64}\left(\mathsf{log1p.f64}\left(x\right), \mathsf{log.f64}\left(x\right)\right)\right), n\right)\right) \]
                                          7. Simplified75.7%

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

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

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

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

                                          if -1.15e-6 < n < -1.2999999999999999e-301

                                          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. Simplified44.6%

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

                                              \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                                            3. Step-by-step derivation
                                              1. Simplified57.8%

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

                                                  \[\leadsto 0 \]
                                              3. Applied egg-rr57.8%

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

                                              if -1.2999999999999999e-301 < n

                                              1. Initial program 24.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}{-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. Simplified66.7%

                                                \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
                                              5. Applied egg-rr59.8%

                                                \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
                                              6. Taylor expanded in n around inf

                                                \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
                                              7. Step-by-step derivation
                                                1. mul-1-negN/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
                                                2. distribute-neg-frac2N/A

                                                  \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
                                                3. mul-1-negN/A

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

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

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

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

                                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
                                                8. mul-1-negN/A

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

                                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
                                              8. Simplified48.6%

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

                                                \[\leadsto \color{blue}{\frac{1}{n \cdot x}} \]
                                              10. 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-*.f6445.8%

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

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

                                            Alternative 18: 46.8% accurate, 14.0× speedup?

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

                                              1. Initial program 30.2%

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

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

                                                \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
                                              5. Applied egg-rr61.4%

                                                \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
                                              6. Taylor expanded in n around inf

                                                \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
                                              7. Step-by-step derivation
                                                1. mul-1-negN/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
                                                2. distribute-neg-frac2N/A

                                                  \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
                                                3. mul-1-negN/A

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

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

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

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

                                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
                                                8. mul-1-negN/A

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

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

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

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

                                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(-1, x\right), \mathsf{neg.f64}\left(\color{blue}{n}\right)\right) \]
                                              11. Simplified46.5%

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

                                              if -1.15e-6 < n < -1.36e-301

                                              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. Simplified44.6%

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

                                                  \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                                                3. Step-by-step derivation
                                                  1. Simplified57.8%

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

                                                      \[\leadsto 0 \]
                                                  3. Applied egg-rr57.8%

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

                                                  if -1.36e-301 < n

                                                  1. Initial program 24.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}{-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. Simplified66.7%

                                                    \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
                                                  5. Applied egg-rr59.8%

                                                    \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
                                                  6. Taylor expanded in n around inf

                                                    \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
                                                  7. Step-by-step derivation
                                                    1. mul-1-negN/A

                                                      \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
                                                    2. distribute-neg-frac2N/A

                                                      \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
                                                    3. mul-1-negN/A

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

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

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

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

                                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
                                                    8. mul-1-negN/A

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

                                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
                                                  8. Simplified48.6%

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

                                                    \[\leadsto \color{blue}{\frac{1}{n \cdot x}} \]
                                                  10. 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-*.f6445.8%

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

                                                    \[\leadsto \color{blue}{\frac{1}{x \cdot n}} \]
                                                4. Recombined 3 regimes into one program.
                                                5. Final simplification49.0%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.15 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \mathbf{elif}\;n \leq -1.36 \cdot 10^{-301}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot n}\\ \end{array} \]
                                                6. Add Preprocessing

                                                Alternative 19: 46.6% accurate, 14.0× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{1}{x \cdot n}\\ \mathbf{if}\;n \leq -1.15 \cdot 10^{-6}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq -1.36 \cdot 10^{-301}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                (FPCore (x n)
                                                 :precision binary64
                                                 (let* ((t_0 (/ 1.0 (* x n))))
                                                   (if (<= n -1.15e-6) t_0 (if (<= n -1.36e-301) 0.0 t_0))))
                                                double code(double x, double n) {
                                                	double t_0 = 1.0 / (x * n);
                                                	double tmp;
                                                	if (n <= -1.15e-6) {
                                                		tmp = t_0;
                                                	} else if (n <= -1.36e-301) {
                                                		tmp = 0.0;
                                                	} else {
                                                		tmp = t_0;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                real(8) function code(x, n)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: n
                                                    real(8) :: t_0
                                                    real(8) :: tmp
                                                    t_0 = 1.0d0 / (x * n)
                                                    if (n <= (-1.15d-6)) then
                                                        tmp = t_0
                                                    else if (n <= (-1.36d-301)) then
                                                        tmp = 0.0d0
                                                    else
                                                        tmp = t_0
                                                    end if
                                                    code = tmp
                                                end function
                                                
                                                public static double code(double x, double n) {
                                                	double t_0 = 1.0 / (x * n);
                                                	double tmp;
                                                	if (n <= -1.15e-6) {
                                                		tmp = t_0;
                                                	} else if (n <= -1.36e-301) {
                                                		tmp = 0.0;
                                                	} else {
                                                		tmp = t_0;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                def code(x, n):
                                                	t_0 = 1.0 / (x * n)
                                                	tmp = 0
                                                	if n <= -1.15e-6:
                                                		tmp = t_0
                                                	elif n <= -1.36e-301:
                                                		tmp = 0.0
                                                	else:
                                                		tmp = t_0
                                                	return tmp
                                                
                                                function code(x, n)
                                                	t_0 = Float64(1.0 / Float64(x * n))
                                                	tmp = 0.0
                                                	if (n <= -1.15e-6)
                                                		tmp = t_0;
                                                	elseif (n <= -1.36e-301)
                                                		tmp = 0.0;
                                                	else
                                                		tmp = t_0;
                                                	end
                                                	return tmp
                                                end
                                                
                                                function tmp_2 = code(x, n)
                                                	t_0 = 1.0 / (x * n);
                                                	tmp = 0.0;
                                                	if (n <= -1.15e-6)
                                                		tmp = t_0;
                                                	elseif (n <= -1.36e-301)
                                                		tmp = 0.0;
                                                	else
                                                		tmp = t_0;
                                                	end
                                                	tmp_2 = tmp;
                                                end
                                                
                                                code[x_, n_] := Block[{t$95$0 = N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.15e-6], t$95$0, If[LessEqual[n, -1.36e-301], 0.0, t$95$0]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                t_0 := \frac{1}{x \cdot n}\\
                                                \mathbf{if}\;n \leq -1.15 \cdot 10^{-6}:\\
                                                \;\;\;\;t\_0\\
                                                
                                                \mathbf{elif}\;n \leq -1.36 \cdot 10^{-301}:\\
                                                \;\;\;\;0\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;t\_0\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if n < -1.15e-6 or -1.36e-301 < n

                                                  1. Initial program 27.2%

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

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

                                                    \[\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 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}}{0 - n}} \]
                                                  5. Applied egg-rr60.5%

                                                    \[\leadsto \color{blue}{\frac{-1}{n} \cdot \left(\log \left(\frac{x}{x + 1}\right) - \frac{0.5 \cdot \left(\log \left(x \cdot \left(x + 1\right)\right) \cdot \log \left(\frac{x + 1}{x}\right)\right) + \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right) \cdot \frac{0.16666666666666666}{n}}{n}\right)} \]
                                                  6. Taylor expanded in n around inf

                                                    \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{x}{1 + x}\right)}{n}} \]
                                                  7. Step-by-step derivation
                                                    1. mul-1-negN/A

                                                      \[\leadsto \mathsf{neg}\left(\frac{\log \left(\frac{x}{1 + x}\right)}{n}\right) \]
                                                    2. distribute-neg-frac2N/A

                                                      \[\leadsto \frac{\log \left(\frac{x}{1 + x}\right)}{\color{blue}{\mathsf{neg}\left(n\right)}} \]
                                                    3. mul-1-negN/A

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

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

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

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

                                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \left(-1 \cdot n\right)\right) \]
                                                    8. mul-1-negN/A

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

                                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{log.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(1, x\right)\right)\right), \mathsf{neg.f64}\left(n\right)\right) \]
                                                  8. Simplified60.9%

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

                                                    \[\leadsto \color{blue}{\frac{1}{n \cdot x}} \]
                                                  10. 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-*.f6446.1%

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

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

                                                  if -1.15e-6 < n < -1.36e-301

                                                  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. Simplified44.6%

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

                                                      \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                                                    3. Step-by-step derivation
                                                      1. Simplified57.8%

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

                                                          \[\leadsto 0 \]
                                                      3. Applied egg-rr57.8%

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

                                                    Alternative 20: 30.9% 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 45.1%

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

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

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

                                                        \[\leadsto \mathsf{\_.f64}\left(1, \color{blue}{1}\right) \]
                                                      3. Step-by-step derivation
                                                        1. Simplified28.2%

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

                                                            \[\leadsto 0 \]
                                                        3. Applied egg-rr28.2%

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

                                                        Reproduce

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