2nthrt (problem 3.4.6)

Percentage Accurate: 53.0% → 86.1%
Time: 45.5s
Alternatives: 15
Speedup: 1.9×

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 15 alternatives:

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

Initial Program: 53.0% accurate, 1.0× speedup?

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

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

Alternative 1: 86.1% accurate, 0.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{{x}^{\left(\frac{3}{n}\right)}}}{x \cdot n}\\


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

    1. Initial program 35.7%

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

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

      \[\leadsto \color{blue}{\frac{\log x - \left(\mathsf{log1p}\left(x\right) + \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) + \frac{0.16666666666666666 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}\right)}{-n}} \]
    5. Step-by-step derivation
      1. div-inv82.0%

        \[\leadsto \color{blue}{\left(\log x - \left(\mathsf{log1p}\left(x\right) + \frac{0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right) + \frac{0.16666666666666666 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n}}{n}\right)\right) \cdot \frac{1}{-n}} \]
      2. associate--r+82.0%

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

        \[\leadsto \left(\left(\log x - \mathsf{log1p}\left(x\right)\right) - \frac{\color{blue}{\frac{0.16666666666666666 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}\right)}{n} + 0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right)}}{n}\right) \cdot \frac{1}{-n} \]
      4. associate-/l*82.0%

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

        \[\leadsto \left(\left(\log x - \mathsf{log1p}\left(x\right)\right) - \frac{\color{blue}{\mathsf{fma}\left(0.16666666666666666, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}, 0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right)\right)}}{n}\right) \cdot \frac{1}{-n} \]
    6. Applied egg-rr82.0%

      \[\leadsto \color{blue}{\left(\left(\log x - \mathsf{log1p}\left(x\right)\right) - \frac{\mathsf{fma}\left(0.16666666666666666, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}, 0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right)\right)}{n}\right) \cdot \frac{1}{-n}} \]
    7. Step-by-step derivation
      1. log1p-undefine82.0%

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

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

      \[\leadsto \left(\color{blue}{\log \left(\frac{x}{1 + x}\right)} - \frac{\mathsf{fma}\left(0.16666666666666666, \frac{{\left(\mathsf{log1p}\left(x\right)\right)}^{3} - {\log x}^{3}}{n}, 0.5 \cdot \left({\left(\mathsf{log1p}\left(x\right)\right)}^{2} - {\log x}^{2}\right)\right)}{n}\right) \cdot \frac{1}{-n} \]
    9. Step-by-step derivation
      1. +-commutative82.2%

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

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

    if 5.2e5 < x

    1. Initial program 66.2%

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

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

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

        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
      3. mul-1-neg98.8%

        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
      4. distribute-neg-frac98.8%

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

        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
      6. remove-double-neg98.8%

        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
      7. *-commutative98.8%

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
    5. Simplified98.8%

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

        \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
      2. pow-to-exp98.7%

        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
      3. add-cbrt-cube98.7%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{\left({x}^{\left(\frac{1}{n}\right)} \cdot {x}^{\left(\frac{1}{n}\right)}\right) \cdot {x}^{\left(\frac{1}{n}\right)}}}}{x \cdot n} \]
      4. pow1/398.7%

        \[\leadsto \frac{\color{blue}{{\left(\left({x}^{\left(\frac{1}{n}\right)} \cdot {x}^{\left(\frac{1}{n}\right)}\right) \cdot {x}^{\left(\frac{1}{n}\right)}\right)}^{0.3333333333333333}}}{x \cdot n} \]
      5. pow398.7%

        \[\leadsto \frac{{\color{blue}{\left({\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right)}}^{0.3333333333333333}}{x \cdot n} \]
      6. pow-pow98.8%

        \[\leadsto \frac{{\color{blue}{\left({x}^{\left(\frac{1}{n} \cdot 3\right)}\right)}}^{0.3333333333333333}}{x \cdot n} \]
    7. Applied egg-rr98.8%

      \[\leadsto \frac{\color{blue}{{\left({x}^{\left(\frac{1}{n} \cdot 3\right)}\right)}^{0.3333333333333333}}}{x \cdot n} \]
    8. Step-by-step derivation
      1. unpow1/398.8%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{{x}^{\left(\frac{1}{n} \cdot 3\right)}}}}{x \cdot n} \]
      2. associate-*l/98.8%

        \[\leadsto \frac{\sqrt[3]{{x}^{\color{blue}{\left(\frac{1 \cdot 3}{n}\right)}}}}{x \cdot n} \]
      3. metadata-eval98.8%

        \[\leadsto \frac{\sqrt[3]{{x}^{\left(\frac{\color{blue}{3}}{n}\right)}}}{x \cdot n} \]
    9. Simplified98.8%

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

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

