2nthrt (problem 3.4.6)

Percentage Accurate: 53.2% → 92.6%
Time: 23.7s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 53.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: 92.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 39.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1 < x

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 79.1% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left({n}^{-1}\right)}\\ t_1 := {\left(x + 1\right)}^{\left({n}^{-1}\right)} - t\_0\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-7} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;1 - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\log \left(\frac{1 + x}{x}\right)}{n}\\ \end{array} \end{array} \]
    (FPCore (x n)
     :precision binary64
     (let* ((t_0 (pow x (pow n -1.0))) (t_1 (- (pow (+ x 1.0) (pow n -1.0)) t_0)))
       (if (or (<= t_1 -5e-7) (not (<= t_1 0.0)))
         (- 1.0 t_0)
         (/ (log (/ (+ 1.0 x) x)) n))))
    double code(double x, double n) {
    	double t_0 = pow(x, pow(n, -1.0));
    	double t_1 = pow((x + 1.0), pow(n, -1.0)) - t_0;
    	double tmp;
    	if ((t_1 <= -5e-7) || !(t_1 <= 0.0)) {
    		tmp = 1.0 - t_0;
    	} else {
    		tmp = log(((1.0 + x) / x)) / n;
    	}
    	return tmp;
    }
    
    real(8) function code(x, n)
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: t_0
        real(8) :: t_1
        real(8) :: tmp
        t_0 = x ** (n ** (-1.0d0))
        t_1 = ((x + 1.0d0) ** (n ** (-1.0d0))) - t_0
        if ((t_1 <= (-5d-7)) .or. (.not. (t_1 <= 0.0d0))) then
            tmp = 1.0d0 - t_0
        else
            tmp = log(((1.0d0 + x) / x)) / n
        end if
        code = tmp
    end function
    
    public static double code(double x, double n) {
    	double t_0 = Math.pow(x, Math.pow(n, -1.0));
    	double t_1 = Math.pow((x + 1.0), Math.pow(n, -1.0)) - t_0;
    	double tmp;
    	if ((t_1 <= -5e-7) || !(t_1 <= 0.0)) {
    		tmp = 1.0 - t_0;
    	} else {
    		tmp = Math.log(((1.0 + x) / x)) / n;
    	}
    	return tmp;
    }
    
    def code(x, n):
    	t_0 = math.pow(x, math.pow(n, -1.0))
    	t_1 = math.pow((x + 1.0), math.pow(n, -1.0)) - t_0
    	tmp = 0
    	if (t_1 <= -5e-7) or not (t_1 <= 0.0):
    		tmp = 1.0 - t_0
    	else:
    		tmp = math.log(((1.0 + x) / x)) / n
    	return tmp
    
    function code(x, n)
    	t_0 = x ^ (n ^ -1.0)
    	t_1 = Float64((Float64(x + 1.0) ^ (n ^ -1.0)) - t_0)
    	tmp = 0.0
    	if ((t_1 <= -5e-7) || !(t_1 <= 0.0))
    		tmp = Float64(1.0 - t_0);
    	else
    		tmp = Float64(log(Float64(Float64(1.0 + x) / x)) / n);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, n)
    	t_0 = x ^ (n ^ -1.0);
    	t_1 = ((x + 1.0) ^ (n ^ -1.0)) - t_0;
    	tmp = 0.0;
    	if ((t_1 <= -5e-7) || ~((t_1 <= 0.0)))
    		tmp = 1.0 - t_0;
    	else
    		tmp = log(((1.0 + x) / x)) / n;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, n_] := Block[{t$95$0 = N[Power[x, N[Power[n, -1.0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(x + 1.0), $MachinePrecision], N[Power[n, -1.0], $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e-7], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(1.0 - t$95$0), $MachinePrecision], N[(N[Log[N[(N[(1.0 + x), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := {x}^{\left({n}^{-1}\right)}\\
    t_1 := {\left(x + 1\right)}^{\left({n}^{-1}\right)} - t\_0\\
    \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-7} \lor \neg \left(t\_1 \leq 0\right):\\
    \;\;\;\;1 - t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\log \left(\frac{1 + x}{x}\right)}{n}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 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))) < -4.99999999999999977e-7 or 0.0 < (-.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 74.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 rewrites72.1%

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

        if -4.99999999999999977e-7 < (-.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.0

        1. Initial program 45.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.f6479.0

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

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

            \[\leadsto \frac{\log \left(\frac{1 + x}{x}\right)}{n} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification77.6%

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

        Alternative 3: 82.3% accurate, 0.4× speedup?

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

          1. Initial program 98.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. associate-/l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{{\left(x \cdot x\right)}^{\left(\frac{0.5}{n}\right)}}{x}}{n} \]

            if -1 < (/.f64 #s(literal 1 binary64) n) < 4.99999999999999954e-22

            1. Initial program 32.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.f6477.6

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

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

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

              if 4.99999999999999954e-22 < (/.f64 #s(literal 1 binary64) n)

              1. Initial program 58.4%

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

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

                \[\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 \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)} - {x}^{\left(\frac{1}{n}\right)} \]
              6. 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)} - {x}^{\left(\frac{1}{n}\right)} \]
                2. *-commutativeN/A

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}, x, 1\right)} - {x}^{\left(\frac{1}{n}\right)} \]
              7. Applied rewrites74.9%

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

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

            Alternative 4: 82.0% accurate, 0.4× speedup?

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

              1. Initial program 98.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. associate-/l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\frac{{\left(x \cdot x\right)}^{\left(\frac{0.5}{n}\right)}}{x}}{n} \]

                if -1 < (/.f64 #s(literal 1 binary64) n) < 4.99999999999999954e-22

                1. Initial program 32.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.f6477.6

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

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

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

                  if 4.99999999999999954e-22 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999999e185

                  1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

                  1. Initial program 27.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.f646.3

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

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

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

                      \[\leadsto \frac{\frac{n}{x}}{\color{blue}{n} \cdot n} \]
                    3. Step-by-step derivation
                      1. Applied rewrites78.5%

                        \[\leadsto \frac{\frac{n}{x}}{\color{blue}{n} \cdot n} \]
                    4. Recombined 4 regimes into one program.
                    5. Final simplification83.8%

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

                    Alternative 5: 82.0% accurate, 0.4× speedup?

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

                      1. Initial program 98.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. associate-/l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if -1 < (/.f64 #s(literal 1 binary64) n) < 4.99999999999999954e-22

                          1. Initial program 32.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.f6477.6

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

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

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

                            if 4.99999999999999954e-22 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999999e185

                            1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

                            1. Initial program 27.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.f646.3

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

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

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

                                \[\leadsto \frac{\frac{n}{x}}{\color{blue}{n} \cdot n} \]
                              3. Step-by-step derivation
                                1. Applied rewrites78.5%

                                  \[\leadsto \frac{\frac{n}{x}}{\color{blue}{n} \cdot n} \]
                              4. Recombined 4 regimes into one program.
                              5. Final simplification83.8%

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

                              Alternative 6: 82.0% accurate, 0.4× speedup?

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

                                1. Initial program 98.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. associate-/l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if -1 < (/.f64 #s(literal 1 binary64) n) < 4.99999999999999954e-22

                                    1. Initial program 32.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.f6477.6

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

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

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

                                      if 4.99999999999999954e-22 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999999e185

                                      1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        1. Initial program 27.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.f646.3

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

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

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

                                            \[\leadsto \frac{\frac{n}{x}}{\color{blue}{n} \cdot n} \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites78.5%

                                              \[\leadsto \frac{\frac{n}{x}}{\color{blue}{n} \cdot n} \]
                                          4. Recombined 4 regimes into one program.
                                          5. Final simplification83.8%

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

                                          Alternative 7: 82.1% accurate, 0.4× speedup?

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

                                            1. Initial program 98.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. associate-/l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                if -1 < (/.f64 #s(literal 1 binary64) n) < 4.99999999999999954e-22

                                                1. Initial program 32.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.f6477.6

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

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

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

                                                  if 4.99999999999999954e-22 < (/.f64 #s(literal 1 binary64) n) < 1.9999999999999999e163

                                                  1. Initial program 84.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 rewrites80.1%

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

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

                                                    1. Initial program 29.8%

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

                                                      \[\leadsto \color{blue}{\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.1

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

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

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

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

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

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

                                                      Alternative 8: 51.2% accurate, 0.7× speedup?

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

                                                        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 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.f6452.3

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

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

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

                                                            \[\leadsto \frac{\log 1}{n} \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites61.5%

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

                                                            if -2e7 < (/.f64 #s(literal 1 binary64) n) < 4e129

                                                            1. Initial program 38.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.f6469.6

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

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

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

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

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

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

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

                                                                  1. Initial program 34.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.f645.8

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

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

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

                                                                      \[\leadsto \frac{\frac{n}{x}}{\color{blue}{n} \cdot n} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites61.6%

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

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

                                                                    Alternative 9: 48.4% accurate, 0.9× speedup?

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

                                                                      1. Initial program 46.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.f6452.8

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

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

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

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

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

                                                                        if 3.50000000000000016e208 < x

                                                                        1. Initial program 97.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{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n} + \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}} \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right)}{x}}{x}} \]
                                                                        4. Step-by-step derivation
                                                                          1. lower-/.f64N/A

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

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

                                                                          \[\leadsto \frac{\frac{1 - \frac{1}{2} \cdot \frac{1}{x}}{n}}{x} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites70.9%

                                                                            \[\leadsto \frac{\frac{1 - \frac{0.5}{x}}{n}}{x} \]
                                                                          2. Taylor expanded in x around 0

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

                                                                              \[\leadsto \frac{\frac{\frac{-0.5}{x}}{n}}{x} \]
                                                                          4. Recombined 2 regimes into one program.
                                                                          5. Final simplification46.8%

                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.5 \cdot 10^{+208}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{{x}^{-1}}{n}, \frac{0.3333333333333333}{x} - 0.5, {n}^{-1}\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{-0.5}{x}}{n}}{x}\\ \end{array} \]
                                                                          6. Add Preprocessing

                                                                          Alternative 10: 92.2% accurate, 1.0× speedup?

                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.62:\\ \;\;\;\;-\mathsf{expm1}\left(\frac{\log x}{n}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{x}^{\left({n}^{-1}\right)}}{n}}{x}\\ \end{array} \end{array} \]
                                                                          (FPCore (x n)
                                                                           :precision binary64
                                                                           (if (<= x 0.62) (- (expm1 (/ (log x) n))) (/ (/ (pow x (pow n -1.0)) n) x)))
                                                                          double code(double x, double n) {
                                                                          	double tmp;
                                                                          	if (x <= 0.62) {
                                                                          		tmp = -expm1((log(x) / n));
                                                                          	} else {
                                                                          		tmp = (pow(x, pow(n, -1.0)) / n) / x;
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          public static double code(double x, double n) {
                                                                          	double tmp;
                                                                          	if (x <= 0.62) {
                                                                          		tmp = -Math.expm1((Math.log(x) / n));
                                                                          	} else {
                                                                          		tmp = (Math.pow(x, Math.pow(n, -1.0)) / n) / x;
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          def code(x, n):
                                                                          	tmp = 0
                                                                          	if x <= 0.62:
                                                                          		tmp = -math.expm1((math.log(x) / n))
                                                                          	else:
                                                                          		tmp = (math.pow(x, math.pow(n, -1.0)) / n) / x
                                                                          	return tmp
                                                                          
                                                                          function code(x, n)
                                                                          	tmp = 0.0
                                                                          	if (x <= 0.62)
                                                                          		tmp = Float64(-expm1(Float64(log(x) / n)));
                                                                          	else
                                                                          		tmp = Float64(Float64((x ^ (n ^ -1.0)) / n) / x);
                                                                          	end
                                                                          	return tmp
                                                                          end
                                                                          
                                                                          code[x_, n_] := If[LessEqual[x, 0.62], (-N[(Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]] - 1), $MachinePrecision]), N[(N[(N[Power[x, N[Power[n, -1.0], $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision]]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          \mathbf{if}\;x \leq 0.62:\\
                                                                          \;\;\;\;-\mathsf{expm1}\left(\frac{\log x}{n}\right)\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;\frac{\frac{{x}^{\left({n}^{-1}\right)}}{n}}{x}\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 2 regimes
                                                                          2. if x < 0.619999999999999996

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

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

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

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

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

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

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

                                                                                  \[\leadsto \color{blue}{\left(0 - e^{\frac{\log x}{n}}\right)} + 1 \]
                                                                                4. remove-double-negN/A

                                                                                  \[\leadsto \left(0 - e^{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{\log x}{n}\right)\right)\right)}}\right) + 1 \]
                                                                                5. distribute-frac-negN/A

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

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

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

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

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

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

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

                                                                                  \[\leadsto 0 - \left(e^{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\log x}{n}\right)\right)}\right)} - 1\right) \]
                                                                                13. remove-double-negN/A

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

                                                                                  \[\leadsto 0 - \color{blue}{\mathsf{expm1}\left(\frac{\log x}{n}\right)} \]
                                                                                15. lower-/.f64N/A

                                                                                  \[\leadsto 0 - \mathsf{expm1}\left(\color{blue}{\frac{\log x}{n}}\right) \]
                                                                                16. lower-log.f6485.8

                                                                                  \[\leadsto 0 - \mathsf{expm1}\left(\frac{\color{blue}{\log x}}{n}\right) \]
                                                                              4. Applied rewrites85.8%

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

                                                                              if 0.619999999999999996 < x

                                                                              1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.62:\\ \;\;\;\;-\mathsf{expm1}\left(\frac{\log x}{n}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{{x}^{\left({n}^{-1}\right)}}{n}}{x}\\ \end{array} \]
                                                                              9. Add Preprocessing

                                                                              Alternative 11: 92.1% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

                                                                                      \[\leadsto \color{blue}{\left(0 - e^{\frac{\log x}{n}}\right)} + 1 \]
                                                                                    4. remove-double-negN/A

                                                                                      \[\leadsto \left(0 - e^{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{\log x}{n}\right)\right)\right)}}\right) + 1 \]
                                                                                    5. distribute-frac-negN/A

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

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

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

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

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

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

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

                                                                                      \[\leadsto 0 - \left(e^{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\log x}{n}\right)\right)}\right)} - 1\right) \]
                                                                                    13. remove-double-negN/A

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

                                                                                      \[\leadsto 0 - \color{blue}{\mathsf{expm1}\left(\frac{\log x}{n}\right)} \]
                                                                                    15. lower-/.f64N/A

                                                                                      \[\leadsto 0 - \mathsf{expm1}\left(\color{blue}{\frac{\log x}{n}}\right) \]
                                                                                    16. lower-log.f6485.8

                                                                                      \[\leadsto 0 - \mathsf{expm1}\left(\frac{\color{blue}{\log x}}{n}\right) \]
                                                                                  4. Applied rewrites85.8%

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

                                                                                  if 0.619999999999999996 < x

                                                                                  1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      \[\leadsto \frac{{x}^{\left(\mathsf{fma}\left(2, \frac{0.5}{n}, -1\right)\right)}}{n} \]
                                                                                  7. Recombined 2 regimes into one program.
                                                                                  8. Final simplification91.7%

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

                                                                                  Alternative 12: 61.3% accurate, 1.1× speedup?

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

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

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

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

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

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

                                                                                        if 8.79999999999999997e-76 < x < 1

                                                                                        1. Initial program 43.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.f6443.2

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

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

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

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

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

                                                                                            if 1 < x < 5.4e11 or 1e85 < x

                                                                                            1. Initial program 83.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.f6476.9

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

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

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

                                                                                                \[\leadsto \frac{\log 1}{n} \]
                                                                                              3. Step-by-step derivation
                                                                                                1. Applied rewrites83.3%

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

                                                                                                if 5.4e11 < x < 1e85

                                                                                                1. Initial program 33.4%

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

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

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

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

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

                                                                                                    \[\leadsto \frac{\frac{1 - \frac{0.5}{x}}{n}}{x} \]
                                                                                                8. Recombined 4 regimes into one program.
                                                                                                9. Final simplification68.4%

                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 8.8 \cdot 10^{-76}:\\ \;\;\;\;\left(-\log x\right) \cdot {n}^{-1}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;\frac{\left(-n\right) \cdot \log x}{n \cdot n}\\ \mathbf{elif}\;x \leq 540000000000 \lor \neg \left(x \leq 10^{+85}\right):\\ \;\;\;\;\frac{\log 1}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{n}}{x}\\ \end{array} \]
                                                                                                10. Add Preprocessing

                                                                                                Alternative 13: 60.5% accurate, 1.7× speedup?

                                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.25 \cdot 10^{-27}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\ \mathbf{elif}\;x \leq 540000000000 \lor \neg \left(x \leq 10^{+85}\right):\\ \;\;\;\;\frac{\log 1}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{n}}{x}\\ \end{array} \end{array} \]
                                                                                                (FPCore (x n)
                                                                                                 :precision binary64
                                                                                                 (if (<= x 2.25e-27)
                                                                                                   (/ (- (log x)) n)
                                                                                                   (if (<= x 1.0)
                                                                                                     (/ (/ n x) (* n n))
                                                                                                     (if (or (<= x 540000000000.0) (not (<= x 1e+85)))
                                                                                                       (/ (log 1.0) n)
                                                                                                       (/ (/ (- 1.0 (/ 0.5 x)) n) x)))))
                                                                                                double code(double x, double n) {
                                                                                                	double tmp;
                                                                                                	if (x <= 2.25e-27) {
                                                                                                		tmp = -log(x) / n;
                                                                                                	} else if (x <= 1.0) {
                                                                                                		tmp = (n / x) / (n * n);
                                                                                                	} else if ((x <= 540000000000.0) || !(x <= 1e+85)) {
                                                                                                		tmp = log(1.0) / n;
                                                                                                	} else {
                                                                                                		tmp = ((1.0 - (0.5 / x)) / n) / x;
                                                                                                	}
                                                                                                	return tmp;
                                                                                                }
                                                                                                
                                                                                                real(8) function code(x, n)
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(8), intent (in) :: n
                                                                                                    real(8) :: tmp
                                                                                                    if (x <= 2.25d-27) then
                                                                                                        tmp = -log(x) / n
                                                                                                    else if (x <= 1.0d0) then
                                                                                                        tmp = (n / x) / (n * n)
                                                                                                    else if ((x <= 540000000000.0d0) .or. (.not. (x <= 1d+85))) then
                                                                                                        tmp = log(1.0d0) / n
                                                                                                    else
                                                                                                        tmp = ((1.0d0 - (0.5d0 / x)) / n) / x
                                                                                                    end if
                                                                                                    code = tmp
                                                                                                end function
                                                                                                
                                                                                                public static double code(double x, double n) {
                                                                                                	double tmp;
                                                                                                	if (x <= 2.25e-27) {
                                                                                                		tmp = -Math.log(x) / n;
                                                                                                	} else if (x <= 1.0) {
                                                                                                		tmp = (n / x) / (n * n);
                                                                                                	} else if ((x <= 540000000000.0) || !(x <= 1e+85)) {
                                                                                                		tmp = Math.log(1.0) / n;
                                                                                                	} else {
                                                                                                		tmp = ((1.0 - (0.5 / x)) / n) / x;
                                                                                                	}
                                                                                                	return tmp;
                                                                                                }
                                                                                                
                                                                                                def code(x, n):
                                                                                                	tmp = 0
                                                                                                	if x <= 2.25e-27:
                                                                                                		tmp = -math.log(x) / n
                                                                                                	elif x <= 1.0:
                                                                                                		tmp = (n / x) / (n * n)
                                                                                                	elif (x <= 540000000000.0) or not (x <= 1e+85):
                                                                                                		tmp = math.log(1.0) / n
                                                                                                	else:
                                                                                                		tmp = ((1.0 - (0.5 / x)) / n) / x
                                                                                                	return tmp
                                                                                                
                                                                                                function code(x, n)
                                                                                                	tmp = 0.0
                                                                                                	if (x <= 2.25e-27)
                                                                                                		tmp = Float64(Float64(-log(x)) / n);
                                                                                                	elseif (x <= 1.0)
                                                                                                		tmp = Float64(Float64(n / x) / Float64(n * n));
                                                                                                	elseif ((x <= 540000000000.0) || !(x <= 1e+85))
                                                                                                		tmp = Float64(log(1.0) / n);
                                                                                                	else
                                                                                                		tmp = Float64(Float64(Float64(1.0 - Float64(0.5 / x)) / n) / x);
                                                                                                	end
                                                                                                	return tmp
                                                                                                end
                                                                                                
                                                                                                function tmp_2 = code(x, n)
                                                                                                	tmp = 0.0;
                                                                                                	if (x <= 2.25e-27)
                                                                                                		tmp = -log(x) / n;
                                                                                                	elseif (x <= 1.0)
                                                                                                		tmp = (n / x) / (n * n);
                                                                                                	elseif ((x <= 540000000000.0) || ~((x <= 1e+85)))
                                                                                                		tmp = log(1.0) / n;
                                                                                                	else
                                                                                                		tmp = ((1.0 - (0.5 / x)) / n) / x;
                                                                                                	end
                                                                                                	tmp_2 = tmp;
                                                                                                end
                                                                                                
                                                                                                code[x_, n_] := If[LessEqual[x, 2.25e-27], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], If[LessEqual[x, 1.0], N[(N[(n / x), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 540000000000.0], N[Not[LessEqual[x, 1e+85]], $MachinePrecision]], N[(N[Log[1.0], $MachinePrecision] / n), $MachinePrecision], N[(N[(N[(1.0 - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] / x), $MachinePrecision]]]]
                                                                                                
                                                                                                \begin{array}{l}
                                                                                                
                                                                                                \\
                                                                                                \begin{array}{l}
                                                                                                \mathbf{if}\;x \leq 2.25 \cdot 10^{-27}:\\
                                                                                                \;\;\;\;\frac{-\log x}{n}\\
                                                                                                
                                                                                                \mathbf{elif}\;x \leq 1:\\
                                                                                                \;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\
                                                                                                
                                                                                                \mathbf{elif}\;x \leq 540000000000 \lor \neg \left(x \leq 10^{+85}\right):\\
                                                                                                \;\;\;\;\frac{\log 1}{n}\\
                                                                                                
                                                                                                \mathbf{else}:\\
                                                                                                \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{n}}{x}\\
                                                                                                
                                                                                                
                                                                                                \end{array}
                                                                                                \end{array}
                                                                                                
                                                                                                Derivation
                                                                                                1. Split input into 4 regimes
                                                                                                2. if x < 2.2500000000000001e-27

                                                                                                  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.f6456.2

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

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

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

                                                                                                    if 2.2500000000000001e-27 < x < 1

                                                                                                    1. Initial program 64.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.f6423.6

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

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

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

                                                                                                        \[\leadsto \frac{\frac{n}{x}}{\color{blue}{n} \cdot n} \]
                                                                                                      3. Step-by-step derivation
                                                                                                        1. Applied rewrites63.5%

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

                                                                                                        if 1 < x < 5.4e11 or 1e85 < x

                                                                                                        1. Initial program 83.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.f6476.9

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

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

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

                                                                                                            \[\leadsto \frac{\log 1}{n} \]
                                                                                                          3. Step-by-step derivation
                                                                                                            1. Applied rewrites83.3%

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

                                                                                                            if 5.4e11 < x < 1e85

                                                                                                            1. Initial program 33.4%

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

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

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

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

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

                                                                                                                \[\leadsto \frac{\frac{1 - \frac{0.5}{x}}{n}}{x} \]
                                                                                                            8. Recombined 4 regimes into one program.
                                                                                                            9. Final simplification67.3%

                                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.25 \cdot 10^{-27}:\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\ \mathbf{elif}\;x \leq 540000000000 \lor \neg \left(x \leq 10^{+85}\right):\\ \;\;\;\;\frac{\log 1}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 - \frac{0.5}{x}}{n}}{x}\\ \end{array} \]
                                                                                                            10. Add Preprocessing

                                                                                                            Alternative 14: 47.8% accurate, 1.8× speedup?

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

                                                                                                              1. Initial program 38.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.f6470.4

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

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

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

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

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

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

                                                                                                                    if -2 < n < 7.4999999999999999e-133

                                                                                                                    1. Initial program 80.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.f6438.5

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

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

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

                                                                                                                        \[\leadsto \frac{\frac{n}{x}}{\color{blue}{n} \cdot n} \]
                                                                                                                      3. Step-by-step derivation
                                                                                                                        1. Applied rewrites42.5%

                                                                                                                          \[\leadsto \frac{\frac{n}{x}}{\color{blue}{n} \cdot n} \]
                                                                                                                      4. Recombined 2 regimes into one program.
                                                                                                                      5. Final simplification47.8%

                                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -2 \lor \neg \left(n \leq 7.5 \cdot 10^{-133}\right):\\ \;\;\;\;\frac{{\left(0.5 + x\right)}^{-1}}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{n}{x}}{n \cdot n}\\ \end{array} \]
                                                                                                                      6. Add Preprocessing

                                                                                                                      Alternative 15: 41.9% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

                                                                                                                              if -2 < n

                                                                                                                              1. Initial program 63.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{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n} + \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}} \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right)}{x}}{x}} \]
                                                                                                                              4. Step-by-step derivation
                                                                                                                                1. lower-/.f64N/A

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

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

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

                                                                                                                                  \[\leadsto \frac{\frac{1 - \frac{0.5}{x}}{n}}{x} \]
                                                                                                                                2. Taylor expanded in x around inf

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

                                                                                                                                    \[\leadsto \frac{\frac{1}{n}}{x} \]
                                                                                                                                4. Recombined 2 regimes into one program.
                                                                                                                                5. Final simplification41.1%

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

                                                                                                                                Alternative 16: 40.4% accurate, 2.0× speedup?

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

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

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

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

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

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

                                                                                                                                    \[\leadsto \frac{\frac{1 - \frac{0.5}{x}}{n}}{x} \]
                                                                                                                                  2. Taylor expanded in x around inf

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

                                                                                                                                      \[\leadsto \frac{\frac{1}{n}}{x} \]
                                                                                                                                    2. Final simplification39.4%

                                                                                                                                      \[\leadsto \frac{{n}^{-1}}{x} \]
                                                                                                                                    3. Add Preprocessing

                                                                                                                                    Alternative 17: 48.4% accurate, 4.1× speedup?

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

                                                                                                                                      1. Initial program 46.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.f6452.8

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

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

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

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

                                                                                                                                        if 3.50000000000000016e208 < x

                                                                                                                                        1. Initial program 97.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{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n} + \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}} \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right)}{x}}{x}} \]
                                                                                                                                        4. Step-by-step derivation
                                                                                                                                          1. lower-/.f64N/A

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

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

                                                                                                                                          \[\leadsto \frac{\frac{1 - \frac{1}{2} \cdot \frac{1}{x}}{n}}{x} \]
                                                                                                                                        7. Step-by-step derivation
                                                                                                                                          1. Applied rewrites70.9%

                                                                                                                                            \[\leadsto \frac{\frac{1 - \frac{0.5}{x}}{n}}{x} \]
                                                                                                                                          2. Taylor expanded in x around 0

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

                                                                                                                                              \[\leadsto \frac{\frac{\frac{-0.5}{x}}{n}}{x} \]
                                                                                                                                          4. Recombined 2 regimes into one program.
                                                                                                                                          5. Add Preprocessing

                                                                                                                                          Reproduce

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