2nthrt (problem 3.4.6)

Percentage Accurate: 52.6% → 87.7%
Time: 28.5s
Alternatives: 19
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 52.6% 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: 87.7% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 47.8%

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

      \[\leadsto \color{blue}{-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. Simplified77.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-rr77.9%

      \[\leadsto \color{blue}{-\frac{\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}}{n}} \]

    if 1.9e7 < x

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), n\right), x\right) \]
    5. Simplified99.0%

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

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

Alternative 2: 87.2% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 48.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
    4. Step-by-step derivation
      1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
      12. metadata-evalN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
      17. /-lowering-/.f6448.2%

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, \color{blue}{n}\right)\right)\right) \]
    5. Simplified48.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{\frac{-1}{6} \cdot \frac{{\log x}^{3}}{n} - \frac{1}{2} \cdot {\log x}^{2}}{n} - -1 \cdot \log x}{n}} \]
    7. Simplified75.9%

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

    if 0.47999999999999998 < x

    1. Initial program 71.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. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 86.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\ \mathbf{if}\;n \leq -30500000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 28500000000:\\ \;\;\;\;e^{\mathsf{log1p}\left(x\right) \cdot \frac{1}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (let* ((t_0 (/ (log (/ x (+ x 1.0))) (- 0.0 n))))
   (if (<= n -30500000000.0)
     t_0
     (if (<= n 28500000000.0)
       (- (exp (* (log1p x) (/ 1.0 n))) (pow x (/ 1.0 n)))
       t_0))))
double code(double x, double n) {
	double t_0 = log((x / (x + 1.0))) / (0.0 - n);
	double tmp;
	if (n <= -30500000000.0) {
		tmp = t_0;
	} else if (n <= 28500000000.0) {
		tmp = exp((log1p(x) * (1.0 / n))) - pow(x, (1.0 / n));
	} else {
		tmp = t_0;
	}
	return tmp;
}
public static double code(double x, double n) {
	double t_0 = Math.log((x / (x + 1.0))) / (0.0 - n);
	double tmp;
	if (n <= -30500000000.0) {
		tmp = t_0;
	} else if (n <= 28500000000.0) {
		tmp = Math.exp((Math.log1p(x) * (1.0 / n))) - Math.pow(x, (1.0 / n));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, n):
	t_0 = math.log((x / (x + 1.0))) / (0.0 - n)
	tmp = 0
	if n <= -30500000000.0:
		tmp = t_0
	elif n <= 28500000000.0:
		tmp = math.exp((math.log1p(x) * (1.0 / n))) - math.pow(x, (1.0 / n))
	else:
		tmp = t_0
	return tmp
function code(x, n)
	t_0 = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(0.0 - n))
	tmp = 0.0
	if (n <= -30500000000.0)
		tmp = t_0;
	elseif (n <= 28500000000.0)
		tmp = Float64(exp(Float64(log1p(x) * Float64(1.0 / n))) - (x ^ Float64(1.0 / n)));
	else
		tmp = t_0;
	end
	return tmp
