2nthrt (problem 3.4.6)

Percentage Accurate: 54.4% → 85.3%
Time: 1.4min
Alternatives: 18
Speedup: 1.6×

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 18 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: 54.4% accurate, 1.0× speedup?

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

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

Alternative 1: 85.3% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\frac{t\_1 + t\_0 \cdot \frac{\frac{0.5}{{n}^{2}} + \frac{-0.5}{n}}{x}}{x}\\

\mathbf{else}:\\
\;\;\;\;e^{\frac{x}{n}} - t\_0\\


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

    1. Initial program 85.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 91.8%

      \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
    4. Step-by-step derivation
      1. mul-1-neg91.8%

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

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

        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
      4. distribute-neg-frac91.8%

        \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
      5. mul-1-neg91.8%

        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
      6. remove-double-neg91.8%

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

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
    5. Simplified91.8%

      \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
    6. Taylor expanded in x around 0 91.8%

      \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{n \cdot x}} \]
    7. Step-by-step derivation
      1. associate-/r*92.6%

        \[\leadsto \color{blue}{\frac{\frac{e^{\frac{\log x}{n}}}{n}}{x}} \]
      2. *-rgt-identity92.6%

        \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
      3. associate-*l/92.6%

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

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

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

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

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

    1. Initial program 33.4%

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

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

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

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

          \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
        3. fma-neg87.8%

          \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
      3. Applied egg-rr87.8%

        \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
      4. Taylor expanded in n around inf 87.8%

        \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
      5. Step-by-step derivation
        1. log1p-define87.8%

          \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
      6. Simplified87.8%

        \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
      7. Step-by-step derivation
        1. div-inv88.0%

          \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) - \log x}\right)}^{2} \cdot \frac{1}{n}} \]
        2. unpow288.0%

          \[\leadsto \color{blue}{\left(\sqrt{\mathsf{log1p}\left(x\right) - \log x} \cdot \sqrt{\mathsf{log1p}\left(x\right) - \log x}\right)} \cdot \frac{1}{n} \]
        3. add-sqr-sqrt88.2%

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

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

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

      1. Initial program 13.2%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. add-log-exp12.9%

          \[\leadsto \color{blue}{\log \left(e^{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}}\right)} \]
        2. pow-to-exp12.9%

          \[\leadsto \log \left(e^{\color{blue}{e^{\log \left(x + 1\right) \cdot \frac{1}{n}}} - {x}^{\left(\frac{1}{n}\right)}}\right) \]
        3. un-div-inv12.9%

          \[\leadsto \log \left(e^{e^{\color{blue}{\frac{\log \left(x + 1\right)}{n}}} - {x}^{\left(\frac{1}{n}\right)}}\right) \]
        4. +-commutative12.9%

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 2: 86.4% accurate, 0.2× speedup?

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

        1. Initial program 40.8%

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

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

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

        if 3.5 < x

        1. Initial program 68.0%

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

          \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
        4. Step-by-step derivation
          1. mul-1-neg97.7%

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

            \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
          3. mul-1-neg97.7%

            \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
          4. distribute-neg-frac97.7%

            \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
          5. mul-1-neg97.7%

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

            \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
          7. *-commutative97.7%

            \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
        5. Simplified97.7%

          \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
        6. Taylor expanded in x around 0 97.7%

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

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

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

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

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

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

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

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

      Alternative 3: 85.7% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.52:\\ \;\;\;\;\frac{-0.16666666666666666 \cdot \left(\frac{1}{n} \cdot \frac{{\log x}^{3}}{n}\right) - \left(\log x + 0.5 \cdot \frac{{\log x}^{2}}{n}\right)}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \end{array} \end{array} \]
      (FPCore (x n)
       :precision binary64
       (if (<= x 0.52)
         (/
          (-
           (* -0.16666666666666666 (* (/ 1.0 n) (/ (pow (log x) 3.0) n)))
           (+ (log x) (* 0.5 (/ (pow (log x) 2.0) n))))
          n)
         (/ (/ (pow x (/ 1.0 n)) n) x)))
      double code(double x, double n) {
      	double tmp;
      	if (x <= 0.52) {
      		tmp = ((-0.16666666666666666 * ((1.0 / n) * (pow(log(x), 3.0) / n))) - (log(x) + (0.5 * (pow(log(x), 2.0) / n)))) / 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.52d0) then
              tmp = (((-0.16666666666666666d0) * ((1.0d0 / n) * ((log(x) ** 3.0d0) / n))) - (log(x) + (0.5d0 * ((log(x) ** 2.0d0) / n)))) / 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.52) {
      		tmp = ((-0.16666666666666666 * ((1.0 / n) * (Math.pow(Math.log(x), 3.0) / n))) - (Math.log(x) + (0.5 * (Math.pow(Math.log(x), 2.0) / n)))) / n;
      	} else {
      		tmp = (Math.pow(x, (1.0 / n)) / n) / x;
      	}
      	return tmp;
      }
      
      def code(x, n):
      	tmp = 0
      	if x <= 0.52:
      		tmp = ((-0.16666666666666666 * ((1.0 / n) * (math.pow(math.log(x), 3.0) / n))) - (math.log(x) + (0.5 * (math.pow(math.log(x), 2.0) / n)))) / n
      	else:
      		tmp = (math.pow(x, (1.0 / n)) / n) / x
      	return tmp
      
      function code(x, n)
      	tmp = 0.0
      	if (x <= 0.52)
      		tmp = Float64(Float64(Float64(-0.16666666666666666 * Float64(Float64(1.0 / n) * Float64((log(x) ^ 3.0) / n))) - Float64(log(x) + Float64(0.5 * Float64((log(x) ^ 2.0) / n)))) / 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.52)
      		tmp = ((-0.16666666666666666 * ((1.0 / n) * ((log(x) ^ 3.0) / n))) - (log(x) + (0.5 * ((log(x) ^ 2.0) / n)))) / n;
      	else
      		tmp = ((x ^ (1.0 / n)) / n) / x;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, n_] := If[LessEqual[x, 0.52], N[(N[(N[(-0.16666666666666666 * N[(N[(1.0 / n), $MachinePrecision] * N[(N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Log[x], $MachinePrecision] + N[(0.5 * N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / n), $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 0.52:\\
      \;\;\;\;\frac{-0.16666666666666666 \cdot \left(\frac{1}{n} \cdot \frac{{\log x}^{3}}{n}\right) - \left(\log x + 0.5 \cdot \frac{{\log x}^{2}}{n}\right)}{n}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < 0.52000000000000002

        1. Initial program 40.8%

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

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

          \[\leadsto \color{blue}{\frac{-0.16666666666666666 \cdot \frac{{\log x}^{3}}{{n}^{2}} - \left(\log x + 0.5 \cdot \frac{{\log x}^{2}}{n}\right)}{n}} \]
        5. Step-by-step derivation
          1. *-un-lft-identity81.4%

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

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

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

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

        if 0.52000000000000002 < x

        1. Initial program 68.0%

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

          \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
        4. Step-by-step derivation
          1. mul-1-neg97.7%

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

            \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
          3. mul-1-neg97.7%

            \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
          4. distribute-neg-frac97.7%

            \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
          5. mul-1-neg97.7%

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

            \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
          7. *-commutative97.7%

            \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
        5. Simplified97.7%

          \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
        6. Taylor expanded in x around 0 97.7%

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

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

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

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

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

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

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

      Alternative 4: 85.4% accurate, 0.9× speedup?

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

        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 90.0%

          \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
        4. Step-by-step derivation
          1. mul-1-neg90.0%

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

            \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
          3. mul-1-neg90.0%

            \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
          4. distribute-neg-frac90.0%

            \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
          5. mul-1-neg90.0%

            \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
          6. remove-double-neg90.0%

            \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
          7. *-commutative90.0%

            \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
        5. Simplified90.0%

          \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
        6. Taylor expanded in x around 0 90.0%

          \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{n \cdot x}} \]
        7. Step-by-step derivation
          1. associate-/r*91.0%

            \[\leadsto \color{blue}{\frac{\frac{e^{\frac{\log x}{n}}}{n}}{x}} \]
          2. *-rgt-identity91.0%

            \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
          3. associate-*l/91.0%

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

            \[\leadsto \frac{\frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n}}{x} \]
          5. exp-to-pow91.0%

            \[\leadsto \frac{\frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n}}{x} \]
        8. Simplified91.0%

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

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

        1. Initial program 33.4%

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

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

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

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

              \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
            3. fma-neg87.8%

              \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
          3. Applied egg-rr87.8%

            \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
          4. Taylor expanded in n around inf 87.8%

            \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
          5. Step-by-step derivation
            1. log1p-define87.8%

              \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
          6. Simplified87.8%

            \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
          7. Step-by-step derivation
            1. div-inv88.0%

              \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) - \log x}\right)}^{2} \cdot \frac{1}{n}} \]
            2. unpow288.0%

              \[\leadsto \color{blue}{\left(\sqrt{\mathsf{log1p}\left(x\right) - \log x} \cdot \sqrt{\mathsf{log1p}\left(x\right) - \log x}\right)} \cdot \frac{1}{n} \]
            3. add-sqr-sqrt88.2%

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

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

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

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

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

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

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

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

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

        Alternative 5: 79.2% accurate, 1.0× speedup?

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

          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 90.0%

            \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
          4. Step-by-step derivation
            1. mul-1-neg90.0%

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

              \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
            3. mul-1-neg90.0%

              \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
            4. distribute-neg-frac90.0%

              \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
            5. mul-1-neg90.0%

              \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
            6. remove-double-neg90.0%

              \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
            7. *-commutative90.0%

              \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
          5. Simplified90.0%

            \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
          6. Taylor expanded in x around 0 90.0%

            \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{n \cdot x}} \]
          7. Step-by-step derivation
            1. associate-/r*91.0%

              \[\leadsto \color{blue}{\frac{\frac{e^{\frac{\log x}{n}}}{n}}{x}} \]
            2. *-rgt-identity91.0%

              \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
            3. associate-*l/91.0%

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

              \[\leadsto \frac{\frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n}}{x} \]
            5. exp-to-pow91.0%

              \[\leadsto \frac{\frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n}}{x} \]
          8. Simplified91.0%

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

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

          1. Initial program 33.4%

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

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

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

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

                \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
              3. fma-neg87.8%

                \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
            3. Applied egg-rr87.8%

              \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
            4. Taylor expanded in n around inf 87.8%

              \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
            5. Step-by-step derivation
              1. log1p-define87.8%

                \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
            6. Simplified87.8%

              \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
            7. Step-by-step derivation
              1. div-inv88.0%

                \[\leadsto \color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) - \log x}\right)}^{2} \cdot \frac{1}{n}} \]
              2. unpow288.0%

                \[\leadsto \color{blue}{\left(\sqrt{\mathsf{log1p}\left(x\right) - \log x} \cdot \sqrt{\mathsf{log1p}\left(x\right) - \log x}\right)} \cdot \frac{1}{n} \]
              3. add-sqr-sqrt88.2%

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

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

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

            1. Initial program 67.8%

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

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

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

          Alternative 6: 79.2% accurate, 1.0× speedup?

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

            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 90.0%

              \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
            4. Step-by-step derivation
              1. mul-1-neg90.0%

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

                \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
              3. mul-1-neg90.0%

                \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
              4. distribute-neg-frac90.0%

                \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
              5. mul-1-neg90.0%

                \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
              6. remove-double-neg90.0%

                \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
              7. *-commutative90.0%

                \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
            5. Simplified90.0%

              \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
            6. Taylor expanded in x around 0 90.0%

              \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{n \cdot x}} \]
            7. Step-by-step derivation
              1. associate-/r*91.0%

                \[\leadsto \color{blue}{\frac{\frac{e^{\frac{\log x}{n}}}{n}}{x}} \]
              2. *-rgt-identity91.0%

                \[\leadsto \frac{\frac{e^{\color{blue}{\frac{\log x}{n} \cdot 1}}}{n}}{x} \]
              3. associate-*l/91.0%

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

                \[\leadsto \frac{\frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n}}{x} \]
              5. exp-to-pow91.0%

                \[\leadsto \frac{\frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n}}{x} \]
            8. Simplified91.0%

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

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

            1. Initial program 33.4%

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

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

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

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

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

            1. Initial program 67.8%

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

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

          Alternative 7: 71.9% accurate, 1.4× speedup?

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

            1. Initial program 35.8%

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

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

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

                \[\leadsto \color{blue}{-\frac{\log x}{n}} \]
              2. distribute-frac-neg266.7%

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

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

            if 3.40000000000000007e-226 < x < 4.99999999999999956e-215

            1. Initial program 83.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 83.9%

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

            if 2.25000000000000015e-129 < x < 4.50000000000000012e-125

            1. Initial program 83.9%

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

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

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

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

                  \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                3. fma-neg51.8%

                  \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
              3. Applied egg-rr51.8%

                \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
              4. Taylor expanded in n around inf 6.0%

                \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
              5. Step-by-step derivation
                1. log1p-define6.0%

                  \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
              6. Simplified6.0%

                \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
              7. Taylor expanded in x around -inf 100.0%

                \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
              8. Step-by-step derivation
                1. mul-1-neg100.0%

                  \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                2. distribute-neg-frac2100.0%

                  \[\leadsto \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{-x}} \]
              9. Simplified100.0%

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

              if 4.50000000000000012e-125 < x < 0.125

              1. Initial program 37.7%

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

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

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

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

                    \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                  3. fma-neg78.8%

                    \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                3. Applied egg-rr78.8%

                  \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                4. Taylor expanded in n around inf 60.7%

                  \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                5. Step-by-step derivation
                  1. log1p-define60.7%

                    \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                6. Simplified60.7%

                  \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                7. Taylor expanded in x around 0 60.1%

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

                if 0.125 < x

                1. Initial program 68.0%

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

                  \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
                4. Step-by-step derivation
                  1. mul-1-neg97.7%

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

                    \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
                  3. mul-1-neg97.7%

                    \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
                  4. distribute-neg-frac97.7%

                    \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
                  5. mul-1-neg97.7%

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

                    \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                  7. *-commutative97.7%

                    \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
                5. Simplified97.7%

                  \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
                6. Taylor expanded in x around 0 97.7%

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.4 \cdot 10^{-226}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-215}:\\ \;\;\;\;\left(1 + \frac{x}{n}\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{-129}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{elif}\;x \leq 0.125:\\ \;\;\;\;x \cdot \left(\frac{1}{n} - x \cdot \left(0.5 \cdot \frac{1}{n} - \frac{x}{n} \cdot 0.3333333333333333\right)\right) - \frac{\log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \end{array} \]
              7. Add Preprocessing

              Alternative 8: 71.8% accurate, 1.5× speedup?

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

                1. Initial program 35.8%

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

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

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

                    \[\leadsto \color{blue}{-\frac{\log x}{n}} \]
                  2. distribute-frac-neg266.7%

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

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

                if 4.50000000000000011e-226 < x < 4.39999999999999993e-215

                1. Initial program 83.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 83.9%

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

                if 2.3e-129 < x < 5.20000000000000011e-125

                1. Initial program 83.9%

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

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

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

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

                      \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                    3. fma-neg51.8%

                      \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                  3. Applied egg-rr51.8%

                    \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                  4. Taylor expanded in n around inf 6.0%

                    \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                  5. Step-by-step derivation
                    1. log1p-define6.0%

                      \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                  6. Simplified6.0%

                    \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                  7. Taylor expanded in x around -inf 100.0%

                    \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                  8. Step-by-step derivation
                    1. mul-1-neg100.0%

                      \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                    2. distribute-neg-frac2100.0%

                      \[\leadsto \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{-x}} \]
                  9. Simplified100.0%

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

                  if 5.20000000000000011e-125 < x < 0.042999999999999997

                  1. Initial program 37.7%

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

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

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

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

                        \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                      3. fma-neg78.8%

                        \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                    3. Applied egg-rr78.8%

                      \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                    4. Taylor expanded in n around inf 60.7%

                      \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                    5. Step-by-step derivation
                      1. log1p-define60.7%

                        \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                    6. Simplified60.7%

                      \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                    7. Taylor expanded in x around 0 59.9%

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

                    if 0.042999999999999997 < x

                    1. Initial program 68.0%

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

                      \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
                    4. Step-by-step derivation
                      1. mul-1-neg97.7%

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

                        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
                      3. mul-1-neg97.7%

                        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
                      4. distribute-neg-frac97.7%

                        \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
                      5. mul-1-neg97.7%

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

                        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                      7. *-commutative97.7%

                        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
                    5. Simplified97.7%

                      \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
                    6. Taylor expanded in x around 0 97.7%

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

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

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

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

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

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4.5 \cdot 10^{-226}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{-215}:\\ \;\;\;\;\left(1 + \frac{x}{n}\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-129}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 5.2 \cdot 10^{-125}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{elif}\;x \leq 0.043:\\ \;\;\;\;x \cdot \left(\frac{1}{n} + -0.5 \cdot \frac{x}{n}\right) - \frac{\log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \end{array} \]
                  7. Add Preprocessing

                  Alternative 9: 71.7% accurate, 1.6× speedup?

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

                    1. Initial program 35.8%

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

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

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

                        \[\leadsto \color{blue}{-\frac{\log x}{n}} \]
                      2. distribute-frac-neg266.7%

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

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

                    if 5.09999999999999973e-226 < x < 4.00000000000000017e-215

                    1. Initial program 83.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 83.9%

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

                    if 2.3e-129 < x < 4.50000000000000012e-125

                    1. Initial program 83.9%

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

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

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

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

                          \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                        3. fma-neg51.8%

                          \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                      3. Applied egg-rr51.8%

                        \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                      4. Taylor expanded in n around inf 6.0%

                        \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                      5. Step-by-step derivation
                        1. log1p-define6.0%

                          \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                      6. Simplified6.0%

                        \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                      7. Taylor expanded in x around -inf 100.0%

                        \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                      8. Step-by-step derivation
                        1. mul-1-neg100.0%

                          \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                        2. distribute-neg-frac2100.0%

                          \[\leadsto \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{-x}} \]
                      9. Simplified100.0%

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

                      if 4.50000000000000012e-125 < x < 0.042999999999999997

                      1. Initial program 37.7%

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

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

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

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

                            \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                          3. fma-neg78.8%

                            \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                        3. Applied egg-rr78.8%

                          \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                        4. Taylor expanded in n around inf 60.7%

                          \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                        5. Step-by-step derivation
                          1. log1p-define60.7%

                            \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                        6. Simplified60.7%

                          \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                        7. Taylor expanded in x around 0 59.8%

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

                        if 0.042999999999999997 < x

                        1. Initial program 68.0%

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

                          \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
                        4. Step-by-step derivation
                          1. mul-1-neg97.7%

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

                            \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
                          3. mul-1-neg97.7%

                            \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
                          4. distribute-neg-frac97.7%

                            \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
                          5. mul-1-neg97.7%

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

                            \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                          7. *-commutative97.7%

                            \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
                        5. Simplified97.7%

                          \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
                        6. Taylor expanded in x around 0 97.7%

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

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

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

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

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5.1 \cdot 10^{-226}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-215}:\\ \;\;\;\;\left(1 + \frac{x}{n}\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-129}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-125}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{elif}\;x \leq 0.043:\\ \;\;\;\;\frac{x}{n} - \frac{\log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \end{array} \]
                      7. Add Preprocessing

                      Alternative 10: 71.7% accurate, 1.6× speedup?

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

                        1. Initial program 35.8%

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

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

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

                            \[\leadsto \color{blue}{-\frac{\log x}{n}} \]
                          2. distribute-frac-neg266.7%

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

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

                        if 1.99999999999999984e-226 < x < 4.09999999999999985e-215

                        1. Initial program 83.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 83.9%

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

                        if 2.3e-129 < x < 1.2500000000000001e-124

                        1. Initial program 83.9%

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

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

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

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

                              \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                            3. fma-neg51.8%

                              \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                          3. Applied egg-rr51.8%

                            \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                          4. Taylor expanded in n around inf 6.0%

                            \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                          5. Step-by-step derivation
                            1. log1p-define6.0%

                              \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                          6. Simplified6.0%

                            \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                          7. Taylor expanded in x around -inf 100.0%

                            \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                          8. Step-by-step derivation
                            1. mul-1-neg100.0%

                              \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                            2. distribute-neg-frac2100.0%

                              \[\leadsto \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{-x}} \]
                          9. Simplified100.0%

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

                          if 1.2500000000000001e-124 < x < 0.0550000000000000003

                          1. Initial program 37.7%

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

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

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

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

                                \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                              3. fma-neg78.8%

                                \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                            3. Applied egg-rr78.8%

                              \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                            4. Taylor expanded in n around inf 60.7%

                              \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                            5. Step-by-step derivation
                              1. log1p-define60.7%

                                \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                            6. Simplified60.7%

                              \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                            7. Taylor expanded in x around 0 59.8%

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

                            if 0.0550000000000000003 < x

                            1. Initial program 68.0%

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

                              \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
                            4. Step-by-step derivation
                              1. mul-1-neg97.7%

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

                                \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
                              3. mul-1-neg97.7%

                                \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
                              4. distribute-neg-frac97.7%

                                \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
                              5. mul-1-neg97.7%

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

                                \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                              7. *-commutative97.7%

                                \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
                            5. Simplified97.7%

                              \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
                            6. Taylor expanded in x around 0 97.7%

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

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

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

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

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

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2 \cdot 10^{-226}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{-215}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-129}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-124}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{elif}\;x \leq 0.055:\\ \;\;\;\;\frac{x}{n} - \frac{\log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \end{array} \]
                          7. Add Preprocessing

                          Alternative 11: 71.7% accurate, 1.6× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\log x}{-n}\\ t_1 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;x \leq 4.5 \cdot 10^{-226}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{-215}:\\ \;\;\;\;1 - t\_1\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{-129}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-125}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{elif}\;x \leq 0.055:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t\_1}{n}}{x}\\ \end{array} \end{array} \]
                          (FPCore (x n)
                           :precision binary64
                           (let* ((t_0 (/ (log x) (- n))) (t_1 (pow x (/ 1.0 n))))
                             (if (<= x 4.5e-226)
                               t_0
                               (if (<= x 6.8e-215)
                                 (- 1.0 t_1)
                                 (if (<= x 1.85e-129)
                                   t_0
                                   (if (<= x 4.8e-125)
                                     (/
                                      (+ (/ 1.0 n) (/ (+ (/ -0.5 n) (/ 0.3333333333333333 (* x n))) x))
                                      x)
                                     (if (<= x 0.055) (/ (- x (log x)) n) (/ (/ t_1 n) x))))))))
                          double code(double x, double n) {
                          	double t_0 = log(x) / -n;
                          	double t_1 = pow(x, (1.0 / n));
                          	double tmp;
                          	if (x <= 4.5e-226) {
                          		tmp = t_0;
                          	} else if (x <= 6.8e-215) {
                          		tmp = 1.0 - t_1;
                          	} else if (x <= 1.85e-129) {
                          		tmp = t_0;
                          	} else if (x <= 4.8e-125) {
                          		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                          	} else if (x <= 0.055) {
                          		tmp = (x - log(x)) / n;
                          	} else {
                          		tmp = (t_1 / n) / x;
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(x, n)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: n
                              real(8) :: t_0
                              real(8) :: t_1
                              real(8) :: tmp
                              t_0 = log(x) / -n
                              t_1 = x ** (1.0d0 / n)
                              if (x <= 4.5d-226) then
                                  tmp = t_0
                              else if (x <= 6.8d-215) then
                                  tmp = 1.0d0 - t_1
                              else if (x <= 1.85d-129) then
                                  tmp = t_0
                              else if (x <= 4.8d-125) then
                                  tmp = ((1.0d0 / n) + ((((-0.5d0) / n) + (0.3333333333333333d0 / (x * n))) / x)) / x
                              else if (x <= 0.055d0) then
                                  tmp = (x - log(x)) / n
                              else
                                  tmp = (t_1 / n) / x
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double n) {
                          	double t_0 = Math.log(x) / -n;
                          	double t_1 = Math.pow(x, (1.0 / n));
                          	double tmp;
                          	if (x <= 4.5e-226) {
                          		tmp = t_0;
                          	} else if (x <= 6.8e-215) {
                          		tmp = 1.0 - t_1;
                          	} else if (x <= 1.85e-129) {
                          		tmp = t_0;
                          	} else if (x <= 4.8e-125) {
                          		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                          	} else if (x <= 0.055) {
                          		tmp = (x - Math.log(x)) / n;
                          	} else {
                          		tmp = (t_1 / n) / x;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, n):
                          	t_0 = math.log(x) / -n
                          	t_1 = math.pow(x, (1.0 / n))
                          	tmp = 0
                          	if x <= 4.5e-226:
                          		tmp = t_0
                          	elif x <= 6.8e-215:
                          		tmp = 1.0 - t_1
                          	elif x <= 1.85e-129:
                          		tmp = t_0
                          	elif x <= 4.8e-125:
                          		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x
                          	elif x <= 0.055:
                          		tmp = (x - math.log(x)) / n
                          	else:
                          		tmp = (t_1 / n) / x
                          	return tmp
                          
                          function code(x, n)
                          	t_0 = Float64(log(x) / Float64(-n))
                          	t_1 = x ^ Float64(1.0 / n)
                          	tmp = 0.0
                          	if (x <= 4.5e-226)
                          		tmp = t_0;
                          	elseif (x <= 6.8e-215)
                          		tmp = Float64(1.0 - t_1);
                          	elseif (x <= 1.85e-129)
                          		tmp = t_0;
                          	elseif (x <= 4.8e-125)
                          		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(-0.5 / n) + Float64(0.3333333333333333 / Float64(x * n))) / x)) / x);
                          	elseif (x <= 0.055)
                          		tmp = Float64(Float64(x - log(x)) / n);
                          	else
                          		tmp = Float64(Float64(t_1 / n) / x);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, n)
                          	t_0 = log(x) / -n;
                          	t_1 = x ^ (1.0 / n);
                          	tmp = 0.0;
                          	if (x <= 4.5e-226)
                          		tmp = t_0;
                          	elseif (x <= 6.8e-215)
                          		tmp = 1.0 - t_1;
                          	elseif (x <= 1.85e-129)
                          		tmp = t_0;
                          	elseif (x <= 4.8e-125)
                          		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                          	elseif (x <= 0.055)
                          		tmp = (x - log(x)) / n;
                          	else
                          		tmp = (t_1 / n) / x;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]}, Block[{t$95$1 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 4.5e-226], t$95$0, If[LessEqual[x, 6.8e-215], N[(1.0 - t$95$1), $MachinePrecision], If[LessEqual[x, 1.85e-129], t$95$0, If[LessEqual[x, 4.8e-125], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(-0.5 / n), $MachinePrecision] + N[(0.3333333333333333 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 0.055], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(t$95$1 / n), $MachinePrecision] / x), $MachinePrecision]]]]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := \frac{\log x}{-n}\\
                          t_1 := {x}^{\left(\frac{1}{n}\right)}\\
                          \mathbf{if}\;x \leq 4.5 \cdot 10^{-226}:\\
                          \;\;\;\;t\_0\\
                          
                          \mathbf{elif}\;x \leq 6.8 \cdot 10^{-215}:\\
                          \;\;\;\;1 - t\_1\\
                          
                          \mathbf{elif}\;x \leq 1.85 \cdot 10^{-129}:\\
                          \;\;\;\;t\_0\\
                          
                          \mathbf{elif}\;x \leq 4.8 \cdot 10^{-125}:\\
                          \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\
                          
                          \mathbf{elif}\;x \leq 0.055:\\
                          \;\;\;\;\frac{x - \log x}{n}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{\frac{t\_1}{n}}{x}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 5 regimes
                          2. if x < 4.50000000000000011e-226 or 6.80000000000000003e-215 < x < 1.8500000000000001e-129

                            1. Initial program 35.8%

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

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

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

                                \[\leadsto \color{blue}{-\frac{\log x}{n}} \]
                              2. distribute-frac-neg266.7%

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

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

                            if 4.50000000000000011e-226 < x < 6.80000000000000003e-215

                            1. Initial program 83.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 83.9%

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

                            if 1.8500000000000001e-129 < x < 4.8000000000000003e-125

                            1. Initial program 83.9%

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

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

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

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

                                  \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                                3. fma-neg51.8%

                                  \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                              3. Applied egg-rr51.8%

                                \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                              4. Taylor expanded in n around inf 6.0%

                                \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                              5. Step-by-step derivation
                                1. log1p-define6.0%

                                  \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                              6. Simplified6.0%

                                \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                              7. Taylor expanded in x around -inf 100.0%

                                \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                              8. Step-by-step derivation
                                1. mul-1-neg100.0%

                                  \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                                2. distribute-neg-frac2100.0%

                                  \[\leadsto \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{-x}} \]
                              9. Simplified100.0%

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

                              if 4.8000000000000003e-125 < x < 0.0550000000000000003

                              1. Initial program 37.7%

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

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

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

                              if 0.0550000000000000003 < x

                              1. Initial program 68.0%

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

                                \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
                              4. Step-by-step derivation
                                1. mul-1-neg97.7%

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

                                  \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
                                3. mul-1-neg97.7%

                                  \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
                                4. distribute-neg-frac97.7%

                                  \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
                                5. mul-1-neg97.7%

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

                                  \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                                7. *-commutative97.7%

                                  \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
                              5. Simplified97.7%

                                \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
                              6. Taylor expanded in x around 0 97.7%

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

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

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

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

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4.5 \cdot 10^{-226}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 6.8 \cdot 10^{-215}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 1.85 \cdot 10^{-129}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-125}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{elif}\;x \leq 0.055:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{n}}{x}\\ \end{array} \]
                            7. Add Preprocessing

                            Alternative 12: 56.9% accurate, 1.6× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\log x}{-n}\\ \mathbf{if}\;x \leq 2 \cdot 10^{-226}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-215}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-129}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-125} \lor \neg \left(x \leq 0.85\right):\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \end{array} \end{array} \]
                            (FPCore (x n)
                             :precision binary64
                             (let* ((t_0 (/ (log x) (- n))))
                               (if (<= x 2e-226)
                                 t_0
                                 (if (<= x 4e-215)
                                   (- 1.0 (pow x (/ 1.0 n)))
                                   (if (<= x 2.3e-129)
                                     t_0
                                     (if (or (<= x 4.5e-125) (not (<= x 0.85)))
                                       (/
                                        (+ (/ 1.0 n) (/ (+ (/ -0.5 n) (/ 0.3333333333333333 (* x n))) x))
                                        x)
                                       (/ (- x (log x)) n)))))))
                            double code(double x, double n) {
                            	double t_0 = log(x) / -n;
                            	double tmp;
                            	if (x <= 2e-226) {
                            		tmp = t_0;
                            	} else if (x <= 4e-215) {
                            		tmp = 1.0 - pow(x, (1.0 / n));
                            	} else if (x <= 2.3e-129) {
                            		tmp = t_0;
                            	} else if ((x <= 4.5e-125) || !(x <= 0.85)) {
                            		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                            	} else {
                            		tmp = (x - log(x)) / n;
                            	}
                            	return tmp;
                            }
                            
                            real(8) function code(x, n)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: n
                                real(8) :: t_0
                                real(8) :: tmp
                                t_0 = log(x) / -n
                                if (x <= 2d-226) then
                                    tmp = t_0
                                else if (x <= 4d-215) then
                                    tmp = 1.0d0 - (x ** (1.0d0 / n))
                                else if (x <= 2.3d-129) then
                                    tmp = t_0
                                else if ((x <= 4.5d-125) .or. (.not. (x <= 0.85d0))) then
                                    tmp = ((1.0d0 / n) + ((((-0.5d0) / n) + (0.3333333333333333d0 / (x * n))) / x)) / x
                                else
                                    tmp = (x - log(x)) / n
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double n) {
                            	double t_0 = Math.log(x) / -n;
                            	double tmp;
                            	if (x <= 2e-226) {
                            		tmp = t_0;
                            	} else if (x <= 4e-215) {
                            		tmp = 1.0 - Math.pow(x, (1.0 / n));
                            	} else if (x <= 2.3e-129) {
                            		tmp = t_0;
                            	} else if ((x <= 4.5e-125) || !(x <= 0.85)) {
                            		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                            	} else {
                            		tmp = (x - Math.log(x)) / n;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, n):
                            	t_0 = math.log(x) / -n
                            	tmp = 0
                            	if x <= 2e-226:
                            		tmp = t_0
                            	elif x <= 4e-215:
                            		tmp = 1.0 - math.pow(x, (1.0 / n))
                            	elif x <= 2.3e-129:
                            		tmp = t_0
                            	elif (x <= 4.5e-125) or not (x <= 0.85):
                            		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x
                            	else:
                            		tmp = (x - math.log(x)) / n
                            	return tmp
                            
                            function code(x, n)
                            	t_0 = Float64(log(x) / Float64(-n))
                            	tmp = 0.0
                            	if (x <= 2e-226)
                            		tmp = t_0;
                            	elseif (x <= 4e-215)
                            		tmp = Float64(1.0 - (x ^ Float64(1.0 / n)));
                            	elseif (x <= 2.3e-129)
                            		tmp = t_0;
                            	elseif ((x <= 4.5e-125) || !(x <= 0.85))
                            		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(-0.5 / n) + Float64(0.3333333333333333 / Float64(x * n))) / x)) / x);
                            	else
                            		tmp = Float64(Float64(x - log(x)) / n);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, n)
                            	t_0 = log(x) / -n;
                            	tmp = 0.0;
                            	if (x <= 2e-226)
                            		tmp = t_0;
                            	elseif (x <= 4e-215)
                            		tmp = 1.0 - (x ^ (1.0 / n));
                            	elseif (x <= 2.3e-129)
                            		tmp = t_0;
                            	elseif ((x <= 4.5e-125) || ~((x <= 0.85)))
                            		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                            	else
                            		tmp = (x - log(x)) / n;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]}, If[LessEqual[x, 2e-226], t$95$0, If[LessEqual[x, 4e-215], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3e-129], t$95$0, If[Or[LessEqual[x, 4.5e-125], N[Not[LessEqual[x, 0.85]], $MachinePrecision]], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(-0.5 / n), $MachinePrecision] + N[(0.3333333333333333 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]]]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := \frac{\log x}{-n}\\
                            \mathbf{if}\;x \leq 2 \cdot 10^{-226}:\\
                            \;\;\;\;t\_0\\
                            
                            \mathbf{elif}\;x \leq 4 \cdot 10^{-215}:\\
                            \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
                            
                            \mathbf{elif}\;x \leq 2.3 \cdot 10^{-129}:\\
                            \;\;\;\;t\_0\\
                            
                            \mathbf{elif}\;x \leq 4.5 \cdot 10^{-125} \lor \neg \left(x \leq 0.85\right):\\
                            \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{x - \log x}{n}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 4 regimes
                            2. if x < 1.99999999999999984e-226 or 4.00000000000000017e-215 < x < 2.3e-129

                              1. Initial program 35.8%

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

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

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

                                  \[\leadsto \color{blue}{-\frac{\log x}{n}} \]
                                2. distribute-frac-neg266.7%

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

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

                              if 1.99999999999999984e-226 < x < 4.00000000000000017e-215

                              1. Initial program 83.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 83.9%

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

                              if 2.3e-129 < x < 4.50000000000000012e-125 or 0.849999999999999978 < x

                              1. Initial program 68.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 65.8%

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

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

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

                                    \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                                  3. fma-neg66.5%

                                    \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                                3. Applied egg-rr66.5%

                                  \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                                4. Taylor expanded in n around inf 64.4%

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

                                    \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                                6. Simplified64.4%

                                  \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                                7. Taylor expanded in x around -inf 66.0%

                                  \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                                8. Step-by-step derivation
                                  1. mul-1-neg66.0%

                                    \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                                  2. distribute-neg-frac266.0%

                                    \[\leadsto \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{-x}} \]
                                9. Simplified66.0%

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

                                if 4.50000000000000012e-125 < x < 0.849999999999999978

                                1. Initial program 37.7%

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

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

                                  \[\leadsto \color{blue}{\frac{x - \log x}{n}} \]
                              5. Recombined 4 regimes into one program.
                              6. Final simplification65.4%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2 \cdot 10^{-226}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-215}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-129}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-125} \lor \neg \left(x \leq 0.85\right):\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \end{array} \]
                              7. Add Preprocessing

                              Alternative 13: 56.6% accurate, 1.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\log x}{-n}\\ t_1 := \frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{if}\;x \leq 5.8 \cdot 10^{-226}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-215}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-129}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-125} \lor \neg \left(x \leq 0.85\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \end{array} \end{array} \]
                              (FPCore (x n)
                               :precision binary64
                               (let* ((t_0 (/ (log x) (- n)))
                                      (t_1
                                       (/
                                        (+ (/ 1.0 n) (/ (+ (/ -0.5 n) (/ 0.3333333333333333 (* x n))) x))
                                        x)))
                                 (if (<= x 5.8e-226)
                                   t_0
                                   (if (<= x 3.5e-215)
                                     t_1
                                     (if (<= x 2.2e-129)
                                       t_0
                                       (if (or (<= x 4.5e-125) (not (<= x 0.85)))
                                         t_1
                                         (/ (- x (log x)) n)))))))
                              double code(double x, double n) {
                              	double t_0 = log(x) / -n;
                              	double t_1 = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                              	double tmp;
                              	if (x <= 5.8e-226) {
                              		tmp = t_0;
                              	} else if (x <= 3.5e-215) {
                              		tmp = t_1;
                              	} else if (x <= 2.2e-129) {
                              		tmp = t_0;
                              	} else if ((x <= 4.5e-125) || !(x <= 0.85)) {
                              		tmp = t_1;
                              	} else {
                              		tmp = (x - log(x)) / n;
                              	}
                              	return tmp;
                              }
                              
                              real(8) function code(x, n)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: n
                                  real(8) :: t_0
                                  real(8) :: t_1
                                  real(8) :: tmp
                                  t_0 = log(x) / -n
                                  t_1 = ((1.0d0 / n) + ((((-0.5d0) / n) + (0.3333333333333333d0 / (x * n))) / x)) / x
                                  if (x <= 5.8d-226) then
                                      tmp = t_0
                                  else if (x <= 3.5d-215) then
                                      tmp = t_1
                                  else if (x <= 2.2d-129) then
                                      tmp = t_0
                                  else if ((x <= 4.5d-125) .or. (.not. (x <= 0.85d0))) then
                                      tmp = t_1
                                  else
                                      tmp = (x - log(x)) / n
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double x, double n) {
                              	double t_0 = Math.log(x) / -n;
                              	double t_1 = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                              	double tmp;
                              	if (x <= 5.8e-226) {
                              		tmp = t_0;
                              	} else if (x <= 3.5e-215) {
                              		tmp = t_1;
                              	} else if (x <= 2.2e-129) {
                              		tmp = t_0;
                              	} else if ((x <= 4.5e-125) || !(x <= 0.85)) {
                              		tmp = t_1;
                              	} else {
                              		tmp = (x - Math.log(x)) / n;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, n):
                              	t_0 = math.log(x) / -n
                              	t_1 = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x
                              	tmp = 0
                              	if x <= 5.8e-226:
                              		tmp = t_0
                              	elif x <= 3.5e-215:
                              		tmp = t_1
                              	elif x <= 2.2e-129:
                              		tmp = t_0
                              	elif (x <= 4.5e-125) or not (x <= 0.85):
                              		tmp = t_1
                              	else:
                              		tmp = (x - math.log(x)) / n
                              	return tmp
                              
                              function code(x, n)
                              	t_0 = Float64(log(x) / Float64(-n))
                              	t_1 = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(-0.5 / n) + Float64(0.3333333333333333 / Float64(x * n))) / x)) / x)
                              	tmp = 0.0
                              	if (x <= 5.8e-226)
                              		tmp = t_0;
                              	elseif (x <= 3.5e-215)
                              		tmp = t_1;
                              	elseif (x <= 2.2e-129)
                              		tmp = t_0;
                              	elseif ((x <= 4.5e-125) || !(x <= 0.85))
                              		tmp = t_1;
                              	else
                              		tmp = Float64(Float64(x - log(x)) / n);
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, n)
                              	t_0 = log(x) / -n;
                              	t_1 = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                              	tmp = 0.0;
                              	if (x <= 5.8e-226)
                              		tmp = t_0;
                              	elseif (x <= 3.5e-215)
                              		tmp = t_1;
                              	elseif (x <= 2.2e-129)
                              		tmp = t_0;
                              	elseif ((x <= 4.5e-125) || ~((x <= 0.85)))
                              		tmp = t_1;
                              	else
                              		tmp = (x - log(x)) / n;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(-0.5 / n), $MachinePrecision] + N[(0.3333333333333333 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[x, 5.8e-226], t$95$0, If[LessEqual[x, 3.5e-215], t$95$1, If[LessEqual[x, 2.2e-129], t$95$0, If[Or[LessEqual[x, 4.5e-125], N[Not[LessEqual[x, 0.85]], $MachinePrecision]], t$95$1, N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]]]]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := \frac{\log x}{-n}\\
                              t_1 := \frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\
                              \mathbf{if}\;x \leq 5.8 \cdot 10^{-226}:\\
                              \;\;\;\;t\_0\\
                              
                              \mathbf{elif}\;x \leq 3.5 \cdot 10^{-215}:\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{elif}\;x \leq 2.2 \cdot 10^{-129}:\\
                              \;\;\;\;t\_0\\
                              
                              \mathbf{elif}\;x \leq 4.5 \cdot 10^{-125} \lor \neg \left(x \leq 0.85\right):\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{x - \log x}{n}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if x < 5.80000000000000003e-226 or 3.5000000000000002e-215 < x < 2.20000000000000003e-129

                                1. Initial program 35.8%

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

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

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

                                    \[\leadsto \color{blue}{-\frac{\log x}{n}} \]
                                  2. distribute-frac-neg266.7%

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

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

                                if 5.80000000000000003e-226 < x < 3.5000000000000002e-215 or 2.20000000000000003e-129 < x < 4.50000000000000012e-125 or 0.849999999999999978 < x

                                1. Initial program 69.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 63.7%

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

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

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

                                      \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                                    3. fma-neg64.4%

                                      \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                                  3. Applied egg-rr64.4%

                                    \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                                  4. Taylor expanded in n around inf 61.7%

                                    \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                                  5. Step-by-step derivation
                                    1. log1p-define61.7%

                                      \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                                  6. Simplified61.7%

                                    \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                                  7. Taylor expanded in x around -inf 66.8%

                                    \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                                  8. Step-by-step derivation
                                    1. mul-1-neg66.8%

                                      \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                                    2. distribute-neg-frac266.8%

                                      \[\leadsto \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{-x}} \]
                                  9. Simplified66.8%

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

                                  if 4.50000000000000012e-125 < x < 0.849999999999999978

                                  1. Initial program 37.7%

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

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

                                    \[\leadsto \color{blue}{\frac{x - \log x}{n}} \]
                                5. Recombined 3 regimes into one program.
                                6. Final simplification65.4%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5.8 \cdot 10^{-226}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-215}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-129}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 4.5 \cdot 10^{-125} \lor \neg \left(x \leq 0.85\right):\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \log x}{n}\\ \end{array} \]
                                7. Add Preprocessing

                                Alternative 14: 56.3% accurate, 1.6× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 6.1 \cdot 10^{-226} \lor \neg \left(x \leq 3.5 \cdot 10^{-215}\right) \land \left(x \leq 2.05 \cdot 10^{-129} \lor \neg \left(x \leq 1.2 \cdot 10^{-124}\right) \land x \leq 0.6\right):\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \end{array} \end{array} \]
                                (FPCore (x n)
                                 :precision binary64
                                 (if (or (<= x 6.1e-226)
                                         (and (not (<= x 3.5e-215))
                                              (or (<= x 2.05e-129) (and (not (<= x 1.2e-124)) (<= x 0.6)))))
                                   (/ (log x) (- n))
                                   (/ (+ (/ 1.0 n) (/ (+ (/ -0.5 n) (/ 0.3333333333333333 (* x n))) x)) x)))
                                double code(double x, double n) {
                                	double tmp;
                                	if ((x <= 6.1e-226) || (!(x <= 3.5e-215) && ((x <= 2.05e-129) || (!(x <= 1.2e-124) && (x <= 0.6))))) {
                                		tmp = log(x) / -n;
                                	} else {
                                		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                                	}
                                	return tmp;
                                }
                                
                                real(8) function code(x, n)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: n
                                    real(8) :: tmp
                                    if ((x <= 6.1d-226) .or. (.not. (x <= 3.5d-215)) .and. (x <= 2.05d-129) .or. (.not. (x <= 1.2d-124)) .and. (x <= 0.6d0)) then
                                        tmp = log(x) / -n
                                    else
                                        tmp = ((1.0d0 / n) + ((((-0.5d0) / n) + (0.3333333333333333d0 / (x * n))) / x)) / x
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double x, double n) {
                                	double tmp;
                                	if ((x <= 6.1e-226) || (!(x <= 3.5e-215) && ((x <= 2.05e-129) || (!(x <= 1.2e-124) && (x <= 0.6))))) {
                                		tmp = Math.log(x) / -n;
                                	} else {
                                		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                                	}
                                	return tmp;
                                }
                                
                                def code(x, n):
                                	tmp = 0
                                	if (x <= 6.1e-226) or (not (x <= 3.5e-215) and ((x <= 2.05e-129) or (not (x <= 1.2e-124) and (x <= 0.6)))):
                                		tmp = math.log(x) / -n
                                	else:
                                		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x
                                	return tmp
                                
                                function code(x, n)
                                	tmp = 0.0
                                	if ((x <= 6.1e-226) || (!(x <= 3.5e-215) && ((x <= 2.05e-129) || (!(x <= 1.2e-124) && (x <= 0.6)))))
                                		tmp = Float64(log(x) / Float64(-n));
                                	else
                                		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(-0.5 / n) + Float64(0.3333333333333333 / Float64(x * n))) / x)) / x);
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(x, n)
                                	tmp = 0.0;
                                	if ((x <= 6.1e-226) || (~((x <= 3.5e-215)) && ((x <= 2.05e-129) || (~((x <= 1.2e-124)) && (x <= 0.6)))))
                                		tmp = log(x) / -n;
                                	else
                                		tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[x_, n_] := If[Or[LessEqual[x, 6.1e-226], And[N[Not[LessEqual[x, 3.5e-215]], $MachinePrecision], Or[LessEqual[x, 2.05e-129], And[N[Not[LessEqual[x, 1.2e-124]], $MachinePrecision], LessEqual[x, 0.6]]]]], N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(-0.5 / n), $MachinePrecision] + N[(0.3333333333333333 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;x \leq 6.1 \cdot 10^{-226} \lor \neg \left(x \leq 3.5 \cdot 10^{-215}\right) \land \left(x \leq 2.05 \cdot 10^{-129} \lor \neg \left(x \leq 1.2 \cdot 10^{-124}\right) \land x \leq 0.6\right):\\
                                \;\;\;\;\frac{\log x}{-n}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if x < 6.0999999999999998e-226 or 3.5000000000000002e-215 < x < 2.05e-129 or 1.19999999999999996e-124 < x < 0.599999999999999978

                                  1. Initial program 36.6%

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

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

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

                                      \[\leadsto \color{blue}{-\frac{\log x}{n}} \]
                                    2. distribute-frac-neg263.7%

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

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

                                  if 6.0999999999999998e-226 < x < 3.5000000000000002e-215 or 2.05e-129 < x < 1.19999999999999996e-124 or 0.599999999999999978 < x

                                  1. Initial program 69.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 63.7%

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

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

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

                                        \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \left(0.5 \cdot \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n} - \log x\right)}\right)}^{2}}}{n} \]
                                      3. fma-neg64.4%

                                        \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                                    3. Applied egg-rr64.4%

                                      \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                                    4. Taylor expanded in n around inf 61.7%

                                      \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                                    5. Step-by-step derivation
                                      1. log1p-define61.7%

                                        \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                                    6. Simplified61.7%

                                      \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                                    7. Taylor expanded in x around -inf 66.8%

                                      \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                                    8. Step-by-step derivation
                                      1. mul-1-neg66.8%

                                        \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                                      2. distribute-neg-frac266.8%

                                        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{-x}} \]
                                    9. Simplified66.8%

                                      \[\leadsto \color{blue}{\frac{\frac{\frac{0.3333333333333333}{x \cdot n} + \frac{-0.5}{n}}{-x} + \frac{-1}{n}}{-x}} \]
                                  5. Recombined 2 regimes into one program.
                                  6. Final simplification65.3%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 6.1 \cdot 10^{-226} \lor \neg \left(x \leq 3.5 \cdot 10^{-215}\right) \land \left(x \leq 2.05 \cdot 10^{-129} \lor \neg \left(x \leq 1.2 \cdot 10^{-124}\right) \land x \leq 0.6\right):\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}\\ \end{array} \]
                                  7. Add Preprocessing

                                  Alternative 15: 46.2% accurate, 12.4× speedup?

                                  \[\begin{array}{l} \\ \frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x} \end{array} \]
                                  (FPCore (x n)
                                   :precision binary64
                                   (/ (+ (/ 1.0 n) (/ (+ (/ -0.5 n) (/ 0.3333333333333333 (* x n))) x)) x))
                                  double code(double x, double n) {
                                  	return ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                                  }
                                  
                                  real(8) function code(x, n)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: n
                                      code = ((1.0d0 / n) + ((((-0.5d0) / n) + (0.3333333333333333d0 / (x * n))) / x)) / x
                                  end function
                                  
                                  public static double code(double x, double n) {
                                  	return ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                                  }
                                  
                                  def code(x, n):
                                  	return ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x
                                  
                                  function code(x, n)
                                  	return Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(-0.5 / n) + Float64(0.3333333333333333 / Float64(x * n))) / x)) / x)
                                  end
                                  
                                  function tmp = code(x, n)
                                  	tmp = ((1.0 / n) + (((-0.5 / n) + (0.3333333333333333 / (x * n))) / x)) / x;
                                  end
                                  
                                  code[x_, n_] := N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(-0.5 / n), $MachinePrecision] + N[(0.3333333333333333 / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x}
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 53.6%

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

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

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

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

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

                                        \[\leadsto \frac{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \color{blue}{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}}\right)}^{2}}{n} \]
                                    3. Applied egg-rr70.2%

                                      \[\leadsto \frac{\color{blue}{{\left(\sqrt{\mathsf{log1p}\left(x\right) + \mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, -\log x\right)}\right)}^{2}}}{n} \]
                                    4. Taylor expanded in n around inf 62.8%

                                      \[\leadsto \frac{{\left(\sqrt{\color{blue}{\log \left(1 + x\right) - \log x}}\right)}^{2}}{n} \]
                                    5. Step-by-step derivation
                                      1. log1p-define62.8%

                                        \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}\right)}^{2}}{n} \]
                                    6. Simplified62.8%

                                      \[\leadsto \frac{{\left(\sqrt{\color{blue}{\mathsf{log1p}\left(x\right) - \log x}}\right)}^{2}}{n} \]
                                    7. Taylor expanded in x around -inf 45.5%

                                      \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                                    8. Step-by-step derivation
                                      1. mul-1-neg45.5%

                                        \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
                                      2. distribute-neg-frac245.5%

                                        \[\leadsto \color{blue}{\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{-x}} \]
                                    9. Simplified45.5%

                                      \[\leadsto \color{blue}{\frac{\frac{\frac{0.3333333333333333}{x \cdot n} + \frac{-0.5}{n}}{-x} + \frac{-1}{n}}{-x}} \]
                                    10. Final simplification45.5%

                                      \[\leadsto \frac{\frac{1}{n} + \frac{\frac{-0.5}{n} + \frac{0.3333333333333333}{x \cdot n}}{x}}{x} \]
                                    11. Add Preprocessing

                                    Alternative 16: 40.6% accurate, 42.2× speedup?

                                    \[\begin{array}{l} \\ \frac{\frac{1}{n}}{x} \end{array} \]
                                    (FPCore (x n) :precision binary64 (/ (/ 1.0 n) x))
                                    double code(double x, double n) {
                                    	return (1.0 / n) / x;
                                    }
                                    
                                    real(8) function code(x, n)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: n
                                        code = (1.0d0 / n) / x
                                    end function
                                    
                                    public static double code(double x, double n) {
                                    	return (1.0 / n) / x;
                                    }
                                    
                                    def code(x, n):
                                    	return (1.0 / n) / x
                                    
                                    function code(x, n)
                                    	return Float64(Float64(1.0 / n) / x)
                                    end
                                    
                                    function tmp = code(x, n)
                                    	tmp = (1.0 / n) / x;
                                    end
                                    
                                    code[x_, n_] := N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \frac{\frac{1}{n}}{x}
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 53.6%

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

                                      \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
                                    4. Step-by-step derivation
                                      1. mul-1-neg60.0%

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

                                        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
                                      3. mul-1-neg60.0%

                                        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
                                      4. distribute-neg-frac60.0%

                                        \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
                                      5. mul-1-neg60.0%

                                        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
                                      6. remove-double-neg60.0%

                                        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                                      7. *-commutative60.0%

                                        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
                                    5. Simplified60.0%

                                      \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
                                    6. Step-by-step derivation
                                      1. associate-/r*60.8%

                                        \[\leadsto \color{blue}{\frac{\frac{e^{\frac{\log x}{n}}}{x}}{n}} \]
                                      2. div-inv60.8%

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

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

                                        \[\leadsto \frac{\frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{{x}^{1}}}}{n} \]
                                      5. pow-div60.8%

                                        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n} - 1\right)}}}{n} \]
                                    7. Applied egg-rr60.8%

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

                                      \[\leadsto \color{blue}{\frac{1}{n \cdot x}} \]
                                    9. Step-by-step derivation
                                      1. associate-/r*40.0%

                                        \[\leadsto \color{blue}{\frac{\frac{1}{n}}{x}} \]
                                    10. Simplified40.0%

                                      \[\leadsto \color{blue}{\frac{\frac{1}{n}}{x}} \]
                                    11. Add Preprocessing

                                    Alternative 17: 40.2% accurate, 42.2× speedup?

                                    \[\begin{array}{l} \\ \frac{1}{x \cdot n} \end{array} \]
                                    (FPCore (x n) :precision binary64 (/ 1.0 (* x n)))
                                    double code(double x, double n) {
                                    	return 1.0 / (x * n);
                                    }
                                    
                                    real(8) function code(x, n)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: n
                                        code = 1.0d0 / (x * n)
                                    end function
                                    
                                    public static double code(double x, double n) {
                                    	return 1.0 / (x * n);
                                    }
                                    
                                    def code(x, n):
                                    	return 1.0 / (x * n)
                                    
                                    function code(x, n)
                                    	return Float64(1.0 / Float64(x * n))
                                    end
                                    
                                    function tmp = code(x, n)
                                    	tmp = 1.0 / (x * n);
                                    end
                                    
                                    code[x_, n_] := N[(1.0 / N[(x * n), $MachinePrecision]), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \frac{1}{x \cdot n}
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 53.6%

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

                                      \[\leadsto \color{blue}{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n \cdot x}} \]
                                    4. Step-by-step derivation
                                      1. mul-1-neg60.0%

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

                                        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
                                      3. mul-1-neg60.0%

                                        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
                                      4. distribute-neg-frac60.0%

                                        \[\leadsto \frac{e^{\color{blue}{\frac{--1 \cdot \log x}{n}}}}{n \cdot x} \]
                                      5. mul-1-neg60.0%

                                        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
                                      6. remove-double-neg60.0%

                                        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                                      7. *-commutative60.0%

                                        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
                                    5. Simplified60.0%

                                      \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x \cdot n}} \]
                                    6. Taylor expanded in n around inf 39.4%

                                      \[\leadsto \color{blue}{\frac{1}{n \cdot x}} \]
                                    7. Step-by-step derivation
                                      1. *-commutative39.4%

                                        \[\leadsto \frac{1}{\color{blue}{x \cdot n}} \]
                                    8. Simplified39.4%

                                      \[\leadsto \color{blue}{\frac{1}{x \cdot n}} \]
                                    9. Add Preprocessing

                                    Alternative 18: 4.5% accurate, 70.3× speedup?

                                    \[\begin{array}{l} \\ \frac{x}{n} \end{array} \]
                                    (FPCore (x n) :precision binary64 (/ x n))
                                    double code(double x, double n) {
                                    	return x / n;
                                    }
                                    
                                    real(8) function code(x, n)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: n
                                        code = x / n
                                    end function
                                    
                                    public static double code(double x, double n) {
                                    	return x / n;
                                    }
                                    
                                    def code(x, n):
                                    	return x / n
                                    
                                    function code(x, n)
                                    	return Float64(x / n)
                                    end
                                    
                                    function tmp = code(x, n)
                                    	tmp = x / n;
                                    end
                                    
                                    code[x_, n_] := N[(x / n), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \frac{x}{n}
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 53.6%

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

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

                                      \[\leadsto \color{blue}{\frac{x}{n}} \]
                                    5. Add Preprocessing

                                    Reproduce

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