Compound Interest

Percentage Accurate: 27.6% → 99.2%
Time: 21.0s
Alternatives: 20
Speedup: 38.0×

Specification

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

\\
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\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 20 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: 27.6% accurate, 1.0× speedup?

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

\\
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\end{array}

Alternative 1: 99.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\ t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{-18}:\\ \;\;\;\;100 \cdot \left(\frac{n}{i} \cdot 0 + \left(n \cdot \frac{t_0}{i} - \frac{n}{i}\right)\right)\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;\frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;n \cdot \frac{t_0}{\frac{i}{100}} + n \cdot \frac{-1}{\frac{i}{100}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
   (if (<= t_1 -1e-18)
     (* 100.0 (+ (* (/ n i) 0.0) (- (* n (/ t_0 i)) (/ n i))))
     (if (<= t_1 0.0)
       (/ (* 100.0 (expm1 (* n (log1p (/ i n))))) (/ i n))
       (if (<= t_1 INFINITY)
         (+ (* n (/ t_0 (/ i 100.0))) (* n (/ -1.0 (/ i 100.0))))
         (* 100.0 (/ n (+ 1.0 (* i -0.5)))))))))
double code(double i, double n) {
	double t_0 = pow((1.0 + (i / n)), n);
	double t_1 = (t_0 + -1.0) / (i / n);
	double tmp;
	if (t_1 <= -1e-18) {
		tmp = 100.0 * (((n / i) * 0.0) + ((n * (t_0 / i)) - (n / i)));
	} else if (t_1 <= 0.0) {
		tmp = (100.0 * expm1((n * log1p((i / n))))) / (i / n);
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = (n * (t_0 / (i / 100.0))) + (n * (-1.0 / (i / 100.0)));
	} else {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	}
	return tmp;
}
public static double code(double i, double n) {
	double t_0 = Math.pow((1.0 + (i / n)), n);
	double t_1 = (t_0 + -1.0) / (i / n);
	double tmp;
	if (t_1 <= -1e-18) {
		tmp = 100.0 * (((n / i) * 0.0) + ((n * (t_0 / i)) - (n / i)));
	} else if (t_1 <= 0.0) {
		tmp = (100.0 * Math.expm1((n * Math.log1p((i / n))))) / (i / n);
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = (n * (t_0 / (i / 100.0))) + (n * (-1.0 / (i / 100.0)));
	} else {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	}
	return tmp;
}
def code(i, n):
	t_0 = math.pow((1.0 + (i / n)), n)
	t_1 = (t_0 + -1.0) / (i / n)
	tmp = 0
	if t_1 <= -1e-18:
		tmp = 100.0 * (((n / i) * 0.0) + ((n * (t_0 / i)) - (n / i)))
	elif t_1 <= 0.0:
		tmp = (100.0 * math.expm1((n * math.log1p((i / n))))) / (i / n)
	elif t_1 <= math.inf:
		tmp = (n * (t_0 / (i / 100.0))) + (n * (-1.0 / (i / 100.0)))
	else:
		tmp = 100.0 * (n / (1.0 + (i * -0.5)))
	return tmp
function code(i, n)
	t_0 = Float64(1.0 + Float64(i / n)) ^ n
	t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n))
	tmp = 0.0
	if (t_1 <= -1e-18)
		tmp = Float64(100.0 * Float64(Float64(Float64(n / i) * 0.0) + Float64(Float64(n * Float64(t_0 / i)) - Float64(n / i))));
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(100.0 * expm1(Float64(n * log1p(Float64(i / n))))) / Float64(i / n));
	elseif (t_1 <= Inf)
		tmp = Float64(Float64(n * Float64(t_0 / Float64(i / 100.0))) + Float64(n * Float64(-1.0 / Float64(i / 100.0))));
	else
		tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5))));
	end
	return tmp
end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-18], N[(100.0 * N[(N[(N[(n / i), $MachinePrecision] * 0.0), $MachinePrecision] + N[(N[(n * N[(t$95$0 / i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(100.0 * N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(n * N[(t$95$0 / N[(i / 100.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(-1.0 / N[(i / 100.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-18}:\\
\;\;\;\;100 \cdot \left(\frac{n}{i} \cdot 0 + \left(n \cdot \frac{t_0}{i} - \frac{n}{i}\right)\right)\\

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\

\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t_0}{\frac{i}{100}} + n \cdot \frac{-1}{\frac{i}{100}}\\

\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -1.0000000000000001e-18

    1. Initial program 99.8%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. div-sub99.8%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \frac{1}{\frac{i}{n}}\right)} \]
      2. associate-/r/99.8%

        \[\leadsto 100 \cdot \left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n} - \frac{1}{\frac{i}{n}}\right) \]
      3. clear-num100.0%

        \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \color{blue}{\frac{n}{i}}\right) \]
      4. *-un-lft-identity100.0%

        \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \color{blue}{1 \cdot \frac{n}{i}}\right) \]
      5. prod-diff100.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(-\frac{n}{i}, 1, \frac{n}{i} \cdot 1\right)\right)} \]
    3. Applied egg-rr100.0%

      \[\leadsto 100 \cdot \color{blue}{\left(\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(-\frac{n}{i}, 1, \frac{n}{i} \cdot 1\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\mathsf{fma}\left(-\frac{n}{i}, 1, \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right)} \]
      2. fma-udef100.0%

        \[\leadsto 100 \cdot \left(\color{blue}{\left(\left(-\frac{n}{i}\right) \cdot 1 + \frac{n}{i} \cdot 1\right)} + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      3. distribute-lft-neg-in100.0%

        \[\leadsto 100 \cdot \left(\left(\color{blue}{\left(-\frac{n}{i} \cdot 1\right)} + \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      4. distribute-rgt-neg-in100.0%

        \[\leadsto 100 \cdot \left(\left(\color{blue}{\frac{n}{i} \cdot \left(-1\right)} + \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      5. metadata-eval100.0%

        \[\leadsto 100 \cdot \left(\left(\frac{n}{i} \cdot \color{blue}{-1} + \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      6. distribute-lft-out100.0%

        \[\leadsto 100 \cdot \left(\color{blue}{\frac{n}{i} \cdot \left(-1 + 1\right)} + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      7. metadata-eval100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot \color{blue}{0} + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      8. fma-udef100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot 0 + \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n + \left(-\frac{n}{i} \cdot 1\right)\right)}\right) \]
      9. *-rgt-identity100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot 0 + \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n + \left(-\color{blue}{\frac{n}{i}}\right)\right)\right) \]
      10. unsub-neg100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot 0 + \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \frac{n}{i}\right)}\right) \]
    5. Simplified100.0%

      \[\leadsto 100 \cdot \color{blue}{\left(\frac{n}{i} \cdot 0 + \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \frac{n}{i}\right)\right)} \]

    if -1.0000000000000001e-18 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0

    1. Initial program 25.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/25.7%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative25.7%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp25.7%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def37.4%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp25.7%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp25.7%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow37.4%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef99.6%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]

    if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0

    1. Initial program 98.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/98.3%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative98.3%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp76.5%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def78.2%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp76.5%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp98.3%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow78.2%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef78.2%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr78.2%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity78.2%

        \[\leadsto \color{blue}{1 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
      2. associate-/l*78.1%

        \[\leadsto 1 \cdot \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{\frac{i}{n}}{100}}} \]
    5. Applied egg-rr78.1%

      \[\leadsto \color{blue}{1 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{\frac{i}{n}}{100}}} \]
    6. Step-by-step derivation
      1. *-lft-identity78.1%

        \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{\frac{i}{n}}{100}}} \]
      2. associate-/l/78.1%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\color{blue}{\frac{i}{100 \cdot n}}} \]
    7. Simplified78.1%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{100 \cdot n}}} \]
    8. Step-by-step derivation
      1. expm1-udef76.5%

        \[\leadsto \frac{\color{blue}{e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)} - 1}}{\frac{i}{100 \cdot n}} \]
      2. div-sub76.7%

        \[\leadsto \color{blue}{\frac{e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}}} \]
      3. *-commutative76.7%

        \[\leadsto \frac{e^{\color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n}}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      4. log1p-udef76.7%

        \[\leadsto \frac{e^{\color{blue}{\log \left(1 + \frac{i}{n}\right)} \cdot n}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      5. exp-to-pow98.3%

        \[\leadsto \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n}}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      6. associate-/r*98.0%

        \[\leadsto \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\color{blue}{\frac{\frac{i}{100}}{n}}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      7. associate-/r*98.1%

        \[\leadsto \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{\frac{i}{100}}{n}} - \frac{1}{\color{blue}{\frac{\frac{i}{100}}{n}}} \]
    9. Applied egg-rr98.1%

      \[\leadsto \color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{\frac{i}{100}}{n}} - \frac{1}{\frac{\frac{i}{100}}{n}}} \]
    10. Step-by-step derivation
      1. associate-/r/98.4%

        \[\leadsto \color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{100}} \cdot n} - \frac{1}{\frac{\frac{i}{100}}{n}} \]
      2. associate-/r/98.5%

        \[\leadsto \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{100}} \cdot n - \color{blue}{\frac{1}{\frac{i}{100}} \cdot n} \]
    11. Simplified98.5%

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

    if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n))

    1. Initial program 0.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 2.0%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative2.0%

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

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def84.6%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified84.6%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]
  3. Recombined 4 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -1 \cdot 10^{-18}:\\ \;\;\;\;100 \cdot \left(\frac{n}{i} \cdot 0 + \left(n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} - \frac{n}{i}\right)\right)\\ \mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq 0:\\ \;\;\;\;\frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq \infty:\\ \;\;\;\;n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{100}} + n \cdot \frac{-1}{\frac{i}{100}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \]

Alternative 2: 98.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\ t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{-52}:\\ \;\;\;\;100 \cdot \left(\frac{n}{i} \cdot 0 + \left(n \cdot \frac{t_0}{i} - \frac{n}{i}\right)\right)\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;n \cdot \left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \frac{100}{i}\right)\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;n \cdot \frac{t_0}{\frac{i}{100}} + n \cdot \frac{-1}{\frac{i}{100}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
   (if (<= t_1 -1e-52)
     (* 100.0 (+ (* (/ n i) 0.0) (- (* n (/ t_0 i)) (/ n i))))
     (if (<= t_1 0.0)
       (* n (* (expm1 (* n (log1p (/ i n)))) (/ 100.0 i)))
       (if (<= t_1 INFINITY)
         (+ (* n (/ t_0 (/ i 100.0))) (* n (/ -1.0 (/ i 100.0))))
         (* 100.0 (/ n (+ 1.0 (* i -0.5)))))))))
double code(double i, double n) {
	double t_0 = pow((1.0 + (i / n)), n);
	double t_1 = (t_0 + -1.0) / (i / n);
	double tmp;
	if (t_1 <= -1e-52) {
		tmp = 100.0 * (((n / i) * 0.0) + ((n * (t_0 / i)) - (n / i)));
	} else if (t_1 <= 0.0) {
		tmp = n * (expm1((n * log1p((i / n)))) * (100.0 / i));
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = (n * (t_0 / (i / 100.0))) + (n * (-1.0 / (i / 100.0)));
	} else {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	}
	return tmp;
}
public static double code(double i, double n) {
	double t_0 = Math.pow((1.0 + (i / n)), n);
	double t_1 = (t_0 + -1.0) / (i / n);
	double tmp;
	if (t_1 <= -1e-52) {
		tmp = 100.0 * (((n / i) * 0.0) + ((n * (t_0 / i)) - (n / i)));
	} else if (t_1 <= 0.0) {
		tmp = n * (Math.expm1((n * Math.log1p((i / n)))) * (100.0 / i));
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = (n * (t_0 / (i / 100.0))) + (n * (-1.0 / (i / 100.0)));
	} else {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	}
	return tmp;
}
def code(i, n):
	t_0 = math.pow((1.0 + (i / n)), n)
	t_1 = (t_0 + -1.0) / (i / n)
	tmp = 0
	if t_1 <= -1e-52:
		tmp = 100.0 * (((n / i) * 0.0) + ((n * (t_0 / i)) - (n / i)))
	elif t_1 <= 0.0:
		tmp = n * (math.expm1((n * math.log1p((i / n)))) * (100.0 / i))
	elif t_1 <= math.inf:
		tmp = (n * (t_0 / (i / 100.0))) + (n * (-1.0 / (i / 100.0)))
	else:
		tmp = 100.0 * (n / (1.0 + (i * -0.5)))
	return tmp
function code(i, n)
	t_0 = Float64(1.0 + Float64(i / n)) ^ n
	t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n))
	tmp = 0.0
	if (t_1 <= -1e-52)
		tmp = Float64(100.0 * Float64(Float64(Float64(n / i) * 0.0) + Float64(Float64(n * Float64(t_0 / i)) - Float64(n / i))));
	elseif (t_1 <= 0.0)
		tmp = Float64(n * Float64(expm1(Float64(n * log1p(Float64(i / n)))) * Float64(100.0 / i)));
	elseif (t_1 <= Inf)
		tmp = Float64(Float64(n * Float64(t_0 / Float64(i / 100.0))) + Float64(n * Float64(-1.0 / Float64(i / 100.0))));
	else
		tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5))));
	end
	return tmp
