2nthrt (problem 3.4.6)

Percentage Accurate: 52.3% → 86.0%
Time: 27.1s
Alternatives: 14
Speedup: 5.1×

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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, n)
use fmin_fmax_functions
    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 14 alternatives:

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

Initial Program: 52.3% 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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Alternative 1: 86.0% accurate, 0.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{e^{\frac{\log x}{n}}}{n \cdot x}\\


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

    1. Initial program 46.5%

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

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

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

    if 7200 < x

    1. Initial program 62.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. lower-/.f64N/A

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

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

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

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

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

        \[\leadsto \frac{e^{-\frac{-1 \cdot \log x}{n}}}{n \cdot x} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{e^{-\frac{-1 \cdot \log x}{n}}}{n \cdot x} \]
      8. mul-1-negN/A

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

        \[\leadsto \frac{e^{-\frac{-\log x}{n}}}{n \cdot x} \]
      10. lower-log.f64N/A

        \[\leadsto \frac{e^{-\frac{-\log x}{n}}}{n \cdot x} \]
      11. lower-*.f6499.7

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

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

      \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
      2. lift-log.f6499.7

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
    8. Applied rewrites99.7%

      \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.7%

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

Alternative 2: 78.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ t_1 := {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - t\_0\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-8}:\\ \;\;\;\;1 - t\_0\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-10}:\\ \;\;\;\;\frac{\log \left(\frac{1 + x}{x}\right)}{n}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{x}{n} + 1\right) - t\_0\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (let* ((t_0 (pow x (/ 1.0 n))) (t_1 (- (pow (+ x 1.0) (/ 1.0 n)) t_0)))
   (if (<= t_1 -1e-8)
     (- 1.0 t_0)
     (if (<= t_1 5e-10) (/ (log (/ (+ 1.0 x) x)) n) (- (+ (/ x n) 1.0) t_0)))))