Alternative 2: 86.1% accurate, 0.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{{x}^{\left(\frac{3}{n}\right)}}}{x \cdot n}\\


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

    1. Initial program 35.7%

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

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

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

    if 5.2e5 < x

    1. Initial program 66.2%

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

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

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

        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
      3. mul-1-neg98.8%

        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
      4. distribute-neg-frac98.8%

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

        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
      6. remove-double-neg98.8%

        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
      7. *-commutative98.8%

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
    5. Simplified98.8%

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

        \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
      2. pow-to-exp98.7%

        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
      3. add-cbrt-cube98.7%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{\left({x}^{\left(\frac{1}{n}\right)} \cdot {x}^{\left(\frac{1}{n}\right)}\right) \cdot {x}^{\left(\frac{1}{n}\right)}}}}{x \cdot n} \]
      4. pow1/398.7%

        \[\leadsto \frac{\color{blue}{{\left(\left({x}^{\left(\frac{1}{n}\right)} \cdot {x}^{\left(\frac{1}{n}\right)}\right) \cdot {x}^{\left(\frac{1}{n}\right)}\right)}^{0.3333333333333333}}}{x \cdot n} \]
      5. pow398.7%

        \[\leadsto \frac{{\color{blue}{\left({\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right)}}^{0.3333333333333333}}{x \cdot n} \]
      6. pow-pow98.8%

        \[\leadsto \frac{{\color{blue}{\left({x}^{\left(\frac{1}{n} \cdot 3\right)}\right)}}^{0.3333333333333333}}{x \cdot n} \]
    7. Applied egg-rr98.8%

      \[\leadsto \frac{\color{blue}{{\left({x}^{\left(\frac{1}{n} \cdot 3\right)}\right)}^{0.3333333333333333}}}{x \cdot n} \]
    8. Step-by-step derivation
      1. unpow1/398.8%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{{x}^{\left(\frac{1}{n} \cdot 3\right)}}}}{x \cdot n} \]
      2. associate-*l/98.8%

        \[\leadsto \frac{\sqrt[3]{{x}^{\color{blue}{\left(\frac{1 \cdot 3}{n}\right)}}}}{x \cdot n} \]
      3. metadata-eval98.8%

        \[\leadsto \frac{\sqrt[3]{{x}^{\left(\frac{\color{blue}{3}}{n}\right)}}}{x \cdot n} \]
    9. Simplified98.8%

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

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

Alternative 3: 85.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.3 \cdot 10^{-14}:\\ \;\;\;\;\frac{\frac{-0.16666666666666666 \cdot \frac{{\log x}^{3}}{n} + {\log x}^{2} \cdot -0.5}{n} - \log x}{n}\\ \mathbf{elif}\;x \leq 1850000:\\ \;\;\;\;\frac{\mathsf{log1p}\left(x\right) - 2 \cdot \log \left(\sqrt{x}\right)}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{{x}^{\left(\frac{3}{n}\right)}}}{x \cdot n}\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (if (<= x 2.3e-14)
   (/
    (-
     (/
      (+
       (* -0.16666666666666666 (/ (pow (log x) 3.0) n))
       (* (pow (log x) 2.0) -0.5))
      n)
     (log x))
    n)
   (if (<= x 1850000.0)
     (/ (- (log1p x) (* 2.0 (log (sqrt x)))) n)
     (/ (cbrt (pow x (/ 3.0 n))) (* x n)))))
double code(double x, double n) {
	double tmp;
	if (x <= 2.3e-14) {
		tmp = ((((-0.16666666666666666 * (pow(log(x), 3.0) / n)) + (pow(log(x), 2.0) * -0.5)) / n) - log(x)) / n;
	} else if (x <= 1850000.0) {
		tmp = (log1p(x) - (2.0 * log(sqrt(x)))) / n;
	} else {
		tmp = cbrt(pow(x, (3.0 / n))) / (x * n);
	}
	return tmp;
}
public static double code(double x, double n) {
	double tmp;
	if (x <= 2.3e-14) {
		tmp = ((((-0.16666666666666666 * (Math.pow(Math.log(x), 3.0) / n)) + (Math.pow(Math.log(x), 2.0) * -0.5)) / n) - Math.log(x)) / n;
	} else if (x <= 1850000.0) {
		tmp = (Math.log1p(x) - (2.0 * Math.log(Math.sqrt(x)))) / n;
	} else {
		tmp = Math.cbrt(Math.pow(x, (3.0 / n))) / (x * n);
	}
	return tmp;
}
function code(x, n)
	tmp = 0.0
	if (x <= 2.3e-14)
		tmp = Float64(Float64(Float64(Float64(Float64(-0.16666666666666666 * Float64((log(x) ^ 3.0) / n)) + Float64((log(x) ^ 2.0) * -0.5)) / n) - log(x)) / n);
	elseif (x <= 1850000.0)
		tmp = Float64(Float64(log1p(x) - Float64(2.0 * log(sqrt(x)))) / n);
	else
		tmp = Float64(cbrt((x ^ Float64(3.0 / n))) / Float64(x * n));
	end
	return tmp