end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-52], N[(100.0 * N[(N[(N[(n / i), $MachinePrecision] * 0.0), $MachinePrecision] + N[(N[(n * N[(t$95$0 / i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(n * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] * N[(100.0 / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(n * N[(t$95$0 / N[(i / 100.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(-1.0 / N[(i / 100.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-52}:\\
\;\;\;\;100 \cdot \left(\frac{n}{i} \cdot 0 + \left(n \cdot \frac{t_0}{i} - \frac{n}{i}\right)\right)\\

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;n \cdot \left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \frac{100}{i}\right)\\

\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t_0}{\frac{i}{100}} + n \cdot \frac{-1}{\frac{i}{100}}\\

\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -1e-52

    1. Initial program 99.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. div-sub99.9%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \frac{1}{\frac{i}{n}}\right)} \]
      2. associate-/r/99.9%

        \[\leadsto 100 \cdot \left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n} - \frac{1}{\frac{i}{n}}\right) \]
      3. clear-num100.0%

        \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \color{blue}{\frac{n}{i}}\right) \]
      4. *-un-lft-identity100.0%

        \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \color{blue}{1 \cdot \frac{n}{i}}\right) \]
      5. prod-diff100.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(-\frac{n}{i}, 1, \frac{n}{i} \cdot 1\right)\right)} \]
    3. Applied egg-rr100.0%

      \[\leadsto 100 \cdot \color{blue}{\left(\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(-\frac{n}{i}, 1, \frac{n}{i} \cdot 1\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\mathsf{fma}\left(-\frac{n}{i}, 1, \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right)} \]
      2. fma-udef100.0%

        \[\leadsto 100 \cdot \left(\color{blue}{\left(\left(-\frac{n}{i}\right) \cdot 1 + \frac{n}{i} \cdot 1\right)} + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      3. distribute-lft-neg-in100.0%

        \[\leadsto 100 \cdot \left(\left(\color{blue}{\left(-\frac{n}{i} \cdot 1\right)} + \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      4. distribute-rgt-neg-in100.0%

        \[\leadsto 100 \cdot \left(\left(\color{blue}{\frac{n}{i} \cdot \left(-1\right)} + \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      5. metadata-eval100.0%

        \[\leadsto 100 \cdot \left(\left(\frac{n}{i} \cdot \color{blue}{-1} + \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      6. distribute-lft-out100.0%

        \[\leadsto 100 \cdot \left(\color{blue}{\frac{n}{i} \cdot \left(-1 + 1\right)} + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      7. metadata-eval100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot \color{blue}{0} + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      8. fma-udef100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot 0 + \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n + \left(-\frac{n}{i} \cdot 1\right)\right)}\right) \]
      9. *-rgt-identity100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot 0 + \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n + \left(-\color{blue}{\frac{n}{i}}\right)\right)\right) \]
      10. unsub-neg100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot 0 + \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \frac{n}{i}\right)}\right) \]
    5. Simplified100.0%

      \[\leadsto 100 \cdot \color{blue}{\left(\frac{n}{i} \cdot 0 + \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \frac{n}{i}\right)\right)} \]

    if -1e-52 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0

    1. Initial program 25.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/24.9%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*24.9%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative24.9%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/24.9%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg24.9%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in24.9%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def24.9%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval24.9%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval24.9%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified24.9%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Step-by-step derivation
      1. expm1-log1p-u24.9%

        \[\leadsto n \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}\right)\right)} \]
      2. expm1-udef21.8%

        \[\leadsto n \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}\right)} - 1\right)} \]
    5. Applied egg-rr71.9%

      \[\leadsto n \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{i}\right)} - 1\right)} \]
    6. Step-by-step derivation
      1. expm1-def97.4%

        \[\leadsto n \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{i}\right)\right)} \]
      2. expm1-log1p98.2%

        \[\leadsto n \cdot \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{i}} \]
      3. *-rgt-identity98.2%

        \[\leadsto n \cdot \frac{\color{blue}{\left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100\right) \cdot 1}}{i} \]
      4. associate-*r/98.0%

        \[\leadsto n \cdot \color{blue}{\left(\left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100\right) \cdot \frac{1}{i}\right)} \]
      5. associate-*l*97.5%

        \[\leadsto n \cdot \color{blue}{\left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \left(100 \cdot \frac{1}{i}\right)\right)} \]
      6. associate-*r/97.6%

        \[\leadsto n \cdot \left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \color{blue}{\frac{100 \cdot 1}{i}}\right) \]
      7. metadata-eval97.6%

        \[\leadsto n \cdot \left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \frac{\color{blue}{100}}{i}\right) \]
    7. Simplified97.6%

      \[\leadsto n \cdot \color{blue}{\left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \frac{100}{i}\right)} \]

    if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0

    1. Initial program 98.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/98.3%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative98.3%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp76.5%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def78.2%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp76.5%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp98.3%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow78.2%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef78.2%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr78.2%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity78.2%

        \[\leadsto \color{blue}{1 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
      2. associate-/l*78.1%

        \[\leadsto 1 \cdot \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{\frac{i}{n}}{100}}} \]
    5. Applied egg-rr78.1%

      \[\leadsto \color{blue}{1 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{\frac{i}{n}}{100}}} \]
    6. Step-by-step derivation
      1. *-lft-identity78.1%

        \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{\frac{i}{n}}{100}}} \]
      2. associate-/l/78.1%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\color{blue}{\frac{i}{100 \cdot n}}} \]
    7. Simplified78.1%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{100 \cdot n}}} \]
    8. Step-by-step derivation
      1. expm1-udef76.5%

        \[\leadsto \frac{\color{blue}{e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)} - 1}}{\frac{i}{100 \cdot n}} \]
      2. div-sub76.7%

        \[\leadsto \color{blue}{\frac{e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}}} \]
      3. *-commutative76.7%

        \[\leadsto \frac{e^{\color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n}}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      4. log1p-udef76.7%

        \[\leadsto \frac{e^{\color{blue}{\log \left(1 + \frac{i}{n}\right)} \cdot n}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      5. exp-to-pow98.3%

        \[\leadsto \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n}}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      6. associate-/r*98.0%

        \[\leadsto \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\color{blue}{\frac{\frac{i}{100}}{n}}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      7. associate-/r*98.1%

        \[\leadsto \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{\frac{i}{100}}{n}} - \frac{1}{\color{blue}{\frac{\frac{i}{100}}{n}}} \]
    9. Applied egg-rr98.1%

      \[\leadsto \color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{\frac{i}{100}}{n}} - \frac{1}{\frac{\frac{i}{100}}{n}}} \]
    10. Step-by-step derivation
      1. associate-/r/98.4%

        \[\leadsto \color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{100}} \cdot n} - \frac{1}{\frac{\frac{i}{100}}{n}} \]
      2. associate-/r/98.5%

        \[\leadsto \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{100}} \cdot n - \color{blue}{\frac{1}{\frac{i}{100}} \cdot n} \]
    11. Simplified98.5%

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

    if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n))

    1. Initial program 0.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 2.0%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative2.0%

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

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def84.6%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified84.6%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]
  3. Recombined 4 regimes into one program.
  4. Final simplification98.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -1 \cdot 10^{-52}:\\ \;\;\;\;100 \cdot \left(\frac{n}{i} \cdot 0 + \left(n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} - \frac{n}{i}\right)\right)\\ \mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq 0:\\ \;\;\;\;n \cdot \left(\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot \frac{100}{i}\right)\\ \mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq \infty:\\ \;\;\;\;n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{100}} + n \cdot \frac{-1}{\frac{i}{100}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \]

Alternative 3: 98.5% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\ t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{-52}:\\ \;\;\;\;100 \cdot \left(\frac{n}{i} \cdot 0 + \left(n \cdot \frac{t_0}{i} - \frac{n}{i}\right)\right)\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;n \cdot \frac{t_0}{\frac{i}{100}} + n \cdot \frac{-1}{\frac{i}{100}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
   (if (<= t_1 -1e-52)
     (* 100.0 (+ (* (/ n i) 0.0) (- (* n (/ t_0 i)) (/ n i))))
     (if (<= t_1 0.0)
       (* n (/ (* 100.0 (expm1 (* n (log1p (/ i n))))) i))
       (if (<= t_1 INFINITY)
         (+ (* n (/ t_0 (/ i 100.0))) (* n (/ -1.0 (/ i 100.0))))
         (* 100.0 (/ n (+ 1.0 (* i -0.5)))))))))
double code(double i, double n) {
	double t_0 = pow((1.0 + (i / n)), n);
	double t_1 = (t_0 + -1.0) / (i / n);
	double tmp;
	if (t_1 <= -1e-52) {
		tmp = 100.0 * (((n / i) * 0.0) + ((n * (t_0 / i)) - (n / i)));
	} else if (t_1 <= 0.0) {
		tmp = n * ((100.0 * expm1((n * log1p((i / n))))) / i);
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = (n * (t_0 / (i / 100.0))) + (n * (-1.0 / (i / 100.0)));
	} else {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	}
	return tmp;
}
public static double code(double i, double n) {
	double t_0 = Math.pow((1.0 + (i / n)), n);
	double t_1 = (t_0 + -1.0) / (i / n);
	double tmp;
	if (t_1 <= -1e-52) {
		tmp = 100.0 * (((n / i) * 0.0) + ((n * (t_0 / i)) - (n / i)));
	} else if (t_1 <= 0.0) {
		tmp = n * ((100.0 * Math.expm1((n * Math.log1p((i / n))))) / i);
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = (n * (t_0 / (i / 100.0))) + (n * (-1.0 / (i / 100.0)));
	} else {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	}
	return tmp;
}
def code(i, n):
	t_0 = math.pow((1.0 + (i / n)), n)
	t_1 = (t_0 + -1.0) / (i / n)
	tmp = 0
	if t_1 <= -1e-52:
		tmp = 100.0 * (((n / i) * 0.0) + ((n * (t_0 / i)) - (n / i)))
	elif t_1 <= 0.0:
		tmp = n * ((100.0 * math.expm1((n * math.log1p((i / n))))) / i)
	elif t_1 <= math.inf:
		tmp = (n * (t_0 / (i / 100.0))) + (n * (-1.0 / (i / 100.0)))
	else:
		tmp = 100.0 * (n / (1.0 + (i * -0.5)))
	return tmp
function code(i, n)
	t_0 = Float64(1.0 + Float64(i / n)) ^ n
	t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n))
	tmp = 0.0
	if (t_1 <= -1e-52)
		tmp = Float64(100.0 * Float64(Float64(Float64(n / i) * 0.0) + Float64(Float64(n * Float64(t_0 / i)) - Float64(n / i))));
	elseif (t_1 <= 0.0)
		tmp = Float64(n * Float64(Float64(100.0 * expm1(Float64(n * log1p(Float64(i / n))))) / i));
	elseif (t_1 <= Inf)
		tmp = Float64(Float64(n * Float64(t_0 / Float64(i / 100.0))) + Float64(n * Float64(-1.0 / Float64(i / 100.0))));
	else
		tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5))));
	end
	return tmp