double code(double x, double n) {
	double t_0 = pow(x, (1.0 / n));
	double t_1 = pow((x + 1.0), (1.0 / n)) - t_0;
	double tmp;
	if (t_1 <= -1e-8) {
		tmp = 1.0 - t_0;
	} else if (t_1 <= 5e-10) {
		tmp = log(((1.0 + x) / x)) / n;
	} else {
		tmp = ((x / n) + 1.0) - t_0;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

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

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


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

    1. Initial program 99.0%

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

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

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

      if -1e-8 < (-.f64 (pow.f64 (+.f64 x #s(literal 1 binary64)) (/.f64 #s(literal 1 binary64) n)) (pow.f64 x (/.f64 #s(literal 1 binary64) n))) < 5.00000000000000031e-10

      1. Initial program 39.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
        2. lower--.f64N/A

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

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
      6. Step-by-step derivation
        1. lift--.f64N/A

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

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

          \[\leadsto \frac{\log \left(1 + x\right) - \log x}{n} \]
        4. diff-logN/A

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

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

          \[\leadsto \frac{\log \left(\frac{1 + x}{x}\right)}{n} \]
        7. lower-+.f6476.4

          \[\leadsto \frac{\log \left(\frac{1 + x}{x}\right)}{n} \]
      7. Applied rewrites76.4%

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

      if 5.00000000000000031e-10 < (-.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 56.2%

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

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

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

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

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

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

    Alternative 3: 78.4% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ t_1 := {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - t\_0\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-8} \lor \neg \left(t\_1 \leq 5 \cdot 10^{-10}\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 (/ 1.0 n))) (t_1 (- (pow (+ x 1.0) (/ 1.0 n)) t_0)))
       (if (or (<= t_1 -1e-8) (not (<= t_1 5e-10)))
         (- 1.0 t_0)
         (/ (log (/ (+ 1.0 x) x)) n))))
    double code(double x, double n) {
    	double t_0 = pow(x, (1.0 / n));
    	double t_1 = pow((x + 1.0), (1.0 / n)) - t_0;
    	double tmp;
    	if ((t_1 <= -1e-8) || !(t_1 <= 5e-10)) {
    		tmp = 1.0 - t_0;
    	} else {
    		tmp = log(((1.0 + x) / x)) / n;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, n)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: n
        real(8) :: t_0
        real(8) :: t_1
        real(8) :: tmp
        t_0 = x ** (1.0d0 / n)
        t_1 = ((x + 1.0d0) ** (1.0d0 / n)) - t_0
        if ((t_1 <= (-1d-8)) .or. (.not. (t_1 <= 5d-10))) 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, (1.0 / n));
    	double t_1 = Math.pow((x + 1.0), (1.0 / n)) - t_0;
    	double tmp;
    	if ((t_1 <= -1e-8) || !(t_1 <= 5e-10)) {
    		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, (1.0 / n))
    	t_1 = math.pow((x + 1.0), (1.0 / n)) - t_0
    	tmp = 0
    	if (t_1 <= -1e-8) or not (t_1 <= 5e-10):
    		tmp = 1.0 - t_0
    	else:
    		tmp = math.log(((1.0 + x) / x)) / n
    	return tmp
    
    function code(x, n)
    	t_0 = x ^ Float64(1.0 / n)
    	t_1 = Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - t_0)
    	tmp = 0.0
    	if ((t_1 <= -1e-8) || !(t_1 <= 5e-10))
    		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 ^ (1.0 / n);
    	t_1 = ((x + 1.0) ^ (1.0 / n)) - t_0;
    	tmp = 0.0;
    	if ((t_1 <= -1e-8) || ~((t_1 <= 5e-10)))
    		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[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e-8], N[Not[LessEqual[t$95$1, 5e-10]], $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(\frac{1}{n}\right)}\\
    t_1 := {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - t\_0\\
    \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-8} \lor \neg \left(t\_1 \leq 5 \cdot 10^{-10}\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))) < -1e-8 or 5.00000000000000031e-10 < (-.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 77.3%

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

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

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

        if -1e-8 < (-.f64 (pow.f64 (+.f64 x #s(literal 1 binary64)) (/.f64 #s(literal 1 binary64) n)) (pow.f64 x (/.f64 #s(literal 1 binary64) n))) < 5.00000000000000031e-10

        1. Initial program 39.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
          2. lower--.f64N/A

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

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
        6. Step-by-step derivation
          1. lift--.f64N/A

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

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

            \[\leadsto \frac{\log \left(1 + x\right) - \log x}{n} \]
          4. diff-logN/A

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

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

            \[\leadsto \frac{\log \left(\frac{1 + x}{x}\right)}{n} \]
          7. lower-+.f6476.4

            \[\leadsto \frac{\log \left(\frac{1 + x}{x}\right)}{n} \]
        7. Applied rewrites76.4%

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

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

      Alternative 4: 85.4% accurate, 0.4× speedup?

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

        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}{-1 \cdot \frac{\left(-1 \cdot \log \left(1 + x\right) + -1 \cdot \frac{\left(-1 \cdot \frac{\left(-1 \cdot \frac{\frac{1}{24} \cdot {\log \left(1 + x\right)}^{4} - \frac{1}{24} \cdot {\log x}^{4}}{n} + \frac{-1}{6} \cdot {\log \left(1 + x\right)}^{3}\right) - \frac{-1}{6} \cdot {\log x}^{3}}{n} + \frac{1}{2} \cdot {\log \left(1 + x\right)}^{2}\right) - \frac{1}{2} \cdot {\log x}^{2}}{n}\right) - -1 \cdot \log x}{n}} \]
        4. Applied rewrites70.4%

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

          \[\leadsto -\frac{\mathsf{fma}\left(-1, -1 \cdot \frac{\frac{1}{24} \cdot \frac{{\log x}^{4}}{n} + \frac{1}{6} \cdot {\log x}^{3}}{{n}^{2}} + \frac{-1}{2} \cdot \frac{{\log x}^{2}}{n}, \log x\right)}{n} \]
        6. Step-by-step derivation
          1. lower-fma.f64N/A

            \[\leadsto -\frac{\mathsf{fma}\left(-1, \mathsf{fma}\left(-1, \frac{\frac{1}{24} \cdot \frac{{\log x}^{4}}{n} + \frac{1}{6} \cdot {\log x}^{3}}{{n}^{2}}, \frac{-1}{2} \cdot \frac{{\log x}^{2}}{n}\right), \log x\right)}{n} \]
        7. Applied rewrites69.8%

          \[\leadsto -\frac{\mathsf{fma}\left(-1, \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(0.041666666666666664, \frac{{\log x}^{4}}{n}, 0.16666666666666666 \cdot {\log x}^{3}\right)}{n \cdot n}, -0.5 \cdot \frac{{\log x}^{2}}{n}\right), \log x\right)}{n} \]
        8. Taylor expanded in n around inf

          \[\leadsto -\frac{\mathsf{fma}\left(-1, \frac{\frac{-1}{2} \cdot {\log x}^{2} + \frac{-1}{6} \cdot \frac{{\log x}^{3}}{n}}{n}, \log x\right)}{n} \]
        9. Step-by-step derivation
          1. lower-/.f64N/A

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

            \[\leadsto -\frac{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(\frac{-1}{2}, {\log x}^{2}, \frac{-1}{6} \cdot \frac{{\log x}^{3}}{n}\right)}{n}, \log x\right)}{n} \]
          3. lift-pow.f64N/A

            \[\leadsto -\frac{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(\frac{-1}{2}, {\log x}^{2}, \frac{-1}{6} \cdot \frac{{\log x}^{3}}{n}\right)}{n}, \log x\right)}{n} \]
          4. lift-log.f64N/A

            \[\leadsto -\frac{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(\frac{-1}{2}, {\log x}^{2}, \frac{-1}{6} \cdot \frac{{\log x}^{3}}{n}\right)}{n}, \log x\right)}{n} \]
          5. lower-*.f64N/A

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

            \[\leadsto -\frac{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(\frac{-1}{2}, {\log x}^{2}, \frac{-1}{6} \cdot \frac{{\log x}^{3}}{n}\right)}{n}, \log x\right)}{n} \]
          7. lift-pow.f64N/A

            \[\leadsto -\frac{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(\frac{-1}{2}, {\log x}^{2}, \frac{-1}{6} \cdot \frac{{\log x}^{3}}{n}\right)}{n}, \log x\right)}{n} \]
          8. lift-log.f6481.1

            \[\leadsto -\frac{\mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-0.5, {\log x}^{2}, -0.16666666666666666 \cdot \frac{{\log x}^{3}}{n}\right)}{n}, \log x\right)}{n} \]
        10. Applied rewrites81.1%

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

        if 1.45e-5 < x

        1. Initial program 62.0%

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

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

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

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

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

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

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

            \[\leadsto \frac{e^{-\frac{-1 \cdot \log x}{n}}}{n \cdot x} \]
          7. lower-/.f64N/A

            \[\leadsto \frac{e^{-\frac{-1 \cdot \log x}{n}}}{n \cdot x} \]
          8. mul-1-negN/A

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

            \[\leadsto \frac{e^{-\frac{-\log x}{n}}}{n \cdot x} \]
          10. lower-log.f64N/A

            \[\leadsto \frac{e^{-\frac{-\log x}{n}}}{n \cdot x} \]
          11. lower-*.f6499.1

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

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

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
        7. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
          2. lift-log.f6499.1

            \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
        8. Applied rewrites99.1%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification88.2%

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

      Alternative 5: 85.5% accurate, 0.6× speedup?

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

        1. Initial program 88.3%

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

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

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

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

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

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

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

            \[\leadsto \frac{e^{-\frac{-1 \cdot \log x}{n}}}{n \cdot x} \]
          7. lower-/.f64N/A

            \[\leadsto \frac{e^{-\frac{-1 \cdot \log x}{n}}}{n \cdot x} \]
          8. mul-1-negN/A

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

            \[\leadsto \frac{e^{-\frac{-\log x}{n}}}{n \cdot x} \]
          10. lower-log.f64N/A

            \[\leadsto \frac{e^{-\frac{-\log x}{n}}}{n \cdot x} \]
          11. lower-*.f6494.4

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

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

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
        7. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
          2. lift-log.f6494.4

            \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
        8. Applied rewrites94.4%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]

        if -3.99999999999999998e-90 < (/.f64 #s(literal 1 binary64) n) < 5.0000000000000001e-9

        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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
          2. lower--.f64N/A

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

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
        6. Step-by-step derivation
          1. lift--.f64N/A

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

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

            \[\leadsto \frac{\log \left(1 + x\right) - \log x}{n} \]
          4. diff-logN/A

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

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

            \[\leadsto \frac{\log \left(\frac{1 + x}{x}\right)}{n} \]
          7. lower-+.f6474.6

            \[\leadsto \frac{\log \left(\frac{1 + x}{x}\right)}{n} \]
        7. Applied rewrites74.6%

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

        if 5.0000000000000001e-9 < (/.f64 #s(literal 1 binary64) n)

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

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

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

            \[\leadsto e^{\frac{\log \left(1 + x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)} \]
          3. lower-log1p.f6498.6

            \[\leadsto e^{\frac{\mathsf{log1p}\left(x\right)}{n}} - {x}^{\left(\frac{1}{n}\right)} \]
        5. Applied rewrites98.6%

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

      Alternative 6: 81.6% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-90}:\\ \;\;\;\;\frac{e^{\frac{\log x}{n}}}{n \cdot x}\\ \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-9}:\\ \;\;\;\;\frac{\log \left(\frac{1 + x}{x}\right)}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+164}:\\ \;\;\;\;\left(\frac{x}{n} + 1\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n}\\ \end{array} \end{array} \]
      (FPCore (x n)
       :precision binary64
       (if (<= (/ 1.0 n) -4e-90)
         (/ (exp (/ (log x) n)) (* n x))
         (if (<= (/ 1.0 n) 5e-9)
           (/ (log (/ (+ 1.0 x) x)) n)
           (if (<= (/ 1.0 n) 1e+164)
             (- (+ (/ x n) 1.0) (pow x (/ 1.0 n)))
             (/
              (/ (- (+ 1.0 (/ 0.3333333333333333 (* x x))) (* 0.5 (pow x -1.0))) x)
              n)))))
      double code(double x, double n) {
      	double tmp;
      	if ((1.0 / n) <= -4e-90) {
      		tmp = exp((log(x) / n)) / (n * x);
      	} else if ((1.0 / n) <= 5e-9) {
      		tmp = log(((1.0 + x) / x)) / n;
      	} else if ((1.0 / n) <= 1e+164) {
      		tmp = ((x / n) + 1.0) - pow(x, (1.0 / n));
      	} else {
      		tmp = (((1.0 + (0.3333333333333333 / (x * x))) - (0.5 * pow(x, -1.0))) / x) / n;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, n)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: n
          real(8) :: tmp
          if ((1.0d0 / n) <= (-4d-90)) then
              tmp = exp((log(x) / n)) / (n * x)
          else if ((1.0d0 / n) <= 5d-9) then
              tmp = log(((1.0d0 + x) / x)) / n
          else if ((1.0d0 / n) <= 1d+164) then
              tmp = ((x / n) + 1.0d0) - (x ** (1.0d0 / n))
          else
              tmp = (((1.0d0 + (0.3333333333333333d0 / (x * x))) - (0.5d0 * (x ** (-1.0d0)))) / x) / n
          end if
          code = tmp
      end function
      
      public static double code(double x, double n) {
      	double tmp;
      	if ((1.0 / n) <= -4e-90) {
      		tmp = Math.exp((Math.log(x) / n)) / (n * x);
      	} else if ((1.0 / n) <= 5e-9) {
      		tmp = Math.log(((1.0 + x) / x)) / n;
      	} else if ((1.0 / n) <= 1e+164) {
      		tmp = ((x / n) + 1.0) - Math.pow(x, (1.0 / n));
      	} else {
      		tmp = (((1.0 + (0.3333333333333333 / (x * x))) - (0.5 * Math.pow(x, -1.0))) / x) / n;
      	}
      	return tmp;
      }
      
      def code(x, n):
      	tmp = 0
      	if (1.0 / n) <= -4e-90:
      		tmp = math.exp((math.log(x) / n)) / (n * x)
      	elif (1.0 / n) <= 5e-9:
      		tmp = math.log(((1.0 + x) / x)) / n
      	elif (1.0 / n) <= 1e+164:
      		tmp = ((x / n) + 1.0) - math.pow(x, (1.0 / n))
      	else:
      		tmp = (((1.0 + (0.3333333333333333 / (x * x))) - (0.5 * math.pow(x, -1.0))) / x) / n
      	return tmp
      
      function code(x, n)
      	tmp = 0.0
      	if (Float64(1.0 / n) <= -4e-90)
      		tmp = Float64(exp(Float64(log(x) / n)) / Float64(n * x));
      	elseif (Float64(1.0 / n) <= 5e-9)
      		tmp = Float64(log(Float64(Float64(1.0 + x) / x)) / n);
      	elseif (Float64(1.0 / n) <= 1e+164)
      		tmp = Float64(Float64(Float64(x / n) + 1.0) - (x ^ Float64(1.0 / n)));
      	else
      		tmp = Float64(Float64(Float64(Float64(1.0 + Float64(0.3333333333333333 / Float64(x * x))) - Float64(0.5 * (x ^ -1.0))) / x) / n);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, n)
      	tmp = 0.0;
      	if ((1.0 / n) <= -4e-90)
      		tmp = exp((log(x) / n)) / (n * x);
      	elseif ((1.0 / n) <= 5e-9)
      		tmp = log(((1.0 + x) / x)) / n;
      	elseif ((1.0 / n) <= 1e+164)
      		tmp = ((x / n) + 1.0) - (x ^ (1.0 / n));
      	else
      		tmp = (((1.0 + (0.3333333333333333 / (x * x))) - (0.5 * (x ^ -1.0))) / x) / n;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, n_] := If[LessEqual[N[(1.0 / n), $MachinePrecision], -4e-90], N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 5e-9], N[(N[Log[N[(N[(1.0 + x), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 1e+164], N[(N[(N[(x / n), $MachinePrecision] + 1.0), $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 + N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.5 * N[Power[x, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\frac{1}{n} \leq -4 \cdot 10^{-90}:\\
      \;\;\;\;\frac{e^{\frac{\log x}{n}}}{n \cdot x}\\
      
      \mathbf{elif}\;\frac{1}{n} \leq 5 \cdot 10^{-9}:\\
      \;\;\;\;\frac{\log \left(\frac{1 + x}{x}\right)}{n}\\
      
      \mathbf{elif}\;\frac{1}{n} \leq 10^{+164}:\\
      \;\;\;\;\left(\frac{x}{n} + 1\right) - {x}^{\left(\frac{1}{n}\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if (/.f64 #s(literal 1 binary64) n) < -3.99999999999999998e-90

        1. Initial program 88.3%

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

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

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

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

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

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

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

            \[\leadsto \frac{e^{-\frac{-1 \cdot \log x}{n}}}{n \cdot x} \]
          7. lower-/.f64N/A

            \[\leadsto \frac{e^{-\frac{-1 \cdot \log x}{n}}}{n \cdot x} \]
          8. mul-1-negN/A

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

            \[\leadsto \frac{e^{-\frac{-\log x}{n}}}{n \cdot x} \]
          10. lower-log.f64N/A

            \[\leadsto \frac{e^{-\frac{-\log x}{n}}}{n \cdot x} \]
          11. lower-*.f6494.4

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

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

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
        7. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
          2. lift-log.f6494.4

            \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]
        8. Applied rewrites94.4%

          \[\leadsto \frac{e^{\frac{\log x}{n}}}{n \cdot x} \]

        if -3.99999999999999998e-90 < (/.f64 #s(literal 1 binary64) n) < 5.0000000000000001e-9

        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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
          2. lower--.f64N/A

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

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
        6. Step-by-step derivation
          1. lift--.f64N/A

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

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

            \[\leadsto \frac{\log \left(1 + x\right) - \log x}{n} \]
          4. diff-logN/A

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

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

            \[\leadsto \frac{\log \left(\frac{1 + x}{x}\right)}{n} \]
          7. lower-+.f6474.6

            \[\leadsto \frac{\log \left(\frac{1 + x}{x}\right)}{n} \]
        7. Applied rewrites74.6%

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

        if 5.0000000000000001e-9 < (/.f64 #s(literal 1 binary64) n) < 1e164

        1. Initial program 88.3%

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

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

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

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

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

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

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

        1. Initial program 17.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
          2. lower--.f64N/A

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

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

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

          \[\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. lower-/.f64N/A

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

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

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

            \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
          5. unpow2N/A

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

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

            \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
          8. inv-powN/A

            \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
          9. lower-pow.f6485.5

            \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
        8. Applied rewrites85.5%

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

      Alternative 7: 60.7% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{1}{x}}{n}\\ \mathbf{if}\;n \leq -8.5:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 4.3 \cdot 10^{-165}:\\ \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\ \mathbf{elif}\;n \leq 23000000000:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;n \leq 1.26 \cdot 10^{+73} \lor \neg \left(n \leq 6.2 \cdot 10^{+168}\right):\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x n)
       :precision binary64
       (let* ((t_0 (/ (/ 1.0 x) n)))
         (if (<= n -8.5)
           t_0
           (if (<= n 4.3e-165)
             (/ (/ (/ 0.3333333333333333 (* x x)) x) n)
             (if (<= n 23000000000.0)
               (- 1.0 (pow x (/ 1.0 n)))
               (if (or (<= n 1.26e+73) (not (<= n 6.2e+168)))
                 (/ (- x (log x)) n)
                 t_0))))))
      double code(double x, double n) {
      	double t_0 = (1.0 / x) / n;
      	double tmp;
      	if (n <= -8.5) {
      		tmp = t_0;
      	} else if (n <= 4.3e-165) {
      		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
      	} else if (n <= 23000000000.0) {
      		tmp = 1.0 - pow(x, (1.0 / n));
      	} else if ((n <= 1.26e+73) || !(n <= 6.2e+168)) {
      		tmp = (x - log(x)) / n;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, n)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: n
          real(8) :: t_0
          real(8) :: tmp
          t_0 = (1.0d0 / x) / n
          if (n <= (-8.5d0)) then
              tmp = t_0
          else if (n <= 4.3d-165) then
              tmp = ((0.3333333333333333d0 / (x * x)) / x) / n
          else if (n <= 23000000000.0d0) then
              tmp = 1.0d0 - (x ** (1.0d0 / n))
          else if ((n <= 1.26d+73) .or. (.not. (n <= 6.2d+168))) then
              tmp = (x - log(x)) / n
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double n) {
      	double t_0 = (1.0 / x) / n;
      	double tmp;
      	if (n <= -8.5) {
      		tmp = t_0;
      	} else if (n <= 4.3e-165) {
      		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
      	} else if (n <= 23000000000.0) {
      		tmp = 1.0 - Math.pow(x, (1.0 / n));
      	} else if ((n <= 1.26e+73) || !(n <= 6.2e+168)) {
      		tmp = (x - Math.log(x)) / n;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, n):
      	t_0 = (1.0 / x) / n
      	tmp = 0
      	if n <= -8.5:
      		tmp = t_0
      	elif n <= 4.3e-165:
      		tmp = ((0.3333333333333333 / (x * x)) / x) / n
      	elif n <= 23000000000.0:
      		tmp = 1.0 - math.pow(x, (1.0 / n))
      	elif (n <= 1.26e+73) or not (n <= 6.2e+168):
      		tmp = (x - math.log(x)) / n
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, n)
      	t_0 = Float64(Float64(1.0 / x) / n)
      	tmp = 0.0
      	if (n <= -8.5)
      		tmp = t_0;
      	elseif (n <= 4.3e-165)
      		tmp = Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) / x) / n);
      	elseif (n <= 23000000000.0)
      		tmp = Float64(1.0 - (x ^ Float64(1.0 / n)));
      	elseif ((n <= 1.26e+73) || !(n <= 6.2e+168))
      		tmp = Float64(Float64(x - log(x)) / n);
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, n)
      	t_0 = (1.0 / x) / n;
      	tmp = 0.0;
      	if (n <= -8.5)
      		tmp = t_0;
      	elseif (n <= 4.3e-165)
      		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
      	elseif (n <= 23000000000.0)
      		tmp = 1.0 - (x ^ (1.0 / n));
      	elseif ((n <= 1.26e+73) || ~((n <= 6.2e+168)))
      		tmp = (x - log(x)) / n;
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, n_] := Block[{t$95$0 = N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[n, -8.5], t$95$0, If[LessEqual[n, 4.3e-165], N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[n, 23000000000.0], N[(1.0 - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[n, 1.26e+73], N[Not[LessEqual[n, 6.2e+168]], $MachinePrecision]], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], t$95$0]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{\frac{1}{x}}{n}\\
      \mathbf{if}\;n \leq -8.5:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;n \leq 4.3 \cdot 10^{-165}:\\
      \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\
      
      \mathbf{elif}\;n \leq 23000000000:\\
      \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\
      
      \mathbf{elif}\;n \leq 1.26 \cdot 10^{+73} \lor \neg \left(n \leq 6.2 \cdot 10^{+168}\right):\\
      \;\;\;\;\frac{x - \log x}{n}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if n < -8.5 or 1.25999999999999993e73 < n < 6.19999999999999993e168

        1. Initial program 29.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
          2. lower--.f64N/A

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

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

            \[\leadsto \frac{\mathsf{log1p}\left(x\right) - \log x}{n} \]
        5. Applied rewrites66.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. lower-/.f64N/A

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

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

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

            \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
          5. unpow2N/A

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

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

            \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
          8. inv-powN/A

            \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
          9. lower-pow.f6457.6

            \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
        8. Applied rewrites57.6%

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

          \[\leadsto \frac{\frac{1}{x}}{n} \]
        10. Step-by-step derivation
          1. Applied rewrites58.5%

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

          if -8.5 < n < 4.30000000000000007e-165

          1. Initial program 81.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
            2. lower--.f64N/A

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

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

              \[\leadsto \frac{\mathsf{log1p}\left(x\right) - \log x}{n} \]
          5. Applied rewrites35.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. lower-/.f64N/A

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

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

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

              \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
            5. unpow2N/A

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

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

              \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
            8. inv-powN/A

              \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
            9. lower-pow.f6459.8

              \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
          8. Applied rewrites59.8%

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

            \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{{x}^{2}}}{x}}{n} \]
          10. Step-by-step derivation
            1. pow2N/A

              \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{x \cdot x}}{x}}{n} \]
            2. lift-/.f64N/A

              \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{x \cdot x}}{x}}{n} \]
            3. lift-*.f6480.0

              \[\leadsto \frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n} \]
          11. Applied rewrites80.0%

            \[\leadsto \frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n} \]

          if 4.30000000000000007e-165 < n < 2.3e10

          1. Initial program 82.1%

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

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

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

            if 2.3e10 < n < 1.25999999999999993e73 or 6.19999999999999993e168 < n

            1. Initial program 24.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
              2. lower--.f64N/A

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -8.5:\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \mathbf{elif}\;n \leq 4.3 \cdot 10^{-165}:\\ \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\ \mathbf{elif}\;n \leq 23000000000:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;n \leq 1.26 \cdot 10^{+73} \lor \neg \left(n \leq 6.2 \cdot 10^{+168}\right):\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \end{array} \]
            10. Add Preprocessing

            Alternative 8: 55.7% accurate, 1.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{1}{x}}{n}\\ \mathbf{if}\;n \leq -8.5:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 7 \cdot 10^{-102}:\\ \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\ \mathbf{elif}\;n \leq 1.26 \cdot 10^{+73} \lor \neg \left(n \leq 6.2 \cdot 10^{+168}\right):\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x n)
             :precision binary64
             (let* ((t_0 (/ (/ 1.0 x) n)))
               (if (<= n -8.5)
                 t_0
                 (if (<= n 7e-102)
                   (/ (/ (/ 0.3333333333333333 (* x x)) x) n)
                   (if (or (<= n 1.26e+73) (not (<= n 6.2e+168)))
                     (/ (- x (log x)) n)
                     t_0)))))
            double code(double x, double n) {
            	double t_0 = (1.0 / x) / n;
            	double tmp;
            	if (n <= -8.5) {
            		tmp = t_0;
            	} else if (n <= 7e-102) {
            		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
            	} else if ((n <= 1.26e+73) || !(n <= 6.2e+168)) {
            		tmp = (x - log(x)) / n;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, n)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: n
                real(8) :: t_0
                real(8) :: tmp
                t_0 = (1.0d0 / x) / n
                if (n <= (-8.5d0)) then
                    tmp = t_0
                else if (n <= 7d-102) then
                    tmp = ((0.3333333333333333d0 / (x * x)) / x) / n
                else if ((n <= 1.26d+73) .or. (.not. (n <= 6.2d+168))) then
                    tmp = (x - log(x)) / n
                else
                    tmp = t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double n) {
            	double t_0 = (1.0 / x) / n;
            	double tmp;
            	if (n <= -8.5) {
            		tmp = t_0;
            	} else if (n <= 7e-102) {
            		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
            	} else if ((n <= 1.26e+73) || !(n <= 6.2e+168)) {
            		tmp = (x - Math.log(x)) / n;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(x, n):
            	t_0 = (1.0 / x) / n
            	tmp = 0
            	if n <= -8.5:
            		tmp = t_0
            	elif n <= 7e-102:
            		tmp = ((0.3333333333333333 / (x * x)) / x) / n
            	elif (n <= 1.26e+73) or not (n <= 6.2e+168):
            		tmp = (x - math.log(x)) / n
            	else:
            		tmp = t_0
            	return tmp
            
            function code(x, n)
            	t_0 = Float64(Float64(1.0 / x) / n)
            	tmp = 0.0
            	if (n <= -8.5)
            		tmp = t_0;
            	elseif (n <= 7e-102)
            		tmp = Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) / x) / n);
            	elseif ((n <= 1.26e+73) || !(n <= 6.2e+168))
            		tmp = Float64(Float64(x - log(x)) / n);
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, n)
            	t_0 = (1.0 / x) / n;
            	tmp = 0.0;
            	if (n <= -8.5)
            		tmp = t_0;
            	elseif (n <= 7e-102)
            		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
            	elseif ((n <= 1.26e+73) || ~((n <= 6.2e+168)))
            		tmp = (x - log(x)) / n;
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, n_] := Block[{t$95$0 = N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[n, -8.5], t$95$0, If[LessEqual[n, 7e-102], N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], If[Or[LessEqual[n, 1.26e+73], N[Not[LessEqual[n, 6.2e+168]], $MachinePrecision]], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], t$95$0]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{\frac{1}{x}}{n}\\
            \mathbf{if}\;n \leq -8.5:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;n \leq 7 \cdot 10^{-102}:\\
            \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\
            
            \mathbf{elif}\;n \leq 1.26 \cdot 10^{+73} \lor \neg \left(n \leq 6.2 \cdot 10^{+168}\right):\\
            \;\;\;\;\frac{x - \log x}{n}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if n < -8.5 or 1.25999999999999993e73 < n < 6.19999999999999993e168

              1. Initial program 29.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                2. lower--.f64N/A

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

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

                  \[\leadsto \frac{\mathsf{log1p}\left(x\right) - \log x}{n} \]
              5. Applied rewrites66.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. lower-/.f64N/A

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

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

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

                  \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                5. unpow2N/A

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

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

                  \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                8. inv-powN/A

                  \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
                9. lower-pow.f6457.6

                  \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
              8. Applied rewrites57.6%

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

                \[\leadsto \frac{\frac{1}{x}}{n} \]
              10. Step-by-step derivation
                1. Applied rewrites58.5%

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

                if -8.5 < n < 6.99999999999999973e-102

                1. Initial program 80.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                  2. lower--.f64N/A

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

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

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

                  \[\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. lower-/.f64N/A

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

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

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

                    \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                  5. unpow2N/A

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

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

                    \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                  8. inv-powN/A

                    \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
                  9. lower-pow.f6458.3

                    \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
                8. Applied rewrites58.3%

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

                  \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{{x}^{2}}}{x}}{n} \]
                10. Step-by-step derivation
                  1. pow2N/A

                    \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{x \cdot x}}{x}}{n} \]
                  2. lift-/.f64N/A

                    \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{x \cdot x}}{x}}{n} \]
                  3. lift-*.f6477.3

                    \[\leadsto \frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n} \]
                11. Applied rewrites77.3%

                  \[\leadsto \frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n} \]

                if 6.99999999999999973e-102 < n < 1.25999999999999993e73 or 6.19999999999999993e168 < n

                1. Initial program 42.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                  2. lower--.f64N/A

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

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

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

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

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

                    \[\leadsto \frac{x - \log x}{n} \]
                8. Recombined 3 regimes into one program.
                9. Final simplification63.5%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -8.5:\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \mathbf{elif}\;n \leq 7 \cdot 10^{-102}:\\ \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\ \mathbf{elif}\;n \leq 1.26 \cdot 10^{+73} \lor \neg \left(n \leq 6.2 \cdot 10^{+168}\right):\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \end{array} \]
                10. Add Preprocessing

                Alternative 9: 55.8% accurate, 1.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{1}{x}}{n}\\ \mathbf{if}\;n \leq -8.5:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 7 \cdot 10^{-102}:\\ \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\ \mathbf{elif}\;n \leq 1.26 \cdot 10^{+73} \lor \neg \left(n \leq 6.2 \cdot 10^{+168}\right):\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (x n)
                 :precision binary64
                 (let* ((t_0 (/ (/ 1.0 x) n)))
                   (if (<= n -8.5)
                     t_0
                     (if (<= n 7e-102)
                       (/ (/ (/ 0.3333333333333333 (* x x)) x) n)
                       (if (or (<= n 1.26e+73) (not (<= n 6.2e+168)))
                         (/ (- (log x)) n)
                         t_0)))))
                double code(double x, double n) {
                	double t_0 = (1.0 / x) / n;
                	double tmp;
                	if (n <= -8.5) {
                		tmp = t_0;
                	} else if (n <= 7e-102) {
                		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
                	} else if ((n <= 1.26e+73) || !(n <= 6.2e+168)) {
                		tmp = -log(x) / n;
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, n)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: n
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = (1.0d0 / x) / n
                    if (n <= (-8.5d0)) then
                        tmp = t_0
                    else if (n <= 7d-102) then
                        tmp = ((0.3333333333333333d0 / (x * x)) / x) / n
                    else if ((n <= 1.26d+73) .or. (.not. (n <= 6.2d+168))) then
                        tmp = -log(x) / n
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double n) {
                	double t_0 = (1.0 / x) / n;
                	double tmp;
                	if (n <= -8.5) {
                		tmp = t_0;
                	} else if (n <= 7e-102) {
                		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
                	} else if ((n <= 1.26e+73) || !(n <= 6.2e+168)) {
                		tmp = -Math.log(x) / n;
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(x, n):
                	t_0 = (1.0 / x) / n
                	tmp = 0
                	if n <= -8.5:
                		tmp = t_0
                	elif n <= 7e-102:
                		tmp = ((0.3333333333333333 / (x * x)) / x) / n
                	elif (n <= 1.26e+73) or not (n <= 6.2e+168):
                		tmp = -math.log(x) / n
                	else:
                		tmp = t_0
                	return tmp
                
                function code(x, n)
                	t_0 = Float64(Float64(1.0 / x) / n)
                	tmp = 0.0
                	if (n <= -8.5)
                		tmp = t_0;
                	elseif (n <= 7e-102)
                		tmp = Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) / x) / n);
                	elseif ((n <= 1.26e+73) || !(n <= 6.2e+168))
                		tmp = Float64(Float64(-log(x)) / n);
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, n)
                	t_0 = (1.0 / x) / n;
                	tmp = 0.0;
                	if (n <= -8.5)
                		tmp = t_0;
                	elseif (n <= 7e-102)
                		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
                	elseif ((n <= 1.26e+73) || ~((n <= 6.2e+168)))
                		tmp = -log(x) / n;
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, n_] := Block[{t$95$0 = N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[n, -8.5], t$95$0, If[LessEqual[n, 7e-102], N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision], If[Or[LessEqual[n, 1.26e+73], N[Not[LessEqual[n, 6.2e+168]], $MachinePrecision]], N[((-N[Log[x], $MachinePrecision]) / n), $MachinePrecision], t$95$0]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \frac{\frac{1}{x}}{n}\\
                \mathbf{if}\;n \leq -8.5:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;n \leq 7 \cdot 10^{-102}:\\
                \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\
                
                \mathbf{elif}\;n \leq 1.26 \cdot 10^{+73} \lor \neg \left(n \leq 6.2 \cdot 10^{+168}\right):\\
                \;\;\;\;\frac{-\log x}{n}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if n < -8.5 or 1.25999999999999993e73 < n < 6.19999999999999993e168

                  1. Initial program 29.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                    2. lower--.f64N/A

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

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

                      \[\leadsto \frac{\mathsf{log1p}\left(x\right) - \log x}{n} \]
                  5. Applied rewrites66.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. lower-/.f64N/A

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

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

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

                      \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                    5. unpow2N/A

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

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

                      \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                    8. inv-powN/A

                      \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
                    9. lower-pow.f6457.6

                      \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
                  8. Applied rewrites57.6%

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

                    \[\leadsto \frac{\frac{1}{x}}{n} \]
                  10. Step-by-step derivation
                    1. Applied rewrites58.5%

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

                    if -8.5 < n < 6.99999999999999973e-102

                    1. Initial program 80.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                      2. lower--.f64N/A

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

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

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

                      \[\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. lower-/.f64N/A

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

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

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

                        \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                      5. unpow2N/A

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

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

                        \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                      8. inv-powN/A

                        \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
                      9. lower-pow.f6458.3

                        \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
                    8. Applied rewrites58.3%

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

                      \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{{x}^{2}}}{x}}{n} \]
                    10. Step-by-step derivation
                      1. pow2N/A

                        \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{x \cdot x}}{x}}{n} \]
                      2. lift-/.f64N/A

                        \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{x \cdot x}}{x}}{n} \]
                      3. lift-*.f6477.3

                        \[\leadsto \frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n} \]
                    11. Applied rewrites77.3%

                      \[\leadsto \frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n} \]

                    if 6.99999999999999973e-102 < n < 1.25999999999999993e73 or 6.19999999999999993e168 < n

                    1. Initial program 42.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                      2. lower--.f64N/A

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

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

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

                      \[\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. log-pow-revN/A

                        \[\leadsto \frac{\log \left({x}^{-1}\right)}{n} \]
                      2. inv-powN/A

                        \[\leadsto \frac{\log \left(\frac{1}{x}\right)}{n} \]
                      3. neg-logN/A

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

                        \[\leadsto \frac{\mathsf{neg}\left(\log x\right)}{n} \]
                      5. lift-neg.f6450.0

                        \[\leadsto \frac{-\log x}{n} \]
                    8. Applied rewrites50.0%

                      \[\leadsto \frac{-\log x}{n} \]
                  11. Recombined 3 regimes into one program.
                  12. Final simplification63.2%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -8.5:\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \mathbf{elif}\;n \leq 7 \cdot 10^{-102}:\\ \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\ \mathbf{elif}\;n \leq 1.26 \cdot 10^{+73} \lor \neg \left(n \leq 6.2 \cdot 10^{+168}\right):\\ \;\;\;\;\frac{-\log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \end{array} \]
                  13. Add Preprocessing

                  Alternative 10: 55.1% accurate, 4.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -8.5 \lor \neg \left(n \leq 3.3 \cdot 10^{-100}\right):\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\ \end{array} \end{array} \]
                  (FPCore (x n)
                   :precision binary64
                   (if (or (<= n -8.5) (not (<= n 3.3e-100)))
                     (/ (/ 1.0 x) n)
                     (/ (/ (/ 0.3333333333333333 (* x x)) x) n)))
                  double code(double x, double n) {
                  	double tmp;
                  	if ((n <= -8.5) || !(n <= 3.3e-100)) {
                  		tmp = (1.0 / x) / n;
                  	} else {
                  		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, n)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: n
                      real(8) :: tmp
                      if ((n <= (-8.5d0)) .or. (.not. (n <= 3.3d-100))) then
                          tmp = (1.0d0 / x) / n
                      else
                          tmp = ((0.3333333333333333d0 / (x * x)) / x) / n
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double n) {
                  	double tmp;
                  	if ((n <= -8.5) || !(n <= 3.3e-100)) {
                  		tmp = (1.0 / x) / n;
                  	} else {
                  		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, n):
                  	tmp = 0
                  	if (n <= -8.5) or not (n <= 3.3e-100):
                  		tmp = (1.0 / x) / n
                  	else:
                  		tmp = ((0.3333333333333333 / (x * x)) / x) / n
                  	return tmp
                  
                  function code(x, n)
                  	tmp = 0.0
                  	if ((n <= -8.5) || !(n <= 3.3e-100))
                  		tmp = Float64(Float64(1.0 / x) / n);
                  	else
                  		tmp = Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) / x) / n);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, n)
                  	tmp = 0.0;
                  	if ((n <= -8.5) || ~((n <= 3.3e-100)))
                  		tmp = (1.0 / x) / n;
                  	else
                  		tmp = ((0.3333333333333333 / (x * x)) / x) / n;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, n_] := If[Or[LessEqual[n, -8.5], N[Not[LessEqual[n, 3.3e-100]], $MachinePrecision]], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;n \leq -8.5 \lor \neg \left(n \leq 3.3 \cdot 10^{-100}\right):\\
                  \;\;\;\;\frac{\frac{1}{x}}{n}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if n < -8.5 or 3.29999999999999996e-100 < n

                    1. Initial program 35.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                      2. lower--.f64N/A

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

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

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

                      \[\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. lower-/.f64N/A

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

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

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

                        \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                      5. unpow2N/A

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

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

                        \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                      8. inv-powN/A

                        \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
                      9. lower-pow.f6444.0

                        \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
                    8. Applied rewrites44.0%

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

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

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

                      if -8.5 < n < 3.29999999999999996e-100

                      1. Initial program 80.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                        2. lower--.f64N/A

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

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

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

                        \[\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. lower-/.f64N/A

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

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

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

                          \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                        5. unpow2N/A

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

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

                          \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                        8. inv-powN/A

                          \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
                        9. lower-pow.f6458.3

                          \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
                      8. Applied rewrites58.3%

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

                        \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{{x}^{2}}}{x}}{n} \]
                      10. Step-by-step derivation
                        1. pow2N/A

                          \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{x \cdot x}}{x}}{n} \]
                        2. lift-/.f64N/A

                          \[\leadsto \frac{\frac{\frac{\frac{1}{3}}{x \cdot x}}{x}}{n} \]
                        3. lift-*.f6477.3

                          \[\leadsto \frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n} \]
                      11. Applied rewrites77.3%

                        \[\leadsto \frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n} \]
                    11. Recombined 2 regimes into one program.
                    12. Final simplification57.1%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -8.5 \lor \neg \left(n \leq 3.3 \cdot 10^{-100}\right):\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{0.3333333333333333}{x \cdot x}}{x}}{n}\\ \end{array} \]
                    13. Add Preprocessing

                    Alternative 11: 53.7% accurate, 5.1× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -8.5 \lor \neg \left(n \leq 3.3 \cdot 10^{-100}\right):\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.3333333333333333}{n \cdot \left(x \cdot x\right)}}{x}\\ \end{array} \end{array} \]
                    (FPCore (x n)
                     :precision binary64
                     (if (or (<= n -8.5) (not (<= n 3.3e-100)))
                       (/ (/ 1.0 x) n)
                       (/ (/ 0.3333333333333333 (* n (* x x))) x)))
                    double code(double x, double n) {
                    	double tmp;
                    	if ((n <= -8.5) || !(n <= 3.3e-100)) {
                    		tmp = (1.0 / x) / n;
                    	} else {
                    		tmp = (0.3333333333333333 / (n * (x * x))) / x;
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, n)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: n
                        real(8) :: tmp
                        if ((n <= (-8.5d0)) .or. (.not. (n <= 3.3d-100))) then
                            tmp = (1.0d0 / x) / n
                        else
                            tmp = (0.3333333333333333d0 / (n * (x * x))) / x
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double n) {
                    	double tmp;
                    	if ((n <= -8.5) || !(n <= 3.3e-100)) {
                    		tmp = (1.0 / x) / n;
                    	} else {
                    		tmp = (0.3333333333333333 / (n * (x * x))) / x;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, n):
                    	tmp = 0
                    	if (n <= -8.5) or not (n <= 3.3e-100):
                    		tmp = (1.0 / x) / n
                    	else:
                    		tmp = (0.3333333333333333 / (n * (x * x))) / x
                    	return tmp
                    
                    function code(x, n)
                    	tmp = 0.0
                    	if ((n <= -8.5) || !(n <= 3.3e-100))
                    		tmp = Float64(Float64(1.0 / x) / n);
                    	else
                    		tmp = Float64(Float64(0.3333333333333333 / Float64(n * Float64(x * x))) / x);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, n)
                    	tmp = 0.0;
                    	if ((n <= -8.5) || ~((n <= 3.3e-100)))
                    		tmp = (1.0 / x) / n;
                    	else
                    		tmp = (0.3333333333333333 / (n * (x * x))) / x;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, n_] := If[Or[LessEqual[n, -8.5], N[Not[LessEqual[n, 3.3e-100]], $MachinePrecision]], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], N[(N[(0.3333333333333333 / N[(n * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;n \leq -8.5 \lor \neg \left(n \leq 3.3 \cdot 10^{-100}\right):\\
                    \;\;\;\;\frac{\frac{1}{x}}{n}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{\frac{0.3333333333333333}{n \cdot \left(x \cdot x\right)}}{x}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if n < -8.5 or 3.29999999999999996e-100 < n

                      1. Initial program 35.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                        2. lower--.f64N/A

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

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

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

                        \[\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. lower-/.f64N/A

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

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

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

                          \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                        5. unpow2N/A

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

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

                          \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                        8. inv-powN/A

                          \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
                        9. lower-pow.f6444.0

                          \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
                      8. Applied rewrites44.0%

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

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

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

                        if -8.5 < n < 3.29999999999999996e-100

                        1. Initial program 80.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                          2. lower--.f64N/A

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

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

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

                          \[\leadsto \color{blue}{\frac{\mathsf{log1p}\left(x\right) - \log x}{n}} \]
                        6. 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}} \]
                        7. Step-by-step derivation
                          1. lower-/.f64N/A

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

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

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

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

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

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

                            \[\leadsto \frac{\left(\frac{\frac{1}{3}}{n \cdot \left(x \cdot x\right)} + \frac{1}{n}\right) - \frac{\frac{1}{2}}{n \cdot x}}{x} \]
                          8. inv-powN/A

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

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

                            \[\leadsto \frac{\left(\frac{\frac{1}{3}}{n \cdot \left(x \cdot x\right)} + {n}^{-1}\right) - \frac{\frac{1}{2}}{n \cdot x}}{x} \]
                          11. lift-*.f6425.1

                            \[\leadsto \frac{\left(\frac{0.3333333333333333}{n \cdot \left(x \cdot x\right)} + {n}^{-1}\right) - \frac{0.5}{n \cdot x}}{x} \]
                        8. Applied rewrites25.1%

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

                          \[\leadsto \frac{\frac{\frac{1}{3}}{n \cdot {x}^{2}}}{x} \]
                        10. Step-by-step derivation
                          1. pow2N/A

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

                            \[\leadsto \frac{\frac{\frac{1}{3}}{n \cdot \left(x \cdot x\right)}}{x} \]
                          3. lift-*.f64N/A

                            \[\leadsto \frac{\frac{\frac{1}{3}}{n \cdot \left(x \cdot x\right)}}{x} \]
                          4. lift-/.f6472.4

                            \[\leadsto \frac{\frac{0.3333333333333333}{n \cdot \left(x \cdot x\right)}}{x} \]
                        11. Applied rewrites72.4%

                          \[\leadsto \frac{\frac{0.3333333333333333}{n \cdot \left(x \cdot x\right)}}{x} \]
                      11. Recombined 2 regimes into one program.
                      12. Final simplification55.3%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -8.5 \lor \neg \left(n \leq 3.3 \cdot 10^{-100}\right):\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.3333333333333333}{n \cdot \left(x \cdot x\right)}}{x}\\ \end{array} \]
                      13. Add Preprocessing

                      Alternative 12: 46.1% accurate, 6.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -0.36 \lor \neg \left(n \leq -2 \cdot 10^{-264}\right):\\ \;\;\;\;\frac{\frac{1}{x}}{n}\\ \mathbf{else}:\\ \;\;\;\;1 - 1\\ \end{array} \end{array} \]
                      (FPCore (x n)
                       :precision binary64
                       (if (or (<= n -0.36) (not (<= n -2e-264))) (/ (/ 1.0 x) n) (- 1.0 1.0)))
                      double code(double x, double n) {
                      	double tmp;
                      	if ((n <= -0.36) || !(n <= -2e-264)) {
                      		tmp = (1.0 / x) / n;
                      	} else {
                      		tmp = 1.0 - 1.0;
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, n)
                      use fmin_fmax_functions
                          real(8), intent (in) :: x
                          real(8), intent (in) :: n
                          real(8) :: tmp
                          if ((n <= (-0.36d0)) .or. (.not. (n <= (-2d-264)))) then
                              tmp = (1.0d0 / x) / n
                          else
                              tmp = 1.0d0 - 1.0d0
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double n) {
                      	double tmp;
                      	if ((n <= -0.36) || !(n <= -2e-264)) {
                      		tmp = (1.0 / x) / n;
                      	} else {
                      		tmp = 1.0 - 1.0;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, n):
                      	tmp = 0
                      	if (n <= -0.36) or not (n <= -2e-264):
                      		tmp = (1.0 / x) / n
                      	else:
                      		tmp = 1.0 - 1.0
                      	return tmp
                      
                      function code(x, n)
                      	tmp = 0.0
                      	if ((n <= -0.36) || !(n <= -2e-264))
                      		tmp = Float64(Float64(1.0 / x) / n);
                      	else
                      		tmp = Float64(1.0 - 1.0);
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, n)
                      	tmp = 0.0;
                      	if ((n <= -0.36) || ~((n <= -2e-264)))
                      		tmp = (1.0 / x) / n;
                      	else
                      		tmp = 1.0 - 1.0;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, n_] := If[Or[LessEqual[n, -0.36], N[Not[LessEqual[n, -2e-264]], $MachinePrecision]], N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision], N[(1.0 - 1.0), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;n \leq -0.36 \lor \neg \left(n \leq -2 \cdot 10^{-264}\right):\\
                      \;\;\;\;\frac{\frac{1}{x}}{n}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;1 - 1\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if n < -0.35999999999999999 or -2e-264 < n

                        1. Initial program 38.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 \frac{\log \left(1 + x\right) - \log x}{\color{blue}{n}} \]
                          2. lower--.f64N/A

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

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

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

                          \[\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. lower-/.f64N/A

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

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

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

                            \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{{x}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                          5. unpow2N/A

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

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

                            \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot \frac{1}{x}}{x}}{n} \]
                          8. inv-powN/A

                            \[\leadsto \frac{\frac{\left(1 + \frac{\frac{1}{3}}{x \cdot x}\right) - \frac{1}{2} \cdot {x}^{-1}}{x}}{n} \]
                          9. lower-pow.f6449.9

                            \[\leadsto \frac{\frac{\left(1 + \frac{0.3333333333333333}{x \cdot x}\right) - 0.5 \cdot {x}^{-1}}{x}}{n} \]
                        8. Applied rewrites49.9%

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

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

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

                          if -0.35999999999999999 < n < -2e-264

                          1. Initial program 100.0%

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

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

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

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

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

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

                            Alternative 13: 45.6% accurate, 8.0× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -0.36 \lor \neg \left(n \leq -2 \cdot 10^{-264}\right):\\ \;\;\;\;\frac{1}{n \cdot x}\\ \mathbf{else}:\\ \;\;\;\;1 - 1\\ \end{array} \end{array} \]
                            (FPCore (x n)
                             :precision binary64
                             (if (or (<= n -0.36) (not (<= n -2e-264))) (/ 1.0 (* n x)) (- 1.0 1.0)))
                            double code(double x, double n) {
                            	double tmp;
                            	if ((n <= -0.36) || !(n <= -2e-264)) {
                            		tmp = 1.0 / (n * x);
                            	} else {
                            		tmp = 1.0 - 1.0;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, n)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: n
                                real(8) :: tmp
                                if ((n <= (-0.36d0)) .or. (.not. (n <= (-2d-264)))) then
                                    tmp = 1.0d0 / (n * x)
                                else
                                    tmp = 1.0d0 - 1.0d0
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double n) {
                            	double tmp;
                            	if ((n <= -0.36) || !(n <= -2e-264)) {
                            		tmp = 1.0 / (n * x);
                            	} else {
                            		tmp = 1.0 - 1.0;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, n):
                            	tmp = 0
                            	if (n <= -0.36) or not (n <= -2e-264):
                            		tmp = 1.0 / (n * x)
                            	else:
                            		tmp = 1.0 - 1.0
                            	return tmp
                            
                            function code(x, n)
                            	tmp = 0.0
                            	if ((n <= -0.36) || !(n <= -2e-264))
                            		tmp = Float64(1.0 / Float64(n * x));
                            	else
                            		tmp = Float64(1.0 - 1.0);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, n)
                            	tmp = 0.0;
                            	if ((n <= -0.36) || ~((n <= -2e-264)))
                            		tmp = 1.0 / (n * x);
                            	else
                            		tmp = 1.0 - 1.0;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, n_] := If[Or[LessEqual[n, -0.36], N[Not[LessEqual[n, -2e-264]], $MachinePrecision]], N[(1.0 / N[(n * x), $MachinePrecision]), $MachinePrecision], N[(1.0 - 1.0), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;n \leq -0.36 \lor \neg \left(n \leq -2 \cdot 10^{-264}\right):\\
                            \;\;\;\;\frac{1}{n \cdot x}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;1 - 1\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if n < -0.35999999999999999 or -2e-264 < n

                              1. Initial program 38.4%

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

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

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

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

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

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

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

                                  \[\leadsto \frac{e^{-\frac{-1 \cdot \log x}{n}}}{n \cdot x} \]
                                7. lower-/.f64N/A

                                  \[\leadsto \frac{e^{-\frac{-1 \cdot \log x}{n}}}{n \cdot x} \]
                                8. mul-1-negN/A

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

                                  \[\leadsto \frac{e^{-\frac{-\log x}{n}}}{n \cdot x} \]
                                10. lower-log.f64N/A

                                  \[\leadsto \frac{e^{-\frac{-\log x}{n}}}{n \cdot x} \]
                                11. lower-*.f6443.4

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

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

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

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

                                if -0.35999999999999999 < n < -2e-264

                                1. Initial program 100.0%

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

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

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

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

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

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

                                  Alternative 14: 29.2% accurate, 57.8× speedup?

                                  \[\begin{array}{l} \\ 1 - 1 \end{array} \]
                                  (FPCore (x n) :precision binary64 (- 1.0 1.0))
                                  double code(double x, double n) {
                                  	return 1.0 - 1.0;
                                  }
                                  
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, n)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: n
                                      code = 1.0d0 - 1.0d0
                                  end function
                                  
                                  public static double code(double x, double n) {
                                  	return 1.0 - 1.0;
                                  }
                                  
                                  def code(x, n):
                                  	return 1.0 - 1.0
                                  
                                  function code(x, n)
                                  	return Float64(1.0 - 1.0)
                                  end
                                  
                                  function tmp = code(x, n)
                                  	tmp = 1.0 - 1.0;
                                  end
                                  
                                  code[x_, n_] := N[(1.0 - 1.0), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  1 - 1
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 52.6%

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

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

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

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

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

                                      Reproduce

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