end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -30500000000.0], t$95$0, If[LessEqual[n, 28500000000.0], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] * N[(1.0 / n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\
\mathbf{if}\;n \leq -30500000000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;n \leq 28500000000:\\
\;\;\;\;e^{\mathsf{log1p}\left(x\right) \cdot \frac{1}{n}} - {x}^{\left(\frac{1}{n}\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -3.05e10 or 2.85e10 < n

    1. Initial program 34.8%

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

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

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

      \[\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. +-commutativeN/A

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

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

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

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

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

    if -3.05e10 < n < 2.85e10

    1. Initial program 92.8%

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\left({\left(\frac{x - 1}{x \cdot x - 1 \cdot 1}\right)}^{\left(\frac{-1}{n}\right)}\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      6. pow-to-expN/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\log \left(\frac{x - 1}{x \cdot x - 1 \cdot 1}\right), \left(\frac{-1}{n}\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\log \left(\frac{1}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}\right), \left(\frac{-1}{n}\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      10. flip-+N/A

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(\left(0 - \log \left(x + 1\right)\right), \left(\frac{-1}{n}\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{exp.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(0, \log \left(x + 1\right)\right), \left(\frac{-1}{n}\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      14. +-commutativeN/A

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

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

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

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

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

Alternative 4: 86.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\ \mathbf{if}\;n \leq -34500000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 52000000000:\\ \;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (let* ((t_0 (/ (log (/ x (+ x 1.0))) (- 0.0 n))))
   (if (<= n -34500000000.0)
     t_0
     (if (<= n 52000000000.0)
       (- (exp (/ (log1p x) n)) (pow x (/ 1.0 n)))
       t_0))))
double code(double x, double n) {
	double t_0 = log((x / (x + 1.0))) / (0.0 - n);
	double tmp;
	if (n <= -34500000000.0) {
		tmp = t_0;
	} else if (n <= 52000000000.0) {
		tmp = exp((log1p(x) / n)) - pow(x, (1.0 / n));
	} else {
		tmp = t_0;
	}
	return tmp;
}
public static double code(double x, double n) {
	double t_0 = Math.log((x / (x + 1.0))) / (0.0 - n);
	double tmp;
	if (n <= -34500000000.0) {
		tmp = t_0;
	} else if (n <= 52000000000.0) {
		tmp = Math.exp((Math.log1p(x) / n)) - Math.pow(x, (1.0 / n));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, n):
	t_0 = math.log((x / (x + 1.0))) / (0.0 - n)
	tmp = 0
	if n <= -34500000000.0:
		tmp = t_0
	elif n <= 52000000000.0:
		tmp = math.exp((math.log1p(x) / n)) - math.pow(x, (1.0 / n))
	else:
		tmp = t_0
	return tmp
function code(x, n)
	t_0 = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(0.0 - n))
	tmp = 0.0
	if (n <= -34500000000.0)
		tmp = t_0;
	elseif (n <= 52000000000.0)
		tmp = Float64(exp(Float64(log1p(x) / n)) - (x ^ Float64(1.0 / n)));
	else
		tmp = t_0;
	end
	return tmp
end
code[x_, n_] := Block[{t$95$0 = N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -34500000000.0], t$95$0, If[LessEqual[n, 52000000000.0], N[(N[Exp[N[(N[Log[1 + x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\
\mathbf{if}\;n \leq -34500000000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;n \leq 52000000000:\\
\;\;\;\;e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -3.45e10 or 5.2e10 < n

    1. Initial program 34.8%

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

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

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

      \[\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. +-commutativeN/A

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

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

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

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

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

    if -3.45e10 < n < 5.2e10

    1. Initial program 92.8%

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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. accelerator-lowering-log1p.f6498.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-rr98.7%

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

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

Alternative 5: 82.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\frac{1}{n} \leq 2000000000000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\frac{1}{n} + \frac{x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right) + \frac{x \cdot \left(0.5 + x \cdot -0.5\right)}{n}}{n}\right) + 1\right) - t\_0\\


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

    1. Initial program 99.5%

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Add Preprocessing

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

    1. Initial program 34.7%

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

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

      \[\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-rr52.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. +-commutativeN/A

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

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

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

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

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

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

    1. Initial program 76.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(\left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} + x \cdot \left(\left(\frac{1}{6} \cdot \frac{1}{{n}^{3}} + \frac{1}{3} \cdot \frac{1}{n}\right) - \frac{1}{2} \cdot \frac{1}{{n}^{2}}\right)\right) - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
    4. Simplified60.4%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(x \cdot \left(\frac{1}{3} \cdot x - \frac{1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\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, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{3} \cdot x - \frac{1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. 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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{3} \cdot x + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      5. 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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{3} \cdot x + \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{1}{3} \cdot x\right), \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      7. *-commutativeN/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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(x \cdot \frac{1}{3}\right), \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      9. /-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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)\right), n\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      10. *-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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)\right), n\right)\right), n\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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{-1}{2} \cdot x\right)\right)\right), n\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      12. *-commutativeN/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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \frac{-1}{2}\right)\right)\right), n\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      13. *-lowering-*.f6496.2%

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

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

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

Alternative 6: 81.6% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;\frac{1}{n} \leq 2000000000000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\frac{1}{n} + \frac{x \cdot \left(-0.5 + x \cdot 0.3333333333333333\right) + \frac{x \cdot \left(0.5 + x \cdot -0.5\right)}{n}}{n}\right) + 1\right) - t\_0\\


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

    1. Initial program 89.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 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. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 35.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. Simplified79.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-rr54.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. +-commutativeN/A

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

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

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

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

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

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

    1. Initial program 76.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(\left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} + x \cdot \left(\left(\frac{1}{6} \cdot \frac{1}{{n}^{3}} + \frac{1}{3} \cdot \frac{1}{n}\right) - \frac{1}{2} \cdot \frac{1}{{n}^{2}}\right)\right) - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
    4. Simplified60.4%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(x \cdot \left(\frac{1}{3} \cdot x - \frac{1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\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, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{3} \cdot x - \frac{1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. 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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{3} \cdot x + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      5. 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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{3} \cdot x + \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{1}{3} \cdot x\right), \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      7. *-commutativeN/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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(x \cdot \frac{1}{3}\right), \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      9. /-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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)\right), n\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      10. *-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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)\right), n\right)\right), n\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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{-1}{2} \cdot x\right)\right)\right), n\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      12. *-commutativeN/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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \frac{-1}{2}\right)\right)\right), n\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      13. *-lowering-*.f6496.2%

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

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

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