end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-52], N[(100.0 * N[(N[(N[(n / i), $MachinePrecision] * 0.0), $MachinePrecision] + N[(N[(n * N[(t$95$0 / i), $MachinePrecision]), $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(n * N[(N[(100.0 * N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(n * N[(t$95$0 / N[(i / 100.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(-1.0 / N[(i / 100.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-52}:\\
\;\;\;\;100 \cdot \left(\frac{n}{i} \cdot 0 + \left(n \cdot \frac{t_0}{i} - \frac{n}{i}\right)\right)\\

\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\\

\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;n \cdot \frac{t_0}{\frac{i}{100}} + n \cdot \frac{-1}{\frac{i}{100}}\\

\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < -1e-52

    1. Initial program 99.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. div-sub99.9%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \frac{1}{\frac{i}{n}}\right)} \]
      2. associate-/r/99.9%

        \[\leadsto 100 \cdot \left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n} - \frac{1}{\frac{i}{n}}\right) \]
      3. clear-num100.0%

        \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \color{blue}{\frac{n}{i}}\right) \]
      4. *-un-lft-identity100.0%

        \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \color{blue}{1 \cdot \frac{n}{i}}\right) \]
      5. prod-diff100.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(-\frac{n}{i}, 1, \frac{n}{i} \cdot 1\right)\right)} \]
    3. Applied egg-rr100.0%

      \[\leadsto 100 \cdot \color{blue}{\left(\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(-\frac{n}{i}, 1, \frac{n}{i} \cdot 1\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutative100.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\mathsf{fma}\left(-\frac{n}{i}, 1, \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right)} \]
      2. fma-udef100.0%

        \[\leadsto 100 \cdot \left(\color{blue}{\left(\left(-\frac{n}{i}\right) \cdot 1 + \frac{n}{i} \cdot 1\right)} + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      3. distribute-lft-neg-in100.0%

        \[\leadsto 100 \cdot \left(\left(\color{blue}{\left(-\frac{n}{i} \cdot 1\right)} + \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      4. distribute-rgt-neg-in100.0%

        \[\leadsto 100 \cdot \left(\left(\color{blue}{\frac{n}{i} \cdot \left(-1\right)} + \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      5. metadata-eval100.0%

        \[\leadsto 100 \cdot \left(\left(\frac{n}{i} \cdot \color{blue}{-1} + \frac{n}{i} \cdot 1\right) + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      6. distribute-lft-out100.0%

        \[\leadsto 100 \cdot \left(\color{blue}{\frac{n}{i} \cdot \left(-1 + 1\right)} + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      7. metadata-eval100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot \color{blue}{0} + \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, -\frac{n}{i} \cdot 1\right)\right) \]
      8. fma-udef100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot 0 + \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n + \left(-\frac{n}{i} \cdot 1\right)\right)}\right) \]
      9. *-rgt-identity100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot 0 + \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n + \left(-\color{blue}{\frac{n}{i}}\right)\right)\right) \]
      10. unsub-neg100.0%

        \[\leadsto 100 \cdot \left(\frac{n}{i} \cdot 0 + \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \frac{n}{i}\right)}\right) \]
    5. Simplified100.0%

      \[\leadsto 100 \cdot \color{blue}{\left(\frac{n}{i} \cdot 0 + \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n - \frac{n}{i}\right)\right)} \]

    if -1e-52 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0

    1. Initial program 25.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/24.9%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*24.9%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative24.9%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/24.9%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg24.9%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in24.9%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def24.9%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval24.9%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval24.9%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified24.9%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Step-by-step derivation
      1. fma-udef24.9%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + -100}}{i} \]
      2. metadata-eval24.9%

        \[\leadsto n \cdot \frac{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + \color{blue}{100 \cdot -1}}{i} \]
      3. metadata-eval24.9%

        \[\leadsto n \cdot \frac{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \color{blue}{\left(-1\right)}}{i} \]
      4. distribute-lft-in24.9%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      5. sub-neg24.9%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}}{i} \]
      6. *-commutative24.9%

        \[\leadsto n \cdot \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{i} \]
      7. pow-to-exp24.9%

        \[\leadsto n \cdot \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{i} \]
      8. expm1-def36.7%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{i} \]
      9. add-log-exp24.9%

        \[\leadsto n \cdot \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{i} \]
      10. pow-to-exp24.9%

        \[\leadsto n \cdot \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{i} \]
      11. log-pow36.7%

        \[\leadsto n \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{i} \]
      12. log1p-udef98.2%

        \[\leadsto n \cdot \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{i} \]
    5. Applied egg-rr98.2%

      \[\leadsto n \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}}{i} \]

    if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0

    1. Initial program 98.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/98.3%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative98.3%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp76.5%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def78.2%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp76.5%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp98.3%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow78.2%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef78.2%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr78.2%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
    4. Step-by-step derivation
      1. *-un-lft-identity78.2%

        \[\leadsto \color{blue}{1 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
      2. associate-/l*78.1%

        \[\leadsto 1 \cdot \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{\frac{i}{n}}{100}}} \]
    5. Applied egg-rr78.1%

      \[\leadsto \color{blue}{1 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{\frac{i}{n}}{100}}} \]
    6. Step-by-step derivation
      1. *-lft-identity78.1%

        \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{\frac{i}{n}}{100}}} \]
      2. associate-/l/78.1%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\color{blue}{\frac{i}{100 \cdot n}}} \]
    7. Simplified78.1%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{100 \cdot n}}} \]
    8. Step-by-step derivation
      1. expm1-udef76.5%

        \[\leadsto \frac{\color{blue}{e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)} - 1}}{\frac{i}{100 \cdot n}} \]
      2. div-sub76.7%

        \[\leadsto \color{blue}{\frac{e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}}} \]
      3. *-commutative76.7%

        \[\leadsto \frac{e^{\color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n}}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      4. log1p-udef76.7%

        \[\leadsto \frac{e^{\color{blue}{\log \left(1 + \frac{i}{n}\right)} \cdot n}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      5. exp-to-pow98.3%

        \[\leadsto \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n}}}{\frac{i}{100 \cdot n}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      6. associate-/r*98.0%

        \[\leadsto \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\color{blue}{\frac{\frac{i}{100}}{n}}} - \frac{1}{\frac{i}{100 \cdot n}} \]
      7. associate-/r*98.1%

        \[\leadsto \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{\frac{i}{100}}{n}} - \frac{1}{\color{blue}{\frac{\frac{i}{100}}{n}}} \]
    9. Applied egg-rr98.1%

      \[\leadsto \color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{\frac{i}{100}}{n}} - \frac{1}{\frac{\frac{i}{100}}{n}}} \]
    10. Step-by-step derivation
      1. associate-/r/98.4%

        \[\leadsto \color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{100}} \cdot n} - \frac{1}{\frac{\frac{i}{100}}{n}} \]
      2. associate-/r/98.5%

        \[\leadsto \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{100}} \cdot n - \color{blue}{\frac{1}{\frac{i}{100}} \cdot n} \]
    11. Simplified98.5%

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

    if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n))

    1. Initial program 0.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 2.0%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative2.0%

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

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def84.6%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified84.6%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]
  3. Recombined 4 regimes into one program.
  4. Final simplification98.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -1 \cdot 10^{-52}:\\ \;\;\;\;100 \cdot \left(\frac{n}{i} \cdot 0 + \left(n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} - \frac{n}{i}\right)\right)\\ \mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq 0:\\ \;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{i}\\ \mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq \infty:\\ \;\;\;\;n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{100}} + n \cdot \frac{-1}{\frac{i}{100}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \]

Alternative 4: 82.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \mathbf{if}\;n \leq -2.75 \cdot 10^{-154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;n \leq 1.45 \cdot 10^{-226}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 5.5 \cdot 10^{-10}:\\ \;\;\;\;100 \cdot \frac{n}{1 + \mathsf{fma}\left(i \cdot i, 0.08333333333333333, i \cdot -0.5\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (let* ((t_0 (* 100.0 (/ n (/ i (expm1 i))))))
   (if (<= n -2.75e-154)
     t_0
     (if (<= n 1.45e-226)
       (* 100.0 (/ 0.0 (/ i n)))
       (if (<= n 5.5e-10)
         (* 100.0 (/ n (+ 1.0 (fma (* i i) 0.08333333333333333 (* i -0.5)))))
         t_0)))))
double code(double i, double n) {
	double t_0 = 100.0 * (n / (i / expm1(i)));
	double tmp;
	if (n <= -2.75e-154) {
		tmp = t_0;
	} else if (n <= 1.45e-226) {
		tmp = 100.0 * (0.0 / (i / n));
	} else if (n <= 5.5e-10) {
		tmp = 100.0 * (n / (1.0 + fma((i * i), 0.08333333333333333, (i * -0.5))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(i, n)
	t_0 = Float64(100.0 * Float64(n / Float64(i / expm1(i))))
	tmp = 0.0
	if (n <= -2.75e-154)
		tmp = t_0;
	elseif (n <= 1.45e-226)
		tmp = Float64(100.0 * Float64(0.0 / Float64(i / n)));
	elseif (n <= 5.5e-10)
		tmp = Float64(100.0 * Float64(n / Float64(1.0 + fma(Float64(i * i), 0.08333333333333333, Float64(i * -0.5)))));
	else
		tmp = t_0;
	end
	return tmp
end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -2.75e-154], t$95$0, If[LessEqual[n, 1.45e-226], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.5e-10], N[(100.0 * N[(n / N[(1.0 + N[(N[(i * i), $MachinePrecision] * 0.08333333333333333 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\
\mathbf{if}\;n \leq -2.75 \cdot 10^{-154}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;n \leq 1.45 \cdot 10^{-226}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\

\mathbf{elif}\;n \leq 5.5 \cdot 10^{-10}:\\
\;\;\;\;100 \cdot \frac{n}{1 + \mathsf{fma}\left(i \cdot i, 0.08333333333333333, i \cdot -0.5\right)}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < -2.75000000000000001e-154 or 5.4999999999999996e-10 < n

    1. Initial program 24.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 40.8%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative40.8%

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

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def87.8%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified87.8%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]

    if -2.75000000000000001e-154 < n < 1.45000000000000001e-226

    1. Initial program 74.8%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 83.4%

      \[\leadsto 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]

    if 1.45000000000000001e-226 < n < 5.4999999999999996e-10

    1. Initial program 26.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 7.1%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative7.1%

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

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def42.9%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified42.9%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 64.9%

      \[\leadsto \frac{n}{\color{blue}{1 + \left(0.08333333333333333 \cdot {i}^{2} + -0.5 \cdot i\right)}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative64.9%

        \[\leadsto \frac{n}{1 + \left(\color{blue}{{i}^{2} \cdot 0.08333333333333333} + -0.5 \cdot i\right)} \cdot 100 \]
      2. fma-def64.9%

        \[\leadsto \frac{n}{1 + \color{blue}{\mathsf{fma}\left({i}^{2}, 0.08333333333333333, -0.5 \cdot i\right)}} \cdot 100 \]
      3. unpow264.9%

        \[\leadsto \frac{n}{1 + \mathsf{fma}\left(\color{blue}{i \cdot i}, 0.08333333333333333, -0.5 \cdot i\right)} \cdot 100 \]
      4. *-commutative64.9%

        \[\leadsto \frac{n}{1 + \mathsf{fma}\left(i \cdot i, 0.08333333333333333, \color{blue}{i \cdot -0.5}\right)} \cdot 100 \]
    7. Simplified64.9%

      \[\leadsto \frac{n}{\color{blue}{1 + \mathsf{fma}\left(i \cdot i, 0.08333333333333333, i \cdot -0.5\right)}} \cdot 100 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -2.75 \cdot 10^{-154}:\\ \;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \mathbf{elif}\;n \leq 1.45 \cdot 10^{-226}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 5.5 \cdot 10^{-10}:\\ \;\;\;\;100 \cdot \frac{n}{1 + \mathsf{fma}\left(i \cdot i, 0.08333333333333333, i \cdot -0.5\right)}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \end{array} \]

Alternative 5: 75.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\ \mathbf{if}\;i \leq -5.4 \cdot 10^{-67}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;i \leq 1.55 \cdot 10^{-202}:\\ \;\;\;\;100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\\ \mathbf{elif}\;i \leq 2.8 \cdot 10^{-24}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (let* ((t_0 (* 100.0 (/ (expm1 i) (/ i n)))))
   (if (<= i -5.4e-67)
     t_0
     (if (<= i 1.55e-202)
       (* 100.0 (+ n (* (* i n) (- 0.5 (/ 0.5 n)))))
       (if (<= i 2.8e-24) (* 100.0 (/ (* i n) i)) t_0)))))
double code(double i, double n) {
	double t_0 = 100.0 * (expm1(i) / (i / n));
	double tmp;
	if (i <= -5.4e-67) {
		tmp = t_0;
	} else if (i <= 1.55e-202) {
		tmp = 100.0 * (n + ((i * n) * (0.5 - (0.5 / n))));
	} else if (i <= 2.8e-24) {
		tmp = 100.0 * ((i * n) / i);
	} else {
		tmp = t_0;
	}
	return tmp;
}
public static double code(double i, double n) {
	double t_0 = 100.0 * (Math.expm1(i) / (i / n));
	double tmp;
	if (i <= -5.4e-67) {
		tmp = t_0;
	} else if (i <= 1.55e-202) {
		tmp = 100.0 * (n + ((i * n) * (0.5 - (0.5 / n))));
	} else if (i <= 2.8e-24) {
		tmp = 100.0 * ((i * n) / i);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(i, n):
	t_0 = 100.0 * (math.expm1(i) / (i / n))
	tmp = 0
	if i <= -5.4e-67:
		tmp = t_0
	elif i <= 1.55e-202:
		tmp = 100.0 * (n + ((i * n) * (0.5 - (0.5 / n))))
	elif i <= 2.8e-24:
		tmp = 100.0 * ((i * n) / i)
	else:
		tmp = t_0
	return tmp
function code(i, n)
	t_0 = Float64(100.0 * Float64(expm1(i) / Float64(i / n)))
	tmp = 0.0
	if (i <= -5.4e-67)
		tmp = t_0;
	elseif (i <= 1.55e-202)
		tmp = Float64(100.0 * Float64(n + Float64(Float64(i * n) * Float64(0.5 - Float64(0.5 / n)))));
	elseif (i <= 2.8e-24)
		tmp = Float64(100.0 * Float64(Float64(i * n) / i));
	else
		tmp = t_0;
	end
	return tmp
end
code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -5.4e-67], t$95$0, If[LessEqual[i, 1.55e-202], N[(100.0 * N[(n + N[(N[(i * n), $MachinePrecision] * N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.8e-24], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\
\mathbf{if}\;i \leq -5.4 \cdot 10^{-67}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;i \leq 1.55 \cdot 10^{-202}:\\
\;\;\;\;100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\\

\mathbf{elif}\;i \leq 2.8 \cdot 10^{-24}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -5.40000000000000032e-67 or 2.8000000000000002e-24 < i

    1. Initial program 48.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 63.0%

      \[\leadsto 100 \cdot \frac{\color{blue}{e^{i} - 1}}{\frac{i}{n}} \]
    3. Step-by-step derivation
      1. expm1-def66.9%

        \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{\frac{i}{n}} \]
    4. Simplified66.9%

      \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{\frac{i}{n}} \]

    if -5.40000000000000032e-67 < i < 1.55e-202

    1. Initial program 7.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 88.2%

      \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*88.4%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
      2. *-commutative88.4%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
      3. associate-*r/88.4%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
      4. metadata-eval88.4%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
    4. Simplified88.4%

      \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]

    if 1.55e-202 < i < 2.8000000000000002e-24

    1. Initial program 21.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/21.7%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative21.7%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp21.7%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def29.3%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp21.7%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp21.7%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow29.3%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef86.5%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr86.5%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
    4. Taylor expanded in i around 0 59.4%

      \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
    5. Step-by-step derivation
      1. div-inv56.7%

        \[\leadsto \color{blue}{\left(100 \cdot i\right) \cdot \frac{1}{\frac{i}{n}}} \]
      2. clear-num56.7%

        \[\leadsto \left(100 \cdot i\right) \cdot \color{blue}{\frac{n}{i}} \]
      3. associate-*l*56.8%

        \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    6. Applied egg-rr56.8%

      \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/84.6%

        \[\leadsto 100 \cdot \color{blue}{\frac{i \cdot n}{i}} \]
    8. Applied egg-rr84.6%

      \[\leadsto 100 \cdot \color{blue}{\frac{i \cdot n}{i}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -5.4 \cdot 10^{-67}:\\ \;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 1.55 \cdot 10^{-202}:\\ \;\;\;\;100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\\ \mathbf{elif}\;i \leq 2.8 \cdot 10^{-24}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\ \end{array} \]

Alternative 6: 79.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -2.95 \cdot 10^{-154} \lor \neg \left(n \leq 1.15 \cdot 10^{-177}\right):\\ \;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (or (<= n -2.95e-154) (not (<= n 1.15e-177)))
   (* n (/ (* 100.0 (expm1 i)) i))
   (* 100.0 (/ 0.0 (/ i n)))))
double code(double i, double n) {
	double tmp;
	if ((n <= -2.95e-154) || !(n <= 1.15e-177)) {
		tmp = n * ((100.0 * expm1(i)) / i);
	} else {
		tmp = 100.0 * (0.0 / (i / n));
	}
	return tmp;
}
public static double code(double i, double n) {
	double tmp;
	if ((n <= -2.95e-154) || !(n <= 1.15e-177)) {
		tmp = n * ((100.0 * Math.expm1(i)) / i);
	} else {
		tmp = 100.0 * (0.0 / (i / n));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if (n <= -2.95e-154) or not (n <= 1.15e-177):
		tmp = n * ((100.0 * math.expm1(i)) / i)
	else:
		tmp = 100.0 * (0.0 / (i / n))
	return tmp
function code(i, n)
	tmp = 0.0
	if ((n <= -2.95e-154) || !(n <= 1.15e-177))
		tmp = Float64(n * Float64(Float64(100.0 * expm1(i)) / i));
	else
		tmp = Float64(100.0 * Float64(0.0 / Float64(i / n)));
	end
	return tmp
end
code[i_, n_] := If[Or[LessEqual[n, -2.95e-154], N[Not[LessEqual[n, 1.15e-177]], $MachinePrecision]], N[(n * N[(N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.95 \cdot 10^{-154} \lor \neg \left(n \leq 1.15 \cdot 10^{-177}\right):\\
\;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\

\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -2.9500000000000001e-154 or 1.15000000000000011e-177 < n

    1. Initial program 24.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/24.6%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*24.5%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative24.5%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/24.6%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg24.6%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in24.6%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def24.6%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval24.6%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval24.6%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified24.6%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Step-by-step derivation
      1. fma-udef24.6%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + -100}}{i} \]
      2. *-commutative24.6%

        \[\leadsto n \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100} + -100}{i} \]
    5. Applied egg-rr24.6%

      \[\leadsto n \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100 + -100}}{i} \]
    6. Taylor expanded in n around inf 37.0%

      \[\leadsto n \cdot \color{blue}{\frac{100 \cdot e^{i} - 100}{i}} \]
    7. Step-by-step derivation
      1. sub-neg37.0%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot e^{i} + \left(-100\right)}}{i} \]
      2. metadata-eval37.0%

        \[\leadsto n \cdot \frac{100 \cdot e^{i} + \color{blue}{-100}}{i} \]
      3. metadata-eval37.0%

        \[\leadsto n \cdot \frac{100 \cdot e^{i} + \color{blue}{100 \cdot -1}}{i} \]
      4. distribute-lft-in37.0%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \left(e^{i} + -1\right)}}{i} \]
      5. metadata-eval37.0%

        \[\leadsto n \cdot \frac{100 \cdot \left(e^{i} + \color{blue}{\left(-1\right)}\right)}{i} \]
      6. sub-neg37.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left(e^{i} - 1\right)}}{i} \]
      7. expm1-def83.7%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\mathsf{expm1}\left(i\right)}}{i} \]
    8. Simplified83.7%

      \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}} \]

    if -2.9500000000000001e-154 < n < 1.15000000000000011e-177

    1. Initial program 71.6%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 78.9%

      \[\leadsto 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -2.95 \cdot 10^{-154} \lor \neg \left(n \leq 1.15 \cdot 10^{-177}\right):\\ \;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \end{array} \]

Alternative 7: 80.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -3.3 \cdot 10^{-154} \lor \neg \left(n \leq 8 \cdot 10^{-176}\right):\\ \;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (or (<= n -3.3e-154) (not (<= n 8e-176)))
   (* 100.0 (* n (/ (expm1 i) i)))
   (* 100.0 (/ 0.0 (/ i n)))))