end
code[x_, n_] := If[LessEqual[x, 2.3e-14], N[(N[(N[(N[(N[(-0.16666666666666666 * N[(N[Power[N[Log[x], $MachinePrecision], 3.0], $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[Log[x], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], If[LessEqual[x, 1850000.0], N[(N[(N[Log[1 + x], $MachinePrecision] - N[(2.0 * N[Log[N[Sqrt[x], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[Power[N[Power[x, N[(3.0 / n), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.3 \cdot 10^{-14}:\\
\;\;\;\;\frac{\frac{-0.16666666666666666 \cdot \frac{{\log x}^{3}}{n} + {\log x}^{2} \cdot -0.5}{n} - \log x}{n}\\

\mathbf{elif}\;x \leq 1850000:\\
\;\;\;\;\frac{\mathsf{log1p}\left(x\right) - 2 \cdot \log \left(\sqrt{x}\right)}{n}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{{x}^{\left(\frac{3}{n}\right)}}}{x \cdot n}\\


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

    1. Initial program 38.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 38.8%

      \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
    4. Step-by-step derivation
      1. *-rgt-identity38.8%

        \[\leadsto 1 - e^{\frac{\color{blue}{\log x \cdot 1}}{n}} \]
      2. associate-/l*38.8%

        \[\leadsto 1 - e^{\color{blue}{\log x \cdot \frac{1}{n}}} \]
      3. exp-to-pow38.8%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{-0.16666666666666666 \cdot \frac{{\log x}^{3}}{n} - 0.5 \cdot {\log x}^{2}}{n} - -1 \cdot \log x}{n}} \]
    7. Step-by-step derivation
      1. mul-1-neg82.4%

        \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{-0.16666666666666666 \cdot \frac{{\log x}^{3}}{n} - 0.5 \cdot {\log x}^{2}}{n} - -1 \cdot \log x}{n}} \]
    8. Simplified82.4%

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

    if 2.29999999999999998e-14 < x < 1.85e6

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

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

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

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

        \[\leadsto \frac{\mathsf{log1p}\left(x\right) - \log \color{blue}{\left(\sqrt{x} \cdot \sqrt{x}\right)}}{n} \]
      2. log-prod79.8%

        \[\leadsto \frac{\mathsf{log1p}\left(x\right) - \color{blue}{\left(\log \left(\sqrt{x}\right) + \log \left(\sqrt{x}\right)\right)}}{n} \]
    7. Applied egg-rr79.8%

      \[\leadsto \frac{\mathsf{log1p}\left(x\right) - \color{blue}{\left(\log \left(\sqrt{x}\right) + \log \left(\sqrt{x}\right)\right)}}{n} \]
    8. Step-by-step derivation
      1. count-279.8%

        \[\leadsto \frac{\mathsf{log1p}\left(x\right) - \color{blue}{2 \cdot \log \left(\sqrt{x}\right)}}{n} \]
    9. Simplified79.8%

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

    if 1.85e6 < x

    1. Initial program 66.2%

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

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

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

        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
      3. mul-1-neg98.8%

        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
      4. distribute-neg-frac98.8%

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

        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
      6. remove-double-neg98.8%

        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
      7. *-commutative98.8%

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
    5. Simplified98.8%

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

        \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
      2. pow-to-exp98.7%

        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
      3. add-cbrt-cube98.7%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{\left({x}^{\left(\frac{1}{n}\right)} \cdot {x}^{\left(\frac{1}{n}\right)}\right) \cdot {x}^{\left(\frac{1}{n}\right)}}}}{x \cdot n} \]
      4. pow1/398.7%

        \[\leadsto \frac{\color{blue}{{\left(\left({x}^{\left(\frac{1}{n}\right)} \cdot {x}^{\left(\frac{1}{n}\right)}\right) \cdot {x}^{\left(\frac{1}{n}\right)}\right)}^{0.3333333333333333}}}{x \cdot n} \]
      5. pow398.7%

        \[\leadsto \frac{{\color{blue}{\left({\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right)}}^{0.3333333333333333}}{x \cdot n} \]
      6. pow-pow98.8%

        \[\leadsto \frac{{\color{blue}{\left({x}^{\left(\frac{1}{n} \cdot 3\right)}\right)}}^{0.3333333333333333}}{x \cdot n} \]
    7. Applied egg-rr98.8%

      \[\leadsto \frac{\color{blue}{{\left({x}^{\left(\frac{1}{n} \cdot 3\right)}\right)}^{0.3333333333333333}}}{x \cdot n} \]
    8. Step-by-step derivation
      1. unpow1/398.8%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{{x}^{\left(\frac{1}{n} \cdot 3\right)}}}}{x \cdot n} \]
      2. associate-*l/98.8%

        \[\leadsto \frac{\sqrt[3]{{x}^{\color{blue}{\left(\frac{1 \cdot 3}{n}\right)}}}}{x \cdot n} \]
      3. metadata-eval98.8%

        \[\leadsto \frac{\sqrt[3]{{x}^{\left(\frac{\color{blue}{3}}{n}\right)}}}{x \cdot n} \]
    9. Simplified98.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.3 \cdot 10^{-14}:\\ \;\;\;\;\frac{\frac{-0.16666666666666666 \cdot \frac{{\log x}^{3}}{n} + {\log x}^{2} \cdot -0.5}{n} - \log x}{n}\\ \mathbf{elif}\;x \leq 1850000:\\ \;\;\;\;\frac{\mathsf{log1p}\left(x\right) - 2 \cdot \log \left(\sqrt{x}\right)}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{{x}^{\left(\frac{3}{n}\right)}}}{x \cdot n}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 80.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.72:\\ \;\;\;\;x \cdot \left(\frac{1}{n} + \frac{\log \left(\frac{1}{x}\right)}{x \cdot n}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{{x}^{\left(\frac{3}{n}\right)}}}{x \cdot n}\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (if (<= x 0.72)
   (* x (+ (/ 1.0 n) (/ (log (/ 1.0 x)) (* x n))))
   (/ (cbrt (pow x (/ 3.0 n))) (* x n))))
double code(double x, double n) {
	double tmp;
	if (x <= 0.72) {
		tmp = x * ((1.0 / n) + (log((1.0 / x)) / (x * n)));
	} else {
		tmp = cbrt(pow(x, (3.0 / n))) / (x * n);
	}
	return tmp;
}
public static double code(double x, double n) {
	double tmp;
	if (x <= 0.72) {
		tmp = x * ((1.0 / n) + (Math.log((1.0 / x)) / (x * n)));
	} else {
		tmp = Math.cbrt(Math.pow(x, (3.0 / n))) / (x * n);
	}
	return tmp;
}
function code(x, n)
	tmp = 0.0
	if (x <= 0.72)
		tmp = Float64(x * Float64(Float64(1.0 / n) + Float64(log(Float64(1.0 / x)) / Float64(x * n))));
	else
		tmp = Float64(cbrt((x ^ Float64(3.0 / n))) / Float64(x * n));
	end
	return tmp
end
code[x_, n_] := If[LessEqual[x, 0.72], N[(x * N[(N[(1.0 / n), $MachinePrecision] + N[(N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Power[x, N[(3.0 / n), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision] / N[(x * n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.72:\\
\;\;\;\;x \cdot \left(\frac{1}{n} + \frac{\log \left(\frac{1}{x}\right)}{x \cdot n}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{{x}^{\left(\frac{3}{n}\right)}}}{x \cdot n}\\


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

    1. Initial program 37.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{\log x}{n}\right)} + \frac{x}{n} \]
      2. distribute-neg-frac59.5%

        \[\leadsto \color{blue}{\frac{-\log x}{n}} + \frac{x}{n} \]
      3. log-rec59.5%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1}{x}\right)}}{n} + \frac{x}{n} \]
      4. +-commutative59.5%

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

        \[\leadsto \frac{x}{n} + \frac{\color{blue}{-\log x}}{n} \]
      6. distribute-neg-frac59.5%

        \[\leadsto \frac{x}{n} + \color{blue}{\left(-\frac{\log x}{n}\right)} \]
      7. unsub-neg59.5%

        \[\leadsto \color{blue}{\frac{x}{n} - \frac{\log x}{n}} \]
    8. Simplified59.5%

      \[\leadsto \color{blue}{\frac{x}{n} - \frac{\log x}{n}} \]
    9. Taylor expanded in x around inf 75.9%

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

    if 0.71999999999999997 < x

    1. Initial program 62.5%

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

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

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

        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
      3. mul-1-neg95.6%

        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
      4. distribute-neg-frac95.6%

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

        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
      6. remove-double-neg95.6%

        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
      7. *-commutative95.6%

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
    5. Simplified95.6%

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

        \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
      2. pow-to-exp95.6%

        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
      3. add-cbrt-cube95.6%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{\left({x}^{\left(\frac{1}{n}\right)} \cdot {x}^{\left(\frac{1}{n}\right)}\right) \cdot {x}^{\left(\frac{1}{n}\right)}}}}{x \cdot n} \]
      4. pow1/395.6%

        \[\leadsto \frac{\color{blue}{{\left(\left({x}^{\left(\frac{1}{n}\right)} \cdot {x}^{\left(\frac{1}{n}\right)}\right) \cdot {x}^{\left(\frac{1}{n}\right)}\right)}^{0.3333333333333333}}}{x \cdot n} \]
      5. pow395.6%

        \[\leadsto \frac{{\color{blue}{\left({\left({x}^{\left(\frac{1}{n}\right)}\right)}^{3}\right)}}^{0.3333333333333333}}{x \cdot n} \]
      6. pow-pow95.6%

        \[\leadsto \frac{{\color{blue}{\left({x}^{\left(\frac{1}{n} \cdot 3\right)}\right)}}^{0.3333333333333333}}{x \cdot n} \]
    7. Applied egg-rr95.6%

      \[\leadsto \frac{\color{blue}{{\left({x}^{\left(\frac{1}{n} \cdot 3\right)}\right)}^{0.3333333333333333}}}{x \cdot n} \]
    8. Step-by-step derivation
      1. unpow1/395.6%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{{x}^{\left(\frac{1}{n} \cdot 3\right)}}}}{x \cdot n} \]
      2. associate-*l/95.7%

        \[\leadsto \frac{\sqrt[3]{{x}^{\color{blue}{\left(\frac{1 \cdot 3}{n}\right)}}}}{x \cdot n} \]
      3. metadata-eval95.7%

        \[\leadsto \frac{\sqrt[3]{{x}^{\left(\frac{\color{blue}{3}}{n}\right)}}}{x \cdot n} \]
    9. Simplified95.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.72:\\ \;\;\;\;x \cdot \left(\frac{1}{n} + \frac{\log \left(\frac{1}{x}\right)}{x \cdot n}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{{x}^{\left(\frac{3}{n}\right)}}}{x \cdot n}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 80.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.72:\\
\;\;\;\;x \cdot \left(\frac{1}{n} + \frac{\log \left(\frac{1}{x}\right)}{x \cdot n}\right)\\

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


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

    1. Initial program 37.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\frac{\log x}{n}\right)} + \frac{x}{n} \]
      2. distribute-neg-frac59.5%

        \[\leadsto \color{blue}{\frac{-\log x}{n}} + \frac{x}{n} \]
      3. log-rec59.5%

        \[\leadsto \frac{\color{blue}{\log \left(\frac{1}{x}\right)}}{n} + \frac{x}{n} \]
      4. +-commutative59.5%

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

        \[\leadsto \frac{x}{n} + \frac{\color{blue}{-\log x}}{n} \]
      6. distribute-neg-frac59.5%

        \[\leadsto \frac{x}{n} + \color{blue}{\left(-\frac{\log x}{n}\right)} \]
      7. unsub-neg59.5%

        \[\leadsto \color{blue}{\frac{x}{n} - \frac{\log x}{n}} \]
    8. Simplified59.5%

      \[\leadsto \color{blue}{\frac{x}{n} - \frac{\log x}{n}} \]
    9. Taylor expanded in x around inf 75.9%

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

    if 0.71999999999999997 < x

    1. Initial program 62.5%

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

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

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

        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
      3. mul-1-neg95.6%

        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
      4. distribute-neg-frac95.6%

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

        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
      6. remove-double-neg95.6%

        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
      7. *-commutative95.6%

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
    5. Simplified95.6%

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

        \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
      2. pow-to-exp95.6%

        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
      3. expm1-log1p-u95.7%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)}}{x \cdot n} \]
      4. expm1-undefine95.6%

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

        \[\leadsto \frac{e^{\color{blue}{\log \left(1 + {x}^{\left(\frac{1}{n}\right)}\right)}} - 1}{x \cdot n} \]
      6. add-exp-log95.6%

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

      \[\leadsto \frac{\color{blue}{\left(1 + {x}^{\left(\frac{1}{n}\right)}\right) - 1}}{x \cdot n} \]
    8. Step-by-step derivation
      1. associate--l+95.6%

        \[\leadsto \frac{\color{blue}{1 + \left({x}^{\left(\frac{1}{n}\right)} - 1\right)}}{x \cdot n} \]
    9. Simplified95.6%

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

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

Alternative 6: 71.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.72:\\
\;\;\;\;\frac{x \cdot \left(1 + x \cdot -0.5\right) - \log x}{n}\\

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


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

    1. Initial program 37.3%

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

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

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

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

      \[\leadsto \frac{\color{blue}{x \cdot \left(1 + -0.5 \cdot x\right) - \log x}}{n} \]
    7. Step-by-step derivation
      1. *-commutative59.7%

        \[\leadsto \frac{x \cdot \left(1 + \color{blue}{x \cdot -0.5}\right) - \log x}{n} \]
    8. Simplified59.7%

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

    if 0.71999999999999997 < x

    1. Initial program 62.5%

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

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

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

        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
      3. mul-1-neg95.6%

        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
      4. distribute-neg-frac95.6%

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

        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
      6. remove-double-neg95.6%

        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
      7. *-commutative95.6%

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
    5. Simplified95.6%

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

        \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{x \cdot n} \]
      2. pow-to-exp95.6%

        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{x \cdot n} \]
      3. expm1-log1p-u95.7%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{\left(\frac{1}{n}\right)}\right)\right)}}{x \cdot n} \]
      4. expm1-undefine95.6%

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

        \[\leadsto \frac{e^{\color{blue}{\log \left(1 + {x}^{\left(\frac{1}{n}\right)}\right)}} - 1}{x \cdot n} \]
      6. add-exp-log95.6%

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

      \[\leadsto \frac{\color{blue}{\left(1 + {x}^{\left(\frac{1}{n}\right)}\right) - 1}}{x \cdot n} \]
    8. Step-by-step derivation
      1. associate--l+95.6%

        \[\leadsto \frac{\color{blue}{1 + \left({x}^{\left(\frac{1}{n}\right)} - 1\right)}}{x \cdot n} \]
    9. Simplified95.6%

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

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

