2nthrt (problem 3.4.6)

Percentage Accurate: 53.1% → 81.8%
Time: 56.9s
Alternatives: 13
Speedup: 1.8×

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 13 alternatives:

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

Initial Program: 53.1% 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: 81.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ t_1 := \frac{t\_0}{x \cdot n}\\ t_2 := \frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{1}{n} \leq -4 \cdot 10^{-127}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-143}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-35}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\frac{1}{n} \leq 1000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{+185}:\\ \;\;\;\;\left(1 + \frac{x}{n}\right) - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x}\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (let* ((t_0 (pow x (/ 1.0 n)))
        (t_1 (/ t_0 (* x n)))
        (t_2 (/ (log (/ (+ x 1.0) x)) n)))
   (if (<= (/ 1.0 n) -5e-16)
     t_1
     (if (<= (/ 1.0 n) -4e-127)
       t_2
       (if (<= (/ 1.0 n) -1e-143)
         (/ (/ (- 1.0 (/ 0.5 x)) n) x)
         (if (<= (/ 1.0 n) 5e-35)
           t_2
           (if (<= (/ 1.0 n) 1000.0)
             t_1
             (if (<= (/ 1.0 n) 2e+185)
               (- (+ 1.0 (/ x n)) t_0)
               (/
                (+
                 (/ 1.0 n)
                 (/ (- (/ 0.3333333333333333 (* x n)) (/ 0.5 n)) x))
                x)))))))))
double code(double x, double n) {
	double t_0 = pow(x, (1.0 / n));
	double t_1 = t_0 / (x * n);
	double t_2 = log(((x + 1.0) / x)) / n;
	double tmp;
	if ((1.0 / n) <= -5e-16) {
		tmp = t_1;
	} else if ((1.0 / n) <= -4e-127) {
		tmp = t_2;
	} else if ((1.0 / n) <= -1e-143) {
		tmp = ((1.0 - (0.5 / x)) / n) / x;
	} else if ((1.0 / n) <= 5e-35) {
		tmp = t_2;
	} else if ((1.0 / n) <= 1000.0) {
		tmp = t_1;
	} else if ((1.0 / n) <= 2e+185) {
		tmp = (1.0 + (x / n)) - t_0;
	} else {
		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / 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) :: t_2
    real(8) :: tmp
    t_0 = x ** (1.0d0 / n)
    t_1 = t_0 / (x * n)
    t_2 = log(((x + 1.0d0) / x)) / n
    if ((1.0d0 / n) <= (-5d-16)) then
        tmp = t_1
    else if ((1.0d0 / n) <= (-4d-127)) then
        tmp = t_2
    else if ((1.0d0 / n) <= (-1d-143)) then
        tmp = ((1.0d0 - (0.5d0 / x)) / n) / x
    else if ((1.0d0 / n) <= 5d-35) then
        tmp = t_2
    else if ((1.0d0 / n) <= 1000.0d0) then
        tmp = t_1
    else if ((1.0d0 / n) <= 2d+185) then
        tmp = (1.0d0 + (x / n)) - t_0
    else
        tmp = ((1.0d0 / n) + (((0.3333333333333333d0 / (x * n)) - (0.5d0 / n)) / x)) / 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 = t_0 / (x * n);
	double t_2 = Math.log(((x + 1.0) / x)) / n;
	double tmp;
	if ((1.0 / n) <= -5e-16) {
		tmp = t_1;
	} else if ((1.0 / n) <= -4e-127) {
		tmp = t_2;
	} else if ((1.0 / n) <= -1e-143) {
		tmp = ((1.0 - (0.5 / x)) / n) / x;
	} else if ((1.0 / n) <= 5e-35) {
		tmp = t_2;
	} else if ((1.0 / n) <= 1000.0) {
		tmp = t_1;
	} else if ((1.0 / n) <= 2e+185) {
		tmp = (1.0 + (x / n)) - t_0;
	} else {
		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / x;
	}
	return tmp;
}
def code(x, n):
	t_0 = math.pow(x, (1.0 / n))
	t_1 = t_0 / (x * n)
	t_2 = math.log(((x + 1.0) / x)) / n
	tmp = 0
	if (1.0 / n) <= -5e-16:
		tmp = t_1
	elif (1.0 / n) <= -4e-127:
		tmp = t_2
	elif (1.0 / n) <= -1e-143:
		tmp = ((1.0 - (0.5 / x)) / n) / x
	elif (1.0 / n) <= 5e-35:
		tmp = t_2
	elif (1.0 / n) <= 1000.0:
		tmp = t_1
	elif (1.0 / n) <= 2e+185:
		tmp = (1.0 + (x / n)) - t_0
	else:
		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / x
	return tmp