double code(double i, double n) {
	double tmp;
	if ((n <= -3.3e-154) || !(n <= 8e-176)) {
		tmp = 100.0 * (n * (expm1(i) / i));
	} else {
		tmp = 100.0 * (0.0 / (i / n));
	}
	return tmp;
}
public static double code(double i, double n) {
	double tmp;
	if ((n <= -3.3e-154) || !(n <= 8e-176)) {
		tmp = 100.0 * (n * (Math.expm1(i) / i));
	} else {
		tmp = 100.0 * (0.0 / (i / n));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if (n <= -3.3e-154) or not (n <= 8e-176):
		tmp = 100.0 * (n * (math.expm1(i) / i))
	else:
		tmp = 100.0 * (0.0 / (i / n))
	return tmp
function code(i, n)
	tmp = 0.0
	if ((n <= -3.3e-154) || !(n <= 8e-176))
		tmp = Float64(100.0 * Float64(n * Float64(expm1(i) / i)));
	else
		tmp = Float64(100.0 * Float64(0.0 / Float64(i / n)));
	end
	return tmp
end
code[i_, n_] := If[Or[LessEqual[n, -3.3e-154], N[Not[LessEqual[n, 8e-176]], $MachinePrecision]], N[(100.0 * N[(n * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.3 \cdot 10^{-154} \lor \neg \left(n \leq 8 \cdot 10^{-176}\right):\\
\;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\

\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -3.30000000000000027e-154 or 8e-176 < n

    1. Initial program 24.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 37.0%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative37.0%

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

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def83.8%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified83.8%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in n around 0 37.0%

      \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i}} \cdot 100 \]
    6. Step-by-step derivation
      1. expm1-def79.3%

        \[\leadsto \frac{n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}}{i} \cdot 100 \]
      2. associate-*r/83.8%

        \[\leadsto \color{blue}{\left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \cdot 100 \]
    7. Simplified83.8%

      \[\leadsto \color{blue}{\left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \cdot 100 \]

    if -3.30000000000000027e-154 < n < 8e-176

    1. Initial program 71.6%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 78.9%

      \[\leadsto 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -3.3 \cdot 10^{-154} \lor \neg \left(n \leq 8 \cdot 10^{-176}\right):\\ \;\;\;\;100 \cdot \left(n \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \end{array} \]

Alternative 8: 79.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -3.3 \cdot 10^{-154} \lor \neg \left(n \leq 8 \cdot 10^{-181}\right):\\ \;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (or (<= n -3.3e-154) (not (<= n 8e-181)))
   (* 100.0 (/ n (/ i (expm1 i))))
   (* 100.0 (/ 0.0 (/ i n)))))
double code(double i, double n) {
	double tmp;
	if ((n <= -3.3e-154) || !(n <= 8e-181)) {
		tmp = 100.0 * (n / (i / expm1(i)));
	} else {
		tmp = 100.0 * (0.0 / (i / n));
	}
	return tmp;
}
public static double code(double i, double n) {
	double tmp;
	if ((n <= -3.3e-154) || !(n <= 8e-181)) {
		tmp = 100.0 * (n / (i / Math.expm1(i)));
	} else {
		tmp = 100.0 * (0.0 / (i / n));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if (n <= -3.3e-154) or not (n <= 8e-181):
		tmp = 100.0 * (n / (i / math.expm1(i)))
	else:
		tmp = 100.0 * (0.0 / (i / n))
	return tmp
function code(i, n)
	tmp = 0.0
	if ((n <= -3.3e-154) || !(n <= 8e-181))
		tmp = Float64(100.0 * Float64(n / Float64(i / expm1(i))));
	else
		tmp = Float64(100.0 * Float64(0.0 / Float64(i / n)));
	end
	return tmp
end
code[i_, n_] := If[Or[LessEqual[n, -3.3e-154], N[Not[LessEqual[n, 8e-181]], $MachinePrecision]], N[(100.0 * N[(n / N[(i / N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.3 \cdot 10^{-154} \lor \neg \left(n \leq 8 \cdot 10^{-181}\right):\\
\;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\

\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -3.30000000000000027e-154 or 8.00000000000000038e-181 < n

    1. Initial program 24.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 37.0%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative37.0%

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

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def83.8%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified83.8%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]

    if -3.30000000000000027e-154 < n < 8.00000000000000038e-181

    1. Initial program 71.6%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 78.9%

      \[\leadsto 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -3.3 \cdot 10^{-154} \lor \neg \left(n \leq 8 \cdot 10^{-181}\right):\\ \;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \end{array} \]

Alternative 9: 65.2% accurate, 4.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -2.35 \cdot 10^{+238}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq -2.55 \cdot 10^{-153}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{elif}\;n \leq 1.4 \cdot 10^{-177}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \frac{100 \cdot \left(i + \left(i \cdot i\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}{i}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= n -2.35e+238)
   (* 100.0 (/ (* i n) i))
   (if (<= n -2.55e-153)
     (* 100.0 (/ n (+ 1.0 (* i -0.5))))
     (if (<= n 1.4e-177)
       (* 100.0 (/ 0.0 (/ i n)))
       (* n (/ (* 100.0 (+ i (* (* i i) (- 0.5 (/ 0.5 n))))) i))))))
double code(double i, double n) {
	double tmp;
	if (n <= -2.35e+238) {
		tmp = 100.0 * ((i * n) / i);
	} else if (n <= -2.55e-153) {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	} else if (n <= 1.4e-177) {
		tmp = 100.0 * (0.0 / (i / n));
	} else {
		tmp = n * ((100.0 * (i + ((i * i) * (0.5 - (0.5 / n))))) / i);
	}
	return tmp;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: tmp
    if (n <= (-2.35d+238)) then
        tmp = 100.0d0 * ((i * n) / i)
    else if (n <= (-2.55d-153)) then
        tmp = 100.0d0 * (n / (1.0d0 + (i * (-0.5d0))))
    else if (n <= 1.4d-177) then
        tmp = 100.0d0 * (0.0d0 / (i / n))
    else
        tmp = n * ((100.0d0 * (i + ((i * i) * (0.5d0 - (0.5d0 / n))))) / i)
    end if
    code = tmp
end function
public static double code(double i, double n) {
	double tmp;
	if (n <= -2.35e+238) {
		tmp = 100.0 * ((i * n) / i);
	} else if (n <= -2.55e-153) {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	} else if (n <= 1.4e-177) {
		tmp = 100.0 * (0.0 / (i / n));
	} else {
		tmp = n * ((100.0 * (i + ((i * i) * (0.5 - (0.5 / n))))) / i);
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if n <= -2.35e+238:
		tmp = 100.0 * ((i * n) / i)
	elif n <= -2.55e-153:
		tmp = 100.0 * (n / (1.0 + (i * -0.5)))
	elif n <= 1.4e-177:
		tmp = 100.0 * (0.0 / (i / n))
	else:
		tmp = n * ((100.0 * (i + ((i * i) * (0.5 - (0.5 / n))))) / i)
	return tmp
function code(i, n)
	tmp = 0.0
	if (n <= -2.35e+238)
		tmp = Float64(100.0 * Float64(Float64(i * n) / i));
	elseif (n <= -2.55e-153)
		tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5))));
	elseif (n <= 1.4e-177)
		tmp = Float64(100.0 * Float64(0.0 / Float64(i / n)));
	else
		tmp = Float64(n * Float64(Float64(100.0 * Float64(i + Float64(Float64(i * i) * Float64(0.5 - Float64(0.5 / n))))) / i));
	end
	return tmp
end
function tmp_2 = code(i, n)
	tmp = 0.0;
	if (n <= -2.35e+238)
		tmp = 100.0 * ((i * n) / i);
	elseif (n <= -2.55e-153)
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	elseif (n <= 1.4e-177)
		tmp = 100.0 * (0.0 / (i / n));
	else
		tmp = n * ((100.0 * (i + ((i * i) * (0.5 - (0.5 / n))))) / i);
	end
	tmp_2 = tmp;
end
code[i_, n_] := If[LessEqual[n, -2.35e+238], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -2.55e-153], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.4e-177], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(100.0 * N[(i + N[(N[(i * i), $MachinePrecision] * N[(0.5 - N[(0.5 / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.35 \cdot 10^{+238}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\

\mathbf{elif}\;n \leq -2.55 \cdot 10^{-153}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\

\mathbf{elif}\;n \leq 1.4 \cdot 10^{-177}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\

\mathbf{else}:\\
\;\;\;\;n \cdot \frac{100 \cdot \left(i + \left(i \cdot i\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}{i}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if n < -2.34999999999999987e238

    1. Initial program 13.1%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/13.1%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative13.1%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp13.1%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def13.1%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp13.1%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp13.1%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow13.1%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef82.3%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr82.3%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
    4. Taylor expanded in i around 0 15.7%

      \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
    5. Step-by-step derivation
      1. div-inv13.1%

        \[\leadsto \color{blue}{\left(100 \cdot i\right) \cdot \frac{1}{\frac{i}{n}}} \]
      2. clear-num13.1%

        \[\leadsto \left(100 \cdot i\right) \cdot \color{blue}{\frac{n}{i}} \]
      3. associate-*l*13.1%

        \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    6. Applied egg-rr13.1%

      \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/72.3%

        \[\leadsto 100 \cdot \color{blue}{\frac{i \cdot n}{i}} \]
    8. Applied egg-rr72.3%

      \[\leadsto 100 \cdot \color{blue}{\frac{i \cdot n}{i}} \]

    if -2.34999999999999987e238 < n < -2.54999999999999988e-153

    1. Initial program 23.8%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 28.7%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative28.7%

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

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def81.0%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified81.0%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 63.2%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative63.2%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified63.2%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]

    if -2.54999999999999988e-153 < n < 1.39999999999999993e-177

    1. Initial program 71.6%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 78.9%

      \[\leadsto 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]

    if 1.39999999999999993e-177 < n

    1. Initial program 26.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/27.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*27.0%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative27.0%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/27.0%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg27.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in27.0%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def27.0%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval27.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval27.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified27.0%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Taylor expanded in i around 0 66.6%

      \[\leadsto n \cdot \frac{\color{blue}{100 \cdot i + 100 \cdot \left({i}^{2} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}}{i} \]
    5. Step-by-step derivation
      1. distribute-lft-out66.6%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \left(i + {i}^{2} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}}{i} \]
      2. unpow266.6%

        \[\leadsto n \cdot \frac{100 \cdot \left(i + \color{blue}{\left(i \cdot i\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}{i} \]
      3. associate-*r/66.6%

        \[\leadsto n \cdot \frac{100 \cdot \left(i + \left(i \cdot i\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)}{i} \]
      4. metadata-eval66.6%

        \[\leadsto n \cdot \frac{100 \cdot \left(i + \left(i \cdot i\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right)}{i} \]
    6. Simplified66.6%

      \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \left(i + \left(i \cdot i\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}}{i} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification67.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -2.35 \cdot 10^{+238}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq -2.55 \cdot 10^{-153}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{elif}\;n \leq 1.4 \cdot 10^{-177}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \frac{100 \cdot \left(i + \left(i \cdot i\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)}{i}\\ \end{array} \]

Alternative 10: 65.4% accurate, 5.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -2.2 \cdot 10^{+237}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq -1.22 \cdot 10^{-152}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{elif}\;n \leq 7.6 \cdot 10^{-178}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(\left(i \cdot i\right) \cdot 16.666666666666668 + \left(100 + i \cdot 50\right)\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= n -2.2e+237)
   (* 100.0 (/ (* i n) i))
   (if (<= n -1.22e-152)
     (* 100.0 (/ n (+ 1.0 (* i -0.5))))
     (if (<= n 7.6e-178)
       (* 100.0 (/ 0.0 (/ i n)))
       (* n (+ (* (* i i) 16.666666666666668) (+ 100.0 (* i 50.0))))))))
double code(double i, double n) {
	double tmp;
	if (n <= -2.2e+237) {
		tmp = 100.0 * ((i * n) / i);
	} else if (n <= -1.22e-152) {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	} else if (n <= 7.6e-178) {
		tmp = 100.0 * (0.0 / (i / n));
	} else {
		tmp = n * (((i * i) * 16.666666666666668) + (100.0 + (i * 50.0)));
	}
	return tmp;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: tmp
    if (n <= (-2.2d+237)) then
        tmp = 100.0d0 * ((i * n) / i)
    else if (n <= (-1.22d-152)) then
        tmp = 100.0d0 * (n / (1.0d0 + (i * (-0.5d0))))
    else if (n <= 7.6d-178) then
        tmp = 100.0d0 * (0.0d0 / (i / n))
    else
        tmp = n * (((i * i) * 16.666666666666668d0) + (100.0d0 + (i * 50.0d0)))
    end if
    code = tmp
end function
public static double code(double i, double n) {
	double tmp;
	if (n <= -2.2e+237) {
		tmp = 100.0 * ((i * n) / i);
	} else if (n <= -1.22e-152) {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	} else if (n <= 7.6e-178) {
		tmp = 100.0 * (0.0 / (i / n));
	} else {
		tmp = n * (((i * i) * 16.666666666666668) + (100.0 + (i * 50.0)));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if n <= -2.2e+237:
		tmp = 100.0 * ((i * n) / i)
	elif n <= -1.22e-152:
		tmp = 100.0 * (n / (1.0 + (i * -0.5)))
	elif n <= 7.6e-178:
		tmp = 100.0 * (0.0 / (i / n))
	else:
		tmp = n * (((i * i) * 16.666666666666668) + (100.0 + (i * 50.0)))
	return tmp
function code(i, n)
	tmp = 0.0
	if (n <= -2.2e+237)
		tmp = Float64(100.0 * Float64(Float64(i * n) / i));
	elseif (n <= -1.22e-152)
		tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5))));
	elseif (n <= 7.6e-178)
		tmp = Float64(100.0 * Float64(0.0 / Float64(i / n)));
	else
		tmp = Float64(n * Float64(Float64(Float64(i * i) * 16.666666666666668) + Float64(100.0 + Float64(i * 50.0))));
	end
	return tmp
end
function tmp_2 = code(i, n)
	tmp = 0.0;
	if (n <= -2.2e+237)
		tmp = 100.0 * ((i * n) / i);
	elseif (n <= -1.22e-152)
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	elseif (n <= 7.6e-178)
		tmp = 100.0 * (0.0 / (i / n));
	else
		tmp = n * (((i * i) * 16.666666666666668) + (100.0 + (i * 50.0)));
	end
	tmp_2 = tmp;
end
code[i_, n_] := If[LessEqual[n, -2.2e+237], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -1.22e-152], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 7.6e-178], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(N[(i * i), $MachinePrecision] * 16.666666666666668), $MachinePrecision] + N[(100.0 + N[(i * 50.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.2 \cdot 10^{+237}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\

\mathbf{elif}\;n \leq -1.22 \cdot 10^{-152}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\

\mathbf{elif}\;n \leq 7.6 \cdot 10^{-178}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\

\mathbf{else}:\\
\;\;\;\;n \cdot \left(\left(i \cdot i\right) \cdot 16.666666666666668 + \left(100 + i \cdot 50\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if n < -2.2e237

    1. Initial program 13.1%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/13.1%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative13.1%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp13.1%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def13.1%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp13.1%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp13.1%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow13.1%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef82.3%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr82.3%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
    4. Taylor expanded in i around 0 15.7%

      \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
    5. Step-by-step derivation
      1. div-inv13.1%

        \[\leadsto \color{blue}{\left(100 \cdot i\right) \cdot \frac{1}{\frac{i}{n}}} \]
      2. clear-num13.1%

        \[\leadsto \left(100 \cdot i\right) \cdot \color{blue}{\frac{n}{i}} \]
      3. associate-*l*13.1%

        \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    6. Applied egg-rr13.1%

      \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/72.3%

        \[\leadsto 100 \cdot \color{blue}{\frac{i \cdot n}{i}} \]
    8. Applied egg-rr72.3%

      \[\leadsto 100 \cdot \color{blue}{\frac{i \cdot n}{i}} \]

    if -2.2e237 < n < -1.22000000000000009e-152

    1. Initial program 23.8%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 28.7%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative28.7%

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

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def81.0%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified81.0%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 63.2%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative63.2%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified63.2%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]

    if -1.22000000000000009e-152 < n < 7.60000000000000029e-178

    1. Initial program 71.6%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 78.9%

      \[\leadsto 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]

    if 7.60000000000000029e-178 < n

    1. Initial program 26.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/27.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*27.0%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative27.0%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/27.0%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg27.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in27.0%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def27.0%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval27.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval27.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified27.0%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Taylor expanded in i around 0 63.6%

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative63.6%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}\right) \]
      2. distribute-lft-out63.6%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
    6. Simplified64.5%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 + \frac{-0.5}{n}\right)\right) + i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)} \]
    7. Taylor expanded in n around inf 66.0%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative66.0%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right) + 100\right)} \]
      2. distribute-lft-in66.0%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)} + 100\right) \]
      3. associate-+l+66.0%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right)} \]
      4. associate-*r*66.0%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      5. metadata-eval66.0%

        \[\leadsto n \cdot \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      6. unpow266.0%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      7. associate-*r*66.0%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{\left(100 \cdot 0.5\right) \cdot i} + 100\right)\right) \]
      8. metadata-eval66.0%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{50} \cdot i + 100\right)\right) \]
    9. Simplified66.0%

      \[\leadsto \color{blue}{n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(50 \cdot i + 100\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification67.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -2.2 \cdot 10^{+237}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq -1.22 \cdot 10^{-152}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{elif}\;n \leq 7.6 \cdot 10^{-178}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(\left(i \cdot i\right) \cdot 16.666666666666668 + \left(100 + i \cdot 50\right)\right)\\ \end{array} \]

Alternative 11: 59.3% accurate, 7.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -9.4 \cdot 10^{+47}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq -5.6 \cdot 10^{-293}:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 3.2 \cdot 10^{-227}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left(n + \left(i \cdot n\right) \cdot 0.5\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= n -9.4e+47)
   (* 100.0 (/ (* i n) i))
   (if (<= n -5.6e-293)
     (* 100.0 (/ i (/ i n)))
     (if (<= n 3.2e-227)
       (* 16.666666666666668 (* n (* i i)))
       (* 100.0 (+ n (* (* i n) 0.5)))))))