Alternative 7: 71.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.72:\\
\;\;\;\;\frac{x \cdot \left(1 + x \cdot -0.5\right) - \log x}{n}\\

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


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

    1. Initial program 37.3%

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

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

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

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

      \[\leadsto \frac{\color{blue}{x \cdot \left(1 + -0.5 \cdot x\right) - \log x}}{n} \]
    7. Step-by-step derivation
      1. *-commutative59.7%

        \[\leadsto \frac{x \cdot \left(1 + \color{blue}{x \cdot -0.5}\right) - \log x}{n} \]
    8. Simplified59.7%

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

    if 0.71999999999999997 < x

    1. Initial program 62.5%

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

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

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

        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
      3. mul-1-neg95.6%

        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
      4. distribute-neg-frac95.6%

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

        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
      6. remove-double-neg95.6%

        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
      7. *-commutative95.6%

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
    5. Simplified95.6%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot n}{e^{\frac{\log x}{n}}}}} \]
      2. inv-pow95.6%

        \[\leadsto \color{blue}{{\left(\frac{x \cdot n}{e^{\frac{\log x}{n}}}\right)}^{-1}} \]
      3. div-inv95.6%

        \[\leadsto {\left(\frac{x \cdot n}{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}\right)}^{-1} \]
      4. pow-to-exp95.6%

        \[\leadsto {\left(\frac{x \cdot n}{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}\right)}^{-1} \]
    7. Applied egg-rr95.6%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot n}{{x}^{\left(\frac{1}{n}\right)}}}} \]
      2. associate-/l*95.6%

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

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