Alternative 7: 81.6% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;\frac{1}{n} \leq 2000000000000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\frac{1}{n} + \frac{x \cdot \left(-0.5 + \frac{0.5}{n}\right)}{n}\right) + 1\right) - t\_0\\


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

    1. Initial program 89.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 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. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 35.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. Simplified79.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-rr54.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. +-commutativeN/A

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

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

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

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

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

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

    1. Initial program 76.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(\left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} + x \cdot \left(\left(\frac{1}{6} \cdot \frac{1}{{n}^{3}} + \frac{1}{3} \cdot \frac{1}{n}\right) - \frac{1}{2} \cdot \frac{1}{{n}^{2}}\right)\right) - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)}, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
    4. Simplified60.4%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(x \cdot \left(\frac{1}{3} \cdot x - \frac{1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\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, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, n\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{3} \cdot x - \frac{1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      4. 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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{3} \cdot x + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      5. 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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{3} \cdot x + \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{1}{3} \cdot x\right), \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      7. *-commutativeN/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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(x \cdot \frac{1}{3}\right), \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \left(\frac{x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{n}\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      9. /-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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\left(x \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)\right), n\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      10. *-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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)\right), n\right)\right), n\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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{-1}{2} \cdot x\right)\right)\right), n\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      12. *-commutativeN/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(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{3}\right), \frac{-1}{2}\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\frac{1}{2}, \left(x \cdot \frac{-1}{2}\right)\right)\right), n\right)\right), n\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      13. *-lowering-*.f6496.2%

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

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

      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \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)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
    9. Step-by-step derivation
      1. +-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) \]
      2. +-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) \]
      3. /-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) \]
      4. sub-negN/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}} + \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) \]
      5. sub-negN/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. 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), \left(x \cdot \left(\frac{\frac{1}{2} \cdot 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. metadata-evalN/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{\frac{1}{2}}{{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) \]
      8. unpow2N/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{\frac{1}{2}}{n \cdot n} - \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) \]
      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), \left(x \cdot \left(\frac{\frac{\frac{1}{2}}{n}}{n} - \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) \]
      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), \left(x \cdot \left(\frac{\frac{\frac{1}{2} \cdot 1}{n}}{n} - \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) \]
      11. 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), \left(x \cdot \left(\frac{\frac{1}{2} \cdot \frac{1}{n}}{n} - \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) \]
      12. 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), \left(x \cdot \left(\frac{\frac{1}{2} \cdot \frac{1}{n}}{n} - \frac{\frac{1}{2} \cdot 1}{n}\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      13. metadata-evalN/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{\frac{1}{2} \cdot \frac{1}{n}}{n} - \frac{\frac{1}{2}}{n}\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      14. div-subN/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 \frac{\frac{1}{2} \cdot \frac{1}{n} - \frac{1}{2}}{n}\right)\right)\right)\right), \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right)\right) \]
      15. associate-/l*N/A

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

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

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

