2nthrt (problem 3.4.6)

Percentage Accurate: 52.6% → 87.1%
Time: 24.0s
Alternatives: 14
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 52.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));
}
real(8) function code(x, n)
    real(8), intent (in) :: x
    real(8), intent (in) :: n
    code = ((x + 1.0d0) ** (1.0d0 / n)) - (x ** (1.0d0 / n))
end function
public static double code(double x, double n) {
	return Math.pow((x + 1.0), (1.0 / n)) - Math.pow(x, (1.0 / n));
}
def code(x, n):
	return math.pow((x + 1.0), (1.0 / n)) - math.pow(x, (1.0 / n))
function code(x, n)
	return Float64((Float64(x + 1.0) ^ Float64(1.0 / n)) - (x ^ Float64(1.0 / n)))
end
function tmp = code(x, n)
	tmp = ((x + 1.0) ^ (1.0 / n)) - (x ^ (1.0 / n));
end
code[x_, n_] := N[(N[Power[N[(x + 1.0), $MachinePrecision], N[(1.0 / n), $MachinePrecision]], $MachinePrecision] - N[Power[x, N[(1.0 / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 87.1% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{\log x}{n}\\
\mathbf{if}\;x \leq 2.65 \cdot 10^{-173}:\\
\;\;\;\;\left(1 - \cosh t\_0\right) - \sinh t\_0\\

\mathbf{elif}\;x \leq 7.7:\\
\;\;\;\;\frac{\left(-\log x\right) + \left(\frac{\mathsf{fma}\left(0.16666666666666666, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}, \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) \cdot 0.5\right)}{n} + \mathsf{log1p}\left(x\right)\right)}{n}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < 2.64999999999999982e-173

    1. Initial program 46.0%

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

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

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

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

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

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

          \[\leadsto 1 - \color{blue}{e^{\log x \cdot \frac{1}{n}}} \]
        5. lift-log.f64N/A

          \[\leadsto 1 - e^{\color{blue}{\log x} \cdot \frac{1}{n}} \]
        6. div-invN/A

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

          \[\leadsto 1 - e^{\color{blue}{\frac{\log x}{n}}} \]
        8. sinh-+-cosh-revN/A

          \[\leadsto 1 - \color{blue}{\left(\cosh \left(\frac{\log x}{n}\right) + \sinh \left(\frac{\log x}{n}\right)\right)} \]
        9. associate--r+N/A

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

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

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

          \[\leadsto \left(1 - \color{blue}{\cosh \left(\frac{\log x}{n}\right)}\right) - \sinh \left(\frac{\log x}{n}\right) \]
        13. lower-sinh.f6485.5

          \[\leadsto \left(1 - \cosh \left(\frac{\log x}{n}\right)\right) - \color{blue}{\sinh \left(\frac{\log x}{n}\right)} \]
      3. Applied rewrites85.5%

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

      if 2.64999999999999982e-173 < x < 7.70000000000000018

      1. Initial program 30.8%

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

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

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

      if 7.70000000000000018 < x

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

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

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

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

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

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

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

          \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
        8. lower-exp.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{n \cdot x}} \]
      6. Step-by-step derivation
        1. Applied rewrites96.1%

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

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

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

        Alternative 2: 85.5% accurate, 0.4× speedup?

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

          1. Initial program 99.8%

            \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
          2. Add Preprocessing

          if -9.9999999999999995e-8 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999998e-8

          1. Initial program 28.9%

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

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

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

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

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

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

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

          if 4.9999999999999998e-8 < (/.f64 #s(literal 1 binary64) n)

          1. Initial program 33.5%

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

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

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

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

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{{x}^{\left(\frac{1}{n}\right)}}\right)\right) + {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \]
            5. sqr-powN/A

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{{x}^{\left(\frac{\frac{1}{n}}{2}\right)} \cdot {x}^{\left(\frac{\frac{1}{n}}{2}\right)}}\right)\right) + {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} \]
            6. distribute-rgt-neg-inN/A

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

              \[\leadsto \color{blue}{\mathsf{fma}\left({x}^{\left(\frac{\frac{1}{n}}{2}\right)}, \mathsf{neg}\left({x}^{\left(\frac{\frac{1}{n}}{2}\right)}\right), {\left(x + 1\right)}^{\left(\frac{1}{n}\right)}\right)} \]
          4. Applied rewrites99.3%

            \[\leadsto \color{blue}{\mathsf{fma}\left({x}^{\left(\frac{0.5}{n}\right)}, -{x}^{\left(\frac{0.5}{n}\right)}, e^{\frac{\mathsf{log1p}\left(x\right)}{n}}\right)} \]
        3. Recombined 3 regimes into one program.
        4. Final simplification88.3%

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

        Alternative 3: 85.5% accurate, 0.4× speedup?

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

          1. Initial program 99.8%

            \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
          2. Add Preprocessing

          if -9.9999999999999995e-8 < (/.f64 #s(literal 1 binary64) n) < 9.9999999999999998e-13

          1. Initial program 29.2%

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

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

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

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

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

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

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

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

          1. Initial program 31.9%

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 4: 86.5% accurate, 0.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\log x}{n}\\ \mathbf{if}\;x \leq 2.65 \cdot 10^{-173}:\\ \;\;\;\;\left(1 - \cosh t\_0\right) - \sinh t\_0\\ \mathbf{elif}\;x \leq 0.205:\\ \;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{{\log x}^{2}}{n}, \log x\right) - \frac{-0.16666666666666666}{n} \cdot \frac{{\log x}^{3}}{n}}{-n}\\ \mathbf{else}:\\ \;\;\;\;{\left({x}^{\left(\frac{-1}{n}\right)} \cdot \left(x \cdot n\right)\right)}^{-1}\\ \end{array} \end{array} \]
        (FPCore (x n)
         :precision binary64
         (let* ((t_0 (/ (log x) n)))
           (if (<= x 2.65e-173)
             (- (- 1.0 (cosh t_0)) (sinh t_0))
             (if (<= x 0.205)
               (/
                (-
                 (fma 0.5 (/ (pow (log x) 2.0) n) (log x))
                 (* (/ -0.16666666666666666 n) (/ (pow (log x) 3.0) n)))
                (- n))
               (pow (* (pow x (/ -1.0 n)) (* x n)) -1.0)))))
        double code(double x, double n) {
        	double t_0 = log(x) / n;
        	double tmp;
        	if (x <= 2.65e-173) {
        		tmp = (1.0 - cosh(t_0)) - sinh(t_0);
        	} else if (x <= 0.205) {
        		tmp = (fma(0.5, (pow(log(x), 2.0) / n), log(x)) - ((-0.16666666666666666 / n) * (pow(log(x), 3.0) / n))) / -n;
        	} else {
        		tmp = pow((pow(x, (-1.0 / n)) * (x * n)), -1.0);
        	}
        	return tmp;
        }
        
        function code(x, n)
        	t_0 = Float64(log(x) / n)
        	tmp = 0.0
        	if (x <= 2.65e-173)
        		tmp = Float64(Float64(1.0 - cosh(t_0)) - sinh(t_0));
        	elseif (x <= 0.205)
        		tmp = Float64(Float64(fma(0.5, Float64((log(x) ^ 2.0) / n), log(x)) - Float64(Float64(-0.16666666666666666 / n) * Float64((log(x) ^ 3.0) / n))) / Float64(-n));
        	else
        		tmp = Float64((x ^ Float64(-1.0 / n)) * Float64(x * n)) ^ -1.0;
        	end
        	return tmp
        end
        
        code[x_, n_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] / n), $MachinePrecision]}, If[LessEqual[x, 2.65e-173], N[(N[(1.0 - N[Cosh[t$95$0], $MachinePrecision]), $MachinePrecision] - N[Sinh[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.205], N[(N[(N[(0.5 * N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] / n), $MachinePrecision] + N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(N[(-0.16666666666666666 / n), $MachinePrecision] * N[(N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision], N[Power[N[(N[Power[x, N[(-1.0 / n), $MachinePrecision]], $MachinePrecision] * N[(x * n), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{\log x}{n}\\
        \mathbf{if}\;x \leq 2.65 \cdot 10^{-173}:\\
        \;\;\;\;\left(1 - \cosh t\_0\right) - \sinh t\_0\\
        
        \mathbf{elif}\;x \leq 0.205:\\
        \;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{{\log x}^{2}}{n}, \log x\right) - \frac{-0.16666666666666666}{n} \cdot \frac{{\log x}^{3}}{n}}{-n}\\
        
        \mathbf{else}:\\
        \;\;\;\;{\left({x}^{\left(\frac{-1}{n}\right)} \cdot \left(x \cdot n\right)\right)}^{-1}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if x < 2.64999999999999982e-173

          1. Initial program 46.0%

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

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

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

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

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

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

                \[\leadsto 1 - \color{blue}{e^{\log x \cdot \frac{1}{n}}} \]
              5. lift-log.f64N/A

                \[\leadsto 1 - e^{\color{blue}{\log x} \cdot \frac{1}{n}} \]
              6. div-invN/A

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

                \[\leadsto 1 - e^{\color{blue}{\frac{\log x}{n}}} \]
              8. sinh-+-cosh-revN/A

                \[\leadsto 1 - \color{blue}{\left(\cosh \left(\frac{\log x}{n}\right) + \sinh \left(\frac{\log x}{n}\right)\right)} \]
              9. associate--r+N/A

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

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

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

                \[\leadsto \left(1 - \color{blue}{\cosh \left(\frac{\log x}{n}\right)}\right) - \sinh \left(\frac{\log x}{n}\right) \]
              13. lower-sinh.f6485.5

                \[\leadsto \left(1 - \cosh \left(\frac{\log x}{n}\right)\right) - \color{blue}{\sinh \left(\frac{\log x}{n}\right)} \]
            3. Applied rewrites85.5%

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

            if 2.64999999999999982e-173 < x < 0.204999999999999988

            1. Initial program 30.8%

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

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

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

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

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

              if 0.204999999999999988 < x

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

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

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

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

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

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

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

                  \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                8. lower-exp.f64N/A

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

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

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

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

                \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{n \cdot x}} \]
              6. Step-by-step derivation
                1. Applied rewrites96.1%

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

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

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

                Alternative 5: 81.8% accurate, 0.4× speedup?

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

                  1. Initial program 99.8%

                    \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
                  2. Add Preprocessing

                  if -9.9999999999999995e-8 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999998e-8

                  1. Initial program 28.9%

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

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

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

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

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

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

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

                  if 4.9999999999999998e-8 < (/.f64 #s(literal 1 binary64) n)

                  1. Initial program 33.5%

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

                    \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}, x, 1\right)} - {x}^{\left(\frac{1}{n}\right)} \]
                  5. Applied rewrites74.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)} \]
                  6. Taylor expanded in n around 0

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

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

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

                  Alternative 6: 81.6% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                      8. lower-exp.f64N/A

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

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

                        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                      11. lower-*.f64100.0

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

                      \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{n \cdot x}} \]
                    6. Step-by-step derivation
                      1. Applied rewrites100.0%

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

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

                        if -10 < (/.f64 #s(literal 1 binary64) n) < 4.9999999999999998e-8

                        1. Initial program 29.3%

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

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

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

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

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

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

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

                        if 4.9999999999999998e-8 < (/.f64 #s(literal 1 binary64) n)

                        1. Initial program 33.5%

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

                          \[\leadsto \color{blue}{\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. +-commutativeN/A

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

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot \left(\frac{1}{2} \cdot \frac{1}{{n}^{2}} - \frac{1}{2} \cdot \frac{1}{n}\right) + \frac{1}{n}, x, 1\right)} - {x}^{\left(\frac{1}{n}\right)} \]
                        5. Applied rewrites74.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)} \]
                        6. Taylor expanded in n around 0

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

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

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

                        Alternative 7: 70.8% accurate, 1.0× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 0.5\right), x, -1\right), x, \log x\right)}{-n}\\ \mathbf{if}\;x \leq 2.05 \cdot 10^{-194}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n \cdot x}\\ \mathbf{elif}\;x \leq 0.00044:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;{\left({x}^{\left(\frac{-1}{n}\right)} \cdot \left(x \cdot n\right)\right)}^{-1}\\ \end{array} \end{array} \]
                        (FPCore (x n)
                         :precision binary64
                         (let* ((t_0
                                 (/
                                  (fma (fma (fma -0.3333333333333333 x 0.5) x -1.0) x (log x))
                                  (- n))))
                           (if (<= x 2.05e-194)
                             t_0
                             (if (<= x 3.8e-129)
                               (/ (- (+ (/ 0.3333333333333333 (* x x)) 1.0) (/ 0.5 x)) (* n x))
                               (if (<= x 0.00044) t_0 (pow (* (pow x (/ -1.0 n)) (* x n)) -1.0))))))
                        double code(double x, double n) {
                        	double t_0 = fma(fma(fma(-0.3333333333333333, x, 0.5), x, -1.0), x, log(x)) / -n;
                        	double tmp;
                        	if (x <= 2.05e-194) {
                        		tmp = t_0;
                        	} else if (x <= 3.8e-129) {
                        		tmp = (((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x)) / (n * x);
                        	} else if (x <= 0.00044) {
                        		tmp = t_0;
                        	} else {
                        		tmp = pow((pow(x, (-1.0 / n)) * (x * n)), -1.0);
                        	}
                        	return tmp;
                        }
                        
                        function code(x, n)
                        	t_0 = Float64(fma(fma(fma(-0.3333333333333333, x, 0.5), x, -1.0), x, log(x)) / Float64(-n))
                        	tmp = 0.0
                        	if (x <= 2.05e-194)
                        		tmp = t_0;
                        	elseif (x <= 3.8e-129)
                        		tmp = Float64(Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) + 1.0) - Float64(0.5 / x)) / Float64(n * x));
                        	elseif (x <= 0.00044)
                        		tmp = t_0;
                        	else
                        		tmp = Float64((x ^ Float64(-1.0 / n)) * Float64(x * n)) ^ -1.0;
                        	end
                        	return tmp
                        end
                        
                        code[x_, n_] := Block[{t$95$0 = N[(N[(N[(N[(-0.3333333333333333 * x + 0.5), $MachinePrecision] * x + -1.0), $MachinePrecision] * x + N[Log[x], $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision]}, If[LessEqual[x, 2.05e-194], t$95$0, If[LessEqual[x, 3.8e-129], N[(N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision] / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00044], t$95$0, N[Power[N[(N[Power[x, N[(-1.0 / n), $MachinePrecision]], $MachinePrecision] * N[(x * n), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 0.5\right), x, -1\right), x, \log x\right)}{-n}\\
                        \mathbf{if}\;x \leq 2.05 \cdot 10^{-194}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;x \leq 3.8 \cdot 10^{-129}:\\
                        \;\;\;\;\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n \cdot x}\\
                        
                        \mathbf{elif}\;x \leq 0.00044:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;{\left({x}^{\left(\frac{-1}{n}\right)} \cdot \left(x \cdot n\right)\right)}^{-1}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if x < 2.0500000000000001e-194 or 3.79999999999999985e-129 < x < 4.40000000000000016e-4

                          1. Initial program 33.6%

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

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

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

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

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

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

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

                            if 2.0500000000000001e-194 < x < 3.79999999999999985e-129

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

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

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

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

                              if 4.40000000000000016e-4 < x

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

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

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

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

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

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

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

                                  \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                                8. lower-exp.f64N/A

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

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

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

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

                                \[\leadsto \color{blue}{\frac{e^{\frac{\log x}{n}}}{n \cdot x}} \]
                              6. Step-by-step derivation
                                1. Applied rewrites94.7%

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

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

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

                                Alternative 8: 50.8% accurate, 1.0× speedup?

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

                                  1. Initial program 45.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}{\left(1 + \frac{x}{n}\right)} - {x}^{\left(\frac{1}{n}\right)} \]
                                  4. Step-by-step derivation
                                    1. *-rgt-identityN/A

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

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

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

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

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

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

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

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

                                  if 1.3500000000000001e-169 < x

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

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

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

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.35 \cdot 10^{-169}:\\ \;\;\;\;\left(\frac{x}{n} + 1\right) - {x}^{\left({n}^{-1}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x}\\ \end{array} \]
                                  9. Add Preprocessing

                                  Alternative 9: 50.8% accurate, 1.1× speedup?

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

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

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

                                      if 1.3500000000000001e-169 < x

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

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

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

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

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.35 \cdot 10^{-169}:\\ \;\;\;\;1 - {x}^{\left({n}^{-1}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x}\\ \end{array} \]
                                      9. Add Preprocessing

                                      Alternative 10: 57.6% accurate, 1.5× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}\\ t_1 := \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 0.5\right), x, -1\right), x, \log x\right)}{-n}\\ \mathbf{if}\;x \leq 2.05 \cdot 10^{-194}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-129}:\\ \;\;\;\;\frac{t\_0}{n \cdot x}\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\ \end{array} \end{array} \]
                                      (FPCore (x n)
                                       :precision binary64
                                       (let* ((t_0 (- (+ (/ 0.3333333333333333 (* x x)) 1.0) (/ 0.5 x)))
                                              (t_1
                                               (/
                                                (fma (fma (fma -0.3333333333333333 x 0.5) x -1.0) x (log x))
                                                (- n))))
                                         (if (<= x 2.05e-194)
                                           t_1
                                           (if (<= x 3.8e-129)
                                             (/ t_0 (* n x))
                                             (if (<= x 1.0) t_1 (/ (/ t_0 n) x))))))
                                      double code(double x, double n) {
                                      	double t_0 = ((0.3333333333333333 / (x * x)) + 1.0) - (0.5 / x);
                                      	double t_1 = fma(fma(fma(-0.3333333333333333, x, 0.5), x, -1.0), x, log(x)) / -n;
                                      	double tmp;
                                      	if (x <= 2.05e-194) {
                                      		tmp = t_1;
                                      	} else if (x <= 3.8e-129) {
                                      		tmp = t_0 / (n * x);
                                      	} else if (x <= 1.0) {
                                      		tmp = t_1;
                                      	} else {
                                      		tmp = (t_0 / n) / x;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(x, n)
                                      	t_0 = Float64(Float64(Float64(0.3333333333333333 / Float64(x * x)) + 1.0) - Float64(0.5 / x))
                                      	t_1 = Float64(fma(fma(fma(-0.3333333333333333, x, 0.5), x, -1.0), x, log(x)) / Float64(-n))
                                      	tmp = 0.0
                                      	if (x <= 2.05e-194)
                                      		tmp = t_1;
                                      	elseif (x <= 3.8e-129)
                                      		tmp = Float64(t_0 / Float64(n * x));
                                      	elseif (x <= 1.0)
                                      		tmp = t_1;
                                      	else
                                      		tmp = Float64(Float64(t_0 / n) / x);
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[x_, n_] := Block[{t$95$0 = N[(N[(N[(0.3333333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(0.5 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(-0.3333333333333333 * x + 0.5), $MachinePrecision] * x + -1.0), $MachinePrecision] * x + N[Log[x], $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision]}, If[LessEqual[x, 2.05e-194], t$95$1, If[LessEqual[x, 3.8e-129], N[(t$95$0 / N[(n * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.0], t$95$1, N[(N[(t$95$0 / n), $MachinePrecision] / x), $MachinePrecision]]]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_0 := \left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}\\
                                      t_1 := \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 0.5\right), x, -1\right), x, \log x\right)}{-n}\\
                                      \mathbf{if}\;x \leq 2.05 \cdot 10^{-194}:\\
                                      \;\;\;\;t\_1\\
                                      
                                      \mathbf{elif}\;x \leq 3.8 \cdot 10^{-129}:\\
                                      \;\;\;\;\frac{t\_0}{n \cdot x}\\
                                      
                                      \mathbf{elif}\;x \leq 1:\\
                                      \;\;\;\;t\_1\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{\frac{t\_0}{n}}{x}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if x < 2.0500000000000001e-194 or 3.79999999999999985e-129 < x < 1

                                        1. Initial program 33.6%

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

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

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

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

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

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

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

                                          if 2.0500000000000001e-194 < x < 3.79999999999999985e-129

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

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

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

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

                                            if 1 < x

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

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

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

                                                \[\leadsto \frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x} \]
                                            7. Recombined 3 regimes into one program.
                                            8. Final simplification61.8%

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

                                            Alternative 11: 41.2% accurate, 2.0× speedup?

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

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

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

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

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

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

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

                                                \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                                              8. lower-exp.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                Alternative 12: 40.7% accurate, 2.2× speedup?

                                                \[\begin{array}{l} \\ {\left(x \cdot n\right)}^{-1} \end{array} \]
                                                (FPCore (x n) :precision binary64 (pow (* x n) -1.0))
                                                double code(double x, double n) {
                                                	return pow((x * n), -1.0);
                                                }
                                                
                                                real(8) function code(x, n)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: n
                                                    code = (x * n) ** (-1.0d0)
                                                end function
                                                
                                                public static double code(double x, double n) {
                                                	return Math.pow((x * n), -1.0);
                                                }
                                                
                                                def code(x, n):
                                                	return math.pow((x * n), -1.0)
                                                
                                                function code(x, n)
                                                	return Float64(x * n) ^ -1.0
                                                end
                                                
                                                function tmp = code(x, n)
                                                	tmp = (x * n) ^ -1.0;
                                                end
                                                
                                                code[x_, n_] := N[Power[N[(x * n), $MachinePrecision], -1.0], $MachinePrecision]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                {\left(x \cdot n\right)}^{-1}
                                                \end{array}
                                                
                                                Derivation
                                                1. Initial program 51.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. lower-/.f64N/A

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

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

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

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

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

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

                                                    \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
                                                  8. lower-exp.f64N/A

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

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

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

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

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

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

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

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

                                                      \[\leadsto {\left(x \cdot n\right)}^{-1} \]
                                                    3. Add Preprocessing

                                                    Alternative 13: 46.7% accurate, 4.1× speedup?

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

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

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

                                                        \[\leadsto \frac{\frac{\left(\frac{0.3333333333333333}{x \cdot x} + 1\right) - \frac{0.5}{x}}{n}}{x} \]
                                                      2. Add Preprocessing

                                                      Alternative 14: 46.2% accurate, 4.6× speedup?

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

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

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

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

                                                        Reproduce

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