double code(double i, double n) {
	double tmp;
	if (n <= -9.4e+47) {
		tmp = 100.0 * ((i * n) / i);
	} else if (n <= -5.6e-293) {
		tmp = 100.0 * (i / (i / n));
	} else if (n <= 3.2e-227) {
		tmp = 16.666666666666668 * (n * (i * i));
	} else {
		tmp = 100.0 * (n + ((i * n) * 0.5));
	}
	return tmp;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: tmp
    if (n <= (-9.4d+47)) then
        tmp = 100.0d0 * ((i * n) / i)
    else if (n <= (-5.6d-293)) then
        tmp = 100.0d0 * (i / (i / n))
    else if (n <= 3.2d-227) then
        tmp = 16.666666666666668d0 * (n * (i * i))
    else
        tmp = 100.0d0 * (n + ((i * n) * 0.5d0))
    end if
    code = tmp
end function
public static double code(double i, double n) {
	double tmp;
	if (n <= -9.4e+47) {
		tmp = 100.0 * ((i * n) / i);
	} else if (n <= -5.6e-293) {
		tmp = 100.0 * (i / (i / n));
	} else if (n <= 3.2e-227) {
		tmp = 16.666666666666668 * (n * (i * i));
	} else {
		tmp = 100.0 * (n + ((i * n) * 0.5));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if n <= -9.4e+47:
		tmp = 100.0 * ((i * n) / i)
	elif n <= -5.6e-293:
		tmp = 100.0 * (i / (i / n))
	elif n <= 3.2e-227:
		tmp = 16.666666666666668 * (n * (i * i))
	else:
		tmp = 100.0 * (n + ((i * n) * 0.5))
	return tmp
function code(i, n)
	tmp = 0.0
	if (n <= -9.4e+47)
		tmp = Float64(100.0 * Float64(Float64(i * n) / i));
	elseif (n <= -5.6e-293)
		tmp = Float64(100.0 * Float64(i / Float64(i / n)));
	elseif (n <= 3.2e-227)
		tmp = Float64(16.666666666666668 * Float64(n * Float64(i * i)));
	else
		tmp = Float64(100.0 * Float64(n + Float64(Float64(i * n) * 0.5)));
	end
	return tmp
end
function tmp_2 = code(i, n)
	tmp = 0.0;
	if (n <= -9.4e+47)
		tmp = 100.0 * ((i * n) / i);
	elseif (n <= -5.6e-293)
		tmp = 100.0 * (i / (i / n));
	elseif (n <= 3.2e-227)
		tmp = 16.666666666666668 * (n * (i * i));
	else
		tmp = 100.0 * (n + ((i * n) * 0.5));
	end
	tmp_2 = tmp;
end
code[i_, n_] := If[LessEqual[n, -9.4e+47], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -5.6e-293], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.2e-227], N[(16.666666666666668 * N[(n * N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(n + N[(N[(i * n), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -9.4 \cdot 10^{+47}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\

\mathbf{elif}\;n \leq -5.6 \cdot 10^{-293}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\

\mathbf{elif}\;n \leq 3.2 \cdot 10^{-227}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;100 \cdot \left(n + \left(i \cdot n\right) \cdot 0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if n < -9.39999999999999928e47

    1. Initial program 21.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/21.4%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative21.4%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp16.8%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def16.8%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp16.8%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp21.4%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow16.8%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef79.7%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr79.7%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
    4. Taylor expanded in i around 0 34.1%

      \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
    5. Step-by-step derivation
      1. div-inv31.4%

        \[\leadsto \color{blue}{\left(100 \cdot i\right) \cdot \frac{1}{\frac{i}{n}}} \]
      2. clear-num31.3%

        \[\leadsto \left(100 \cdot i\right) \cdot \color{blue}{\frac{n}{i}} \]
      3. associate-*l*31.4%

        \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    6. Applied egg-rr31.4%

      \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/60.0%

        \[\leadsto 100 \cdot \color{blue}{\frac{i \cdot n}{i}} \]
    8. Applied egg-rr60.0%

      \[\leadsto 100 \cdot \color{blue}{\frac{i \cdot n}{i}} \]

    if -9.39999999999999928e47 < n < -5.60000000000000051e-293

    1. Initial program 37.1%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 56.1%

      \[\leadsto 100 \cdot \frac{\color{blue}{i}}{\frac{i}{n}} \]

    if -5.60000000000000051e-293 < n < 3.2000000000000001e-227

    1. Initial program 81.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/81.5%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*81.5%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative81.5%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/81.5%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg81.5%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in81.5%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def81.5%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval81.5%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval81.5%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified81.5%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Taylor expanded in i around 0 1.1%

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative1.1%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}\right) \]
      2. distribute-lft-out1.1%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
    6. Simplified1.1%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 + \frac{-0.5}{n}\right)\right) + i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)} \]
    7. Taylor expanded in n around inf 7.7%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative7.7%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right) + 100\right)} \]
      2. distribute-lft-in7.7%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)} + 100\right) \]
      3. associate-+l+7.7%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right)} \]
      4. associate-*r*7.7%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      5. metadata-eval7.7%

        \[\leadsto n \cdot \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      6. unpow27.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      7. associate-*r*7.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{\left(100 \cdot 0.5\right) \cdot i} + 100\right)\right) \]
      8. metadata-eval7.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{50} \cdot i + 100\right)\right) \]
    9. Simplified7.7%

      \[\leadsto \color{blue}{n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(50 \cdot i + 100\right)\right)} \]
    10. Taylor expanded in i around inf 70.0%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)} \]
    11. Step-by-step derivation
      1. unpow270.0%

        \[\leadsto 16.666666666666668 \cdot \left(n \cdot \color{blue}{\left(i \cdot i\right)}\right) \]
    12. Simplified70.0%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)} \]

    if 3.2000000000000001e-227 < n

    1. Initial program 28.1%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 61.6%

      \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*61.7%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
      2. *-commutative61.7%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
      3. associate-*r/61.7%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
      4. metadata-eval61.7%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
    4. Simplified61.7%

      \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]
    5. Taylor expanded in n around inf 61.7%

      \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \color{blue}{0.5}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification60.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -9.4 \cdot 10^{+47}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq -5.6 \cdot 10^{-293}:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 3.2 \cdot 10^{-227}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left(n + \left(i \cdot n\right) \cdot 0.5\right)\\ \end{array} \]