Alternative 8: 70.9% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.72:\\
\;\;\;\;\frac{x - \log x}{n}\\

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


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

    1. Initial program 37.3%

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

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

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

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

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

    if 0.71999999999999997 < x

    1. Initial program 62.5%

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

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

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

        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
      3. mul-1-neg95.6%

        \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
      4. distribute-neg-frac95.6%

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

        \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
      6. remove-double-neg95.6%

        \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
      7. *-commutative95.6%

        \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
    5. Simplified95.6%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot n}{e^{\frac{\log x}{n}}}}} \]
      2. inv-pow95.6%

        \[\leadsto \color{blue}{{\left(\frac{x \cdot n}{e^{\frac{\log x}{n}}}\right)}^{-1}} \]
      3. div-inv95.6%

        \[\leadsto {\left(\frac{x \cdot n}{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}\right)}^{-1} \]
      4. pow-to-exp95.6%

        \[\leadsto {\left(\frac{x \cdot n}{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}\right)}^{-1} \]
    7. Applied egg-rr95.6%

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

        \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot n}{{x}^{\left(\frac{1}{n}\right)}}}} \]
      2. associate-/l*95.6%

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

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

Alternative 9: 70.9% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.72:\\
\;\;\;\;\frac{x - \log x}{n}\\

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


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

    1. Initial program 37.3%

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

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

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

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

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

    if 0.71999999999999997 < x

    1. Initial program 62.5%

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

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

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

        \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
      3. distribute-frac-neg95.6%

        \[\leadsto \frac{e^{-\color{blue}{\left(-\frac{\log x}{n}\right)}}}{n \cdot x} \]
      4. remove-double-neg95.6%

        \[\leadsto \frac{e^{\color{blue}{\frac{\log x}{n}}}}{n \cdot x} \]
      5. *-rgt-identity95.6%

        \[\leadsto \frac{e^{\frac{\color{blue}{\log x \cdot 1}}{n}}}{n \cdot x} \]
      6. associate-/l*95.6%

        \[\leadsto \frac{e^{\color{blue}{\log x \cdot \frac{1}{n}}}}{n \cdot x} \]
      7. exp-to-pow95.6%

        \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{1}{n}\right)}}}{n \cdot x} \]
      8. *-commutative95.6%

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

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