Alternative 8: 77.7% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;\frac{1}{n} \leq 2000000000000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\

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


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

    1. Initial program 89.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 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. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 35.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. Simplified79.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-rr54.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. +-commutativeN/A

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

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

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

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

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

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

    1. Initial program 76.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 + \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-/.f6480.5%

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

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

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

Alternative 9: 77.5% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;\frac{1}{n} \leq 2000000000000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\

\mathbf{else}:\\
\;\;\;\;1 - t\_0\\


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

    1. Initial program 89.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 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. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 35.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. Simplified79.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-rr54.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. +-commutativeN/A

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

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

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

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

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

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

    1. Initial program 76.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
    4. Step-by-step derivation
      1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
      12. metadata-evalN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
      17. /-lowering-/.f6476.4%

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

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

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

Alternative 10: 64.2% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq 2000000000000:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\ \mathbf{else}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (if (<= (/ 1.0 n) 2000000000000.0)
   (/ (log (/ x (+ x 1.0))) (- 0.0 n))
   (- 1.0 (pow x (/ 1.0 n)))))
double code(double x, double n) {
	double tmp;
	if ((1.0 / n) <= 2000000000000.0) {
		tmp = log((x / (x + 1.0))) / (0.0 - n);
	} else {
		tmp = 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) :: tmp
    if ((1.0d0 / n) <= 2000000000000.0d0) then
        tmp = log((x / (x + 1.0d0))) / (0.0d0 - n)
    else
        tmp = 1.0d0 - (x ** (1.0d0 / n))
    end if
    code = tmp
end function
public static double code(double x, double n) {
	double tmp;
	if ((1.0 / n) <= 2000000000000.0) {
		tmp = Math.log((x / (x + 1.0))) / (0.0 - n);
	} else {
		tmp = 1.0 - Math.pow(x, (1.0 / n));
	}
	return tmp;
}
def code(x, n):
	tmp = 0
	if (1.0 / n) <= 2000000000000.0:
		tmp = math.log((x / (x + 1.0))) / (0.0 - n)
	else:
		tmp = 1.0 - math.pow(x, (1.0 / n))
	return tmp
function code(x, n)
	tmp = 0.0
	if (Float64(1.0 / n) <= 2000000000000.0)
		tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(0.0 - n));
	else
		tmp = Float64(1.0 - (x ^ Float64(1.0 / n)));
	end
	return tmp
end
function tmp_2 = code(x, n)
	tmp = 0.0;
	if ((1.0 / n) <= 2000000000000.0)
		tmp = log((x / (x + 1.0))) / (0.0 - n);
	else
		tmp = 1.0 - (x ^ (1.0 / n));
	end
	tmp_2 = tmp;
end
code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], 2000000000000.0], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - n), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{1}{n} \leq 2000000000000:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{0 - n}\\

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


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

    1. Initial program 57.7%

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

      \[\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. Simplified80.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-rr53.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. +-commutativeN/A

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

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

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

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

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

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

    1. Initial program 76.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
    4. Step-by-step derivation
      1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
      12. metadata-evalN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
      17. /-lowering-/.f6476.4%

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

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

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

Alternative 11: 60.5% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;x \leq 0.6:\\
\;\;\;\;0 - \frac{\log x}{n}\\

\mathbf{elif}\;x \leq 2.06 \cdot 10^{+167}:\\
\;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x}\\