Alternative 12: 65.2% accurate, 7.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -1.05 \cdot 10^{+238}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq -1.1 \cdot 10^{-151}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{elif}\;n \leq 2.1 \cdot 10^{-177}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 + \left(i \cdot i\right) \cdot 16.666666666666668\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= n -1.05e+238)
   (* 100.0 (/ (* i n) i))
   (if (<= n -1.1e-151)
     (* 100.0 (/ n (+ 1.0 (* i -0.5))))
     (if (<= n 2.1e-177)
       (* 100.0 (/ 0.0 (/ i n)))
       (* n (+ 100.0 (* (* i i) 16.666666666666668)))))))
double code(double i, double n) {
	double tmp;
	if (n <= -1.05e+238) {
		tmp = 100.0 * ((i * n) / i);
	} else if (n <= -1.1e-151) {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	} else if (n <= 2.1e-177) {
		tmp = 100.0 * (0.0 / (i / n));
	} else {
		tmp = n * (100.0 + ((i * i) * 16.666666666666668));
	}
	return tmp;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: tmp
    if (n <= (-1.05d+238)) then
        tmp = 100.0d0 * ((i * n) / i)
    else if (n <= (-1.1d-151)) then
        tmp = 100.0d0 * (n / (1.0d0 + (i * (-0.5d0))))
    else if (n <= 2.1d-177) then
        tmp = 100.0d0 * (0.0d0 / (i / n))
    else
        tmp = n * (100.0d0 + ((i * i) * 16.666666666666668d0))
    end if
    code = tmp
end function
public static double code(double i, double n) {
	double tmp;
	if (n <= -1.05e+238) {
		tmp = 100.0 * ((i * n) / i);
	} else if (n <= -1.1e-151) {
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	} else if (n <= 2.1e-177) {
		tmp = 100.0 * (0.0 / (i / n));
	} else {
		tmp = n * (100.0 + ((i * i) * 16.666666666666668));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if n <= -1.05e+238:
		tmp = 100.0 * ((i * n) / i)
	elif n <= -1.1e-151:
		tmp = 100.0 * (n / (1.0 + (i * -0.5)))
	elif n <= 2.1e-177:
		tmp = 100.0 * (0.0 / (i / n))
	else:
		tmp = n * (100.0 + ((i * i) * 16.666666666666668))
	return tmp
function code(i, n)
	tmp = 0.0
	if (n <= -1.05e+238)
		tmp = Float64(100.0 * Float64(Float64(i * n) / i));
	elseif (n <= -1.1e-151)
		tmp = Float64(100.0 * Float64(n / Float64(1.0 + Float64(i * -0.5))));
	elseif (n <= 2.1e-177)
		tmp = Float64(100.0 * Float64(0.0 / Float64(i / n)));
	else
		tmp = Float64(n * Float64(100.0 + Float64(Float64(i * i) * 16.666666666666668)));
	end
	return tmp
end
function tmp_2 = code(i, n)
	tmp = 0.0;
	if (n <= -1.05e+238)
		tmp = 100.0 * ((i * n) / i);
	elseif (n <= -1.1e-151)
		tmp = 100.0 * (n / (1.0 + (i * -0.5)));
	elseif (n <= 2.1e-177)
		tmp = 100.0 * (0.0 / (i / n));
	else
		tmp = n * (100.0 + ((i * i) * 16.666666666666668));
	end
	tmp_2 = tmp;
end
code[i_, n_] := If[LessEqual[n, -1.05e+238], N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -1.1e-151], N[(100.0 * N[(n / N[(1.0 + N[(i * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.1e-177], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(100.0 + N[(N[(i * i), $MachinePrecision] * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.05 \cdot 10^{+238}:\\
\;\;\;\;100 \cdot \frac{i \cdot n}{i}\\

\mathbf{elif}\;n \leq -1.1 \cdot 10^{-151}:\\
\;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\

\mathbf{elif}\;n \leq 2.1 \cdot 10^{-177}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\

\mathbf{else}:\\
\;\;\;\;n \cdot \left(100 + \left(i \cdot i\right) \cdot 16.666666666666668\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if n < -1.05000000000000004e238

    1. Initial program 13.1%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/13.1%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative13.1%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp13.1%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def13.1%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp13.1%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp13.1%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow13.1%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef82.3%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr82.3%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
    4. Taylor expanded in i around 0 15.7%

      \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
    5. Step-by-step derivation
      1. div-inv13.1%

        \[\leadsto \color{blue}{\left(100 \cdot i\right) \cdot \frac{1}{\frac{i}{n}}} \]
      2. clear-num13.1%

        \[\leadsto \left(100 \cdot i\right) \cdot \color{blue}{\frac{n}{i}} \]
      3. associate-*l*13.1%

        \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    6. Applied egg-rr13.1%

      \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/72.3%

        \[\leadsto 100 \cdot \color{blue}{\frac{i \cdot n}{i}} \]
    8. Applied egg-rr72.3%

      \[\leadsto 100 \cdot \color{blue}{\frac{i \cdot n}{i}} \]

    if -1.05000000000000004e238 < n < -1.1e-151

    1. Initial program 23.8%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 28.7%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative28.7%

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

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def81.0%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified81.0%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 63.2%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative63.2%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified63.2%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]

    if -1.1e-151 < n < 2.10000000000000001e-177

    1. Initial program 71.6%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 78.9%

      \[\leadsto 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]

    if 2.10000000000000001e-177 < n

    1. Initial program 26.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/27.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*27.0%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative27.0%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/27.0%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg27.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in27.0%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def27.0%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval27.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval27.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified27.0%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Taylor expanded in i around 0 63.6%

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative63.6%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}\right) \]
      2. distribute-lft-out63.6%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
    6. Simplified64.5%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 + \frac{-0.5}{n}\right)\right) + i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)} \]
    7. Taylor expanded in n around inf 66.0%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative66.0%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right) + 100\right)} \]
      2. distribute-lft-in66.0%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)} + 100\right) \]
      3. associate-+l+66.0%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right)} \]
      4. associate-*r*66.0%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      5. metadata-eval66.0%

        \[\leadsto n \cdot \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      6. unpow266.0%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      7. associate-*r*66.0%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{\left(100 \cdot 0.5\right) \cdot i} + 100\right)\right) \]
      8. metadata-eval66.0%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{50} \cdot i + 100\right)\right) \]
    9. Simplified66.0%

      \[\leadsto \color{blue}{n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(50 \cdot i + 100\right)\right)} \]
    10. Taylor expanded in i around 0 65.8%

      \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{100}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification67.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.05 \cdot 10^{+238}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq -1.1 \cdot 10^{-151}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{elif}\;n \leq 2.1 \cdot 10^{-177}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 + \left(i \cdot i\right) \cdot 16.666666666666668\right)\\ \end{array} \]

Alternative 13: 62.0% accurate, 8.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -8 \cdot 10^{-153} \lor \neg \left(n \leq 8.8 \cdot 10^{-181}\right):\\ \;\;\;\;100 \cdot \left(n + \left(i \cdot n\right) \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (or (<= n -8e-153) (not (<= n 8.8e-181)))
   (* 100.0 (+ n (* (* i n) 0.5)))
   (* 100.0 (/ 0.0 (/ i n)))))
double code(double i, double n) {
	double tmp;
	if ((n <= -8e-153) || !(n <= 8.8e-181)) {
		tmp = 100.0 * (n + ((i * n) * 0.5));
	} else {
		tmp = 100.0 * (0.0 / (i / n));
	}
	return tmp;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: tmp
    if ((n <= (-8d-153)) .or. (.not. (n <= 8.8d-181))) then
        tmp = 100.0d0 * (n + ((i * n) * 0.5d0))
    else
        tmp = 100.0d0 * (0.0d0 / (i / n))
    end if
    code = tmp
end function
public static double code(double i, double n) {
	double tmp;
	if ((n <= -8e-153) || !(n <= 8.8e-181)) {
		tmp = 100.0 * (n + ((i * n) * 0.5));
	} else {
		tmp = 100.0 * (0.0 / (i / n));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if (n <= -8e-153) or not (n <= 8.8e-181):
		tmp = 100.0 * (n + ((i * n) * 0.5))
	else:
		tmp = 100.0 * (0.0 / (i / n))
	return tmp
function code(i, n)
	tmp = 0.0
	if ((n <= -8e-153) || !(n <= 8.8e-181))
		tmp = Float64(100.0 * Float64(n + Float64(Float64(i * n) * 0.5)));
	else
		tmp = Float64(100.0 * Float64(0.0 / Float64(i / n)));
	end
	return tmp
end
function tmp_2 = code(i, n)
	tmp = 0.0;
	if ((n <= -8e-153) || ~((n <= 8.8e-181)))
		tmp = 100.0 * (n + ((i * n) * 0.5));
	else
		tmp = 100.0 * (0.0 / (i / n));
	end
	tmp_2 = tmp;
end
code[i_, n_] := If[Or[LessEqual[n, -8e-153], N[Not[LessEqual[n, 8.8e-181]], $MachinePrecision]], N[(100.0 * N[(n + N[(N[(i * n), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -8 \cdot 10^{-153} \lor \neg \left(n \leq 8.8 \cdot 10^{-181}\right):\\
\;\;\;\;100 \cdot \left(n + \left(i \cdot n\right) \cdot 0.5\right)\\

\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -8.00000000000000031e-153 or 8.79999999999999988e-181 < n

    1. Initial program 24.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 61.5%

      \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*61.5%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
      2. *-commutative61.5%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
      3. associate-*r/61.5%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
      4. metadata-eval61.5%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
    4. Simplified61.5%

      \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]
    5. Taylor expanded in n around inf 61.4%

      \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \color{blue}{0.5}\right) \]

    if -8.00000000000000031e-153 < n < 8.79999999999999988e-181

    1. Initial program 71.6%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 78.9%

      \[\leadsto 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -8 \cdot 10^{-153} \lor \neg \left(n \leq 8.8 \cdot 10^{-181}\right):\\ \;\;\;\;100 \cdot \left(n + \left(i \cdot n\right) \cdot 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \end{array} \]

Alternative 14: 63.6% accurate, 8.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -9.5 \cdot 10^{-154} \lor \neg \left(n \leq 4 \cdot 10^{-177}\right):\\ \;\;\;\;n \cdot \left(100 + \left(i \cdot i\right) \cdot 16.666666666666668\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (or (<= n -9.5e-154) (not (<= n 4e-177)))
   (* n (+ 100.0 (* (* i i) 16.666666666666668)))
   (* 100.0 (/ 0.0 (/ i n)))))
double code(double i, double n) {
	double tmp;
	if ((n <= -9.5e-154) || !(n <= 4e-177)) {
		tmp = n * (100.0 + ((i * i) * 16.666666666666668));
	} else {
		tmp = 100.0 * (0.0 / (i / n));
	}
	return tmp;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: tmp
    if ((n <= (-9.5d-154)) .or. (.not. (n <= 4d-177))) then
        tmp = n * (100.0d0 + ((i * i) * 16.666666666666668d0))
    else
        tmp = 100.0d0 * (0.0d0 / (i / n))
    end if
    code = tmp
end function
public static double code(double i, double n) {
	double tmp;
	if ((n <= -9.5e-154) || !(n <= 4e-177)) {
		tmp = n * (100.0 + ((i * i) * 16.666666666666668));
	} else {
		tmp = 100.0 * (0.0 / (i / n));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if (n <= -9.5e-154) or not (n <= 4e-177):
		tmp = n * (100.0 + ((i * i) * 16.666666666666668))
	else:
		tmp = 100.0 * (0.0 / (i / n))
	return tmp
function code(i, n)
	tmp = 0.0
	if ((n <= -9.5e-154) || !(n <= 4e-177))
		tmp = Float64(n * Float64(100.0 + Float64(Float64(i * i) * 16.666666666666668)));
	else
		tmp = Float64(100.0 * Float64(0.0 / Float64(i / n)));
	end
	return tmp
end
function tmp_2 = code(i, n)
	tmp = 0.0;
	if ((n <= -9.5e-154) || ~((n <= 4e-177)))
		tmp = n * (100.0 + ((i * i) * 16.666666666666668));
	else
		tmp = 100.0 * (0.0 / (i / n));
	end
	tmp_2 = tmp;
end
code[i_, n_] := If[Or[LessEqual[n, -9.5e-154], N[Not[LessEqual[n, 4e-177]], $MachinePrecision]], N[(n * N[(100.0 + N[(N[(i * i), $MachinePrecision] * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(0.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq -9.5 \cdot 10^{-154} \lor \neg \left(n \leq 4 \cdot 10^{-177}\right):\\
\;\;\;\;n \cdot \left(100 + \left(i \cdot i\right) \cdot 16.666666666666668\right)\\

\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -9.50000000000000057e-154 or 3.99999999999999981e-177 < n

    1. Initial program 24.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/24.6%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*24.5%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative24.5%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/24.6%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg24.6%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in24.6%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def24.6%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval24.6%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval24.6%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified24.6%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Taylor expanded in i around 0 62.1%

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative62.1%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}\right) \]
      2. distribute-lft-out62.1%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
    6. Simplified62.6%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 + \frac{-0.5}{n}\right)\right) + i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)} \]
    7. Taylor expanded in n around inf 63.3%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative63.3%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right) + 100\right)} \]
      2. distribute-lft-in63.3%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)} + 100\right) \]
      3. associate-+l+63.3%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right)} \]
      4. associate-*r*63.3%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      5. metadata-eval63.3%

        \[\leadsto n \cdot \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      6. unpow263.3%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      7. associate-*r*63.3%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{\left(100 \cdot 0.5\right) \cdot i} + 100\right)\right) \]
      8. metadata-eval63.3%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{50} \cdot i + 100\right)\right) \]
    9. Simplified63.3%

      \[\leadsto \color{blue}{n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(50 \cdot i + 100\right)\right)} \]
    10. Taylor expanded in i around 0 62.8%

      \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{100}\right) \]

    if -9.50000000000000057e-154 < n < 3.99999999999999981e-177

    1. Initial program 71.6%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 78.9%

      \[\leadsto 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -9.5 \cdot 10^{-154} \lor \neg \left(n \leq 4 \cdot 10^{-177}\right):\\ \;\;\;\;n \cdot \left(100 + \left(i \cdot i\right) \cdot 16.666666666666668\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{0}{\frac{i}{n}}\\ \end{array} \]

Alternative 15: 57.0% accurate, 10.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -5 \cdot 10^{+159}:\\ \;\;\;\;100 \cdot \left(i \cdot \frac{n}{i}\right)\\ \mathbf{elif}\;i \leq 1.1 \cdot 10^{-56}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i -5e+159)
   (* 100.0 (* i (/ n i)))
   (if (<= i 1.1e-56) (* n 100.0) (* 16.666666666666668 (* n (* i i))))))