Alternative 10: 56.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.9:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (if (<= x 0.9)
   (/ (- x (log x)) n)
   (/
    (/
     (+ 1.0 (/ (- (/ (+ 0.3333333333333333 (* 0.25 (/ -1.0 x))) x) 0.5) x))
     x)
    n)))
double code(double x, double n) {
	double tmp;
	if (x <= 0.9) {
		tmp = (x - log(x)) / n;
	} else {
		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
	}
	return tmp;
}
real(8) function code(x, n)
    real(8), intent (in) :: x
    real(8), intent (in) :: n
    real(8) :: tmp
    if (x <= 0.9d0) then
        tmp = (x - log(x)) / n
    else
        tmp = ((1.0d0 + ((((0.3333333333333333d0 + (0.25d0 * ((-1.0d0) / x))) / x) - 0.5d0) / x)) / x) / n
    end if
    code = tmp
end function
public static double code(double x, double n) {
	double tmp;
	if (x <= 0.9) {
		tmp = (x - Math.log(x)) / n;
	} else {
		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
	}
	return tmp;
}
def code(x, n):
	tmp = 0
	if x <= 0.9:
		tmp = (x - math.log(x)) / n
	else:
		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n
	return tmp
function code(x, n)
	tmp = 0.0
	if (x <= 0.9)
		tmp = Float64(Float64(x - log(x)) / n);
	else
		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(Float64(0.3333333333333333 + Float64(0.25 * Float64(-1.0 / x))) / x) - 0.5) / x)) / x) / n);
	end
	return tmp
end
function tmp_2 = code(x, n)
	tmp = 0.0;
	if (x <= 0.9)
		tmp = (x - log(x)) / n;
	else
		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
	end
	tmp_2 = tmp;