function code(x, n)
	t_0 = x ^ Float64(1.0 / n)
	t_1 = Float64(t_0 / Float64(x * n))
	t_2 = Float64(log(Float64(Float64(x + 1.0) / x)) / n)
	tmp = 0.0
	if (Float64(1.0 / n) <= -5e-16)
		tmp = t_1;
	elseif (Float64(1.0 / n) <= -4e-127)
		tmp = t_2;
	elseif (Float64(1.0 / n) <= -1e-143)
		tmp = Float64(Float64(Float64(1.0 - Float64(0.5 / x)) / n) / x);
	elseif (Float64(1.0 / n) <= 5e-35)
		tmp = t_2;
	elseif (Float64(1.0 / n) <= 1000.0)
		tmp = t_1;
	elseif (Float64(1.0 / n) <= 2e+185)
		tmp = Float64(Float64(1.0 + Float64(x / n)) - t_0);
	else
		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(0.3333333333333333 / Float64(x * n)) - Float64(0.5 / n)) / x)) / x);
	end
	return tmp
end
function tmp_2 = code(x, n)
	t_0 = x ^ (1.0 / n);
	t_1 = t_0 / (x * n);
	t_2 = log(((x + 1.0) / x)) / n;
	tmp = 0.0;
	if ((1.0 / n) <= -5e-16)
		tmp = t_1;
	elseif ((1.0 / n) <= -4e-127)
		tmp = t_2;
	elseif ((1.0 / n) <= -1e-143)
		tmp = ((1.0 - (0.5 / x)) / n) / x;
	elseif ((1.0 / n) <= 5e-35)
		tmp = t_2;
	elseif ((1.0 / n) <= 1000.0)
		tmp = t_1;
	elseif ((1.0 / n) <= 2e+185)
		tmp = (1.0 + (x / n)) - t_0;
	else
		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / 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[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-16], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-127], t$95$2, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-143], N[(N[(N[(1.0 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-35], t$95$2, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1000.0], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e+185], N[(N[(1.0 + N[(x / n), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(0.3333333333333333 / N[(x * n), $MachinePrecision]), $MachinePrecision] - N[(0.5 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;\frac{1}{n} \leq -4 \cdot 10^{-127}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-143}:\\
\;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{n}}{x}\\

\mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-35}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;\frac{1}{n} \leq 1000:\\
\;\;\;\;t\_1\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 #s(literal 1 binary64) n) < -5.0000000000000004e-16 or 4.99999999999999964e-35 < (/.f64 #s(literal 1 binary64) n) < 1e3

    1. Initial program 87.9%

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 96.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-neg96.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
      10. *-commutative96.0%

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

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

    if -5.0000000000000004e-16 < (/.f64 #s(literal 1 binary64) n) < -4.0000000000000001e-127 or -9.9999999999999995e-144 < (/.f64 #s(literal 1 binary64) n) < 4.99999999999999964e-35

    1. Initial program 27.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 80.7%

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
    6. Step-by-step derivation
      1. log1p-undefine80.7%

        \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
      2. diff-log80.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
    7. Applied egg-rr80.9%

      \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
    8. Step-by-step derivation
      1. +-commutative80.9%

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

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

    if -4.0000000000000001e-127 < (/.f64 #s(literal 1 binary64) n) < -9.9999999999999995e-144

    1. Initial program 7.1%

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

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

        \[\leadsto e^{\frac{\color{blue}{\mathsf{log1p}\left(x\right)}}{n}} - e^{\frac{\log x}{n}} \]
      2. *-rgt-identity7.1%

        \[\leadsto e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - e^{\frac{\color{blue}{\log x \cdot 1}}{n}} \]
      3. associate-/l*7.1%

        \[\leadsto e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - e^{\color{blue}{\log x \cdot \frac{1}{n}}} \]
      4. exp-to-pow7.1%

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

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

      \[\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}} \]
    7. Step-by-step derivation
      1. Simplified99.4%

        \[\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}} \]
      2. Taylor expanded in n around inf 99.4%

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

          \[\leadsto \frac{\frac{1 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{n}}{x} \]
        2. metadata-eval99.4%

          \[\leadsto \frac{\frac{1 - \frac{\color{blue}{0.5}}{x}}{n}}{x} \]
      4. Simplified99.4%

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

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

      1. Initial program 80.6%

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

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

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

      1. Initial program 8.2%

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

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

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

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

        \[\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}} \]
      7. Step-by-step derivation
        1. mul-1-neg94.9%

          \[\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. mul-1-neg94.9%

          \[\leadsto -\frac{\color{blue}{\left(-\frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right)} - \frac{1}{n}}{x} \]
        3. associate-*r/94.9%

          \[\leadsto -\frac{\left(-\frac{\color{blue}{\frac{0.3333333333333333 \cdot 1}{n \cdot x}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
        4. metadata-eval94.9%

          \[\leadsto -\frac{\left(-\frac{\frac{\color{blue}{0.3333333333333333}}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
        5. *-commutative94.9%

          \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{\color{blue}{x \cdot n}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
        6. associate-*r/94.9%

          \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \color{blue}{\frac{0.5 \cdot 1}{n}}}{x}\right) - \frac{1}{n}}{x} \]
        7. metadata-eval94.9%

          \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \frac{\color{blue}{0.5}}{n}}{x}\right) - \frac{1}{n}}{x} \]
      8. Simplified94.9%

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

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

    Alternative 2: 81.5% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ t_1 := \frac{t\_0}{x \cdot n}\\ t_2 := \frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{1}{n} \leq -4 \cdot 10^{-127}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-143}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-35}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\frac{1}{n} \leq 1000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+104}:\\ \;\;\;\;1 - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \mathsf{log1p}\left(x + -1\right)}{n}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (pow x (/ 1.0 n)))
            (t_1 (/ t_0 (* x n)))
            (t_2 (/ (log (/ (+ x 1.0) x)) n)))
       (if (<= (/ 1.0 n) -5e-16)
         t_1
         (if (<= (/ 1.0 n) -4e-127)
           t_2
           (if (<= (/ 1.0 n) -1e-143)
             (/ (/ (- 1.0 (/ 0.5 x)) n) x)
             (if (<= (/ 1.0 n) 5e-35)
               t_2
               (if (<= (/ 1.0 n) 1000.0)
                 t_1
                 (if (<= (/ 1.0 n) 1e+104)
                   (- 1.0 t_0)
                   (/ (- x (log1p (+ x -1.0))) n)))))))))
    double code(double x, double n) {
    	double t_0 = pow(x, (1.0 / n));
    	double t_1 = t_0 / (x * n);
    	double t_2 = log(((x + 1.0) / x)) / n;
    	double tmp;
    	if ((1.0 / n) <= -5e-16) {
    		tmp = t_1;
    	} else if ((1.0 / n) <= -4e-127) {
    		tmp = t_2;
    	} else if ((1.0 / n) <= -1e-143) {
    		tmp = ((1.0 - (0.5 / x)) / n) / x;
    	} else if ((1.0 / n) <= 5e-35) {
    		tmp = t_2;
    	} else if ((1.0 / n) <= 1000.0) {
    		tmp = t_1;
    	} else if ((1.0 / n) <= 1e+104) {
    		tmp = 1.0 - t_0;
    	} else {
    		tmp = (x - log1p((x + -1.0))) / n;
    	}
    	return tmp;
    }
    
    public static double code(double x, double n) {
    	double t_0 = Math.pow(x, (1.0 / n));
    	double t_1 = t_0 / (x * n);
    	double t_2 = Math.log(((x + 1.0) / x)) / n;
    	double tmp;
    	if ((1.0 / n) <= -5e-16) {
    		tmp = t_1;
    	} else if ((1.0 / n) <= -4e-127) {
    		tmp = t_2;
    	} else if ((1.0 / n) <= -1e-143) {
    		tmp = ((1.0 - (0.5 / x)) / n) / x;
    	} else if ((1.0 / n) <= 5e-35) {
    		tmp = t_2;
    	} else if ((1.0 / n) <= 1000.0) {
    		tmp = t_1;
    	} else if ((1.0 / n) <= 1e+104) {
    		tmp = 1.0 - t_0;
    	} else {
    		tmp = (x - Math.log1p((x + -1.0))) / n;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = math.pow(x, (1.0 / n))
    	t_1 = t_0 / (x * n)
    	t_2 = math.log(((x + 1.0) / x)) / n
    	tmp = 0
    	if (1.0 / n) <= -5e-16:
    		tmp = t_1
    	elif (1.0 / n) <= -4e-127:
    		tmp = t_2
    	elif (1.0 / n) <= -1e-143:
    		tmp = ((1.0 - (0.5 / x)) / n) / x
    	elif (1.0 / n) <= 5e-35:
    		tmp = t_2
    	elif (1.0 / n) <= 1000.0:
    		tmp = t_1
    	elif (1.0 / n) <= 1e+104:
    		tmp = 1.0 - t_0
    	else:
    		tmp = (x - math.log1p((x + -1.0))) / n
    	return tmp
    
    function code(x, n)
    	t_0 = x ^ Float64(1.0 / n)
    	t_1 = Float64(t_0 / Float64(x * n))
    	t_2 = Float64(log(Float64(Float64(x + 1.0) / x)) / n)
    	tmp = 0.0
    	if (Float64(1.0 / n) <= -5e-16)
    		tmp = t_1;
    	elseif (Float64(1.0 / n) <= -4e-127)
    		tmp = t_2;
    	elseif (Float64(1.0 / n) <= -1e-143)
    		tmp = Float64(Float64(Float64(1.0 - Float64(0.5 / x)) / n) / x);
    	elseif (Float64(1.0 / n) <= 5e-35)
    		tmp = t_2;
    	elseif (Float64(1.0 / n) <= 1000.0)
    		tmp = t_1;
    	elseif (Float64(1.0 / n) <= 1e+104)
    		tmp = Float64(1.0 - t_0);
    	else
    		tmp = Float64(Float64(x - log1p(Float64(x + -1.0))) / n);
    	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[(x * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(N[(x + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-16], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-127], t$95$2, If[LessEqual[N[(1.0 / n), $MachinePrecision], -1e-143], N[(N[(N[(1.0 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-35], t$95$2, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1000.0], t$95$1, If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+104], N[(1.0 - t$95$0), $MachinePrecision], N[(N[(x - N[Log[1 + N[(x + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]]]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := {x}^{\left(\frac{1}{n}\right)}\\
    t_1 := \frac{t\_0}{x \cdot n}\\
    t_2 := \frac{\log \left(\frac{x + 1}{x}\right)}{n}\\
    \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-16}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;\frac{1}{n} \leq -4 \cdot 10^{-127}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-143}:\\
    \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{n}}{x}\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-35}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 1000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;\frac{1}{n} \leq 10^{+104}:\\
    \;\;\;\;1 - t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x - \mathsf{log1p}\left(x + -1\right)}{n}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if (/.f64 #s(literal 1 binary64) n) < -5.0000000000000004e-16 or 4.99999999999999964e-35 < (/.f64 #s(literal 1 binary64) n) < 1e3

      1. Initial program 87.9%

        \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf 96.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-neg96.0%

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
        10. *-commutative96.0%

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

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

      if -5.0000000000000004e-16 < (/.f64 #s(literal 1 binary64) n) < -4.0000000000000001e-127 or -9.9999999999999995e-144 < (/.f64 #s(literal 1 binary64) n) < 4.99999999999999964e-35

      1. Initial program 27.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 80.7%

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. log1p-undefine80.7%

          \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
        2. diff-log80.9%

          \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
      7. Applied egg-rr80.9%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
      8. Step-by-step derivation
        1. +-commutative80.9%

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

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

      if -4.0000000000000001e-127 < (/.f64 #s(literal 1 binary64) n) < -9.9999999999999995e-144

      1. Initial program 7.1%

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

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

          \[\leadsto e^{\frac{\color{blue}{\mathsf{log1p}\left(x\right)}}{n}} - e^{\frac{\log x}{n}} \]
        2. *-rgt-identity7.1%

          \[\leadsto e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - e^{\frac{\color{blue}{\log x \cdot 1}}{n}} \]
        3. associate-/l*7.1%

          \[\leadsto e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - e^{\color{blue}{\log x \cdot \frac{1}{n}}} \]
        4. exp-to-pow7.1%

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

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

        \[\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}} \]
      7. Step-by-step derivation
        1. Simplified99.4%

          \[\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}} \]
        2. Taylor expanded in n around inf 99.4%

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

            \[\leadsto \frac{\frac{1 - \color{blue}{\frac{0.5 \cdot 1}{x}}}{n}}{x} \]
          2. metadata-eval99.4%

            \[\leadsto \frac{\frac{1 - \frac{\color{blue}{0.5}}{x}}{n}}{x} \]
        4. Simplified99.4%

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

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

        1. Initial program 98.3%

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

          \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
        4. Step-by-step derivation
          1. *-rgt-identity90.2%

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

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

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

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

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

        1. Initial program 23.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 21.2%

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

          \[\leadsto \color{blue}{\frac{x - \log x}{n}} \]
        5. Step-by-step derivation
          1. log1p-expm1-u79.3%

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

            \[\leadsto \frac{x - \mathsf{log1p}\left(\color{blue}{e^{\log x} - 1}\right)}{n} \]
          3. add-exp-log79.3%

            \[\leadsto \frac{x - \mathsf{log1p}\left(\color{blue}{x} - 1\right)}{n} \]
        6. Applied egg-rr79.3%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-16}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq -4 \cdot 10^{-127}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{-143}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{n}}{x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-35}:\\ \;\;\;\;\frac{\log \left(\frac{x + 1}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 1000:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+104}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x - \mathsf{log1p}\left(x + -1\right)}{n}\\ \end{array} \]
      10. Add Preprocessing

      Alternative 3: 68.2% accurate, 1.6× speedup?

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

        1. Initial program 45.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 72.5%

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
        6. Step-by-step derivation
          1. log1p-undefine72.5%

            \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
          2. diff-log72.3%

            \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
        7. Applied egg-rr72.3%

          \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
        8. Step-by-step derivation
          1. +-commutative72.3%

            \[\leadsto \frac{\log \left(\frac{\color{blue}{x + 1}}{x}\right)}{n} \]
        9. Simplified72.3%

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

        if -5.00000000000000046e105 < (/.f64 #s(literal 1 binary64) n) < -2e20 or 2.0000000000000001e-4 < (/.f64 #s(literal 1 binary64) n) < 1e104

        1. Initial program 93.4%

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

          \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
        4. Step-by-step derivation
          1. *-rgt-identity66.5%

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

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

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

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

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

        1. Initial program 23.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 21.2%

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

          \[\leadsto \color{blue}{\frac{x - \log x}{n}} \]
        5. Step-by-step derivation
          1. log1p-expm1-u79.3%

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

            \[\leadsto \frac{x - \mathsf{log1p}\left(\color{blue}{e^{\log x} - 1}\right)}{n} \]
          3. add-exp-log79.3%

            \[\leadsto \frac{x - \mathsf{log1p}\left(\color{blue}{x} - 1\right)}{n} \]
        6. Applied egg-rr79.3%

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

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

      Alternative 4: 68.5% accurate, 1.6× speedup?

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

        1. Initial program 45.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 72.5%

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
        6. Step-by-step derivation
          1. log1p-undefine72.5%

            \[\leadsto \frac{\color{blue}{\log \left(1 + x\right)} - \log x}{n} \]
          2. diff-log72.3%

            \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
        7. Applied egg-rr72.3%

          \[\leadsto \frac{\color{blue}{\log \left(\frac{1 + x}{x}\right)}}{n} \]
        8. Step-by-step derivation
          1. +-commutative72.3%

            \[\leadsto \frac{\log \left(\frac{\color{blue}{x + 1}}{x}\right)}{n} \]
        9. Simplified72.3%

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

        if -5.00000000000000046e105 < (/.f64 #s(literal 1 binary64) n) < -2e20 or 2.0000000000000001e-4 < (/.f64 #s(literal 1 binary64) n) < 2e185

        1. Initial program 86.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 62.7%

          \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
        4. Step-by-step derivation
          1. *-rgt-identity62.7%

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

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

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

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

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

        1. Initial program 8.2%

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

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

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

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

          \[\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}} \]
        7. Step-by-step derivation
          1. mul-1-neg94.9%

            \[\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. mul-1-neg94.9%

            \[\leadsto -\frac{\color{blue}{\left(-\frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right)} - \frac{1}{n}}{x} \]
          3. associate-*r/94.9%

            \[\leadsto -\frac{\left(-\frac{\color{blue}{\frac{0.3333333333333333 \cdot 1}{n \cdot x}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
          4. metadata-eval94.9%

            \[\leadsto -\frac{\left(-\frac{\frac{\color{blue}{0.3333333333333333}}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
          5. *-commutative94.9%

            \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{\color{blue}{x \cdot n}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
          6. associate-*r/94.9%

            \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \color{blue}{\frac{0.5 \cdot 1}{n}}}{x}\right) - \frac{1}{n}}{x} \]
          7. metadata-eval94.9%

            \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \frac{\color{blue}{0.5}}{n}}{x}\right) - \frac{1}{n}}{x} \]
        8. Simplified94.9%

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

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

      Alternative 5: 57.5% accurate, 1.8× speedup?

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

        1. Initial program 16.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 16.7%

          \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
        4. Step-by-step derivation
          1. *-rgt-identity16.7%

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{-1 \cdot \log x}{n}} \]
          2. neg-mul-187.5%

            \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
        8. Simplified87.5%

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

        if 1.64999999999999993e-290 < x < 2.2999999999999998e-249

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

          \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
        4. Step-by-step derivation
          1. *-rgt-identity73.6%

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

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

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

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

        if 2.2999999999999998e-249 < x < 0.214999999999999997

        1. Initial program 35.2%

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

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

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

        if 0.214999999999999997 < x

        1. Initial program 66.2%

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

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

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

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

          \[\leadsto \frac{\color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{x}}}{n} \]
      3. Recombined 4 regimes into one program.
      4. Final simplification57.8%

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

      Alternative 6: 56.9% accurate, 1.8× speedup?

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

        1. Initial program 41.0%

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

          \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
        4. Step-by-step derivation
          1. *-rgt-identity41.0%

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{-1 \cdot \log x}{n}} \]
          2. neg-mul-155.6%

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

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

        if 5.50000000000000014e-193 < x < 6.4000000000000003e-172

        1. Initial program 43.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 21.4%

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

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

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

          \[\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}} \]
        7. Step-by-step derivation
          1. mul-1-neg67.6%

            \[\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. mul-1-neg67.6%

            \[\leadsto -\frac{\color{blue}{\left(-\frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right)} - \frac{1}{n}}{x} \]
          3. associate-*r/67.6%

            \[\leadsto -\frac{\left(-\frac{\color{blue}{\frac{0.3333333333333333 \cdot 1}{n \cdot x}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
          4. metadata-eval67.6%

            \[\leadsto -\frac{\left(-\frac{\frac{\color{blue}{0.3333333333333333}}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
          5. *-commutative67.6%

            \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{\color{blue}{x \cdot n}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
          6. associate-*r/67.6%

            \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \color{blue}{\frac{0.5 \cdot 1}{n}}}{x}\right) - \frac{1}{n}}{x} \]
          7. metadata-eval67.6%

            \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \frac{\color{blue}{0.5}}{n}}{x}\right) - \frac{1}{n}}{x} \]
        8. Simplified67.6%

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

        if 6.4000000000000003e-172 < x < 0.214999999999999997

        1. Initial program 35.0%

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

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

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

        if 0.214999999999999997 < x

        1. Initial program 66.2%

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

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

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

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

          \[\leadsto \frac{\color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{x}}}{n} \]
      3. Recombined 4 regimes into one program.
      4. Final simplification57.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5.5 \cdot 10^{-193}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 6.4 \cdot 10^{-172}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x}\\ \mathbf{elif}\;x \leq 0.215:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 7: 56.7% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\log x}{-n}\\ \mathbf{if}\;x \leq 6.2 \cdot 10^{-193}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 8.8 \cdot 10^{-172}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x}\\ \mathbf{elif}\;x \leq 0.215:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \end{array} \]
      (FPCore (x n)
       :precision binary64
       (let* ((t_0 (/ (log x) (- n))))
         (if (<= x 6.2e-193)
           t_0
           (if (<= x 8.8e-172)
             (/ (+ (/ 1.0 n) (/ (- (/ 0.3333333333333333 (* x n)) (/ 0.5 n)) x)) x)
             (if (<= x 0.215)
               t_0
               (/
                (/ (+ 1.0 (/ (- (* 0.3333333333333333 (/ 1.0 x)) 0.5) x)) x)
                n))))))
      double code(double x, double n) {
      	double t_0 = log(x) / -n;
      	double tmp;
      	if (x <= 6.2e-193) {
      		tmp = t_0;
      	} else if (x <= 8.8e-172) {
      		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / x;
      	} else if (x <= 0.215) {
      		tmp = t_0;
      	} else {
      		tmp = ((1.0 + (((0.3333333333333333 * (1.0 / x)) - 0.5) / x)) / 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 <= 6.2d-193) then
              tmp = t_0
          else if (x <= 8.8d-172) then
              tmp = ((1.0d0 / n) + (((0.3333333333333333d0 / (x * n)) - (0.5d0 / n)) / x)) / x
          else if (x <= 0.215d0) then
              tmp = t_0
          else
              tmp = ((1.0d0 + (((0.3333333333333333d0 * (1.0d0 / x)) - 0.5d0) / x)) / 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 <= 6.2e-193) {
      		tmp = t_0;
      	} else if (x <= 8.8e-172) {
      		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / x;
      	} else if (x <= 0.215) {
      		tmp = t_0;
      	} else {
      		tmp = ((1.0 + (((0.3333333333333333 * (1.0 / x)) - 0.5) / x)) / x) / n;
      	}
      	return tmp;
      }
      
      def code(x, n):
      	t_0 = math.log(x) / -n
      	tmp = 0
      	if x <= 6.2e-193:
      		tmp = t_0
      	elif x <= 8.8e-172:
      		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / x
      	elif x <= 0.215:
      		tmp = t_0
      	else:
      		tmp = ((1.0 + (((0.3333333333333333 * (1.0 / x)) - 0.5) / x)) / x) / n
      	return tmp
      
      function code(x, n)
      	t_0 = Float64(log(x) / Float64(-n))
      	tmp = 0.0
      	if (x <= 6.2e-193)
      		tmp = t_0;
      	elseif (x <= 8.8e-172)
      		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(0.3333333333333333 / Float64(x * n)) - Float64(0.5 / n)) / x)) / x);
      	elseif (x <= 0.215)
      		tmp = t_0;
      	else
      		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(0.3333333333333333 * Float64(1.0 / x)) - 0.5) / x)) / x) / n);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, n)
      	t_0 = log(x) / -n;
      	tmp = 0.0;
      	if (x <= 6.2e-193)
      		tmp = t_0;
      	elseif (x <= 8.8e-172)
      		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / x;
      	elseif (x <= 0.215)
      		tmp = t_0;
      	else
      		tmp = ((1.0 + (((0.3333333333333333 * (1.0 / x)) - 0.5) / x)) / x) / n;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision]}, If[LessEqual[x, 6.2e-193], t$95$0, If[LessEqual[x, 8.8e-172], N[(N[(N[(1.0 / n), $MachinePrecision] + N[(N[(N[(0.3333333333333333 / N[(x * n), $MachinePrecision]), $MachinePrecision] - N[(0.5 / n), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 0.215], t$95$0, N[(N[(N[(1.0 + N[(N[(N[(0.3333333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{\log x}{-n}\\
      \mathbf{if}\;x \leq 6.2 \cdot 10^{-193}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;x \leq 8.8 \cdot 10^{-172}:\\
      \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x}\\
      
      \mathbf{elif}\;x \leq 0.215:\\
      \;\;\;\;t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{1 + \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x}}{x}}{n}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x < 6.2000000000000004e-193 or 8.80000000000000036e-172 < x < 0.214999999999999997

        1. Initial program 37.4%

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

          \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
        4. Step-by-step derivation
          1. *-rgt-identity35.8%

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{-1 \cdot \log x}{n}} \]
          2. neg-mul-154.7%

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

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

        if 6.2000000000000004e-193 < x < 8.80000000000000036e-172

        1. Initial program 43.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 21.4%

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

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

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

          \[\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}} \]
        7. Step-by-step derivation
          1. mul-1-neg67.6%

            \[\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. mul-1-neg67.6%

            \[\leadsto -\frac{\color{blue}{\left(-\frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right)} - \frac{1}{n}}{x} \]
          3. associate-*r/67.6%

            \[\leadsto -\frac{\left(-\frac{\color{blue}{\frac{0.3333333333333333 \cdot 1}{n \cdot x}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
          4. metadata-eval67.6%

            \[\leadsto -\frac{\left(-\frac{\frac{\color{blue}{0.3333333333333333}}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
          5. *-commutative67.6%

            \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{\color{blue}{x \cdot n}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
          6. associate-*r/67.6%

            \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \color{blue}{\frac{0.5 \cdot 1}{n}}}{x}\right) - \frac{1}{n}}{x} \]
          7. metadata-eval67.6%

            \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \frac{\color{blue}{0.5}}{n}}{x}\right) - \frac{1}{n}}{x} \]
        8. Simplified67.6%

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

        if 0.214999999999999997 < x

        1. Initial program 66.2%

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

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

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

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

          \[\leadsto \frac{\color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x} - 1}{x}}}{n} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification57.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 6.2 \cdot 10^{-193}:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{elif}\;x \leq 8.8 \cdot 10^{-172}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x}\\ \mathbf{elif}\;x \leq 0.215:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{0.3333333333333333 \cdot \frac{1}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 80.9% accurate, 1.8× speedup?

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

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

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

          \[\leadsto \color{blue}{\frac{x - \log x}{n}} \]
        5. Taylor expanded in x around inf 75.2%

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

            \[\leadsto x \cdot \left(\frac{1}{n} + \frac{\color{blue}{-\log x}}{n \cdot x}\right) \]
          2. *-commutative75.2%

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

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

        if 3.2e-13 < x

        1. Initial program 65.8%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{x} \cdot \frac{1}{n}} \]
          3. div-inv95.6%

            \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x} \cdot \frac{1}{n} \]
          4. pow-to-exp95.6%

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

            \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{{x}^{1}}} \cdot \frac{1}{n} \]
          6. pow-div95.3%

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

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

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

      Alternative 9: 45.7% accurate, 12.4× speedup?

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

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

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

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

        \[\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}} \]
      7. Step-by-step derivation
        1. mul-1-neg44.9%

          \[\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. mul-1-neg44.9%

          \[\leadsto -\frac{\color{blue}{\left(-\frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right)} - \frac{1}{n}}{x} \]
        3. associate-*r/44.9%

          \[\leadsto -\frac{\left(-\frac{\color{blue}{\frac{0.3333333333333333 \cdot 1}{n \cdot x}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
        4. metadata-eval44.9%

          \[\leadsto -\frac{\left(-\frac{\frac{\color{blue}{0.3333333333333333}}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
        5. *-commutative44.9%

          \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{\color{blue}{x \cdot n}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
        6. associate-*r/44.9%

          \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \color{blue}{\frac{0.5 \cdot 1}{n}}}{x}\right) - \frac{1}{n}}{x} \]
        7. metadata-eval44.9%

          \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \frac{\color{blue}{0.5}}{n}}{x}\right) - \frac{1}{n}}{x} \]
      8. Simplified44.9%

        \[\leadsto \color{blue}{-\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}\right) - \frac{1}{n}}{x}} \]
      9. Final simplification44.9%

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

      Alternative 10: 39.9% accurate, 30.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x} \cdot \frac{1}{n} \]
        5. pow157.1%

          \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{{x}^{1}}} \cdot \frac{1}{n} \]
        6. pow-div57.0%

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

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

        \[\leadsto \color{blue}{\frac{1}{x}} \cdot \frac{1}{n} \]
      9. Final simplification40.8%

        \[\leadsto \frac{1}{n} \cdot \frac{1}{x} \]
      10. Add Preprocessing

      Alternative 11: 39.9% accurate, 42.2× speedup?

      \[\begin{array}{l} \\ \frac{\frac{1}{x}}{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(Float64(1.0 / x) / n)
      end
      
      function tmp = code(x, n)
      	tmp = (1.0 / x) / n;
      end
      
      code[x_, n_] := N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{\frac{1}{x}}{n}
      \end{array}
      
      Derivation
      1. Initial program 50.4%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{1}{\color{blue}{x \cdot n}} \]
        2. associate-/r*40.8%

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

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

      Alternative 12: 39.5% 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 50.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{n \cdot x}} \]
      7. Final simplification40.2%

        \[\leadsto \frac{1}{x \cdot n} \]
      8. Add Preprocessing

      Alternative 13: 4.6% 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 50.4%

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

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

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

      Reproduce

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