double code(double i, double n) {
	double tmp;
	if (i <= -5e+159) {
		tmp = 100.0 * (i * (n / i));
	} else if (i <= 1.1e-56) {
		tmp = n * 100.0;
	} else {
		tmp = 16.666666666666668 * (n * (i * i));
	}
	return tmp;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: tmp
    if (i <= (-5d+159)) then
        tmp = 100.0d0 * (i * (n / i))
    else if (i <= 1.1d-56) then
        tmp = n * 100.0d0
    else
        tmp = 16.666666666666668d0 * (n * (i * i))
    end if
    code = tmp
end function
public static double code(double i, double n) {
	double tmp;
	if (i <= -5e+159) {
		tmp = 100.0 * (i * (n / i));
	} else if (i <= 1.1e-56) {
		tmp = n * 100.0;
	} else {
		tmp = 16.666666666666668 * (n * (i * i));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if i <= -5e+159:
		tmp = 100.0 * (i * (n / i))
	elif i <= 1.1e-56:
		tmp = n * 100.0
	else:
		tmp = 16.666666666666668 * (n * (i * i))
	return tmp
function code(i, n)
	tmp = 0.0
	if (i <= -5e+159)
		tmp = Float64(100.0 * Float64(i * Float64(n / i)));
	elseif (i <= 1.1e-56)
		tmp = Float64(n * 100.0);
	else
		tmp = Float64(16.666666666666668 * Float64(n * Float64(i * i)));
	end
	return tmp
end
function tmp_2 = code(i, n)
	tmp = 0.0;
	if (i <= -5e+159)
		tmp = 100.0 * (i * (n / i));
	elseif (i <= 1.1e-56)
		tmp = n * 100.0;
	else
		tmp = 16.666666666666668 * (n * (i * i));
	end
	tmp_2 = tmp;
end
code[i_, n_] := If[LessEqual[i, -5e+159], N[(100.0 * N[(i * N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.1e-56], N[(n * 100.0), $MachinePrecision], N[(16.666666666666668 * N[(n * N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -5 \cdot 10^{+159}:\\
\;\;\;\;100 \cdot \left(i \cdot \frac{n}{i}\right)\\

\mathbf{elif}\;i \leq 1.1 \cdot 10^{-56}:\\
\;\;\;\;n \cdot 100\\

\mathbf{else}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -5.00000000000000003e159

    1. Initial program 68.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/68.9%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative68.9%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp60.9%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def64.6%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp60.9%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp68.9%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow64.6%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef91.8%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr91.8%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
    4. Taylor expanded in i around 0 34.4%

      \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
    5. Step-by-step derivation
      1. div-inv34.4%

        \[\leadsto \color{blue}{\left(100 \cdot i\right) \cdot \frac{1}{\frac{i}{n}}} \]
      2. clear-num30.5%

        \[\leadsto \left(100 \cdot i\right) \cdot \color{blue}{\frac{n}{i}} \]
      3. associate-*l*30.5%

        \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]
    6. Applied egg-rr30.5%

      \[\leadsto \color{blue}{100 \cdot \left(i \cdot \frac{n}{i}\right)} \]

    if -5.00000000000000003e159 < i < 1.10000000000000002e-56

    1. Initial program 17.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 65.1%

      \[\leadsto \color{blue}{100 \cdot n} \]
    3. Step-by-step derivation
      1. *-commutative65.1%

        \[\leadsto \color{blue}{n \cdot 100} \]
    4. Simplified65.1%

      \[\leadsto \color{blue}{n \cdot 100} \]

    if 1.10000000000000002e-56 < i

    1. Initial program 53.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/54.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*54.0%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative54.0%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/54.0%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg54.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in54.1%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def54.0%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval54.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval54.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified54.0%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Taylor expanded in i around 0 47.7%

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative47.7%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}\right) \]
      2. distribute-lft-out47.7%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
    6. Simplified47.7%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 + \frac{-0.5}{n}\right)\right) + i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)} \]
    7. Taylor expanded in n around inf 48.7%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative48.7%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right) + 100\right)} \]
      2. distribute-lft-in48.7%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)} + 100\right) \]
      3. associate-+l+48.7%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right)} \]
      4. associate-*r*48.7%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      5. metadata-eval48.7%

        \[\leadsto n \cdot \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      6. unpow248.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      7. associate-*r*48.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{\left(100 \cdot 0.5\right) \cdot i} + 100\right)\right) \]
      8. metadata-eval48.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{50} \cdot i + 100\right)\right) \]
    9. Simplified48.7%

      \[\leadsto \color{blue}{n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(50 \cdot i + 100\right)\right)} \]
    10. Taylor expanded in i around inf 50.0%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)} \]
    11. Step-by-step derivation
      1. unpow250.0%

        \[\leadsto 16.666666666666668 \cdot \left(n \cdot \color{blue}{\left(i \cdot i\right)}\right) \]
    12. Simplified50.0%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -5 \cdot 10^{+159}:\\ \;\;\;\;100 \cdot \left(i \cdot \frac{n}{i}\right)\\ \mathbf{elif}\;i \leq 1.1 \cdot 10^{-56}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \]

Alternative 16: 57.3% accurate, 10.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -1.1 \cdot 10^{+158}:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 1.1 \cdot 10^{-56}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i -1.1e+158)
   (* 100.0 (/ i (/ i n)))
   (if (<= i 1.1e-56) (* n 100.0) (* 16.666666666666668 (* n (* i i))))))
double code(double i, double n) {
	double tmp;
	if (i <= -1.1e+158) {
		tmp = 100.0 * (i / (i / n));
	} else if (i <= 1.1e-56) {
		tmp = n * 100.0;
	} else {
		tmp = 16.666666666666668 * (n * (i * i));
	}
	return tmp;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: tmp
    if (i <= (-1.1d+158)) then
        tmp = 100.0d0 * (i / (i / n))
    else if (i <= 1.1d-56) then
        tmp = n * 100.0d0
    else
        tmp = 16.666666666666668d0 * (n * (i * i))
    end if
    code = tmp
end function
public static double code(double i, double n) {
	double tmp;
	if (i <= -1.1e+158) {
		tmp = 100.0 * (i / (i / n));
	} else if (i <= 1.1e-56) {
		tmp = n * 100.0;
	} else {
		tmp = 16.666666666666668 * (n * (i * i));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if i <= -1.1e+158:
		tmp = 100.0 * (i / (i / n))
	elif i <= 1.1e-56:
		tmp = n * 100.0
	else:
		tmp = 16.666666666666668 * (n * (i * i))
	return tmp
function code(i, n)
	tmp = 0.0
	if (i <= -1.1e+158)
		tmp = Float64(100.0 * Float64(i / Float64(i / n)));
	elseif (i <= 1.1e-56)
		tmp = Float64(n * 100.0);
	else
		tmp = Float64(16.666666666666668 * Float64(n * Float64(i * i)));
	end
	return tmp
end
function tmp_2 = code(i, n)
	tmp = 0.0;
	if (i <= -1.1e+158)
		tmp = 100.0 * (i / (i / n));
	elseif (i <= 1.1e-56)
		tmp = n * 100.0;
	else
		tmp = 16.666666666666668 * (n * (i * i));
	end
	tmp_2 = tmp;
end
code[i_, n_] := If[LessEqual[i, -1.1e+158], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.1e-56], N[(n * 100.0), $MachinePrecision], N[(16.666666666666668 * N[(n * N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.1 \cdot 10^{+158}:\\
\;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\

\mathbf{elif}\;i \leq 1.1 \cdot 10^{-56}:\\
\;\;\;\;n \cdot 100\\

\mathbf{else}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -1.1000000000000001e158

    1. Initial program 68.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 34.4%

      \[\leadsto 100 \cdot \frac{\color{blue}{i}}{\frac{i}{n}} \]

    if -1.1000000000000001e158 < i < 1.10000000000000002e-56

    1. Initial program 17.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 65.1%

      \[\leadsto \color{blue}{100 \cdot n} \]
    3. Step-by-step derivation
      1. *-commutative65.1%

        \[\leadsto \color{blue}{n \cdot 100} \]
    4. Simplified65.1%

      \[\leadsto \color{blue}{n \cdot 100} \]

    if 1.10000000000000002e-56 < i

    1. Initial program 53.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/54.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*54.0%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative54.0%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/54.0%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg54.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in54.1%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def54.0%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval54.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval54.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified54.0%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Taylor expanded in i around 0 47.7%

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative47.7%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}\right) \]
      2. distribute-lft-out47.7%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
    6. Simplified47.7%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 + \frac{-0.5}{n}\right)\right) + i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)} \]
    7. Taylor expanded in n around inf 48.7%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative48.7%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right) + 100\right)} \]
      2. distribute-lft-in48.7%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)} + 100\right) \]
      3. associate-+l+48.7%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right)} \]
      4. associate-*r*48.7%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      5. metadata-eval48.7%

        \[\leadsto n \cdot \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      6. unpow248.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      7. associate-*r*48.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{\left(100 \cdot 0.5\right) \cdot i} + 100\right)\right) \]
      8. metadata-eval48.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{50} \cdot i + 100\right)\right) \]
    9. Simplified48.7%

      \[\leadsto \color{blue}{n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(50 \cdot i + 100\right)\right)} \]
    10. Taylor expanded in i around inf 50.0%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)} \]
    11. Step-by-step derivation
      1. unpow250.0%

        \[\leadsto 16.666666666666668 \cdot \left(n \cdot \color{blue}{\left(i \cdot i\right)}\right) \]
    12. Simplified50.0%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification58.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.1 \cdot 10^{+158}:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 1.1 \cdot 10^{-56}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \]

Alternative 17: 58.1% accurate, 10.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -2.45 \cdot 10^{-11}:\\ \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 1.1 \cdot 10^{-56}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i -2.45e-11)
   (/ (* i 100.0) (/ i n))
   (if (<= i 1.1e-56) (* n 100.0) (* 16.666666666666668 (* n (* i i))))))