\mathbf{else}:\\
\;\;\;\;0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < 1.64999999999999986e-247

    1. Initial program 65.9%

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

      \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
    4. Step-by-step derivation
      1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
      12. metadata-evalN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
      17. /-lowering-/.f6465.9%

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

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

    if 1.64999999999999986e-247 < x < 0.599999999999999978

    1. Initial program 44.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
    4. Step-by-step derivation
      1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
      12. metadata-evalN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
      17. /-lowering-/.f6444.1%

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

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

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

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

        \[\leadsto 0 - \color{blue}{\frac{\log x}{n}} \]
      3. --lowering--.f64N/A

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

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

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

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

    if 0.599999999999999978 < x < 2.06e167

    1. Initial program 49.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.06e167 < x

    1. Initial program 93.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
    4. Step-by-step derivation
      1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
      12. metadata-evalN/A

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
      17. /-lowering-/.f6457.2%

        \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, \color{blue}{n}\right)\right)\right) \]
    5. Simplified57.2%

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

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

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

          \[\leadsto 0 \]
      3. Applied egg-rr93.4%

        \[\leadsto \color{blue}{0} \]
    8. Recombined 4 regimes into one program.
    9. Final simplification69.1%

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

    Alternative 12: 60.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 2.06 \cdot 10^{+167}:\\ \;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (if (<= x 0.6)
       (- 0.0 (/ (log x) n))
       (if (<= x 2.06e+167)
         (/ (/ (- (+ (/ 0.3333333333333333 (* x x)) 1.0) (/ 0.5 x)) n) x)
         0.0)))
    double code(double x, double n) {
    	double tmp;
    	if (x <= 0.6) {
    		tmp = 0.0 - (log(x) / n);
    	} else if (x <= 2.06e+167) {
    		tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / x;
    	} else {
    		tmp = 0.0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: tmp
        if (x <= 0.6d0) then
            tmp = 0.0d0 - (log(x) / n)
        else if (x <= 2.06d+167) then
            tmp = ((((0.3333333333333333d0 / (x * x)) + 1.0d0) - (0.5d0 / x)) / n) / x
        else
            tmp = 0.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double tmp;
    	if (x <= 0.6) {
    		tmp = 0.0 - (Math.log(x) / n);
    	} else if (x <= 2.06e+167) {
    		tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / 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 <= 2.06e+167:
    		tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / 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 <= 2.06e+167)
    		tmp = Float64(Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) + 1.0) - Float64(0.5 / x)) / n) / 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 <= 2.06e+167)
    		tmp = ((((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / n) / 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, 2.06e+167], N[(N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision], 0.0]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq 0.6:\\
    \;\;\;\;0 - \frac{\log x}{n}\\
    
    \mathbf{elif}\;x \leq 2.06 \cdot 10^{+167}:\\
    \;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x}\\
    
    \mathbf{else}:\\
    \;\;\;\;0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < 0.599999999999999978

      1. Initial program 48.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
      4. Step-by-step derivation
        1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
        12. metadata-evalN/A

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

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

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

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

          \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
        17. /-lowering-/.f6448.2%

          \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, \color{blue}{n}\right)\right)\right) \]
      5. Simplified48.2%

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

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

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

          \[\leadsto 0 - \color{blue}{\frac{\log x}{n}} \]
        3. --lowering--.f64N/A

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

          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\log x, \color{blue}{n}\right)\right) \]
        5. log-lowering-log.f6452.1%

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

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

      if 0.599999999999999978 < x < 2.06e167

      1. Initial program 49.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.06e167 < x

      1. Initial program 93.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
      4. Step-by-step derivation
        1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
        12. metadata-evalN/A

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

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

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

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

          \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
        17. /-lowering-/.f6457.2%

          \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, \color{blue}{n}\right)\right)\right) \]
      5. Simplified57.2%

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

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

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

            \[\leadsto 0 \]
        3. Applied egg-rr93.4%

          \[\leadsto \color{blue}{0} \]
      8. Recombined 3 regimes into one program.
      9. Final simplification66.7%

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

      Alternative 13: 49.7% accurate, 10.5× speedup?

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

        1. Initial program 48.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2.05e167 < x

        1. Initial program 93.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
        4. Step-by-step derivation
          1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
          12. metadata-evalN/A

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

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

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

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

            \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
          17. /-lowering-/.f6457.2%

            \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, \color{blue}{n}\right)\right)\right) \]
        5. Simplified57.2%

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

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

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

              \[\leadsto 0 \]
          3. Applied egg-rr93.4%

            \[\leadsto \color{blue}{0} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification56.4%

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

        Alternative 14: 49.7% accurate, 11.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.06 \cdot 10^{+167}:\\ \;\;\;\;\frac{\frac{\frac{x + \left(\frac{0.3333333333333333}{x} - 0.5\right)}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
        (FPCore (x n)
         :precision binary64
         (if (<= x 2.06e+167)
           (/ (/ (/ (+ x (- (/ 0.3333333333333333 x) 0.5)) n) x) x)
           0.0))
        double code(double x, double n) {
        	double tmp;
        	if (x <= 2.06e+167) {
        		tmp = (((x + ((0.3333333333333333 / x) - 0.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 <= 2.06d+167) then
                tmp = (((x + ((0.3333333333333333d0 / x) - 0.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 <= 2.06e+167) {
        		tmp = (((x + ((0.3333333333333333 / x) - 0.5)) / n) / x) / x;
        	} else {
        		tmp = 0.0;
        	}
        	return tmp;
        }
        
        def code(x, n):
        	tmp = 0
        	if x <= 2.06e+167:
        		tmp = (((x + ((0.3333333333333333 / x) - 0.5)) / n) / x) / x
        	else:
        		tmp = 0.0
        	return tmp
        
        function code(x, n)
        	tmp = 0.0
        	if (x <= 2.06e+167)
        		tmp = Float64(Float64(Float64(Float64(x + Float64(Float64(0.3333333333333333 / x) - 0.5)) / n) / x) / x);
        	else
        		tmp = 0.0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, n)
        	tmp = 0.0;
        	if (x <= 2.06e+167)
        		tmp = (((x + ((0.3333333333333333 / x) - 0.5)) / n) / x) / x;
        	else
        		tmp = 0.0;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, n_] := If[LessEqual[x, 2.06e+167], N[(N[(N[(N[(x + N[(N[(0.3333333333333333 / x), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision] / x), $MachinePrecision], 0.0]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;x \leq 2.06 \cdot 10^{+167}:\\
        \;\;\;\;\frac{\frac{\frac{x + \left(\frac{0.3333333333333333}{x} - 0.5\right)}{n}}{x}}{x}\\
        
        \mathbf{else}:\\
        \;\;\;\;0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < 2.06e167

          1. Initial program 48.7%

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)} \cdot x + n \cdot \left({x}^{\left(\frac{1}{n}\right)} \cdot \left(\left(\frac{\frac{1}{2}}{n \cdot n} + \frac{\frac{-1}{2}}{n}\right) + \frac{\frac{\frac{1}{6}}{n \cdot \left(n \cdot n\right)} + \left(\frac{\frac{1}{3}}{n} + \frac{\frac{-1}{2}}{n \cdot n}\right)}{x}\right)\right)\right), \left(n \cdot x\right)\right), x\right) \]
          6. Applied egg-rr34.3%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(x, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(\frac{1}{3}, x\right)\right)\right), n\right), x\right), x\right) \]
          9. Simplified44.6%

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

          if 2.06e167 < x

          1. Initial program 93.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
          4. Step-by-step derivation
            1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
            12. metadata-evalN/A

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

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

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

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

              \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
            17. /-lowering-/.f6457.2%

              \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, \color{blue}{n}\right)\right)\right) \]
          5. Simplified57.2%

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

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

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

                \[\leadsto 0 \]
            3. Applied egg-rr93.4%

              \[\leadsto \color{blue}{0} \]
          8. Recombined 2 regimes into one program.
          9. Final simplification56.4%

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.06 \cdot 10^{+167}:\\ \;\;\;\;\frac{\frac{\frac{x + \left(\frac{0.3333333333333333}{x} - 0.5\right)}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
          10. Add Preprocessing

          Alternative 15: 49.4% accurate, 11.7× speedup?

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

            1. Initial program 48.7%

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

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left({x}^{\left(\frac{1}{n}\right)} \cdot x + n \cdot \left({x}^{\left(\frac{1}{n}\right)} \cdot \left(\left(\frac{\frac{1}{2}}{n \cdot n} + \frac{\frac{-1}{2}}{n}\right) + \frac{\frac{\frac{1}{6}}{n \cdot \left(n \cdot n\right)} + \left(\frac{\frac{1}{3}}{n} + \frac{\frac{-1}{2}}{n \cdot n}\right)}{x}\right)\right)\right), \left(n \cdot x\right)\right), x\right) \]
            6. Applied egg-rr34.3%

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

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

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

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

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

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

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

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

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

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

            if 1.9499999999999999e167 < x

            1. Initial program 93.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
            4. Step-by-step derivation
              1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
              12. metadata-evalN/A

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

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

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

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

                \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
              17. /-lowering-/.f6457.2%

                \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, \color{blue}{n}\right)\right)\right) \]
            5. Simplified57.2%

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

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

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

                  \[\leadsto 0 \]
              3. Applied egg-rr93.4%

                \[\leadsto \color{blue}{0} \]
            8. Recombined 2 regimes into one program.
            9. Final simplification56.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.95 \cdot 10^{+167}:\\ \;\;\;\;\frac{\frac{x + \left(\frac{0.3333333333333333}{x} - 0.5\right)}{x \cdot n}}{x}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
            10. Add Preprocessing

            Alternative 16: 45.8% accurate, 17.6× speedup?

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

              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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
              4. Step-by-step derivation
                1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
                12. metadata-evalN/A

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

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

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

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

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

                  \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, \color{blue}{n}\right)\right)\right) \]
              5. Simplified47.7%

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

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

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

                    \[\leadsto 0 \]
                3. Applied egg-rr54.7%

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

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

                1. Initial program 42.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 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. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), n\right), x\right) \]
                5. Simplified49.2%

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

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

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

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

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

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

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

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

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

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

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

              Alternative 17: 45.8% accurate, 17.6× speedup?

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

                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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
                4. Step-by-step derivation
                  1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
                  12. metadata-evalN/A

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

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

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

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

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

                    \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, \color{blue}{n}\right)\right)\right) \]
                5. Simplified47.7%

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

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

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

                      \[\leadsto 0 \]
                  3. Applied egg-rr54.7%

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

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

                  1. Initial program 42.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 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. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, n\right)\right), n\right), x\right) \]
                  5. Simplified49.2%

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

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

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

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

                Alternative 18: 43.8% accurate, 21.1× speedup?

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

                  1. Initial program 48.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 2.29999999999999988e167 < x

                  1. Initial program 93.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
                  4. Step-by-step derivation
                    1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
                    12. metadata-evalN/A

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

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

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

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

                      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \color{blue}{\left(\frac{1}{n}\right)}\right)\right) \]
                    17. /-lowering-/.f6457.2%

                      \[\leadsto \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(x, \mathsf{/.f64}\left(1, \color{blue}{n}\right)\right)\right) \]
                  5. Simplified57.2%

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

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

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

                        \[\leadsto 0 \]
                    3. Applied egg-rr93.4%

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

                  Alternative 19: 30.8% accurate, 211.0× speedup?

                  \[\begin{array}{l} \\ 0 \end{array} \]
                  (FPCore (x n) :precision binary64 0.0)
                  double code(double x, double n) {
                  	return 0.0;
                  }
                  
                  real(8) function code(x, n)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: n
                      code = 0.0d0
                  end function
                  
                  public static double code(double x, double n) {
                  	return 0.0;
                  }
                  
                  def code(x, n):
                  	return 0.0
                  
                  function code(x, n)
                  	return 0.0
                  end
                  
                  function tmp = code(x, n)
                  	tmp = 0.0;
                  end
                  
                  code[x_, n_] := 0.0
                  
                  \begin{array}{l}
                  
                  \\
                  0
                  \end{array}
                  
                  Derivation
                  1. Initial program 59.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 \color{blue}{1 - e^{\frac{\log x}{n}}} \]
                  4. Step-by-step derivation
                    1. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{\_.f64}\left(1, \left(e^{\frac{\left(-1 \cdot -1\right) \cdot \log x}{n}}\right)\right) \]
                    12. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

                    Reproduce

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