2nthrt (problem 3.4.6)

Percentage Accurate: 53.6% → 83.1%
Time: 27.5s
Alternatives: 18
Speedup: 1.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 18 alternatives:

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

Initial Program: 53.6% 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: 83.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := e^{\frac{\log x}{n}}\\
\mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{-13}:\\
\;\;\;\;\frac{t\_0}{n \cdot x}\\

\mathbf{elif}\;\frac{1}{n} \leq 1.5 \cdot 10^{-182}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}}{n}, \mathsf{log1p}\left(x\right)\right) - \log x}{n}\\

\mathbf{elif}\;\frac{1}{n} \leq 50:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\frac{-0.5 + \frac{0.5}{n}}{n}}{x}, t\_0, \frac{t\_0}{n}\right)}{x}\\

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


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

    1. Initial program 96.5%

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

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

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

      if -1e-13 < (/.f64 #s(literal 1 binary64) n) < 1.5000000000000001e-182

      1. Initial program 41.3%

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

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

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

        if 1.5000000000000001e-182 < (/.f64 #s(literal 1 binary64) n) < 50

        1. Initial program 20.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{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n} + \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}} \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right)}{x}}{x}} \]
        4. Applied rewrites67.7%

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

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

        1. Initial program 51.1%

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

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

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

            \[\leadsto e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)} \]
          3. Step-by-step derivation
            1. Applied rewrites100.0%

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

          Alternative 2: 82.2% accurate, 0.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := {x}^{\left(\frac{1}{n}\right)}\\ t_1 := {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - t\_0\\ \mathbf{if}\;t\_1 \leq -2:\\ \;\;\;\;1 - t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{0.5}{n} - 0.5, x, 1\right)}{n}, x, 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 -2.0)
               (- 1.0 t_0)
               (if (<= t_1 0.0)
                 (/ (- (log1p x) (log x)) n)
                 (- (fma (/ (fma (- (/ 0.5 n) 0.5) x 1.0) n) x 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 <= -2.0) {
          		tmp = 1.0 - t_0;
          	} else if (t_1 <= 0.0) {
          		tmp = (log1p(x) - log(x)) / n;
          	} else {
          		tmp = fma((fma(((0.5 / n) - 0.5), x, 1.0) / n), x, 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 <= -2.0)
          		tmp = Float64(1.0 - t_0);
          	elseif (t_1 <= 0.0)
          		tmp = Float64(Float64(log1p(x) - log(x)) / n);
          	else
          		tmp = Float64(fma(Float64(fma(Float64(Float64(0.5 / n) - 0.5), x, 1.0) / n), x, 1.0) - t_0);
          	end
          	return tmp
          end
          
          code[x_, n_] := Block[{t$95$0 = N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, -2.0], N[(1.0 - t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(N[(N[(N[(N[(0.5 / n), $MachinePrecision] - 0.5), $MachinePrecision] * x + 1.0), $MachinePrecision] / n), $MachinePrecision] * x + 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 -2:\\
          \;\;\;\;1 - t\_0\\
          
          \mathbf{elif}\;t\_1 \leq 0:\\
          \;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{0.5}{n} - 0.5, x, 1\right)}{n}, x, 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))) < -2

            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 rewrites100.0%

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

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

              1. Initial program 50.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. Applied rewrites79.9%

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

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

                1. Initial program 50.1%

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

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

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

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

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

                Alternative 3: 81.6% accurate, 0.4× speedup?

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

                  1. Initial program 81.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. Applied rewrites90.6%

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

                    if -4.9999999999999999e-122 < (/.f64 #s(literal 1 binary64) n) < 1.5000000000000001e-182

                    1. Initial program 46.7%

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

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

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

                      if 1.5000000000000001e-182 < (/.f64 #s(literal 1 binary64) n) < 50

                      1. Initial program 20.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{\frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}}}{n} + \frac{e^{-1 \cdot \frac{\log \left(\frac{1}{x}\right)}{n}} \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right)}{x}}{x}} \]
                      4. Applied rewrites67.7%

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

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

                      1. Initial program 51.1%

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

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

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

                          \[\leadsto e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)} \]
                        3. Step-by-step derivation
                          1. Applied rewrites100.0%

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

                        Alternative 4: 81.5% accurate, 0.8× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{e^{\frac{\log x}{n}}}{n \cdot x}\\ \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-122}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-188}:\\ \;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 50:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \end{array} \end{array} \]
                        (FPCore (x n)
                         :precision binary64
                         (let* ((t_0 (/ (exp (/ (log x) n)) (* n x))))
                           (if (<= (/ 1.0 n) -5e-122)
                             t_0
                             (if (<= (/ 1.0 n) 2e-188)
                               (/ (- (log1p x) (log x)) n)
                               (if (<= (/ 1.0 n) 50.0) t_0 (- (exp (/ x n)) (pow x (/ 1.0 n))))))))
                        double code(double x, double n) {
                        	double t_0 = exp((log(x) / n)) / (n * x);
                        	double tmp;
                        	if ((1.0 / n) <= -5e-122) {
                        		tmp = t_0;
                        	} else if ((1.0 / n) <= 2e-188) {
                        		tmp = (log1p(x) - log(x)) / n;
                        	} else if ((1.0 / n) <= 50.0) {
                        		tmp = t_0;
                        	} else {
                        		tmp = exp((x / n)) - pow(x, (1.0 / n));
                        	}
                        	return tmp;
                        }
                        
                        public static double code(double x, double n) {
                        	double t_0 = Math.exp((Math.log(x) / n)) / (n * x);
                        	double tmp;
                        	if ((1.0 / n) <= -5e-122) {
                        		tmp = t_0;
                        	} else if ((1.0 / n) <= 2e-188) {
                        		tmp = (Math.log1p(x) - Math.log(x)) / n;
                        	} else if ((1.0 / n) <= 50.0) {
                        		tmp = t_0;
                        	} else {
                        		tmp = Math.exp((x / n)) - Math.pow(x, (1.0 / n));
                        	}
                        	return tmp;
                        }
                        
                        def code(x, n):
                        	t_0 = math.exp((math.log(x) / n)) / (n * x)
                        	tmp = 0
                        	if (1.0 / n) <= -5e-122:
                        		tmp = t_0
                        	elif (1.0 / n) <= 2e-188:
                        		tmp = (math.log1p(x) - math.log(x)) / n
                        	elif (1.0 / n) <= 50.0:
                        		tmp = t_0
                        	else:
                        		tmp = math.exp((x / n)) - math.pow(x, (1.0 / n))
                        	return tmp
                        
                        function code(x, n)
                        	t_0 = Float64(exp(Float64(log(x) / n)) / Float64(n * x))
                        	tmp = 0.0
                        	if (Float64(1.0 / n) <= -5e-122)
                        		tmp = t_0;
                        	elseif (Float64(1.0 / n) <= 2e-188)
                        		tmp = Float64(Float64(log1p(x) - log(x)) / n);
                        	elseif (Float64(1.0 / n) <= 50.0)
                        		tmp = t_0;
                        	else
                        		tmp = Float64(exp(Float64(x / n)) - (x ^ Float64(1.0 / n)));
                        	end
                        	return tmp
                        end
                        
                        code[x_, n_] := Block[{t$95$0 = N[(N[Exp[N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]], $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 / n), $MachinePrecision], -5e-122], t$95$0, If[LessEqual[N[(1.0 / n), $MachinePrecision], 2e-188], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[N[(1.0 / n), $MachinePrecision], 50.0], t$95$0, N[(N[Exp[N[(x / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \frac{e^{\frac{\log x}{n}}}{n \cdot x}\\
                        \mathbf{if}\;\frac{1}{n} \leq -5 \cdot 10^{-122}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;\frac{1}{n} \leq 2 \cdot 10^{-188}:\\
                        \;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
                        
                        \mathbf{elif}\;\frac{1}{n} \leq 50:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;e^{\frac{x}{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) < -4.9999999999999999e-122 or 1.9999999999999999e-188 < (/.f64 #s(literal 1 binary64) n) < 50

                          1. Initial program 64.1%

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

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

                            if -4.9999999999999999e-122 < (/.f64 #s(literal 1 binary64) n) < 1.9999999999999999e-188

                            1. Initial program 47.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. Applied rewrites92.3%

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

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

                              1. Initial program 51.1%

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

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

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

                                  \[\leadsto e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites100.0%

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

                                Alternative 5: 85.7% accurate, 0.9× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -0.005 \lor \neg \left(\frac{1}{n} \leq 50\right):\\ \;\;\;\;e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\ \end{array} \end{array} \]
                                (FPCore (x n)
                                 :precision binary64
                                 (if (or (<= (/ 1.0 n) -0.005) (not (<= (/ 1.0 n) 50.0)))
                                   (- (exp (/ x n)) (pow x (/ 1.0 n)))
                                   (/ (- (log1p x) (log x)) n)))
                                double code(double x, double n) {
                                	double tmp;
                                	if (((1.0 / n) <= -0.005) || !((1.0 / n) <= 50.0)) {
                                		tmp = exp((x / n)) - pow(x, (1.0 / n));
                                	} else {
                                		tmp = (log1p(x) - log(x)) / n;
                                	}
                                	return tmp;
                                }
                                
                                public static double code(double x, double n) {
                                	double tmp;
                                	if (((1.0 / n) <= -0.005) || !((1.0 / n) <= 50.0)) {
                                		tmp = Math.exp((x / n)) - Math.pow(x, (1.0 / n));
                                	} else {
                                		tmp = (Math.log1p(x) - Math.log(x)) / n;
                                	}
                                	return tmp;
                                }
                                
                                def code(x, n):
                                	tmp = 0
                                	if ((1.0 / n) <= -0.005) or not ((1.0 / n) <= 50.0):
                                		tmp = math.exp((x / n)) - math.pow(x, (1.0 / n))
                                	else:
                                		tmp = (math.log1p(x) - math.log(x)) / n
                                	return tmp
                                
                                function code(x, n)
                                	tmp = 0.0
                                	if ((Float64(1.0 / n) <= -0.005) || !(Float64(1.0 / n) <= 50.0))
                                		tmp = Float64(exp(Float64(x / n)) - (x ^ Float64(1.0 / n)));
                                	else
                                		tmp = Float64(Float64(log1p(x) - log(x)) / n);
                                	end
                                	return tmp
                                end
                                
                                code[x_, n_] := If[Or[LessEqual[N[(1.0 / n), $MachinePrecision], -0.005], N[Not[LessEqual[N[(1.0 / n), $MachinePrecision], 50.0]], $MachinePrecision]], N[(N[Exp[N[(x / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[1 + x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;\frac{1}{n} \leq -0.005 \lor \neg \left(\frac{1}{n} \leq 50\right):\\
                                \;\;\;\;e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if (/.f64 #s(literal 1 binary64) n) < -0.0050000000000000001 or 50 < (/.f64 #s(literal 1 binary64) n)

                                  1. Initial program 81.0%

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

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

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

                                      \[\leadsto e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites100.0%

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

                                      if -0.0050000000000000001 < (/.f64 #s(literal 1 binary64) n) < 50

                                      1. Initial program 34.4%

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

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

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

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -0.005 \lor \neg \left(\frac{1}{n} \leq 50\right):\\ \;\;\;\;e^{\frac{x}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{log1p}\left(x\right) - \log x}{n}\\ \end{array} \]
                                      7. Add Preprocessing

                                      Alternative 6: 54.1% accurate, 1.0× speedup?

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

                                        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 rewrites70.5%

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

                                          if -9.99999999999999974e232 < (/.f64 #s(literal 1 binary64) n) < -9.99999999999999948e123

                                          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 rewrites16.3%

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

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

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

                                              if -9.99999999999999948e123 < (/.f64 #s(literal 1 binary64) n) < -4e3

                                              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 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. Applied rewrites100.0%

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

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

                                                    \[\leadsto \frac{\frac{-\log x}{n \cdot x} - \frac{1}{x}}{\color{blue}{-n}} \]
                                                  2. Step-by-step derivation
                                                    1. Applied rewrites68.9%

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

                                                    if -4e3 < (/.f64 #s(literal 1 binary64) n) < 50

                                                    1. Initial program 34.9%

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

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

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

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

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

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

                                                        1. Initial program 51.1%

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

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

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

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

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

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

                                                        Alternative 7: 53.9% accurate, 1.0× speedup?

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

                                                          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 rewrites70.5%

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

                                                            if -9.99999999999999974e232 < (/.f64 #s(literal 1 binary64) n) < -9.99999999999999948e123

                                                            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 rewrites16.3%

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

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

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

                                                                if -9.99999999999999948e123 < (/.f64 #s(literal 1 binary64) n) < -4e3

                                                                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 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. Applied rewrites100.0%

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

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

                                                                      \[\leadsto \frac{\frac{-\log x}{n \cdot x} - \frac{1}{x}}{\color{blue}{-n}} \]
                                                                    2. Step-by-step derivation
                                                                      1. Applied rewrites68.9%

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

                                                                      if -4e3 < (/.f64 #s(literal 1 binary64) n) < 50

                                                                      1. Initial program 34.9%

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

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

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

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

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

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

                                                                          1. Initial program 51.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}{\left(1 + x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                          4. Step-by-step derivation
                                                                            1. Applied rewrites70.8%

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

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

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

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

                                                                            Alternative 8: 53.8% accurate, 1.1× speedup?

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

                                                                              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 rewrites70.5%

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

                                                                                if -9.99999999999999974e232 < (/.f64 #s(literal 1 binary64) n) < -9.99999999999999948e123

                                                                                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 rewrites16.3%

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

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

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

                                                                                    if -9.99999999999999948e123 < (/.f64 #s(literal 1 binary64) n) < -4e3

                                                                                    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 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. Applied rewrites100.0%

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

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

                                                                                          \[\leadsto \frac{\frac{-\log x}{n \cdot x} - \frac{1}{x}}{\color{blue}{-n}} \]
                                                                                        2. Step-by-step derivation
                                                                                          1. Applied rewrites68.9%

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

                                                                                          if -4e3 < (/.f64 #s(literal 1 binary64) n) < 50

                                                                                          1. Initial program 34.9%

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

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

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

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

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

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

                                                                                              1. Initial program 72.7%

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

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

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

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

                                                                                                1. Initial program 13.9%

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

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

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

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

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

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

                                                                                                        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 1\right), n, 0.5 \cdot x\right)}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                      2. Taylor expanded in x around 0

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

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

                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{n} \leq -1 \cdot 10^{+233}:\\ \;\;\;\;1 - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{elif}\;\frac{1}{n} \leq -1 \cdot 10^{+124}:\\ \;\;\;\;1 - 1\\ \mathbf{elif}\;\frac{1}{n} \leq -4000:\\ \;\;\;\;\frac{\log x \cdot x + n \cdot x}{\left(\left(n \cdot x\right) \cdot x\right) \cdot n}\\ \mathbf{elif}\;\frac{1}{n} \leq 50:\\ \;\;\;\;\frac{\frac{\log x}{n \cdot x} - \frac{-1}{x}}{n}\\ \mathbf{elif}\;\frac{1}{n} \leq 10^{+188}:\\ \;\;\;\;\left(\frac{x}{n} - -1\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{n}{n \cdot n}, x, 1\right) - 1\\ \end{array} \]
                                                                                                      6. Add Preprocessing

                                                                                                      Alternative 9: 52.9% accurate, 1.2× speedup?

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

                                                                                                        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 rewrites70.5%

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

                                                                                                          if -9.99999999999999974e232 < (/.f64 #s(literal 1 binary64) n) < -4e3

                                                                                                          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 rewrites36.0%

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

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

                                                                                                              if -4e3 < (/.f64 #s(literal 1 binary64) n) < 50

                                                                                                              1. Initial program 34.9%

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

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

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

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

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

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

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

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

                                                                                                                    1. Initial program 72.7%

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

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

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

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

                                                                                                                      1. Initial program 13.9%

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

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

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

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

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

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

                                                                                                                              \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 1\right), n, 0.5 \cdot x\right)}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                                            2. Taylor expanded in x around 0

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

                                                                                                                                \[\leadsto \mathsf{fma}\left(\frac{n}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                                            4. Recombined 5 regimes into one program.
                                                                                                                            5. Add Preprocessing

                                                                                                                            Alternative 10: 52.8% accurate, 1.3× speedup?

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

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

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

                                                                                                                                if -9.99999999999999974e232 < (/.f64 #s(literal 1 binary64) n) < -4e3

                                                                                                                                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 rewrites36.0%

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

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

                                                                                                                                    if -4e3 < (/.f64 #s(literal 1 binary64) n) < 50

                                                                                                                                    1. Initial program 34.9%

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

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

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

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

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

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

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

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

                                                                                                                                          1. Initial program 13.9%

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

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

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

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

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

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

                                                                                                                                                  \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 1\right), n, 0.5 \cdot x\right)}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                                                                2. Taylor expanded in x around 0

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

                                                                                                                                                    \[\leadsto \mathsf{fma}\left(\frac{n}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                                                                4. Recombined 4 regimes into one program.
                                                                                                                                                5. Add Preprocessing

                                                                                                                                                Alternative 11: 53.4% accurate, 1.4× speedup?

                                                                                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -200:\\ \;\;\;\;\frac{\frac{\log x}{n} + 1}{n \cdot x}\\ \mathbf{elif}\;n \leq -4.6 \cdot 10^{-117}:\\ \;\;\;\;\frac{\log x \cdot x + n \cdot x}{\left(\left(n \cdot x\right) \cdot x\right) \cdot n}\\ \mathbf{elif}\;n \leq -1 \cdot 10^{-227}:\\ \;\;\;\;1 - 1\\ \mathbf{elif}\;n \leq 3.5 \cdot 10^{-190}:\\ \;\;\;\;\mathsf{fma}\left(\frac{n}{n \cdot n}, x, 1\right) - 1\\ \mathbf{elif}\;n \leq 0.03:\\ \;\;\;\;\left(\frac{x}{n} - -1\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n}}{x}\\ \end{array} \end{array} \]
                                                                                                                                                (FPCore (x n)
                                                                                                                                                 :precision binary64
                                                                                                                                                 (if (<= n -200.0)
                                                                                                                                                   (/ (+ (/ (log x) n) 1.0) (* n x))
                                                                                                                                                   (if (<= n -4.6e-117)
                                                                                                                                                     (/ (+ (* (log x) x) (* n x)) (* (* (* n x) x) n))
                                                                                                                                                     (if (<= n -1e-227)
                                                                                                                                                       (- 1.0 1.0)
                                                                                                                                                       (if (<= n 3.5e-190)
                                                                                                                                                         (- (fma (/ n (* n n)) x 1.0) 1.0)
                                                                                                                                                         (if (<= n 0.03)
                                                                                                                                                           (- (- (/ x n) -1.0) (pow x (/ 1.0 n)))
                                                                                                                                                           (/ (/ 1.0 n) x)))))))
                                                                                                                                                double code(double x, double n) {
                                                                                                                                                	double tmp;
                                                                                                                                                	if (n <= -200.0) {
                                                                                                                                                		tmp = ((log(x) / n) + 1.0) / (n * x);
                                                                                                                                                	} else if (n <= -4.6e-117) {
                                                                                                                                                		tmp = ((log(x) * x) + (n * x)) / (((n * x) * x) * n);
                                                                                                                                                	} else if (n <= -1e-227) {
                                                                                                                                                		tmp = 1.0 - 1.0;
                                                                                                                                                	} else if (n <= 3.5e-190) {
                                                                                                                                                		tmp = fma((n / (n * n)), x, 1.0) - 1.0;
                                                                                                                                                	} else if (n <= 0.03) {
                                                                                                                                                		tmp = ((x / n) - -1.0) - pow(x, (1.0 / n));
                                                                                                                                                	} else {
                                                                                                                                                		tmp = (1.0 / n) / x;
                                                                                                                                                	}
                                                                                                                                                	return tmp;
                                                                                                                                                }
                                                                                                                                                
                                                                                                                                                function code(x, n)
                                                                                                                                                	tmp = 0.0
                                                                                                                                                	if (n <= -200.0)
                                                                                                                                                		tmp = Float64(Float64(Float64(log(x) / n) + 1.0) / Float64(n * x));
                                                                                                                                                	elseif (n <= -4.6e-117)
                                                                                                                                                		tmp = Float64(Float64(Float64(log(x) * x) + Float64(n * x)) / Float64(Float64(Float64(n * x) * x) * n));
                                                                                                                                                	elseif (n <= -1e-227)
                                                                                                                                                		tmp = Float64(1.0 - 1.0);
                                                                                                                                                	elseif (n <= 3.5e-190)
                                                                                                                                                		tmp = Float64(fma(Float64(n / Float64(n * n)), x, 1.0) - 1.0);
                                                                                                                                                	elseif (n <= 0.03)
                                                                                                                                                		tmp = Float64(Float64(Float64(x / n) - -1.0) - (x ^ Float64(1.0 / n)));
                                                                                                                                                	else
                                                                                                                                                		tmp = Float64(Float64(1.0 / n) / x);
                                                                                                                                                	end
                                                                                                                                                	return tmp
                                                                                                                                                end
                                                                                                                                                
                                                                                                                                                code[x_, n_] := If[LessEqual[n, -200.0], N[(N[(N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision] + 1.0), $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -4.6e-117], N[(N[(N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision] + N[(n * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(n * x), $MachinePrecision] * x), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -1e-227], N[(1.0 - 1.0), $MachinePrecision], If[LessEqual[n, 3.5e-190], N[(N[(N[(n / N[(n * n), $MachinePrecision]), $MachinePrecision] * x + 1.0), $MachinePrecision] - 1.0), $MachinePrecision], If[LessEqual[n, 0.03], N[(N[(N[(x / n), $MachinePrecision] - -1.0), $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / n), $MachinePrecision] / x), $MachinePrecision]]]]]]
                                                                                                                                                
                                                                                                                                                \begin{array}{l}
                                                                                                                                                
                                                                                                                                                \\
                                                                                                                                                \begin{array}{l}
                                                                                                                                                \mathbf{if}\;n \leq -200:\\
                                                                                                                                                \;\;\;\;\frac{\frac{\log x}{n} + 1}{n \cdot x}\\
                                                                                                                                                
                                                                                                                                                \mathbf{elif}\;n \leq -4.6 \cdot 10^{-117}:\\
                                                                                                                                                \;\;\;\;\frac{\log x \cdot x + n \cdot x}{\left(\left(n \cdot x\right) \cdot x\right) \cdot n}\\
                                                                                                                                                
                                                                                                                                                \mathbf{elif}\;n \leq -1 \cdot 10^{-227}:\\
                                                                                                                                                \;\;\;\;1 - 1\\
                                                                                                                                                
                                                                                                                                                \mathbf{elif}\;n \leq 3.5 \cdot 10^{-190}:\\
                                                                                                                                                \;\;\;\;\mathsf{fma}\left(\frac{n}{n \cdot n}, x, 1\right) - 1\\
                                                                                                                                                
                                                                                                                                                \mathbf{elif}\;n \leq 0.03:\\
                                                                                                                                                \;\;\;\;\left(\frac{x}{n} - -1\right) - {x}^{\left(\frac{1}{n}\right)}\\
                                                                                                                                                
                                                                                                                                                \mathbf{else}:\\
                                                                                                                                                \;\;\;\;\frac{\frac{1}{n}}{x}\\
                                                                                                                                                
                                                                                                                                                
                                                                                                                                                \end{array}
                                                                                                                                                \end{array}
                                                                                                                                                
                                                                                                                                                Derivation
                                                                                                                                                1. Split input into 6 regimes
                                                                                                                                                2. if n < -200

                                                                                                                                                  1. Initial program 31.7%

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

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

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

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

                                                                                                                                                      if -200 < n < -4.59999999999999989e-117

                                                                                                                                                      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 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. Applied rewrites97.1%

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

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

                                                                                                                                                            \[\leadsto \frac{\frac{-\log x}{n \cdot x} - \frac{1}{x}}{\color{blue}{-n}} \]
                                                                                                                                                          2. Step-by-step derivation
                                                                                                                                                            1. Applied rewrites67.0%

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

                                                                                                                                                            if -4.59999999999999989e-117 < n < -9.99999999999999945e-228

                                                                                                                                                            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 rewrites16.3%

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

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

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

                                                                                                                                                                if -9.99999999999999945e-228 < n < 3.4999999999999999e-190

                                                                                                                                                                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 0

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

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

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

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

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

                                                                                                                                                                        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 1\right), n, 0.5 \cdot x\right)}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                                                                                      2. Taylor expanded in x around 0

                                                                                                                                                                        \[\leadsto \mathsf{fma}\left(\frac{n}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                        1. Applied rewrites78.5%

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

                                                                                                                                                                        if 3.4999999999999999e-190 < n < 0.029999999999999999

                                                                                                                                                                        1. Initial program 72.7%

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

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

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

                                                                                                                                                                          if 0.029999999999999999 < n

                                                                                                                                                                          1. Initial program 36.7%

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

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

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

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

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

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

                                                                                                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -200:\\ \;\;\;\;\frac{\frac{\log x}{n} + 1}{n \cdot x}\\ \mathbf{elif}\;n \leq -4.6 \cdot 10^{-117}:\\ \;\;\;\;\frac{\log x \cdot x + n \cdot x}{\left(\left(n \cdot x\right) \cdot x\right) \cdot n}\\ \mathbf{elif}\;n \leq -1 \cdot 10^{-227}:\\ \;\;\;\;1 - 1\\ \mathbf{elif}\;n \leq 3.5 \cdot 10^{-190}:\\ \;\;\;\;\mathsf{fma}\left(\frac{n}{n \cdot n}, x, 1\right) - 1\\ \mathbf{elif}\;n \leq 0.03:\\ \;\;\;\;\left(\frac{x}{n} - -1\right) - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{n}}{x}\\ \end{array} \]
                                                                                                                                                                              6. Add Preprocessing

                                                                                                                                                                              Alternative 12: 52.9% accurate, 1.5× speedup?

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

                                                                                                                                                                                1. Initial program 32.8%

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

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

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

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

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

                                                                                                                                                                                    if -15 < n < -9.99999999999999945e-228

                                                                                                                                                                                    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 rewrites36.0%

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

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

                                                                                                                                                                                        if -9.99999999999999945e-228 < n < 3.4999999999999999e-190

                                                                                                                                                                                        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 0

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

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

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

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

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

                                                                                                                                                                                                \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 1\right), n, 0.5 \cdot x\right)}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                                                                                                              2. Taylor expanded in x around 0

                                                                                                                                                                                                \[\leadsto \mathsf{fma}\left(\frac{n}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                1. Applied rewrites78.5%

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

                                                                                                                                                                                                if 3.4999999999999999e-190 < n < 0.029999999999999999

                                                                                                                                                                                                1. Initial program 72.7%

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

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

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

                                                                                                                                                                                                  if 0.029999999999999999 < n

                                                                                                                                                                                                  1. Initial program 36.7%

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

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

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

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

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

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

                                                                                                                                                                                                      Alternative 13: 48.9% accurate, 1.5× speedup?

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

                                                                                                                                                                                                        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}{\left(1 + x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                          1. Applied rewrites0.5%

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

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

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

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

                                                                                                                                                                                                                \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 1\right), n, 0.5 \cdot x\right)}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                                                                                                                              2. Taylor expanded in x around 0

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

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

                                                                                                                                                                                                                if -9.99999999999999974e232 < (/.f64 #s(literal 1 binary64) n) < -4e3

                                                                                                                                                                                                                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 rewrites36.0%

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

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

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

                                                                                                                                                                                                                    1. Initial program 35.2%

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

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

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

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

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

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

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

                                                                                                                                                                                                                          1. Initial program 50.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 rewrites48.1%

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

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

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

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

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

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

                                                                                                                                                                                                                                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\left(-\frac{\mathsf{fma}\left(-0.3333333333333333, x, -\frac{\mathsf{fma}\left(0.16666666666666666, \frac{x}{n}, -0.5 \cdot x\right) - -0.5}{n}\right)}{n}\right) - \frac{0.5}{n}, x, \frac{1}{n}\right), x, 1\right) - 1 \]
                                                                                                                                                                                                                                4. Recombined 4 regimes into one program.
                                                                                                                                                                                                                                5. Final simplification57.7%

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

                                                                                                                                                                                                                                Alternative 14: 48.9% accurate, 1.8× speedup?

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

                                                                                                                                                                                                                                  1. Initial program 32.8%

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

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

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

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

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

                                                                                                                                                                                                                                      if -8.5 < n < -9.99999999999999945e-228

                                                                                                                                                                                                                                      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 rewrites36.0%

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

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

                                                                                                                                                                                                                                          if -9.99999999999999945e-228 < n < 0.5

                                                                                                                                                                                                                                          1. Initial program 65.8%

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

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

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

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

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

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

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

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

                                                                                                                                                                                                                                                  if 0.5 < n

                                                                                                                                                                                                                                                  1. Initial program 37.3%

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

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

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

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

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

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

                                                                                                                                                                                                                                                      Alternative 15: 46.3% accurate, 4.1× speedup?

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

                                                                                                                                                                                                                                                        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}{\left(1 + x \cdot \left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}\right)\right)} - {x}^{\left(\frac{1}{n}\right)} \]
                                                                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                                                                          1. Applied rewrites0.5%

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

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

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

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

                                                                                                                                                                                                                                                                \[\leadsto \mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 1\right), n, 0.5 \cdot x\right)}{n \cdot n}, x, 1\right) - 1 \]
                                                                                                                                                                                                                                                              2. Taylor expanded in x around 0

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

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

                                                                                                                                                                                                                                                                if -9.99999999999999974e232 < (/.f64 #s(literal 1 binary64) n) < -4e3

                                                                                                                                                                                                                                                                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 rewrites36.0%

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

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

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

                                                                                                                                                                                                                                                                    1. Initial program 39.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. Applied rewrites43.5%

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

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

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

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

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

                                                                                                                                                                                                                                                                        Alternative 16: 45.8% accurate, 6.6× speedup?

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

                                                                                                                                                                                                                                                                          1. Initial program 32.8%

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

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

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

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

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

                                                                                                                                                                                                                                                                              if -8.5 < n < -8.79999999999999922e-230

                                                                                                                                                                                                                                                                              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 rewrites36.0%

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

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

                                                                                                                                                                                                                                                                                  if -8.79999999999999922e-230 < n

                                                                                                                                                                                                                                                                                  1. Initial program 51.8%

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

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

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

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

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

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

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

                                                                                                                                                                                                                                                                                      Alternative 17: 45.5% accurate, 8.0× speedup?

                                                                                                                                                                                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -8.5 \lor \neg \left(n \leq -8.8 \cdot 10^{-230}\right):\\ \;\;\;\;\frac{1}{n \cdot x}\\ \mathbf{else}:\\ \;\;\;\;1 - 1\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                                                                      (FPCore (x n)
                                                                                                                                                                                                                                                                                       :precision binary64
                                                                                                                                                                                                                                                                                       (if (or (<= n -8.5) (not (<= n -8.8e-230))) (/ 1.0 (* n x)) (- 1.0 1.0)))
                                                                                                                                                                                                                                                                                      double code(double x, double n) {
                                                                                                                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                                                                                                                      	if ((n <= -8.5) || !(n <= -8.8e-230)) {
                                                                                                                                                                                                                                                                                      		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 <= (-8.5d0)) .or. (.not. (n <= (-8.8d-230)))) 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 <= -8.5) || !(n <= -8.8e-230)) {
                                                                                                                                                                                                                                                                                      		tmp = 1.0 / (n * x);
                                                                                                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                                                                                                      		tmp = 1.0 - 1.0;
                                                                                                                                                                                                                                                                                      	}
                                                                                                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                      def code(x, n):
                                                                                                                                                                                                                                                                                      	tmp = 0
                                                                                                                                                                                                                                                                                      	if (n <= -8.5) or not (n <= -8.8e-230):
                                                                                                                                                                                                                                                                                      		tmp = 1.0 / (n * x)
                                                                                                                                                                                                                                                                                      	else:
                                                                                                                                                                                                                                                                                      		tmp = 1.0 - 1.0
                                                                                                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                      function code(x, n)
                                                                                                                                                                                                                                                                                      	tmp = 0.0
                                                                                                                                                                                                                                                                                      	if ((n <= -8.5) || !(n <= -8.8e-230))
                                                                                                                                                                                                                                                                                      		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 <= -8.5) || ~((n <= -8.8e-230)))
                                                                                                                                                                                                                                                                                      		tmp = 1.0 / (n * x);
                                                                                                                                                                                                                                                                                      	else
                                                                                                                                                                                                                                                                                      		tmp = 1.0 - 1.0;
                                                                                                                                                                                                                                                                                      	end
                                                                                                                                                                                                                                                                                      	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                      code[x_, n_] := If[Or[LessEqual[n, -8.5], N[Not[LessEqual[n, -8.8e-230]], $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 -8.5 \lor \neg \left(n \leq -8.8 \cdot 10^{-230}\right):\\
                                                                                                                                                                                                                                                                                      \;\;\;\;\frac{1}{n \cdot x}\\
                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                                                                                                                                                      \;\;\;\;1 - 1\\
                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                      Derivation
                                                                                                                                                                                                                                                                                      1. Split input into 2 regimes
                                                                                                                                                                                                                                                                                      2. if n < -8.5 or -8.79999999999999922e-230 < n

                                                                                                                                                                                                                                                                                        1. Initial program 46.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. Applied rewrites49.9%

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

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

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

                                                                                                                                                                                                                                                                                            if -8.5 < n < -8.79999999999999922e-230

                                                                                                                                                                                                                                                                                            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 rewrites36.0%

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

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

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

                                                                                                                                                                                                                                                                                              Alternative 18: 30.5% 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 57.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 rewrites41.0%

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

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

                                                                                                                                                                                                                                                                                                  Reproduce

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