2nthrt (problem 3.4.6)

Percentage Accurate: 54.2% → 86.0%
Time: 26.5s
Alternatives: 19
Speedup: 1.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 54.2% accurate, 1.0× speedup?

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

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

Alternative 1: 86.0% accurate, 0.2× speedup?

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

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

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


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

    1. Initial program 45.7%

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

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

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

    if 1.65e6 < x

    1. Initial program 64.5%

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

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

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

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

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

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

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

        \[\leadsto \frac{e^{\frac{\color{blue}{1} \cdot \log x}{n}}}{n \cdot x} \]
      7. *-commutativeN/A

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

        \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n \cdot x} \]
      9. exp-to-powN/A

        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
      10. lower-pow.f64N/A

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

        \[\leadsto \frac{{x}^{\color{blue}{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
      12. *-commutativeN/A

        \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
      13. lower-*.f6498.9

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

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

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

Alternative 2: 77.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 0.9101169306103679:\\
\;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\

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


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

    1. Initial program 98.8%

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

      \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
    4. Step-by-step derivation
      1. Applied rewrites98.8%

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

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

      1. Initial program 45.9%

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

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

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

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

          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
        4. lower-log.f6474.8

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

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

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

        if 0.910116930610367914 < (-.f64 (pow.f64 (+.f64 x #s(literal 1 binary64)) (/.f64 #s(literal 1 binary64) n)) (pow.f64 x (/.f64 #s(literal 1 binary64) n)))

        1. Initial program 44.7%

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

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

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

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

            \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
          4. lower-log.f646.0

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

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

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

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

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

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

              \[\leadsto \frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x \cdot n} \]
            3. Step-by-step derivation
              1. Applied rewrites42.9%

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

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

            Alternative 3: 77.1% accurate, 0.4× speedup?

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

              1. Initial program 98.8%

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

                \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
              4. Step-by-step derivation
                1. Applied rewrites98.8%

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

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

                1. Initial program 45.9%

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

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

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

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

                    \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                  4. lower-log.f6474.8

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

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

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

                  if 0.910116930610367914 < (-.f64 (pow.f64 (+.f64 x #s(literal 1 binary64)) (/.f64 #s(literal 1 binary64) n)) (pow.f64 x (/.f64 #s(literal 1 binary64) n)))

                  1. Initial program 44.7%

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

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

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

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

                      \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                    4. lower-log.f646.0

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

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

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

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

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

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

                        \[\leadsto \frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x \cdot n} \]
                      3. Step-by-step derivation
                        1. Applied rewrites42.9%

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

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

                      Alternative 4: 85.6% accurate, 0.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{\left(\log x - x\right) - \mathsf{fma}\left(-0.5, \frac{{\log x}^{2}}{n}, \frac{{\log x}^{3} \cdot -0.16666666666666666}{n \cdot n}\right)}{-n}\\ \mathbf{else}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\ \end{array} \end{array} \]
                      (FPCore (x n)
                       :precision binary64
                       (if (<= x 1.0)
                         (/
                          (-
                           (- (log x) x)
                           (fma
                            -0.5
                            (/ (pow (log x) 2.0) n)
                            (/ (* (pow (log x) 3.0) -0.16666666666666666) (* n n))))
                          (- n))
                         (/ (pow x (/ 1.0 n)) (* x n))))
                      double code(double x, double n) {
                      	double tmp;
                      	if (x <= 1.0) {
                      		tmp = ((log(x) - x) - fma(-0.5, (pow(log(x), 2.0) / n), ((pow(log(x), 3.0) * -0.16666666666666666) / (n * n)))) / -n;
                      	} else {
                      		tmp = pow(x, (1.0 / n)) / (x * n);
                      	}
                      	return tmp;
                      }
                      
                      function code(x, n)
                      	tmp = 0.0
                      	if (x <= 1.0)
                      		tmp = Float64(Float64(Float64(log(x) - x) - fma(-0.5, Float64((log(x) ^ 2.0) / n), Float64(Float64((log(x) ^ 3.0) * -0.16666666666666666) / Float64(n * n)))) / Float64(-n));
                      	else
                      		tmp = Float64((x ^ Float64(1.0 / n)) / Float64(x * n));
                      	end
                      	return tmp
                      end
                      
                      code[x_, n_] := If[LessEqual[x, 1.0], N[(N[(N[(N[Log[x], $MachinePrecision] - x), $MachinePrecision] - N[(-0.5 * N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / n), $MachinePrecision] + N[(N[(N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision], N[(N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;x \leq 1:\\
                      \;\;\;\;\frac{\left(\log x - x\right) - \mathsf{fma}\left(-0.5, \frac{{\log x}^{2}}{n}, \frac{{\log x}^{3} \cdot -0.16666666666666666}{n \cdot n}\right)}{-n}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if x < 1

                        1. Initial program 46.3%

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

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

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

                          \[\leadsto \frac{\left(\log x + -1 \cdot x\right) - \left(\frac{-1}{2} \cdot \frac{{\log x}^{2}}{n} + \frac{-1}{6} \cdot \frac{{\log x}^{3}}{{n}^{2}}\right)}{\mathsf{neg}\left(\color{blue}{n}\right)} \]
                        6. Step-by-step derivation
                          1. Applied rewrites76.5%

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

                          if 1 < x

                          1. Initial program 63.5%

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

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

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

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

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

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

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

                              \[\leadsto \frac{e^{\frac{\color{blue}{1} \cdot \log x}{n}}}{n \cdot x} \]
                            7. *-commutativeN/A

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

                              \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n \cdot x} \]
                            9. exp-to-powN/A

                              \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                            10. lower-pow.f64N/A

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

                              \[\leadsto \frac{{x}^{\color{blue}{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                            12. *-commutativeN/A

                              \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
                            13. lower-*.f6497.8

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

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

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

                        Alternative 5: 85.3% accurate, 0.4× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.97:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{{\log x}^{2}}{n}, \log x\right) + \frac{0.16666666666666666 \cdot {\log x}^{3}}{n \cdot n}}{-n}\\ \mathbf{else}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\ \end{array} \end{array} \]
                        (FPCore (x n)
                         :precision binary64
                         (if (<= x 0.97)
                           (/
                            (+
                             (fma 0.5 (/ (pow (log x) 2.0) n) (log x))
                             (/ (* 0.16666666666666666 (pow (log x) 3.0)) (* n n)))
                            (- n))
                           (/ (pow x (/ 1.0 n)) (* x n))))
                        double code(double x, double n) {
                        	double tmp;
                        	if (x <= 0.97) {
                        		tmp = (fma(0.5, (pow(log(x), 2.0) / n), log(x)) + ((0.16666666666666666 * pow(log(x), 3.0)) / (n * n))) / -n;
                        	} else {
                        		tmp = pow(x, (1.0 / n)) / (x * n);
                        	}
                        	return tmp;
                        }
                        
                        function code(x, n)
                        	tmp = 0.0
                        	if (x <= 0.97)
                        		tmp = Float64(Float64(fma(0.5, Float64((log(x) ^ 2.0) / n), log(x)) + Float64(Float64(0.16666666666666666 * (log(x) ^ 3.0)) / Float64(n * n))) / Float64(-n));
                        	else
                        		tmp = Float64((x ^ Float64(1.0 / n)) / Float64(x * n));
                        	end
                        	return tmp
                        end
                        
                        code[x_, n_] := If[LessEqual[x, 0.97], N[(N[(N[(0.5 * N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / n), $MachinePrecision] + N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(N[(0.16666666666666666 * N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision], N[(N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq 0.97:\\
                        \;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{{\log x}^{2}}{n}, \log x\right) + \frac{0.16666666666666666 \cdot {\log x}^{3}}{n \cdot n}}{-n}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < 0.96999999999999997

                          1. Initial program 46.3%

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

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

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

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

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

                          if 0.96999999999999997 < x

                          1. Initial program 63.5%

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

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

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

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

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

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

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

                              \[\leadsto \frac{e^{\frac{\color{blue}{1} \cdot \log x}{n}}}{n \cdot x} \]
                            7. *-commutativeN/A

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

                              \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n \cdot x} \]
                            9. exp-to-powN/A

                              \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                            10. lower-pow.f64N/A

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

                              \[\leadsto \frac{{x}^{\color{blue}{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                            12. *-commutativeN/A

                              \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
                            13. lower-*.f6497.8

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

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

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

                        Alternative 6: 85.7% accurate, 0.8× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{t\_0}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-34}:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{x}{n}} - t\_0\\ \end{array} \end{array} \]
                        (FPCore (x n)
                         :precision binary64
                         (let* ((t_0 (pow x (/ 1.0 n))))
                           (if (<= (/ 1.0 n) -4e-29)
                             (/ t_0 (* x n))
                             (if (<= (/ 1.0 n) 1e-97)
                               (/ (log (/ x (+ x 1.0))) (- n))
                               (if (<= (/ 1.0 n) 2e-34)
                                 (/ 1.0 (* x (fma 0.5 (/ n x) n)))
                                 (- (exp (/ x n)) t_0))))))
                        double code(double x, double n) {
                        	double t_0 = pow(x, (1.0 / n));
                        	double tmp;
                        	if ((1.0 / n) <= -4e-29) {
                        		tmp = t_0 / (x * n);
                        	} else if ((1.0 / n) <= 1e-97) {
                        		tmp = log((x / (x + 1.0))) / -n;
                        	} else if ((1.0 / n) <= 2e-34) {
                        		tmp = 1.0 / (x * fma(0.5, (n / x), n));
                        	} else {
                        		tmp = exp((x / n)) - t_0;
                        	}
                        	return tmp;
                        }
                        
                        function code(x, n)
                        	t_0 = x ^ Float64(1.0 / n)
                        	tmp = 0.0
                        	if (Float64(1.0 / n) <= -4e-29)
                        		tmp = Float64(t_0 / Float64(x * n));
                        	elseif (Float64(1.0 / n) <= 1e-97)
                        		tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(-n));
                        	elseif (Float64(1.0 / n) <= 2e-34)
                        		tmp = Float64(1.0 / Float64(x * fma(0.5, Float64(n / x), n)));
                        	else
                        		tmp = Float64(exp(Float64(x / n)) - t_0);
                        	end
                        	return tmp
                        end
                        
                        code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-29], N[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-97], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-n)), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-34], N[(1.0 / N[(x * N[(0.5 * N[(n / x), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(x / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := {x}^{\left(\frac{1}{n}\right)}\\
                        \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\
                        \;\;\;\;\frac{t\_0}{x \cdot n}\\
                        
                        \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\
                        \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\
                        
                        \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-34}:\\
                        \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;e^{\frac{x}{n}} - t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 4 regimes
                        2. if (/.f64 #s(literal 1 binary64) n) < -3.99999999999999977e-29

                          1. Initial program 88.6%

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

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

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

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

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

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

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

                              \[\leadsto \frac{e^{\frac{\color{blue}{1} \cdot \log x}{n}}}{n \cdot x} \]
                            7. *-commutativeN/A

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

                              \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n \cdot x} \]
                            9. exp-to-powN/A

                              \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                            10. lower-pow.f64N/A

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

                              \[\leadsto \frac{{x}^{\color{blue}{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                            12. *-commutativeN/A

                              \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
                            13. lower-*.f6491.4

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

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

                          if -3.99999999999999977e-29 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000004e-97

                          1. Initial program 39.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

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

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

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

                              \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                            4. lower-log.f6477.3

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

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

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

                            if 1.00000000000000004e-97 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999986e-34

                            1. Initial program 4.0%

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

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

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

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

                                \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                              4. lower-log.f6430.2

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

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

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

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

                                  \[\leadsto \frac{1}{x \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}} \]

                                if 1.99999999999999986e-34 < (/.f64 #s(literal 1 binary64) n)

                                1. Initial program 45.0%

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

                                    \[\leadsto \color{blue}{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}} - {x}^{\left(\frac{1}{n}\right)} \]
                                  2. pow-to-expN/A

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

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

                                    \[\leadsto e^{\log \left(x + 1\right) \cdot \color{blue}{\frac{1}{n}}} - {x}^{\left(\frac{1}{n}\right)} \]
                                  5. un-div-invN/A

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

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

                                    \[\leadsto e^{\frac{\log \color{blue}{\left(x + 1\right)}}{n}} - {x}^{\left(\frac{1}{n}\right)} \]
                                  8. +-commutativeN/A

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

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

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

                                  \[\leadsto e^{\color{blue}{\frac{x}{n}}} - {x}^{\left(\frac{1}{n}\right)} \]
                                6. Step-by-step derivation
                                  1. lower-/.f6497.8

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-34}:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \end{array} \]
                              6. Add Preprocessing

                              Alternative 7: 82.3% accurate, 1.0× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{t\_0}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\ \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-21}:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(x, 0.16666666666666666, n \cdot \mathsf{fma}\left(x, -0.5, 0.5\right)\right)}{n \cdot \left(n \cdot n\right)}, \frac{1}{n}\right), 1\right) - t\_0\\ \end{array} \end{array} \]
                              (FPCore (x n)
                               :precision binary64
                               (let* ((t_0 (pow x (/ 1.0 n))))
                                 (if (<= (/ 1.0 n) -4e-29)
                                   (/ t_0 (* x n))
                                   (if (<= (/ 1.0 n) 1e-97)
                                     (/ (log (/ x (+ x 1.0))) (- n))
                                     (if (<= (/ 1.0 n) 4e-21)
                                       (/ 1.0 (* x (fma 0.5 (/ n x) n)))
                                       (-
                                        (fma
                                         x
                                         (fma
                                          x
                                          (/
                                           (fma x 0.16666666666666666 (* n (fma x -0.5 0.5)))
                                           (* n (* n n)))
                                          (/ 1.0 n))
                                         1.0)
                                        t_0))))))
                              double code(double x, double n) {
                              	double t_0 = pow(x, (1.0 / n));
                              	double tmp;
                              	if ((1.0 / n) <= -4e-29) {
                              		tmp = t_0 / (x * n);
                              	} else if ((1.0 / n) <= 1e-97) {
                              		tmp = log((x / (x + 1.0))) / -n;
                              	} else if ((1.0 / n) <= 4e-21) {
                              		tmp = 1.0 / (x * fma(0.5, (n / x), n));
                              	} else {
                              		tmp = fma(x, fma(x, (fma(x, 0.16666666666666666, (n * fma(x, -0.5, 0.5))) / (n * (n * n))), (1.0 / n)), 1.0) - t_0;
                              	}
                              	return tmp;
                              }
                              
                              function code(x, n)
                              	t_0 = x ^ Float64(1.0 / n)
                              	tmp = 0.0
                              	if (Float64(1.0 / n) <= -4e-29)
                              		tmp = Float64(t_0 / Float64(x * n));
                              	elseif (Float64(1.0 / n) <= 1e-97)
                              		tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(-n));
                              	elseif (Float64(1.0 / n) <= 4e-21)
                              		tmp = Float64(1.0 / Float64(x * fma(0.5, Float64(n / x), n)));
                              	else
                              		tmp = Float64(fma(x, fma(x, Float64(fma(x, 0.16666666666666666, Float64(n * fma(x, -0.5, 0.5))) / Float64(n * Float64(n * n))), Float64(1.0 / n)), 1.0) - t_0);
                              	end
                              	return tmp
                              end
                              
                              code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-29], N[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-97], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-n)), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e-21], N[(1.0 / N[(x * N[(0.5 * N[(n / x), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(x * N[(N[(x * 0.16666666666666666 + N[(n * N[(x * -0.5 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(n * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := {x}^{\left(\frac{1}{n}\right)}\\
                              \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\
                              \;\;\;\;\frac{t\_0}{x \cdot n}\\
                              
                              \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\
                              \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\
                              
                              \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-21}:\\
                              \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(x, 0.16666666666666666, n \cdot \mathsf{fma}\left(x, -0.5, 0.5\right)\right)}{n \cdot \left(n \cdot n\right)}, \frac{1}{n}\right), 1\right) - t\_0\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 4 regimes
                              2. if (/.f64 #s(literal 1 binary64) n) < -3.99999999999999977e-29

                                1. Initial program 88.6%

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

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

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

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

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

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

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

                                    \[\leadsto \frac{e^{\frac{\color{blue}{1} \cdot \log x}{n}}}{n \cdot x} \]
                                  7. *-commutativeN/A

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

                                    \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n \cdot x} \]
                                  9. exp-to-powN/A

                                    \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                                  10. lower-pow.f64N/A

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

                                    \[\leadsto \frac{{x}^{\color{blue}{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                                  12. *-commutativeN/A

                                    \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
                                  13. lower-*.f6491.4

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

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

                                if -3.99999999999999977e-29 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000004e-97

                                1. Initial program 39.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

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

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

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

                                    \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                  4. lower-log.f6477.3

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

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

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

                                  if 1.00000000000000004e-97 < (/.f64 #s(literal 1 binary64) n) < 3.99999999999999963e-21

                                  1. Initial program 4.0%

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

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

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

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

                                      \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                    4. lower-log.f6435.9

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

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

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

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

                                        \[\leadsto \frac{1}{x \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}} \]

                                      if 3.99999999999999963e-21 < (/.f64 #s(literal 1 binary64) n)

                                      1. Initial program 46.0%

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

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

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

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(x, x \cdot \left(\left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} + x \cdot \left(\left(\frac{1}{6} \cdot \frac{1}{{n}^{3}} + \frac{1}{3} \cdot \frac{1}{n}\right) - \frac{1}{2} \cdot \frac{1}{{n}^{2}}\right)\right) - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}, 1\right)} - {x}^{\left(\frac{1}{n}\right)} \]
                                      5. Applied rewrites35.1%

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

                                        \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\frac{1}{6} \cdot x + n \cdot \left(\frac{1}{2} + \frac{-1}{2} \cdot x\right)}{\color{blue}{{n}^{3}}}, \frac{1}{n}\right), 1\right) - {x}^{\left(\frac{1}{n}\right)} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites72.9%

                                          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(x, 0.16666666666666666, n \cdot \mathsf{fma}\left(x, -0.5, 0.5\right)\right)}{\color{blue}{n \cdot \left(n \cdot n\right)}}, \frac{1}{n}\right), 1\right) - {x}^{\left(\frac{1}{n}\right)} \]
                                      8. Recombined 4 regimes into one program.
                                      9. Final simplification80.7%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\ \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-21}:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\mathsf{fma}\left(x, 0.16666666666666666, n \cdot \mathsf{fma}\left(x, -0.5, 0.5\right)\right)}{n \cdot \left(n \cdot n\right)}, \frac{1}{n}\right), 1\right) - {x}^{\left(\frac{1}{n}\right)}\\ \end{array} \]
                                      10. Add Preprocessing

                                      Alternative 8: 82.2% accurate, 1.1× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{t\_0}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\ \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-21}:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666 \cdot \frac{x}{n \cdot \left(n \cdot n\right)}, \frac{1}{n}\right), 1\right) - t\_0\\ \end{array} \end{array} \]
                                      (FPCore (x n)
                                       :precision binary64
                                       (let* ((t_0 (pow x (/ 1.0 n))))
                                         (if (<= (/ 1.0 n) -4e-29)
                                           (/ t_0 (* x n))
                                           (if (<= (/ 1.0 n) 1e-97)
                                             (/ (log (/ x (+ x 1.0))) (- n))
                                             (if (<= (/ 1.0 n) 4e-21)
                                               (/ 1.0 (* x (fma 0.5 (/ n x) n)))
                                               (-
                                                (fma
                                                 x
                                                 (fma x (* 0.16666666666666666 (/ x (* n (* n n)))) (/ 1.0 n))
                                                 1.0)
                                                t_0))))))
                                      double code(double x, double n) {
                                      	double t_0 = pow(x, (1.0 / n));
                                      	double tmp;
                                      	if ((1.0 / n) <= -4e-29) {
                                      		tmp = t_0 / (x * n);
                                      	} else if ((1.0 / n) <= 1e-97) {
                                      		tmp = log((x / (x + 1.0))) / -n;
                                      	} else if ((1.0 / n) <= 4e-21) {
                                      		tmp = 1.0 / (x * fma(0.5, (n / x), n));
                                      	} else {
                                      		tmp = fma(x, fma(x, (0.16666666666666666 * (x / (n * (n * n)))), (1.0 / n)), 1.0) - t_0;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(x, n)
                                      	t_0 = x ^ Float64(1.0 / n)
                                      	tmp = 0.0
                                      	if (Float64(1.0 / n) <= -4e-29)
                                      		tmp = Float64(t_0 / Float64(x * n));
                                      	elseif (Float64(1.0 / n) <= 1e-97)
                                      		tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(-n));
                                      	elseif (Float64(1.0 / n) <= 4e-21)
                                      		tmp = Float64(1.0 / Float64(x * fma(0.5, Float64(n / x), n)));
                                      	else
                                      		tmp = Float64(fma(x, fma(x, Float64(0.16666666666666666 * Float64(x / Float64(n * Float64(n * n)))), Float64(1.0 / n)), 1.0) - t_0);
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-29], N[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-97], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-n)), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e-21], N[(1.0 / N[(x * N[(0.5 * N[(n / x), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(x * N[(0.16666666666666666 * N[(x / N[(n * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_0 := {x}^{\left(\frac{1}{n}\right)}\\
                                      \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\
                                      \;\;\;\;\frac{t\_0}{x \cdot n}\\
                                      
                                      \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\
                                      \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\
                                      
                                      \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-21}:\\
                                      \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666 \cdot \frac{x}{n \cdot \left(n \cdot n\right)}, \frac{1}{n}\right), 1\right) - t\_0\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 4 regimes
                                      2. if (/.f64 #s(literal 1 binary64) n) < -3.99999999999999977e-29

                                        1. Initial program 88.6%

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

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

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

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

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

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

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

                                            \[\leadsto \frac{e^{\frac{\color{blue}{1} \cdot \log x}{n}}}{n \cdot x} \]
                                          7. *-commutativeN/A

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

                                            \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n \cdot x} \]
                                          9. exp-to-powN/A

                                            \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                                          10. lower-pow.f64N/A

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

                                            \[\leadsto \frac{{x}^{\color{blue}{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                                          12. *-commutativeN/A

                                            \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
                                          13. lower-*.f6491.4

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

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

                                        if -3.99999999999999977e-29 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000004e-97

                                        1. Initial program 39.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

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

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

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

                                            \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                          4. lower-log.f6477.3

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

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

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

                                          if 1.00000000000000004e-97 < (/.f64 #s(literal 1 binary64) n) < 3.99999999999999963e-21

                                          1. Initial program 4.0%

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

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

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

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

                                              \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                            4. lower-log.f6435.9

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

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

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

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

                                                \[\leadsto \frac{1}{x \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}} \]

                                              if 3.99999999999999963e-21 < (/.f64 #s(literal 1 binary64) n)

                                              1. Initial program 46.0%

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

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

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

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(x, x \cdot \left(\left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} + x \cdot \left(\left(\frac{1}{6} \cdot \frac{1}{{n}^{3}} + \frac{1}{3} \cdot \frac{1}{n}\right) - \frac{1}{2} \cdot \frac{1}{{n}^{2}}\right)\right) - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}, 1\right)} - {x}^{\left(\frac{1}{n}\right)} \]
                                              5. Applied rewrites35.1%

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

                                                \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{1}{6} \cdot \color{blue}{\frac{x}{{n}^{3}}}, \frac{1}{n}\right), 1\right) - {x}^{\left(\frac{1}{n}\right)} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites72.0%

                                                  \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666 \cdot \color{blue}{\frac{x}{n \cdot \left(n \cdot n\right)}}, \frac{1}{n}\right), 1\right) - {x}^{\left(\frac{1}{n}\right)} \]
                                              8. Recombined 4 regimes into one program.
                                              9. Final simplification80.6%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\ \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-21}:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.16666666666666666 \cdot \frac{x}{n \cdot \left(n \cdot n\right)}, \frac{1}{n}\right), 1\right) - {x}^{\left(\frac{1}{n}\right)}\\ \end{array} \]
                                              10. Add Preprocessing

                                              Alternative 9: 82.6% accurate, 1.2× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{t\_0}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\ \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-21}:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{+171}:\\ \;\;\;\;\left(\frac{x}{n} + 1\right) - t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{0.5}{n \cdot n} - \frac{0.5}{n}, \frac{1}{n}\right), 1\right) - 1\\ \end{array} \end{array} \]
                                              (FPCore (x n)
                                               :precision binary64
                                               (let* ((t_0 (pow x (/ 1.0 n))))
                                                 (if (<= (/ 1.0 n) -4e-29)
                                                   (/ t_0 (* x n))
                                                   (if (<= (/ 1.0 n) 1e-97)
                                                     (/ (log (/ x (+ x 1.0))) (- n))
                                                     (if (<= (/ 1.0 n) 4e-21)
                                                       (/ 1.0 (* x (fma 0.5 (/ n x) n)))
                                                       (if (<= (/ 1.0 n) 4e+171)
                                                         (- (+ (/ x n) 1.0) t_0)
                                                         (-
                                                          (fma x (fma x (- (/ 0.5 (* n n)) (/ 0.5 n)) (/ 1.0 n)) 1.0)
                                                          1.0)))))))
                                              double code(double x, double n) {
                                              	double t_0 = pow(x, (1.0 / n));
                                              	double tmp;
                                              	if ((1.0 / n) <= -4e-29) {
                                              		tmp = t_0 / (x * n);
                                              	} else if ((1.0 / n) <= 1e-97) {
                                              		tmp = log((x / (x + 1.0))) / -n;
                                              	} else if ((1.0 / n) <= 4e-21) {
                                              		tmp = 1.0 / (x * fma(0.5, (n / x), n));
                                              	} else if ((1.0 / n) <= 4e+171) {
                                              		tmp = ((x / n) + 1.0) - t_0;
                                              	} else {
                                              		tmp = fma(x, fma(x, ((0.5 / (n * n)) - (0.5 / n)), (1.0 / n)), 1.0) - 1.0;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              function code(x, n)
                                              	t_0 = x ^ Float64(1.0 / n)
                                              	tmp = 0.0
                                              	if (Float64(1.0 / n) <= -4e-29)
                                              		tmp = Float64(t_0 / Float64(x * n));
                                              	elseif (Float64(1.0 / n) <= 1e-97)
                                              		tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(-n));
                                              	elseif (Float64(1.0 / n) <= 4e-21)
                                              		tmp = Float64(1.0 / Float64(x * fma(0.5, Float64(n / x), n)));
                                              	elseif (Float64(1.0 / n) <= 4e+171)
                                              		tmp = Float64(Float64(Float64(x / n) + 1.0) - t_0);
                                              	else
                                              		tmp = Float64(fma(x, fma(x, Float64(Float64(0.5 / Float64(n * n)) - Float64(0.5 / n)), Float64(1.0 / n)), 1.0) - 1.0);
                                              	end
                                              	return tmp
                                              end
                                              
                                              code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-29], N[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-97], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-n)), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e-21], N[(1.0 / N[(x * N[(0.5 * N[(n / x), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e+171], N[(N[(N[(x / n), $MachinePrecision] + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(x * N[(N[(0.5 / N[(n * n), $MachinePrecision]), $MachinePrecision] - N[(0.5 / n), $MachinePrecision]), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - 1.0), $MachinePrecision]]]]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              t_0 := {x}^{\left(\frac{1}{n}\right)}\\
                                              \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\
                                              \;\;\;\;\frac{t\_0}{x \cdot n}\\
                                              
                                              \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\
                                              \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\
                                              
                                              \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-21}:\\
                                              \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\
                                              
                                              \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{+171}:\\
                                              \;\;\;\;\left(\frac{x}{n} + 1\right) - t\_0\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{0.5}{n \cdot n} - \frac{0.5}{n}, \frac{1}{n}\right), 1\right) - 1\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 5 regimes
                                              2. if (/.f64 #s(literal 1 binary64) n) < -3.99999999999999977e-29

                                                1. Initial program 88.6%

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

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

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

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

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

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

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

                                                    \[\leadsto \frac{e^{\frac{\color{blue}{1} \cdot \log x}{n}}}{n \cdot x} \]
                                                  7. *-commutativeN/A

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

                                                    \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n \cdot x} \]
                                                  9. exp-to-powN/A

                                                    \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                                                  10. lower-pow.f64N/A

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

                                                    \[\leadsto \frac{{x}^{\color{blue}{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                                                  12. *-commutativeN/A

                                                    \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
                                                  13. lower-*.f6491.4

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

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

                                                if -3.99999999999999977e-29 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000004e-97

                                                1. Initial program 39.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

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

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

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

                                                    \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                                  4. lower-log.f6477.3

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

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

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

                                                  if 1.00000000000000004e-97 < (/.f64 #s(literal 1 binary64) n) < 3.99999999999999963e-21

                                                  1. Initial program 4.0%

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

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

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

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

                                                      \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                                    4. lower-log.f6435.9

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

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

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

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

                                                        \[\leadsto \frac{1}{x \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}} \]

                                                      if 3.99999999999999963e-21 < (/.f64 #s(literal 1 binary64) n) < 3.99999999999999982e171

                                                      1. Initial program 63.3%

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

                                                        \[\leadsto \color{blue}{\left(1 + \frac{x}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
                                                      4. Step-by-step derivation
                                                        1. *-rgt-identityN/A

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

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

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

                                                          \[\leadsto \left(1 + \color{blue}{\frac{x \cdot 1}{n}}\right) - {x}^{\left(\frac{1}{n}\right)} \]
                                                        5. *-rgt-identityN/A

                                                          \[\leadsto \left(1 + \frac{\color{blue}{x}}{n}\right) - {x}^{\left(\frac{1}{n}\right)} \]
                                                        6. lower-/.f6461.1

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

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

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

                                                      1. Initial program 29.5%

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

                                                        \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                      4. Step-by-step derivation
                                                        1. Applied rewrites25.1%

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

                                                          \[\leadsto 1 - \color{blue}{1} \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites2.0%

                                                            \[\leadsto 1 - \color{blue}{1} \]
                                                          2. Taylor expanded in x around 0

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

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

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

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

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

                                                              \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\frac{\frac{1}{2} \cdot 1}{{n}^{2}}} - \frac{1}{2} \cdot \frac{1}{n}, \frac{1}{n}\right), 1\right) - 1 \]
                                                            6. metadata-evalN/A

                                                              \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\color{blue}{\frac{1}{2}}}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}, \frac{1}{n}\right), 1\right) - 1 \]
                                                            7. lower-/.f64N/A

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

                                                              \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\frac{1}{2}}{\color{blue}{n \cdot n}} - \frac{1}{2} \cdot \frac{1}{n}, \frac{1}{n}\right), 1\right) - 1 \]
                                                            9. lower-*.f64N/A

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

                                                              \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\frac{1}{2}}{n \cdot n} - \color{blue}{\frac{\frac{1}{2} \cdot 1}{n}}, \frac{1}{n}\right), 1\right) - 1 \]
                                                            11. metadata-evalN/A

                                                              \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\frac{1}{2}}{n \cdot n} - \frac{\color{blue}{\frac{1}{2}}}{n}, \frac{1}{n}\right), 1\right) - 1 \]
                                                            12. lower-/.f64N/A

                                                              \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\frac{1}{2}}{n \cdot n} - \color{blue}{\frac{\frac{1}{2}}{n}}, \frac{1}{n}\right), 1\right) - 1 \]
                                                            13. lower-/.f6473.6

                                                              \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{0.5}{n \cdot n} - \frac{0.5}{n}, \color{blue}{\frac{1}{n}}\right), 1\right) - 1 \]
                                                          4. Applied rewrites73.6%

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{0.5}{n \cdot n} - \frac{0.5}{n}, \frac{1}{n}\right), 1\right)} - 1 \]
                                                        4. Recombined 5 regimes into one program.
                                                        5. Final simplification79.8%

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\ \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{-21}:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{+171}:\\ \;\;\;\;\left(\frac{x}{n} + 1\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{0.5}{n \cdot n} - \frac{0.5}{n}, \frac{1}{n}\right), 1\right) - 1\\ \end{array} \]
                                                        6. Add Preprocessing

                                                        Alternative 10: 81.9% accurate, 1.3× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{t\_0}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-34}:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{+171}:\\ \;\;\;\;1 - t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{0.5}{n \cdot n} - \frac{0.5}{n}, \frac{1}{n}\right), 1\right) - 1\\ \end{array} \end{array} \]
                                                        (FPCore (x n)
                                                         :precision binary64
                                                         (let* ((t_0 (pow x (/ 1.0 n))))
                                                           (if (<= (/ 1.0 n) -4e-29)
                                                             (/ t_0 (* x n))
                                                             (if (<= (/ 1.0 n) 1e-97)
                                                               (/ (log (/ x (+ x 1.0))) (- n))
                                                               (if (<= (/ 1.0 n) 2e-34)
                                                                 (/ 1.0 (* x (fma 0.5 (/ n x) n)))
                                                                 (if (<= (/ 1.0 n) 4e+171)
                                                                   (- 1.0 t_0)
                                                                   (-
                                                                    (fma x (fma x (- (/ 0.5 (* n n)) (/ 0.5 n)) (/ 1.0 n)) 1.0)
                                                                    1.0)))))))
                                                        double code(double x, double n) {
                                                        	double t_0 = pow(x, (1.0 / n));
                                                        	double tmp;
                                                        	if ((1.0 / n) <= -4e-29) {
                                                        		tmp = t_0 / (x * n);
                                                        	} else if ((1.0 / n) <= 1e-97) {
                                                        		tmp = log((x / (x + 1.0))) / -n;
                                                        	} else if ((1.0 / n) <= 2e-34) {
                                                        		tmp = 1.0 / (x * fma(0.5, (n / x), n));
                                                        	} else if ((1.0 / n) <= 4e+171) {
                                                        		tmp = 1.0 - t_0;
                                                        	} else {
                                                        		tmp = fma(x, fma(x, ((0.5 / (n * n)) - (0.5 / n)), (1.0 / n)), 1.0) - 1.0;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        function code(x, n)
                                                        	t_0 = x ^ Float64(1.0 / n)
                                                        	tmp = 0.0
                                                        	if (Float64(1.0 / n) <= -4e-29)
                                                        		tmp = Float64(t_0 / Float64(x * n));
                                                        	elseif (Float64(1.0 / n) <= 1e-97)
                                                        		tmp = Float64(log(Float64(x / Float64(x + 1.0))) / Float64(-n));
                                                        	elseif (Float64(1.0 / n) <= 2e-34)
                                                        		tmp = Float64(1.0 / Float64(x * fma(0.5, Float64(n / x), n)));
                                                        	elseif (Float64(1.0 / n) <= 4e+171)
                                                        		tmp = Float64(1.0 - t_0);
                                                        	else
                                                        		tmp = Float64(fma(x, fma(x, Float64(Float64(0.5 / Float64(n * n)) - Float64(0.5 / n)), Float64(1.0 / n)), 1.0) - 1.0);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-29], N[(t$95$0 / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e-97], N[(N[Log[N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-n)), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-34], N[(1.0 / N[(x * N[(0.5 * N[(n / x), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 4e+171], N[(1.0 - t$95$0), $MachinePrecision], N[(N[(x * N[(x * N[(N[(0.5 / N[(n * n), $MachinePrecision]), $MachinePrecision] - N[(0.5 / n), $MachinePrecision]), $MachinePrecision] + N[(1.0 / n), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - 1.0), $MachinePrecision]]]]]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        t_0 := {x}^{\left(\frac{1}{n}\right)}\\
                                                        \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\
                                                        \;\;\;\;\frac{t\_0}{x \cdot n}\\
                                                        
                                                        \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\
                                                        \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\
                                                        
                                                        \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-34}:\\
                                                        \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\
                                                        
                                                        \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{+171}:\\
                                                        \;\;\;\;1 - t\_0\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{0.5}{n \cdot n} - \frac{0.5}{n}, \frac{1}{n}\right), 1\right) - 1\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 5 regimes
                                                        2. if (/.f64 #s(literal 1 binary64) n) < -3.99999999999999977e-29

                                                          1. Initial program 88.6%

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

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

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

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

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

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

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

                                                              \[\leadsto \frac{e^{\frac{\color{blue}{1} \cdot \log x}{n}}}{n \cdot x} \]
                                                            7. *-commutativeN/A

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

                                                              \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n \cdot x} \]
                                                            9. exp-to-powN/A

                                                              \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                                                            10. lower-pow.f64N/A

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

                                                              \[\leadsto \frac{{x}^{\color{blue}{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
                                                            12. *-commutativeN/A

                                                              \[\leadsto \frac{{x}^{\left(\frac{1}{n}\right)}}{\color{blue}{x \cdot n}} \]
                                                            13. lower-*.f6491.4

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

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

                                                          if -3.99999999999999977e-29 < (/.f64 #s(literal 1 binary64) n) < 1.00000000000000004e-97

                                                          1. Initial program 39.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

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

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

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

                                                              \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                                            4. lower-log.f6477.3

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

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

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

                                                            if 1.00000000000000004e-97 < (/.f64 #s(literal 1 binary64) n) < 1.99999999999999986e-34

                                                            1. Initial program 4.0%

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

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

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

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

                                                                \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                                              4. lower-log.f6430.2

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

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

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

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

                                                                  \[\leadsto \frac{1}{x \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}} \]

                                                                if 1.99999999999999986e-34 < (/.f64 #s(literal 1 binary64) n) < 3.99999999999999982e171

                                                                1. Initial program 60.6%

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

                                                                  \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                4. Step-by-step derivation
                                                                  1. Applied rewrites56.2%

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

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

                                                                  1. Initial program 29.5%

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

                                                                    \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                  4. Step-by-step derivation
                                                                    1. Applied rewrites25.1%

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

                                                                      \[\leadsto 1 - \color{blue}{1} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites2.0%

                                                                        \[\leadsto 1 - \color{blue}{1} \]
                                                                      2. Taylor expanded in x around 0

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

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

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

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

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

                                                                          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \color{blue}{\frac{\frac{1}{2} \cdot 1}{{n}^{2}}} - \frac{1}{2} \cdot \frac{1}{n}, \frac{1}{n}\right), 1\right) - 1 \]
                                                                        6. metadata-evalN/A

                                                                          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\color{blue}{\frac{1}{2}}}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}, \frac{1}{n}\right), 1\right) - 1 \]
                                                                        7. lower-/.f64N/A

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

                                                                          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\frac{1}{2}}{\color{blue}{n \cdot n}} - \frac{1}{2} \cdot \frac{1}{n}, \frac{1}{n}\right), 1\right) - 1 \]
                                                                        9. lower-*.f64N/A

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

                                                                          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\frac{1}{2}}{n \cdot n} - \color{blue}{\frac{\frac{1}{2} \cdot 1}{n}}, \frac{1}{n}\right), 1\right) - 1 \]
                                                                        11. metadata-evalN/A

                                                                          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\frac{1}{2}}{n \cdot n} - \frac{\color{blue}{\frac{1}{2}}}{n}, \frac{1}{n}\right), 1\right) - 1 \]
                                                                        12. lower-/.f64N/A

                                                                          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{\frac{1}{2}}{n \cdot n} - \color{blue}{\frac{\frac{1}{2}}{n}}, \frac{1}{n}\right), 1\right) - 1 \]
                                                                        13. lower-/.f6473.6

                                                                          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{0.5}{n \cdot n} - \frac{0.5}{n}, \color{blue}{\frac{1}{n}}\right), 1\right) - 1 \]
                                                                      4. Applied rewrites73.6%

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

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{{x}^{\left(\frac{1}{n}\right)}}{x \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{-97}:\\ \;\;\;\;\frac{\log \left(\frac{x}{x + 1}\right)}{-n}\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-34}:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq 4 \cdot 10^{+171}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{0.5}{n \cdot n} - \frac{0.5}{n}, \frac{1}{n}\right), 1\right) - 1\\ \end{array} \]
                                                                    6. Add Preprocessing

                                                                    Alternative 11: 56.6% accurate, 1.6× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;x \leq 1.85 \cdot 10^{-187}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-148}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-82}:\\ \;\;\;\;\frac{\frac{-0.5 + \frac{0.3333333333333333}{x}}{x} + 1}{x \cdot n}\\ \mathbf{elif}\;x \leq 0.0145:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+128}:\\ \;\;\;\;\frac{1}{x \cdot \left(\left(n - \frac{\mathsf{fma}\left(n, 0.041666666666666664, n \cdot -0.08333333333333333\right)}{x \cdot \left(x \cdot x\right)}\right) + \frac{\mathsf{fma}\left(n, 0.5, \frac{n \cdot -0.08333333333333333}{x}\right)}{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - 1\\ \end{array} \end{array} \]
                                                                    (FPCore (x n)
                                                                     :precision binary64
                                                                     (let* ((t_0 (- 1.0 (pow x (/ 1.0 n)))))
                                                                       (if (<= x 1.85e-187)
                                                                         t_0
                                                                         (if (<= x 1.9e-148)
                                                                           (/ (- (log x)) n)
                                                                           (if (<= x 4.2e-82)
                                                                             (/ (+ (/ (+ -0.5 (/ 0.3333333333333333 x)) x) 1.0) (* x n))
                                                                             (if (<= x 0.0145)
                                                                               t_0
                                                                               (if (<= x 4.6e+128)
                                                                                 (/
                                                                                  1.0
                                                                                  (*
                                                                                   x
                                                                                   (+
                                                                                    (-
                                                                                     n
                                                                                     (/
                                                                                      (fma n 0.041666666666666664 (* n -0.08333333333333333))
                                                                                      (* x (* x x))))
                                                                                    (/ (fma n 0.5 (/ (* n -0.08333333333333333) x)) x))))
                                                                                 (- 1.0 1.0))))))))
                                                                    double code(double x, double n) {
                                                                    	double t_0 = 1.0 - pow(x, (1.0 / n));
                                                                    	double tmp;
                                                                    	if (x <= 1.85e-187) {
                                                                    		tmp = t_0;
                                                                    	} else if (x <= 1.9e-148) {
                                                                    		tmp = -log(x) / n;
                                                                    	} else if (x <= 4.2e-82) {
                                                                    		tmp = (((-0.5 + (0.3333333333333333 / x)) / x) + 1.0) / (x * n);
                                                                    	} else if (x <= 0.0145) {
                                                                    		tmp = t_0;
                                                                    	} else if (x <= 4.6e+128) {
                                                                    		tmp = 1.0 / (x * ((n - (fma(n, 0.041666666666666664, (n * -0.08333333333333333)) / (x * (x * x)))) + (fma(n, 0.5, ((n * -0.08333333333333333) / x)) / x)));
                                                                    	} else {
                                                                    		tmp = 1.0 - 1.0;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    function code(x, n)
                                                                    	t_0 = Float64(1.0 - (x ^ Float64(1.0 / n)))
                                                                    	tmp = 0.0
                                                                    	if (x <= 1.85e-187)
                                                                    		tmp = t_0;
                                                                    	elseif (x <= 1.9e-148)
                                                                    		tmp = Float64(Float64(-log(x)) / n);
                                                                    	elseif (x <= 4.2e-82)
                                                                    		tmp = Float64(Float64(Float64(Float64(-0.5 + Float64(0.3333333333333333 / x)) / x) + 1.0) / Float64(x * n));
                                                                    	elseif (x <= 0.0145)
                                                                    		tmp = t_0;
                                                                    	elseif (x <= 4.6e+128)
                                                                    		tmp = Float64(1.0 / Float64(x * Float64(Float64(n - Float64(fma(n, 0.041666666666666664, Float64(n * -0.08333333333333333)) / Float64(x * Float64(x * x)))) + Float64(fma(n, 0.5, Float64(Float64(n * -0.08333333333333333) / x)) / x))));
                                                                    	else
                                                                    		tmp = Float64(1.0 - 1.0);
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    code[x_, n_] := Block[{t$95$0 = N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.85e-187], t$95$0, If[LessEqual[x, 1.9e-148], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[x, 4.2e-82], N[(N[(N[(N[(-0.5 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.0145], t$95$0, If[LessEqual[x, 4.6e+128], N[(1.0 / N[(x * N[(N[(n - N[(N[(n * 0.041666666666666664 + N[(n * -0.08333333333333333), $MachinePrecision]), $MachinePrecision] / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * 0.5 + N[(N[(n * -0.08333333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - 1.0), $MachinePrecision]]]]]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    t_0 := 1 - {x}^{\left(\frac{1}{n}\right)}\\
                                                                    \mathbf{if}\;x \leq 1.85 \cdot 10^{-187}:\\
                                                                    \;\;\;\;t\_0\\
                                                                    
                                                                    \mathbf{elif}\;x \leq 1.9 \cdot 10^{-148}:\\
                                                                    \;\;\;\;\frac{-\log x}{n}\\
                                                                    
                                                                    \mathbf{elif}\;x \leq 4.2 \cdot 10^{-82}:\\
                                                                    \;\;\;\;\frac{\frac{-0.5 + \frac{0.3333333333333333}{x}}{x} + 1}{x \cdot n}\\
                                                                    
                                                                    \mathbf{elif}\;x \leq 0.0145:\\
                                                                    \;\;\;\;t\_0\\
                                                                    
                                                                    \mathbf{elif}\;x \leq 4.6 \cdot 10^{+128}:\\
                                                                    \;\;\;\;\frac{1}{x \cdot \left(\left(n - \frac{\mathsf{fma}\left(n, 0.041666666666666664, n \cdot -0.08333333333333333\right)}{x \cdot \left(x \cdot x\right)}\right) + \frac{\mathsf{fma}\left(n, 0.5, \frac{n \cdot -0.08333333333333333}{x}\right)}{x}\right)}\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;1 - 1\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 5 regimes
                                                                    2. if x < 1.85000000000000005e-187 or 4.2000000000000001e-82 < x < 0.0145000000000000007

                                                                      1. Initial program 52.4%

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

                                                                        \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                      4. Step-by-step derivation
                                                                        1. Applied rewrites50.4%

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

                                                                        if 1.85000000000000005e-187 < x < 1.90000000000000007e-148

                                                                        1. Initial program 24.7%

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

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

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

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

                                                                            \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                                                          4. lower-log.f6465.6

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

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

                                                                          \[\leadsto \frac{-1 \cdot \log x}{n} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites65.6%

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

                                                                          if 1.90000000000000007e-148 < x < 4.2000000000000001e-82

                                                                          1. Initial program 40.5%

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

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

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

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

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

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

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

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

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

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

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

                                                                                \[\leadsto \frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x \cdot n} \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites66.3%

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

                                                                                if 0.0145000000000000007 < x < 4.59999999999999996e128

                                                                                1. Initial program 32.7%

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

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

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

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

                                                                                    \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                                                                  4. lower-log.f6436.3

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

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

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

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

                                                                                    \[\leadsto \frac{1}{x \cdot \color{blue}{\left(\left(n - \frac{\mathsf{fma}\left(n, 0.041666666666666664, n \cdot -0.08333333333333333\right)}{x \cdot \left(x \cdot x\right)}\right) + \frac{\mathsf{fma}\left(n, 0.5, \frac{n \cdot -0.08333333333333333}{x}\right)}{x}\right)}} \]

                                                                                  if 4.59999999999999996e128 < x

                                                                                  1. Initial program 86.5%

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

                                                                                    \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                  4. Step-by-step derivation
                                                                                    1. Applied rewrites58.9%

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

                                                                                      \[\leadsto 1 - \color{blue}{1} \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites86.5%

                                                                                        \[\leadsto 1 - \color{blue}{1} \]
                                                                                    4. Recombined 5 regimes into one program.
                                                                                    5. Final simplification68.4%

                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.85 \cdot 10^{-187}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-148}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-82}:\\ \;\;\;\;\frac{\frac{-0.5 + \frac{0.3333333333333333}{x}}{x} + 1}{x \cdot n}\\ \mathbf{elif}\;x \leq 0.0145:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+128}:\\ \;\;\;\;\frac{1}{x \cdot \left(\left(n - \frac{\mathsf{fma}\left(n, 0.041666666666666664, n \cdot -0.08333333333333333\right)}{x \cdot \left(x \cdot x\right)}\right) + \frac{\mathsf{fma}\left(n, 0.5, \frac{n \cdot -0.08333333333333333}{x}\right)}{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - 1\\ \end{array} \]
                                                                                    6. Add Preprocessing

                                                                                    Alternative 12: 59.6% accurate, 1.7× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.9 \cdot 10^{-148}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{-0.5 + \frac{0.3333333333333333}{x}}{x} + 1}{x \cdot n}\\ \mathbf{elif}\;x \leq 0.5:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+128}:\\ \;\;\;\;\frac{1}{x \cdot \left(\left(n - \frac{\mathsf{fma}\left(n, 0.041666666666666664, n \cdot -0.08333333333333333\right)}{x \cdot \left(x \cdot x\right)}\right) + \frac{\mathsf{fma}\left(n, 0.5, \frac{n \cdot -0.08333333333333333}{x}\right)}{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - 1\\ \end{array} \end{array} \]
                                                                                    (FPCore (x n)
                                                                                     :precision binary64
                                                                                     (if (<= x 1.9e-148)
                                                                                       (/ (- (log x)) n)
                                                                                       (if (<= x 3.2e-71)
                                                                                         (/ (+ (/ (+ -0.5 (/ 0.3333333333333333 x)) x) 1.0) (* x n))
                                                                                         (if (<= x 0.5)
                                                                                           (/ (- x (log x)) n)
                                                                                           (if (<= x 4.6e+128)
                                                                                             (/
                                                                                              1.0
                                                                                              (*
                                                                                               x
                                                                                               (+
                                                                                                (-
                                                                                                 n
                                                                                                 (/
                                                                                                  (fma n 0.041666666666666664 (* n -0.08333333333333333))
                                                                                                  (* x (* x x))))
                                                                                                (/ (fma n 0.5 (/ (* n -0.08333333333333333) x)) x))))
                                                                                             (- 1.0 1.0))))))
                                                                                    double code(double x, double n) {
                                                                                    	double tmp;
                                                                                    	if (x <= 1.9e-148) {
                                                                                    		tmp = -log(x) / n;
                                                                                    	} else if (x <= 3.2e-71) {
                                                                                    		tmp = (((-0.5 + (0.3333333333333333 / x)) / x) + 1.0) / (x * n);
                                                                                    	} else if (x <= 0.5) {
                                                                                    		tmp = (x - log(x)) / n;
                                                                                    	} else if (x <= 4.6e+128) {
                                                                                    		tmp = 1.0 / (x * ((n - (fma(n, 0.041666666666666664, (n * -0.08333333333333333)) / (x * (x * x)))) + (fma(n, 0.5, ((n * -0.08333333333333333) / x)) / x)));
                                                                                    	} else {
                                                                                    		tmp = 1.0 - 1.0;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    function code(x, n)
                                                                                    	tmp = 0.0
                                                                                    	if (x <= 1.9e-148)
                                                                                    		tmp = Float64(Float64(-log(x)) / n);
                                                                                    	elseif (x <= 3.2e-71)
                                                                                    		tmp = Float64(Float64(Float64(Float64(-0.5 + Float64(0.3333333333333333 / x)) / x) + 1.0) / Float64(x * n));
                                                                                    	elseif (x <= 0.5)
                                                                                    		tmp = Float64(Float64(x - log(x)) / n);
                                                                                    	elseif (x <= 4.6e+128)
                                                                                    		tmp = Float64(1.0 / Float64(x * Float64(Float64(n - Float64(fma(n, 0.041666666666666664, Float64(n * -0.08333333333333333)) / Float64(x * Float64(x * x)))) + Float64(fma(n, 0.5, Float64(Float64(n * -0.08333333333333333) / x)) / x))));
                                                                                    	else
                                                                                    		tmp = Float64(1.0 - 1.0);
                                                                                    	end
                                                                                    	return tmp
                                                                                    end
                                                                                    
                                                                                    code[x_, n_] := If[LessEqual[x, 1.9e-148], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[x, 3.2e-71], N[(N[(N[(N[(-0.5 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.5], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 4.6e+128], N[(1.0 / N[(x * N[(N[(n - N[(N[(n * 0.041666666666666664 + N[(n * -0.08333333333333333), $MachinePrecision]), $MachinePrecision] / N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * 0.5 + N[(N[(n * -0.08333333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - 1.0), $MachinePrecision]]]]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    \mathbf{if}\;x \leq 1.9 \cdot 10^{-148}:\\
                                                                                    \;\;\;\;\frac{-\log x}{n}\\
                                                                                    
                                                                                    \mathbf{elif}\;x \leq 3.2 \cdot 10^{-71}:\\
                                                                                    \;\;\;\;\frac{\frac{-0.5 + \frac{0.3333333333333333}{x}}{x} + 1}{x \cdot n}\\
                                                                                    
                                                                                    \mathbf{elif}\;x \leq 0.5:\\
                                                                                    \;\;\;\;\frac{x - \log x}{n}\\
                                                                                    
                                                                                    \mathbf{elif}\;x \leq 4.6 \cdot 10^{+128}:\\
                                                                                    \;\;\;\;\frac{1}{x \cdot \left(\left(n - \frac{\mathsf{fma}\left(n, 0.041666666666666664, n \cdot -0.08333333333333333\right)}{x \cdot \left(x \cdot x\right)}\right) + \frac{\mathsf{fma}\left(n, 0.5, \frac{n \cdot -0.08333333333333333}{x}\right)}{x}\right)}\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;1 - 1\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 5 regimes
                                                                                    2. if x < 1.90000000000000007e-148

                                                                                      1. Initial program 46.7%

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

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

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

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

                                                                                          \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                                                                        4. lower-log.f6448.6

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

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

                                                                                        \[\leadsto \frac{-1 \cdot \log x}{n} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites48.6%

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

                                                                                        if 1.90000000000000007e-148 < x < 3.1999999999999999e-71

                                                                                        1. Initial program 45.2%

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

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

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x \cdot n} \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites65.2%

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

                                                                                              if 3.1999999999999999e-71 < x < 0.5

                                                                                              1. Initial program 45.9%

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

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

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

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

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

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

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

                                                                                                \[\leadsto \frac{x - \log x}{n} \]
                                                                                              7. Step-by-step derivation
                                                                                                1. Applied rewrites41.8%

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

                                                                                                if 0.5 < x < 4.59999999999999996e128

                                                                                                1. Initial program 33.2%

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

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

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

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

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

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

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

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

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

                                                                                                    \[\leadsto \frac{1}{x \cdot \color{blue}{\left(\left(n - \frac{\mathsf{fma}\left(n, 0.041666666666666664, n \cdot -0.08333333333333333\right)}{x \cdot \left(x \cdot x\right)}\right) + \frac{\mathsf{fma}\left(n, 0.5, \frac{n \cdot -0.08333333333333333}{x}\right)}{x}\right)}} \]

                                                                                                  if 4.59999999999999996e128 < x

                                                                                                  1. Initial program 86.5%

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

                                                                                                    \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                                  4. Step-by-step derivation
                                                                                                    1. Applied rewrites58.9%

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

                                                                                                      \[\leadsto 1 - \color{blue}{1} \]
                                                                                                    3. Step-by-step derivation
                                                                                                      1. Applied rewrites86.5%

                                                                                                        \[\leadsto 1 - \color{blue}{1} \]
                                                                                                    4. Recombined 5 regimes into one program.
                                                                                                    5. Final simplification65.8%

                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.9 \cdot 10^{-148}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{-0.5 + \frac{0.3333333333333333}{x}}{x} + 1}{x \cdot n}\\ \mathbf{elif}\;x \leq 0.5:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+128}:\\ \;\;\;\;\frac{1}{x \cdot \left(\left(n - \frac{\mathsf{fma}\left(n, 0.041666666666666664, n \cdot -0.08333333333333333\right)}{x \cdot \left(x \cdot x\right)}\right) + \frac{\mathsf{fma}\left(n, 0.5, \frac{n \cdot -0.08333333333333333}{x}\right)}{x}\right)}\\ \mathbf{else}:\\ \;\;\;\;1 - 1\\ \end{array} \]
                                                                                                    6. Add Preprocessing

                                                                                                    Alternative 13: 58.8% accurate, 1.7× speedup?

                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-\log x}{n}\\ \mathbf{if}\;x \leq 1.9 \cdot 10^{-148}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{-0.5 + \frac{0.3333333333333333}{x}}{x} + 1}{x \cdot n}\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+128}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;1 - 1\\ \end{array} \end{array} \]
                                                                                                    (FPCore (x n)
                                                                                                     :precision binary64
                                                                                                     (let* ((t_0 (/ (- (log x)) n)))
                                                                                                       (if (<= x 1.9e-148)
                                                                                                         t_0
                                                                                                         (if (<= x 3.2e-71)
                                                                                                           (/ (+ (/ (+ -0.5 (/ 0.3333333333333333 x)) x) 1.0) (* x n))
                                                                                                           (if (<= x 2.7e-16)
                                                                                                             t_0
                                                                                                             (if (<= x 4.6e+128)
                                                                                                               (/
                                                                                                                (+ (/ 1.0 n) (/ (- (/ 0.3333333333333333 (* x n)) (/ 0.5 n)) x))
                                                                                                                x)
                                                                                                               (- 1.0 1.0)))))))
                                                                                                    double code(double x, double n) {
                                                                                                    	double t_0 = -log(x) / n;
                                                                                                    	double tmp;
                                                                                                    	if (x <= 1.9e-148) {
                                                                                                    		tmp = t_0;
                                                                                                    	} else if (x <= 3.2e-71) {
                                                                                                    		tmp = (((-0.5 + (0.3333333333333333 / x)) / x) + 1.0) / (x * n);
                                                                                                    	} else if (x <= 2.7e-16) {
                                                                                                    		tmp = t_0;
                                                                                                    	} else if (x <= 4.6e+128) {
                                                                                                    		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / x;
                                                                                                    	} else {
                                                                                                    		tmp = 1.0 - 1.0;
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    real(8) function code(x, n)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(8), intent (in) :: n
                                                                                                        real(8) :: t_0
                                                                                                        real(8) :: tmp
                                                                                                        t_0 = -log(x) / n
                                                                                                        if (x <= 1.9d-148) then
                                                                                                            tmp = t_0
                                                                                                        else if (x <= 3.2d-71) then
                                                                                                            tmp = ((((-0.5d0) + (0.3333333333333333d0 / x)) / x) + 1.0d0) / (x * n)
                                                                                                        else if (x <= 2.7d-16) then
                                                                                                            tmp = t_0
                                                                                                        else if (x <= 4.6d+128) then
                                                                                                            tmp = ((1.0d0 / n) + (((0.3333333333333333d0 / (x * n)) - (0.5d0 / n)) / x)) / x
                                                                                                        else
                                                                                                            tmp = 1.0d0 - 1.0d0
                                                                                                        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 <= 1.9e-148) {
                                                                                                    		tmp = t_0;
                                                                                                    	} else if (x <= 3.2e-71) {
                                                                                                    		tmp = (((-0.5 + (0.3333333333333333 / x)) / x) + 1.0) / (x * n);
                                                                                                    	} else if (x <= 2.7e-16) {
                                                                                                    		tmp = t_0;
                                                                                                    	} else if (x <= 4.6e+128) {
                                                                                                    		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / x;
                                                                                                    	} else {
                                                                                                    		tmp = 1.0 - 1.0;
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    def code(x, n):
                                                                                                    	t_0 = -math.log(x) / n
                                                                                                    	tmp = 0
                                                                                                    	if x <= 1.9e-148:
                                                                                                    		tmp = t_0
                                                                                                    	elif x <= 3.2e-71:
                                                                                                    		tmp = (((-0.5 + (0.3333333333333333 / x)) / x) + 1.0) / (x * n)
                                                                                                    	elif x <= 2.7e-16:
                                                                                                    		tmp = t_0
                                                                                                    	elif x <= 4.6e+128:
                                                                                                    		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / x
                                                                                                    	else:
                                                                                                    		tmp = 1.0 - 1.0
                                                                                                    	return tmp
                                                                                                    
                                                                                                    function code(x, n)
                                                                                                    	t_0 = Float64(Float64(-log(x)) / n)
                                                                                                    	tmp = 0.0
                                                                                                    	if (x <= 1.9e-148)
                                                                                                    		tmp = t_0;
                                                                                                    	elseif (x <= 3.2e-71)
                                                                                                    		tmp = Float64(Float64(Float64(Float64(-0.5 + Float64(0.3333333333333333 / x)) / x) + 1.0) / Float64(x * n));
                                                                                                    	elseif (x <= 2.7e-16)
                                                                                                    		tmp = t_0;
                                                                                                    	elseif (x <= 4.6e+128)
                                                                                                    		tmp = Float64(Float64(Float64(1.0 / n) + Float64(Float64(Float64(0.3333333333333333 / Float64(x * n)) - Float64(0.5 / n)) / x)) / x);
                                                                                                    	else
                                                                                                    		tmp = Float64(1.0 - 1.0);
                                                                                                    	end
                                                                                                    	return tmp
                                                                                                    end
                                                                                                    
                                                                                                    function tmp_2 = code(x, n)
                                                                                                    	t_0 = -log(x) / n;
                                                                                                    	tmp = 0.0;
                                                                                                    	if (x <= 1.9e-148)
                                                                                                    		tmp = t_0;
                                                                                                    	elseif (x <= 3.2e-71)
                                                                                                    		tmp = (((-0.5 + (0.3333333333333333 / x)) / x) + 1.0) / (x * n);
                                                                                                    	elseif (x <= 2.7e-16)
                                                                                                    		tmp = t_0;
                                                                                                    	elseif (x <= 4.6e+128)
                                                                                                    		tmp = ((1.0 / n) + (((0.3333333333333333 / (x * n)) - (0.5 / n)) / x)) / x;
                                                                                                    	else
                                                                                                    		tmp = 1.0 - 1.0;
                                                                                                    	end
                                                                                                    	tmp_2 = tmp;
                                                                                                    end
                                                                                                    
                                                                                                    code[x_, n_] := Block[{t$95$0 = N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision]}, If[LessEqual[x, 1.9e-148], t$95$0, If[LessEqual[x, 3.2e-71], N[(N[(N[(N[(-0.5 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + 1.0), $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-16], t$95$0, If[LessEqual[x, 4.6e+128], 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], N[(1.0 - 1.0), $MachinePrecision]]]]]]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    t_0 := \frac{-\log x}{n}\\
                                                                                                    \mathbf{if}\;x \leq 1.9 \cdot 10^{-148}:\\
                                                                                                    \;\;\;\;t\_0\\
                                                                                                    
                                                                                                    \mathbf{elif}\;x \leq 3.2 \cdot 10^{-71}:\\
                                                                                                    \;\;\;\;\frac{\frac{-0.5 + \frac{0.3333333333333333}{x}}{x} + 1}{x \cdot n}\\
                                                                                                    
                                                                                                    \mathbf{elif}\;x \leq 2.7 \cdot 10^{-16}:\\
                                                                                                    \;\;\;\;t\_0\\
                                                                                                    
                                                                                                    \mathbf{elif}\;x \leq 4.6 \cdot 10^{+128}:\\
                                                                                                    \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x}\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;1 - 1\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 4 regimes
                                                                                                    2. if x < 1.90000000000000007e-148 or 3.1999999999999999e-71 < x < 2.69999999999999999e-16

                                                                                                      1. Initial program 44.7%

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

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

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

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

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

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

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

                                                                                                        \[\leadsto \frac{-1 \cdot \log x}{n} \]
                                                                                                      7. Step-by-step derivation
                                                                                                        1. Applied rewrites48.4%

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

                                                                                                        if 1.90000000000000007e-148 < x < 3.1999999999999999e-71

                                                                                                        1. Initial program 45.2%

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

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

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

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

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

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

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

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

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

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

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

                                                                                                              \[\leadsto \frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x \cdot n} \]
                                                                                                            3. Step-by-step derivation
                                                                                                              1. Applied rewrites65.2%

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

                                                                                                              if 2.69999999999999999e-16 < x < 4.59999999999999996e128

                                                                                                              1. Initial program 38.1%

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

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

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

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

                                                                                                                  \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                                                                                                4. lower-log.f6434.7

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

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

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

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

                                                                                                                  \[\leadsto \frac{-1 \cdot \frac{\frac{1}{2} \cdot \frac{1}{n} - \frac{1}{3} \cdot \frac{1}{n \cdot x}}{x} + \frac{1}{n}}{x} \]
                                                                                                                3. Step-by-step derivation
                                                                                                                  1. Applied rewrites73.8%

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

                                                                                                                  if 4.59999999999999996e128 < x

                                                                                                                  1. Initial program 86.5%

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

                                                                                                                    \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                                                  4. Step-by-step derivation
                                                                                                                    1. Applied rewrites58.9%

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

                                                                                                                      \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                    3. Step-by-step derivation
                                                                                                                      1. Applied rewrites86.5%

                                                                                                                        \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                    4. Recombined 4 regimes into one program.
                                                                                                                    5. Final simplification65.8%

                                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.9 \cdot 10^{-148}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{-0.5 + \frac{0.3333333333333333}{x}}{x} + 1}{x \cdot n}\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-16}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+128}:\\ \;\;\;\;\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;1 - 1\\ \end{array} \]
                                                                                                                    6. Add Preprocessing

                                                                                                                    Alternative 14: 50.2% accurate, 3.2× speedup?

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

                                                                                                                      1. Initial program 42.7%

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

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

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

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

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

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

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

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

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

                                                                                                                          \[\leadsto \frac{-1 \cdot \frac{\frac{1}{2} \cdot \frac{1}{n} - \frac{1}{3} \cdot \frac{1}{n \cdot x}}{x} + \frac{1}{n}}{x} \]
                                                                                                                        3. Step-by-step derivation
                                                                                                                          1. Applied rewrites47.6%

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

                                                                                                                          if 4.59999999999999996e128 < x

                                                                                                                          1. Initial program 86.5%

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

                                                                                                                            \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                                                          4. Step-by-step derivation
                                                                                                                            1. Applied rewrites58.9%

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

                                                                                                                              \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                            3. Step-by-step derivation
                                                                                                                              1. Applied rewrites86.5%

                                                                                                                                \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                            4. Recombined 2 regimes into one program.
                                                                                                                            5. Final simplification57.8%

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

                                                                                                                            Alternative 15: 50.0% accurate, 4.5× speedup?

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

                                                                                                                              1. Initial program 42.7%

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                                    \[\leadsto \frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x \cdot n} \]
                                                                                                                                  3. Step-by-step derivation
                                                                                                                                    1. Applied rewrites47.6%

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

                                                                                                                                    if 4.59999999999999996e128 < x

                                                                                                                                    1. Initial program 86.5%

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

                                                                                                                                      \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                                                                    4. Step-by-step derivation
                                                                                                                                      1. Applied rewrites58.9%

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

                                                                                                                                        \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                                      3. Step-by-step derivation
                                                                                                                                        1. Applied rewrites86.5%

                                                                                                                                          \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                                      4. Recombined 2 regimes into one program.
                                                                                                                                      5. Final simplification57.8%

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

                                                                                                                                      Alternative 16: 45.9% accurate, 5.8× speedup?

                                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -0.0075:\\ \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\ \mathbf{elif}\;n \leq -1.4 \cdot 10^{-171}:\\ \;\;\;\;1 - 1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n}}{x}\\ \end{array} \end{array} \]
                                                                                                                                      (FPCore (x n)
                                                                                                                                       :precision binary64
                                                                                                                                       (if (<= n -0.0075)
                                                                                                                                         (/ 1.0 (* x (fma 0.5 (/ n x) n)))
                                                                                                                                         (if (<= n -1.4e-171) (- 1.0 1.0) (/ (/ 1.0 n) x))))
                                                                                                                                      double code(double x, double n) {
                                                                                                                                      	double tmp;
                                                                                                                                      	if (n <= -0.0075) {
                                                                                                                                      		tmp = 1.0 / (x * fma(0.5, (n / x), n));
                                                                                                                                      	} else if (n <= -1.4e-171) {
                                                                                                                                      		tmp = 1.0 - 1.0;
                                                                                                                                      	} else {
                                                                                                                                      		tmp = (1.0 / n) / x;
                                                                                                                                      	}
                                                                                                                                      	return tmp;
                                                                                                                                      }
                                                                                                                                      
                                                                                                                                      function code(x, n)
                                                                                                                                      	tmp = 0.0
                                                                                                                                      	if (n <= -0.0075)
                                                                                                                                      		tmp = Float64(1.0 / Float64(x * fma(0.5, Float64(n / x), n)));
                                                                                                                                      	elseif (n <= -1.4e-171)
                                                                                                                                      		tmp = Float64(1.0 - 1.0);
                                                                                                                                      	else
                                                                                                                                      		tmp = Float64(Float64(1.0 / n) / x);
                                                                                                                                      	end
                                                                                                                                      	return tmp
                                                                                                                                      end
                                                                                                                                      
                                                                                                                                      code[x_, n_] := If[LessEqual[n, -0.0075], N[(1.0 / N[(x * N[(0.5 * N[(n / x), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -1.4e-171], N[(1.0 - 1.0), $MachinePrecision], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision]]]
                                                                                                                                      
                                                                                                                                      \begin{array}{l}
                                                                                                                                      
                                                                                                                                      \\
                                                                                                                                      \begin{array}{l}
                                                                                                                                      \mathbf{if}\;n \leq -0.0075:\\
                                                                                                                                      \;\;\;\;\frac{1}{x \cdot \mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}\\
                                                                                                                                      
                                                                                                                                      \mathbf{elif}\;n \leq -1.4 \cdot 10^{-171}:\\
                                                                                                                                      \;\;\;\;1 - 1\\
                                                                                                                                      
                                                                                                                                      \mathbf{else}:\\
                                                                                                                                      \;\;\;\;\frac{\frac{1}{n}}{x}\\
                                                                                                                                      
                                                                                                                                      
                                                                                                                                      \end{array}
                                                                                                                                      \end{array}
                                                                                                                                      
                                                                                                                                      Derivation
                                                                                                                                      1. Split input into 3 regimes
                                                                                                                                      2. if n < -0.0074999999999999997

                                                                                                                                        1. Initial program 37.3%

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

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

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

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

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

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

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

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

                                                                                                                                            \[\leadsto \frac{1}{x \cdot \color{blue}{\left(n + \frac{1}{2} \cdot \frac{n}{x}\right)}} \]
                                                                                                                                          3. Step-by-step derivation
                                                                                                                                            1. Applied rewrites59.9%

                                                                                                                                              \[\leadsto \frac{1}{x \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{n}{x}, n\right)}} \]

                                                                                                                                            if -0.0074999999999999997 < n < -1.40000000000000011e-171

                                                                                                                                            1. Initial program 100.0%

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

                                                                                                                                              \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                                                                            4. Step-by-step derivation
                                                                                                                                              1. Applied rewrites47.4%

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

                                                                                                                                                \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                1. Applied rewrites55.0%

                                                                                                                                                  \[\leadsto 1 - \color{blue}{1} \]

                                                                                                                                                if -1.40000000000000011e-171 < n

                                                                                                                                                1. Initial program 53.7%

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

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

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

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

                                                                                                                                                    \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(x\right)} - \log x}{n} \]
                                                                                                                                                  4. lower-log.f6441.3

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

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

                                                                                                                                                  \[\leadsto \frac{\left(\frac{1}{n} + \frac{1}{3} \cdot \frac{1}{n \cdot {x}^{2}}\right) - \left(\frac{\frac{1}{2}}{n \cdot x} + \frac{1}{4} \cdot \frac{1}{n \cdot {x}^{3}}\right)}{\color{blue}{x}} \]
                                                                                                                                                7. Step-by-step derivation
                                                                                                                                                  1. Applied rewrites29.0%

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

                                                                                                                                                    \[\leadsto \frac{\frac{1}{n}}{x} \]
                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                    1. Applied rewrites52.4%

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

                                                                                                                                                  Alternative 17: 44.5% accurate, 8.0× speedup?

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

                                                                                                                                                    1. Initial program 42.7%

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

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

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

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

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

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

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

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

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

                                                                                                                                                        \[\leadsto \frac{\frac{1}{n}}{x} \]
                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                        1. Applied rewrites41.8%

                                                                                                                                                          \[\leadsto \frac{\frac{1}{n}}{x} \]

                                                                                                                                                        if 4.59999999999999996e128 < x

                                                                                                                                                        1. Initial program 86.5%

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

                                                                                                                                                          \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                          1. Applied rewrites58.9%

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

                                                                                                                                                            \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                            1. Applied rewrites86.5%

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

                                                                                                                                                          Alternative 18: 44.3% accurate, 10.0× speedup?

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

                                                                                                                                                            1. Initial program 42.7%

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

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

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

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

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

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

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

                                                                                                                                                              \[\leadsto \frac{1}{\color{blue}{n \cdot x}} \]
                                                                                                                                                            7. Step-by-step derivation
                                                                                                                                                              1. Applied rewrites41.8%

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

                                                                                                                                                              if 4.59999999999999996e128 < x

                                                                                                                                                              1. Initial program 86.5%

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

                                                                                                                                                                \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                                                                                              4. Step-by-step derivation
                                                                                                                                                                1. Applied rewrites58.9%

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

                                                                                                                                                                  \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                  1. Applied rewrites86.5%

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

                                                                                                                                                                Alternative 19: 31.9% accurate, 57.8× speedup?

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

                                                                                                                                                                  \[\leadsto \color{blue}{1} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                  1. Applied rewrites42.8%

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

                                                                                                                                                                    \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                    1. Applied rewrites31.0%

                                                                                                                                                                      \[\leadsto 1 - \color{blue}{1} \]
                                                                                                                                                                    2. Add Preprocessing

                                                                                                                                                                    Reproduce

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