double code(double i, double n) {
	double tmp;
	if (i <= -2.45e-11) {
		tmp = (i * 100.0) / (i / n);
	} else if (i <= 1.1e-56) {
		tmp = n * 100.0;
	} else {
		tmp = 16.666666666666668 * (n * (i * i));
	}
	return tmp;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: tmp
    if (i <= (-2.45d-11)) then
        tmp = (i * 100.0d0) / (i / n)
    else if (i <= 1.1d-56) then
        tmp = n * 100.0d0
    else
        tmp = 16.666666666666668d0 * (n * (i * i))
    end if
    code = tmp
end function
public static double code(double i, double n) {
	double tmp;
	if (i <= -2.45e-11) {
		tmp = (i * 100.0) / (i / n);
	} else if (i <= 1.1e-56) {
		tmp = n * 100.0;
	} else {
		tmp = 16.666666666666668 * (n * (i * i));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if i <= -2.45e-11:
		tmp = (i * 100.0) / (i / n)
	elif i <= 1.1e-56:
		tmp = n * 100.0
	else:
		tmp = 16.666666666666668 * (n * (i * i))
	return tmp
function code(i, n)
	tmp = 0.0
	if (i <= -2.45e-11)
		tmp = Float64(Float64(i * 100.0) / Float64(i / n));
	elseif (i <= 1.1e-56)
		tmp = Float64(n * 100.0);
	else
		tmp = Float64(16.666666666666668 * Float64(n * Float64(i * i)));
	end
	return tmp
end
function tmp_2 = code(i, n)
	tmp = 0.0;
	if (i <= -2.45e-11)
		tmp = (i * 100.0) / (i / n);
	elseif (i <= 1.1e-56)
		tmp = n * 100.0;
	else
		tmp = 16.666666666666668 * (n * (i * i));
	end
	tmp_2 = tmp;
end
code[i_, n_] := If[LessEqual[i, -2.45e-11], N[(N[(i * 100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.1e-56], N[(n * 100.0), $MachinePrecision], N[(16.666666666666668 * N[(n * N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.45 \cdot 10^{-11}:\\
\;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\

\mathbf{elif}\;i \leq 1.1 \cdot 10^{-56}:\\
\;\;\;\;n \cdot 100\\

\mathbf{else}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -2.4499999999999999e-11

    1. Initial program 50.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/50.4%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. *-commutative50.4%

        \[\leadsto \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 100}}{\frac{i}{n}} \]
      3. pow-to-exp41.4%

        \[\leadsto \frac{\left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right) \cdot 100}{\frac{i}{n}} \]
      4. expm1-def51.6%

        \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)} \cdot 100}{\frac{i}{n}} \]
      5. add-log-exp41.4%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{\log \left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      6. pow-to-exp50.4%

        \[\leadsto \frac{\mathsf{expm1}\left(\log \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      7. log-pow51.6%

        \[\leadsto \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
      8. log1p-udef90.8%

        \[\leadsto \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right) \cdot 100}{\frac{i}{n}} \]
    3. Applied egg-rr90.8%

      \[\leadsto \color{blue}{\frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right) \cdot 100}{\frac{i}{n}}} \]
    4. Taylor expanded in i around 0 18.8%

      \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]

    if -2.4499999999999999e-11 < i < 1.10000000000000002e-56

    1. Initial program 9.8%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 84.2%

      \[\leadsto \color{blue}{100 \cdot n} \]
    3. Step-by-step derivation
      1. *-commutative84.2%

        \[\leadsto \color{blue}{n \cdot 100} \]
    4. Simplified84.2%

      \[\leadsto \color{blue}{n \cdot 100} \]

    if 1.10000000000000002e-56 < i

    1. Initial program 53.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/54.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*54.0%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative54.0%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/54.0%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg54.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in54.1%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def54.0%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval54.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval54.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified54.0%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Taylor expanded in i around 0 47.7%

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative47.7%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}\right) \]
      2. distribute-lft-out47.7%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
    6. Simplified47.7%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 + \frac{-0.5}{n}\right)\right) + i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)} \]
    7. Taylor expanded in n around inf 48.7%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative48.7%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right) + 100\right)} \]
      2. distribute-lft-in48.7%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)} + 100\right) \]
      3. associate-+l+48.7%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right)} \]
      4. associate-*r*48.7%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      5. metadata-eval48.7%

        \[\leadsto n \cdot \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      6. unpow248.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      7. associate-*r*48.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{\left(100 \cdot 0.5\right) \cdot i} + 100\right)\right) \]
      8. metadata-eval48.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{50} \cdot i + 100\right)\right) \]
    9. Simplified48.7%

      \[\leadsto \color{blue}{n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(50 \cdot i + 100\right)\right)} \]
    10. Taylor expanded in i around inf 50.0%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)} \]
    11. Step-by-step derivation
      1. unpow250.0%

        \[\leadsto 16.666666666666668 \cdot \left(n \cdot \color{blue}{\left(i \cdot i\right)}\right) \]
    12. Simplified50.0%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification58.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -2.45 \cdot 10^{-11}:\\ \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 1.1 \cdot 10^{-56}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \]

Alternative 18: 54.5% accurate, 12.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq 1.1 \cdot 10^{-56}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i 1.1e-56) (* n 100.0) (* 16.666666666666668 (* n (* i i)))))
double code(double i, double n) {
	double tmp;
	if (i <= 1.1e-56) {
		tmp = n * 100.0;
	} else {
		tmp = 16.666666666666668 * (n * (i * i));
	}
	return tmp;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: tmp
    if (i <= 1.1d-56) then
        tmp = n * 100.0d0
    else
        tmp = 16.666666666666668d0 * (n * (i * i))
    end if
    code = tmp
end function
public static double code(double i, double n) {
	double tmp;
	if (i <= 1.1e-56) {
		tmp = n * 100.0;
	} else {
		tmp = 16.666666666666668 * (n * (i * i));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if i <= 1.1e-56:
		tmp = n * 100.0
	else:
		tmp = 16.666666666666668 * (n * (i * i))
	return tmp
function code(i, n)
	tmp = 0.0
	if (i <= 1.1e-56)
		tmp = Float64(n * 100.0);
	else
		tmp = Float64(16.666666666666668 * Float64(n * Float64(i * i)));
	end
	return tmp
end
function tmp_2 = code(i, n)
	tmp = 0.0;
	if (i <= 1.1e-56)
		tmp = n * 100.0;
	else
		tmp = 16.666666666666668 * (n * (i * i));
	end
	tmp_2 = tmp;
end
code[i_, n_] := If[LessEqual[i, 1.1e-56], N[(n * 100.0), $MachinePrecision], N[(16.666666666666668 * N[(n * N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.1 \cdot 10^{-56}:\\
\;\;\;\;n \cdot 100\\

\mathbf{else}:\\
\;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < 1.10000000000000002e-56

    1. Initial program 24.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 57.0%

      \[\leadsto \color{blue}{100 \cdot n} \]
    3. Step-by-step derivation
      1. *-commutative57.0%

        \[\leadsto \color{blue}{n \cdot 100} \]
    4. Simplified57.0%

      \[\leadsto \color{blue}{n \cdot 100} \]

    if 1.10000000000000002e-56 < i

    1. Initial program 53.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/54.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*54.0%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative54.0%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/54.0%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg54.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in54.1%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def54.0%

        \[\leadsto n \cdot \frac{\color{blue}{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \left(-1\right)\right)}}{i} \]
      8. metadata-eval54.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, 100 \cdot \color{blue}{-1}\right)}{i} \]
      9. metadata-eval54.0%

        \[\leadsto n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, \color{blue}{-100}\right)}{i} \]
    3. Simplified54.0%

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Taylor expanded in i around 0 47.7%

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. +-commutative47.7%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)}\right) \]
      2. distribute-lft-out47.7%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
    6. Simplified47.7%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 + \frac{-0.5}{n}\right)\right) + i \cdot \left(0.5 - \frac{0.5}{n}\right)\right)\right)} \]
    7. Taylor expanded in n around inf 48.7%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. +-commutative48.7%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right) + 100\right)} \]
      2. distribute-lft-in48.7%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)} + 100\right) \]
      3. associate-+l+48.7%

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right)} \]
      4. associate-*r*48.7%

        \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      5. metadata-eval48.7%

        \[\leadsto n \cdot \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      6. unpow248.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + \left(100 \cdot \left(0.5 \cdot i\right) + 100\right)\right) \]
      7. associate-*r*48.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{\left(100 \cdot 0.5\right) \cdot i} + 100\right)\right) \]
      8. metadata-eval48.7%

        \[\leadsto n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(\color{blue}{50} \cdot i + 100\right)\right) \]
    9. Simplified48.7%

      \[\leadsto \color{blue}{n \cdot \left(16.666666666666668 \cdot \left(i \cdot i\right) + \left(50 \cdot i + 100\right)\right)} \]
    10. Taylor expanded in i around inf 50.0%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)} \]
    11. Step-by-step derivation
      1. unpow250.0%

        \[\leadsto 16.666666666666668 \cdot \left(n \cdot \color{blue}{\left(i \cdot i\right)}\right) \]
    12. Simplified50.0%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 1.1 \cdot 10^{-56}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \]

Alternative 19: 2.8% accurate, 38.0× speedup?

\[\begin{array}{l} \\ i \cdot -50 \end{array} \]
(FPCore (i n) :precision binary64 (* i -50.0))
double code(double i, double n) {
	return i * -50.0;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    code = i * (-50.0d0)
end function
public static double code(double i, double n) {
	return i * -50.0;
}
def code(i, n):
	return i * -50.0
function code(i, n)
	return Float64(i * -50.0)
end
function tmp = code(i, n)
	tmp = i * -50.0;
end
code[i_, n_] := N[(i * -50.0), $MachinePrecision]
\begin{array}{l}

\\
i \cdot -50
\end{array}
Derivation
  1. Initial program 31.9%

    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
  2. Taylor expanded in i around 0 52.9%

    \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
  3. Step-by-step derivation
    1. associate-*r*53.2%

      \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
    2. *-commutative53.2%

      \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
    3. associate-*r/53.2%

      \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
    4. metadata-eval53.2%

      \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
  4. Simplified53.2%

    \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]
  5. Taylor expanded in n around 0 2.7%

    \[\leadsto \color{blue}{-50 \cdot i} \]
  6. Step-by-step derivation
    1. *-commutative2.7%

      \[\leadsto \color{blue}{i \cdot -50} \]
  7. Simplified2.7%

    \[\leadsto \color{blue}{i \cdot -50} \]
  8. Final simplification2.7%

    \[\leadsto i \cdot -50 \]

Alternative 20: 49.6% accurate, 38.0× speedup?

\[\begin{array}{l} \\ n \cdot 100 \end{array} \]
(FPCore (i n) :precision binary64 (* n 100.0))
double code(double i, double n) {
	return n * 100.0;
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    code = n * 100.0d0
end function
public static double code(double i, double n) {
	return n * 100.0;
}
def code(i, n):
	return n * 100.0
function code(i, n)
	return Float64(n * 100.0)
end
function tmp = code(i, n)
	tmp = n * 100.0;
end
code[i_, n_] := N[(n * 100.0), $MachinePrecision]
\begin{array}{l}

\\
n \cdot 100
\end{array}
Derivation
  1. Initial program 31.9%

    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
  2. Taylor expanded in i around 0 45.0%

    \[\leadsto \color{blue}{100 \cdot n} \]
  3. Step-by-step derivation
    1. *-commutative45.0%

      \[\leadsto \color{blue}{n \cdot 100} \]
  4. Simplified45.0%

    \[\leadsto \color{blue}{n \cdot 100} \]
  5. Final simplification45.0%

    \[\leadsto n \cdot 100 \]

Developer target: 33.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + \frac{i}{n}\\ 100 \cdot \frac{e^{n \cdot \begin{array}{l} \mathbf{if}\;t_0 = 1:\\ \;\;\;\;\frac{i}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{i}{n} \cdot \log t_0}{\left(\frac{i}{n} + 1\right) - 1}\\ \end{array}} - 1}{\frac{i}{n}} \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (let* ((t_0 (+ 1.0 (/ i n))))
   (*
    100.0
    (/
     (-
      (exp
       (*
        n
        (if (== t_0 1.0)
          (/ i n)
          (/ (* (/ i n) (log t_0)) (- (+ (/ i n) 1.0) 1.0)))))
      1.0)
     (/ i n)))))
double code(double i, double n) {
	double t_0 = 1.0 + (i / n);
	double tmp;
	if (t_0 == 1.0) {
		tmp = i / n;
	} else {
		tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0);
	}
	return 100.0 * ((exp((n * tmp)) - 1.0) / (i / n));
}
real(8) function code(i, n)
    real(8), intent (in) :: i
    real(8), intent (in) :: n
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 + (i / n)
    if (t_0 == 1.0d0) then
        tmp = i / n
    else
        tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0d0) - 1.0d0)
    end if
    code = 100.0d0 * ((exp((n * tmp)) - 1.0d0) / (i / n))
end function
public static double code(double i, double n) {
	double t_0 = 1.0 + (i / n);
	double tmp;
	if (t_0 == 1.0) {
		tmp = i / n;
	} else {
		tmp = ((i / n) * Math.log(t_0)) / (((i / n) + 1.0) - 1.0);
	}
	return 100.0 * ((Math.exp((n * tmp)) - 1.0) / (i / n));
}
def code(i, n):
	t_0 = 1.0 + (i / n)
	tmp = 0
	if t_0 == 1.0:
		tmp = i / n
	else:
		tmp = ((i / n) * math.log(t_0)) / (((i / n) + 1.0) - 1.0)
	return 100.0 * ((math.exp((n * tmp)) - 1.0) / (i / n))
function code(i, n)
	t_0 = Float64(1.0 + Float64(i / n))
	tmp = 0.0
	if (t_0 == 1.0)
		tmp = Float64(i / n);
	else
		tmp = Float64(Float64(Float64(i / n) * log(t_0)) / Float64(Float64(Float64(i / n) + 1.0) - 1.0));
	end
	return Float64(100.0 * Float64(Float64(exp(Float64(n * tmp)) - 1.0) / Float64(i / n)))
end
function tmp_2 = code(i, n)
	t_0 = 1.0 + (i / n);
	tmp = 0.0;
	if (t_0 == 1.0)
		tmp = i / n;
	else
		tmp = ((i / n) * log(t_0)) / (((i / n) + 1.0) - 1.0);
	end
	tmp_2 = 100.0 * ((exp((n * tmp)) - 1.0) / (i / n));
end
code[i_, n_] := Block[{t$95$0 = N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision]}, N[(100.0 * N[(N[(N[Exp[N[(n * If[Equal[t$95$0, 1.0], N[(i / n), $MachinePrecision], N[(N[(N[(i / n), $MachinePrecision] * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(i / n), $MachinePrecision] + 1.0), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]], $MachinePrecision] - 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 + \frac{i}{n}\\
100 \cdot \frac{e^{n \cdot \begin{array}{l}
\mathbf{if}\;t_0 = 1:\\
\;\;\;\;\frac{i}{n}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{i}{n} \cdot \log t_0}{\left(\frac{i}{n} + 1\right) - 1}\\


\end{array}} - 1}{\frac{i}{n}}
\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023178 
(FPCore (i n)
  :name "Compound Interest"
  :precision binary64

  :herbie-target
  (* 100.0 (/ (- (exp (* n (if (== (+ 1.0 (/ i n)) 1.0) (/ i n) (/ (* (/ i n) (log (+ 1.0 (/ i n)))) (- (+ (/ i n) 1.0) 1.0))))) 1.0) (/ i n)))

  (* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))