end
code[x_, n_] := If[LessEqual[x, 0.9], N[(N[(x - N[Log[x], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(N[(N[(0.3333333333333333 + N[(0.25 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.9:\\
\;\;\;\;\frac{x - \log x}{n}\\

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


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

    1. Initial program 37.3%

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

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

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

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

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

    if 0.900000000000000022 < x

    1. Initial program 62.5%

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{x} - 0.3333333333333333}{x} - 0.5}{x} - 1}{x}}}{n} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.9:\\ \;\;\;\;\frac{x - \log x}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 56.6% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.7:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \end{array} \]
(FPCore (x n)
 :precision binary64
 (if (<= x 0.7)
   (/ (log x) (- n))
   (/
    (/
     (+ 1.0 (/ (- (/ (+ 0.3333333333333333 (* 0.25 (/ -1.0 x))) x) 0.5) x))
     x)
    n)))
double code(double x, double n) {
	double tmp;
	if (x <= 0.7) {
		tmp = log(x) / -n;
	} else {
		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
	}
	return tmp;
}
real(8) function code(x, n)
    real(8), intent (in) :: x
    real(8), intent (in) :: n
    real(8) :: tmp
    if (x <= 0.7d0) then
        tmp = log(x) / -n
    else
        tmp = ((1.0d0 + ((((0.3333333333333333d0 + (0.25d0 * ((-1.0d0) / x))) / x) - 0.5d0) / x)) / x) / n
    end if
    code = tmp
end function
public static double code(double x, double n) {
	double tmp;
	if (x <= 0.7) {
		tmp = Math.log(x) / -n;
	} else {
		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
	}
	return tmp;
}
def code(x, n):
	tmp = 0
	if x <= 0.7:
		tmp = math.log(x) / -n
	else:
		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n
	return tmp
function code(x, n)
	tmp = 0.0
	if (x <= 0.7)
		tmp = Float64(log(x) / Float64(-n));
	else
		tmp = Float64(Float64(Float64(1.0 + Float64(Float64(Float64(Float64(0.3333333333333333 + Float64(0.25 * Float64(-1.0 / x))) / x) - 0.5) / x)) / x) / n);
	end
	return tmp
end
function tmp_2 = code(x, n)
	tmp = 0.0;
	if (x <= 0.7)
		tmp = log(x) / -n;
	else
		tmp = ((1.0 + ((((0.3333333333333333 + (0.25 * (-1.0 / x))) / x) - 0.5) / x)) / x) / n;
	end
	tmp_2 = tmp;
end
code[x_, n_] := If[LessEqual[x, 0.7], N[(N[Log[x], $MachinePrecision] / (-n)), $MachinePrecision], N[(N[(N[(1.0 + N[(N[(N[(N[(0.3333333333333333 + N[(0.25 * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / n), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.7:\\
\;\;\;\;\frac{\log x}{-n}\\

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


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

    1. Initial program 37.6%

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

      \[\leadsto \color{blue}{1 - e^{\frac{\log x}{n}}} \]
    4. Step-by-step derivation
      1. *-rgt-identity37.4%

        \[\leadsto 1 - e^{\frac{\color{blue}{\log x \cdot 1}}{n}} \]
      2. associate-/l*37.4%

        \[\leadsto 1 - e^{\color{blue}{\log x \cdot \frac{1}{n}}} \]
      3. exp-to-pow37.4%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{\log x}{n}} \]
    7. Step-by-step derivation
      1. associate-*r/58.7%

        \[\leadsto \color{blue}{\frac{-1 \cdot \log x}{n}} \]
      2. neg-mul-158.7%

        \[\leadsto \frac{\color{blue}{-\log x}}{n} \]
    8. Simplified58.7%

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

    if 0.69999999999999996 < x

    1. Initial program 62.0%

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{-1 \cdot \frac{-1 \cdot \frac{0.25 \cdot \frac{1}{x} - 0.3333333333333333}{x} - 0.5}{x} - 1}{x}}}{n} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.7:\\ \;\;\;\;\frac{\log x}{-n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1 + \frac{\frac{0.3333333333333333 + 0.25 \cdot \frac{-1}{x}}{x} - 0.5}{x}}{x}}{n}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 45.6% accurate, 12.4× speedup?

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

\\
\frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x}
\end{array}
Derivation
  1. Initial program 48.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 63.5%

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

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

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

    \[\leadsto \color{blue}{-1 \cdot \frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
  7. Step-by-step derivation
    1. mul-1-neg50.1%

      \[\leadsto \color{blue}{-\frac{-1 \cdot \frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x} - \frac{1}{n}}{x}} \]
    2. mul-1-neg50.1%

      \[\leadsto -\frac{\color{blue}{\left(-\frac{0.3333333333333333 \cdot \frac{1}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right)} - \frac{1}{n}}{x} \]
    3. associate-*r/50.1%

      \[\leadsto -\frac{\left(-\frac{\color{blue}{\frac{0.3333333333333333 \cdot 1}{n \cdot x}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
    4. metadata-eval50.1%

      \[\leadsto -\frac{\left(-\frac{\frac{\color{blue}{0.3333333333333333}}{n \cdot x} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
    5. *-commutative50.1%

      \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{\color{blue}{x \cdot n}} - 0.5 \cdot \frac{1}{n}}{x}\right) - \frac{1}{n}}{x} \]
    6. associate-*r/50.1%

      \[\leadsto -\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \color{blue}{\frac{0.5 \cdot 1}{n}}}{x}\right) - \frac{1}{n}}{x} \]
    7. metadata-eval50.1%

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

    \[\leadsto \color{blue}{-\frac{\left(-\frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}\right) - \frac{1}{n}}{x}} \]
  9. Final simplification50.1%

    \[\leadsto \frac{\frac{1}{n} + \frac{\frac{0.3333333333333333}{x \cdot n} - \frac{0.5}{n}}{x}}{x} \]
  10. Add Preprocessing

Alternative 13: 39.9% accurate, 42.2× speedup?

\[\begin{array}{l} \\ \frac{\frac{1}{x}}{n} \end{array} \]
(FPCore (x n) :precision binary64 (/ (/ 1.0 x) n))
double code(double x, double n) {
	return (1.0 / x) / n;
}
real(8) function code(x, n)
    real(8), intent (in) :: x
    real(8), intent (in) :: n
    code = (1.0d0 / x) / n
end function
public static double code(double x, double n) {
	return (1.0 / x) / n;
}
def code(x, n):
	return (1.0 / x) / n
function code(x, n)
	return Float64(Float64(1.0 / x) / n)
end
function tmp = code(x, n)
	tmp = (1.0 / x) / n;
end
code[x_, n_] := N[(N[(1.0 / x), $MachinePrecision] / n), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{1}{x}}{n}
\end{array}
Derivation
  1. Initial program 48.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 58.2%

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

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

      \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
    3. mul-1-neg58.2%

      \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
    4. distribute-neg-frac58.2%

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

      \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
    6. remove-double-neg58.2%

      \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
    7. *-commutative58.2%

      \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
  5. Simplified58.2%

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

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

      \[\leadsto \frac{1}{\color{blue}{x \cdot n}} \]
    2. associate-/r*46.1%

      \[\leadsto \color{blue}{\frac{\frac{1}{x}}{n}} \]
  8. Simplified46.1%

    \[\leadsto \color{blue}{\frac{\frac{1}{x}}{n}} \]
  9. Add Preprocessing

Alternative 14: 39.3% accurate, 42.2× speedup?

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

\\
\frac{1}{x \cdot n}
\end{array}
Derivation
  1. Initial program 48.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 58.2%

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

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

      \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
    3. mul-1-neg58.2%

      \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
    4. distribute-neg-frac58.2%

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

      \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
    6. remove-double-neg58.2%

      \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
    7. *-commutative58.2%

      \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
  5. Simplified58.2%

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

    \[\leadsto \frac{\color{blue}{1}}{x \cdot n} \]
  7. Add Preprocessing

Alternative 15: 4.6% accurate, 70.3× speedup?

\[\begin{array}{l} \\ \frac{x}{n} \end{array} \]
(FPCore (x n) :precision binary64 (/ x n))
double code(double x, double n) {
	return x / n;
}
real(8) function code(x, n)
    real(8), intent (in) :: x
    real(8), intent (in) :: n
    code = x / n
end function
public static double code(double x, double n) {
	return x / n;
}
def code(x, n):
	return x / n
function code(x, n)
	return Float64(x / n)
end
function tmp = code(x, n)
	tmp = x / n;
end
code[x_, n_] := N[(x / n), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{n}
\end{array}
Derivation
  1. Initial program 48.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 58.2%

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

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

      \[\leadsto \frac{e^{-\frac{\color{blue}{-\log x}}{n}}}{n \cdot x} \]
    3. mul-1-neg58.2%

      \[\leadsto \frac{e^{-\frac{\color{blue}{-1 \cdot \log x}}{n}}}{n \cdot x} \]
    4. distribute-neg-frac58.2%

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

      \[\leadsto \frac{e^{\frac{-\color{blue}{\left(-\log x\right)}}{n}}}{n \cdot x} \]
    6. remove-double-neg58.2%

      \[\leadsto \frac{e^{\frac{\color{blue}{\log x}}{n}}}{n \cdot x} \]
    7. *-commutative58.2%

      \[\leadsto \frac{e^{\frac{\log x}{n}}}{\color{blue}{x \cdot n}} \]
  5. Simplified58.2%

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

    \[\leadsto \frac{\color{blue}{1}}{x \cdot n} \]
  7. Step-by-step derivation
    1. associate-/r*46.1%

      \[\leadsto \color{blue}{\frac{\frac{1}{x}}{n}} \]
    2. div-inv46.1%

      \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{1}{n}} \]
    3. add-exp-log45.3%

      \[\leadsto \color{blue}{e^{\log \left(\frac{1}{x}\right)}} \cdot \frac{1}{n} \]
    4. add-sqr-sqrt13.1%

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

      \[\leadsto e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right) \cdot \log \left(\frac{1}{x}\right)}}} \cdot \frac{1}{n} \]
    6. log-rec14.9%

      \[\leadsto e^{\sqrt{\color{blue}{\left(-\log x\right)} \cdot \log \left(\frac{1}{x}\right)}} \cdot \frac{1}{n} \]
    7. log-rec14.9%

      \[\leadsto e^{\sqrt{\left(-\log x\right) \cdot \color{blue}{\left(-\log x\right)}}} \cdot \frac{1}{n} \]
    8. sqr-neg14.9%

      \[\leadsto e^{\sqrt{\color{blue}{\log x \cdot \log x}}} \cdot \frac{1}{n} \]
    9. sqrt-unprod1.9%

      \[\leadsto e^{\color{blue}{\sqrt{\log x} \cdot \sqrt{\log x}}} \cdot \frac{1}{n} \]
    10. add-sqr-sqrt5.1%

      \[\leadsto e^{\color{blue}{\log x}} \cdot \frac{1}{n} \]
    11. add-exp-log5.1%

      \[\leadsto \color{blue}{x} \cdot \frac{1}{n} \]
  8. Applied egg-rr5.1%

    \[\leadsto \color{blue}{x \cdot \frac{1}{n}} \]
  9. Step-by-step derivation
    1. associate-*r/5.1%

      \[\leadsto \color{blue}{\frac{x \cdot 1}{n}} \]
    2. *-rgt-identity5.1%

      \[\leadsto \frac{\color{blue}{x}}{n} \]
  10. Simplified5.1%

    \[\leadsto \color{blue}{\frac{x}{n}} \]
  11. Add Preprocessing

Reproduce

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