Compound Interest

Percentage Accurate: 28.4% → 95.7%
Time: 13.9s
Alternatives: 17
Speedup: 24.3×

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 17 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: 28.4% 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: 95.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\ t_1 := \mathsf{fma}\left(t\_0, 100, -100\right)\\ t_2 := \frac{t\_0 + -1}{\frac{i}{n}}\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-75}:\\ \;\;\;\;n \cdot \frac{t\_1}{i}\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\frac{n \cdot t\_1}{i}\\ \mathbf{else}:\\ \;\;\;\;n \cdot 100\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (let* ((t_0 (pow (+ 1.0 (/ i n)) n))
        (t_1 (fma t_0 100.0 -100.0))
        (t_2 (/ (+ t_0 -1.0) (/ i n))))
   (if (<= t_2 -1e-75)
     (* n (/ t_1 i))
     (if (<= t_2 0.0)
       (* 100.0 (/ (expm1 (* n (log1p (/ i n)))) (/ i n)))
       (if (<= t_2 INFINITY) (/ (* n t_1) i) (* n 100.0))))))
double code(double i, double n) {
	double t_0 = pow((1.0 + (i / n)), n);
	double t_1 = fma(t_0, 100.0, -100.0);
	double t_2 = (t_0 + -1.0) / (i / n);
	double tmp;
	if (t_2 <= -1e-75) {
		tmp = n * (t_1 / i);
	} else if (t_2 <= 0.0) {
		tmp = 100.0 * (expm1((n * log1p((i / n)))) / (i / n));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = (n * t_1) / i;
	} else {
		tmp = n * 100.0;
	}
	return tmp;
}
function code(i, n)
	t_0 = Float64(1.0 + Float64(i / n)) ^ n
	t_1 = fma(t_0, 100.0, -100.0)
	t_2 = Float64(Float64(t_0 + -1.0) / Float64(i / n))
	tmp = 0.0
	if (t_2 <= -1e-75)
		tmp = Float64(n * Float64(t_1 / i));
	elseif (t_2 <= 0.0)
		tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / Float64(i / n)));
	elseif (t_2 <= Inf)
		tmp = Float64(Float64(n * t_1) / i);
	else
		tmp = Float64(n * 100.0);
	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[(t$95$0 * 100.0 + -100.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-75], N[(n * N[(t$95$1 / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(100.0 * N[(N[(Exp[N[(n * N[Log[1 + N[(i / n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(n * t$95$1), $MachinePrecision] / i), $MachinePrecision], N[(n * 100.0), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \mathsf{fma}\left(t\_0, 100, -100\right)\\
t_2 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-75}:\\
\;\;\;\;n \cdot \frac{t\_1}{i}\\

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{n \cdot t\_1}{i}\\

\mathbf{else}:\\
\;\;\;\;n \cdot 100\\


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

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto 100 \cdot \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 1}}{\frac{i}{n}} \]
      6. lift-/.f64N/A

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

        \[\leadsto 100 \cdot \color{blue}{\left(\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot \frac{1}{\frac{i}{n}}\right)} \]
      8. div-invN/A

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

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      10. lift-/.f64N/A

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

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

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

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

    if -9.9999999999999996e-76 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < 0.0

    1. Initial program 21.0%

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

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

        \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
      3. sqr-powN/A

        \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{\left(\frac{n}{2}\right)} \cdot {\left(1 + \frac{i}{n}\right)}^{\left(\frac{n}{2}\right)}} - 1}{\frac{i}{n}} \]
      4. sqr-powN/A

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

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

        \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
      7. *-commutativeN/A

        \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
      8. lower-*.f64N/A

        \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
      9. lift-+.f64N/A

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

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

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

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

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto 100 \cdot \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 1}}{\frac{i}{n}} \]
      6. lift-/.f64N/A

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

        \[\leadsto 100 \cdot \color{blue}{\left(\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot \frac{1}{\frac{i}{n}}\right)} \]
      8. lift-/.f64N/A

        \[\leadsto 100 \cdot \left(\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot \frac{1}{\color{blue}{\frac{i}{n}}}\right) \]
      9. clear-numN/A

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

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

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

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

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

    if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n))

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{100 \cdot n} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{n \cdot 100} \]
      2. lower-*.f6472.0

        \[\leadsto \color{blue}{n \cdot 100} \]
    5. Applied rewrites72.0%

      \[\leadsto \color{blue}{n \cdot 100} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification94.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -1 \cdot 10^{-75}:\\ \;\;\;\;n \cdot \frac{\mathsf{fma}\left({\left(1 + \frac{i}{n}\right)}^{n}, 100, -100\right)}{i}\\ \mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq 0:\\ \;\;\;\;100 \cdot \frac{\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:\\ \;\;\;\;\frac{n \cdot \mathsf{fma}\left({\left(1 + \frac{i}{n}\right)}^{n}, 100, -100\right)}{i}\\ \mathbf{else}:\\ \;\;\;\;n \cdot 100\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 58.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -\infty:\\ \;\;\;\;n \cdot \left(i \cdot \left(\left(i \cdot i\right) \cdot 4.166666666666667\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(16.666666666666668, i, 50\right), n \cdot 100\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= (/ (+ (pow (+ 1.0 (/ i n)) n) -1.0) (/ i n)) (- INFINITY))
   (* n (* i (* (* i i) 4.166666666666667)))
   (fma i (* n (fma 16.666666666666668 i 50.0)) (* n 100.0))))
double code(double i, double n) {
	double tmp;
	if (((pow((1.0 + (i / n)), n) + -1.0) / (i / n)) <= -((double) INFINITY)) {
		tmp = n * (i * ((i * i) * 4.166666666666667));
	} else {
		tmp = fma(i, (n * fma(16.666666666666668, i, 50.0)), (n * 100.0));
	}
	return tmp;
}
function code(i, n)
	tmp = 0.0
	if (Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) / Float64(i / n)) <= Float64(-Inf))
		tmp = Float64(n * Float64(i * Float64(Float64(i * i) * 4.166666666666667)));
	else
		tmp = fma(i, Float64(n * fma(16.666666666666668, i, 50.0)), Float64(n * 100.0));
	end
	return tmp
end
code[i_, n_] := If[LessEqual[N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(n * N[(i * N[(N[(i * i), $MachinePrecision] * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * N[(n * N[(16.666666666666668 * i + 50.0), $MachinePrecision]), $MachinePrecision] + N[(n * 100.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -\infty:\\
\;\;\;\;n \cdot \left(i \cdot \left(\left(i \cdot i\right) \cdot 4.166666666666667\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -inf.0

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
      3. *-commutativeN/A

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

        \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
      6. lower-expm1.f6420.8

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

      \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
    6. Step-by-step derivation
      1. lift-expm1.f64N/A

        \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
      4. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
      5. associate-/l*N/A

        \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
      7. *-commutativeN/A

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
      8. *-lft-identityN/A

        \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
      9. times-fracN/A

        \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
      10. metadata-evalN/A

        \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
      11. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
      12. lower-/.f6420.8

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

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

      \[\leadsto \color{blue}{100 \cdot n + i \cdot \left(50 \cdot n + i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right)\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{i \cdot \left(50 \cdot n + i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right)\right) + 100 \cdot n} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, 50 \cdot n + i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right), 100 \cdot n\right)} \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right) + 50 \cdot n}, 100 \cdot n\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n, 50 \cdot n\right)}, 100 \cdot n\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\left(\frac{25}{6} \cdot i\right) \cdot n} + \frac{50}{3} \cdot n, 50 \cdot n\right), 100 \cdot n\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{n \cdot \left(\frac{25}{6} \cdot i + \frac{50}{3}\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \color{blue}{\left(\frac{50}{3} + \frac{25}{6} \cdot i\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{n \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \color{blue}{\left(\frac{25}{6} \cdot i + \frac{50}{3}\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \left(\color{blue}{i \cdot \frac{25}{6}} + \frac{50}{3}\right), 50 \cdot n\right), 100 \cdot n\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \color{blue}{\mathsf{fma}\left(i, \frac{25}{6}, \frac{50}{3}\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, \frac{25}{6}, \frac{50}{3}\right), \color{blue}{n \cdot 50}\right), 100 \cdot n\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, \frac{25}{6}, \frac{50}{3}\right), \color{blue}{n \cdot 50}\right), 100 \cdot n\right) \]
      14. lower-*.f64100.0

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), n \cdot 50\right), \color{blue}{100 \cdot n}\right) \]
    10. Applied rewrites100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), n \cdot 50\right), 100 \cdot n\right)} \]
    11. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{25}{6} \cdot \left({i}^{3} \cdot n\right)} \]
    12. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{25}{6} \cdot {i}^{3}\right) \cdot n} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{n \cdot \left(\frac{25}{6} \cdot {i}^{3}\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{n \cdot \left(\frac{25}{6} \cdot {i}^{3}\right)} \]
      4. unpow3N/A

        \[\leadsto n \cdot \left(\frac{25}{6} \cdot \color{blue}{\left(\left(i \cdot i\right) \cdot i\right)}\right) \]
      5. unpow2N/A

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

        \[\leadsto n \cdot \color{blue}{\left(\left(\frac{25}{6} \cdot {i}^{2}\right) \cdot i\right)} \]
      7. unpow2N/A

        \[\leadsto n \cdot \left(\left(\frac{25}{6} \cdot \color{blue}{\left(i \cdot i\right)}\right) \cdot i\right) \]
      8. associate-*r*N/A

        \[\leadsto n \cdot \left(\color{blue}{\left(\left(\frac{25}{6} \cdot i\right) \cdot i\right)} \cdot i\right) \]
      9. *-commutativeN/A

        \[\leadsto n \cdot \color{blue}{\left(i \cdot \left(\left(\frac{25}{6} \cdot i\right) \cdot i\right)\right)} \]
      10. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\left(i \cdot \left(\left(\frac{25}{6} \cdot i\right) \cdot i\right)\right)} \]
      11. associate-*r*N/A

        \[\leadsto n \cdot \left(i \cdot \color{blue}{\left(\frac{25}{6} \cdot \left(i \cdot i\right)\right)}\right) \]
      12. unpow2N/A

        \[\leadsto n \cdot \left(i \cdot \left(\frac{25}{6} \cdot \color{blue}{{i}^{2}}\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto n \cdot \left(i \cdot \color{blue}{\left(\frac{25}{6} \cdot {i}^{2}\right)}\right) \]
      14. unpow2N/A

        \[\leadsto n \cdot \left(i \cdot \left(\frac{25}{6} \cdot \color{blue}{\left(i \cdot i\right)}\right)\right) \]
      15. lower-*.f64100.0

        \[\leadsto n \cdot \left(i \cdot \left(4.166666666666667 \cdot \color{blue}{\left(i \cdot i\right)}\right)\right) \]
    13. Applied rewrites100.0%

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

    if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n))

    1. Initial program 26.8%

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

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
      3. *-commutativeN/A

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

        \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
      6. lower-expm1.f6475.0

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

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

      \[\leadsto \color{blue}{100 \cdot n + i \cdot \left(\frac{50}{3} \cdot \left(i \cdot n\right) + 50 \cdot n\right)} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, \frac{50}{3} \cdot \left(i \cdot n\right) + 50 \cdot n, 100 \cdot n\right)} \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{\left(\frac{50}{3} \cdot i\right) \cdot n} + 50 \cdot n, 100 \cdot n\right) \]
      4. distribute-rgt-outN/A

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{n \cdot \left(\frac{50}{3} \cdot i + 50\right)}, 100 \cdot n\right) \]
      5. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{n \cdot \left(\frac{50}{3} \cdot i + 50\right)}, 100 \cdot n\right) \]
      6. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, n \cdot \color{blue}{\mathsf{fma}\left(\frac{50}{3}, i, 50\right)}, 100 \cdot n\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(\frac{50}{3}, i, 50\right), \color{blue}{n \cdot 100}\right) \]
      8. lower-*.f6458.4

        \[\leadsto \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(16.666666666666668, i, 50\right), \color{blue}{n \cdot 100}\right) \]
    8. Applied rewrites58.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(16.666666666666668, i, 50\right), n \cdot 100\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -\infty:\\ \;\;\;\;n \cdot \left(i \cdot \left(\left(i \cdot i\right) \cdot 4.166666666666667\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(16.666666666666668, i, 50\right), n \cdot 100\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 58.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -\infty:\\ \;\;\;\;n \cdot \left(i \cdot \left(\left(i \cdot i\right) \cdot 4.166666666666667\right)\right)\\ \mathbf{else}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= (/ (+ (pow (+ 1.0 (/ i n)) n) -1.0) (/ i n)) (- INFINITY))
   (* n (* i (* (* i i) 4.166666666666667)))
   (* n (fma i (fma i 16.666666666666668 50.0) 100.0))))
double code(double i, double n) {
	double tmp;
	if (((pow((1.0 + (i / n)), n) + -1.0) / (i / n)) <= -((double) INFINITY)) {
		tmp = n * (i * ((i * i) * 4.166666666666667));
	} else {
		tmp = n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0);
	}
	return tmp;
}
function code(i, n)
	tmp = 0.0
	if (Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) / Float64(i / n)) <= Float64(-Inf))
		tmp = Float64(n * Float64(i * Float64(Float64(i * i) * 4.166666666666667)));
	else
		tmp = Float64(n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0));
	end
	return tmp
end
code[i_, n_] := If[LessEqual[N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(n * N[(i * N[(N[(i * i), $MachinePrecision] * 4.166666666666667), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(i * N[(i * 16.666666666666668 + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -\infty:\\
\;\;\;\;n \cdot \left(i \cdot \left(\left(i \cdot i\right) \cdot 4.166666666666667\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n)) < -inf.0

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
      3. *-commutativeN/A

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

        \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
      6. lower-expm1.f6420.8

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

      \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
    6. Step-by-step derivation
      1. lift-expm1.f64N/A

        \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
      4. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
      5. associate-/l*N/A

        \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
      7. *-commutativeN/A

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
      8. *-lft-identityN/A

        \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
      9. times-fracN/A

        \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
      10. metadata-evalN/A

        \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
      11. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
      12. lower-/.f6420.8

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

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

      \[\leadsto \color{blue}{100 \cdot n + i \cdot \left(50 \cdot n + i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right)\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{i \cdot \left(50 \cdot n + i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right)\right) + 100 \cdot n} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, 50 \cdot n + i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right), 100 \cdot n\right)} \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right) + 50 \cdot n}, 100 \cdot n\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n, 50 \cdot n\right)}, 100 \cdot n\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\left(\frac{25}{6} \cdot i\right) \cdot n} + \frac{50}{3} \cdot n, 50 \cdot n\right), 100 \cdot n\right) \]
      6. distribute-rgt-outN/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{n \cdot \left(\frac{25}{6} \cdot i + \frac{50}{3}\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \color{blue}{\left(\frac{50}{3} + \frac{25}{6} \cdot i\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
      8. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{n \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \color{blue}{\left(\frac{25}{6} \cdot i + \frac{50}{3}\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \left(\color{blue}{i \cdot \frac{25}{6}} + \frac{50}{3}\right), 50 \cdot n\right), 100 \cdot n\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \color{blue}{\mathsf{fma}\left(i, \frac{25}{6}, \frac{50}{3}\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, \frac{25}{6}, \frac{50}{3}\right), \color{blue}{n \cdot 50}\right), 100 \cdot n\right) \]
      13. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, \frac{25}{6}, \frac{50}{3}\right), \color{blue}{n \cdot 50}\right), 100 \cdot n\right) \]
      14. lower-*.f64100.0

        \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), n \cdot 50\right), \color{blue}{100 \cdot n}\right) \]
    10. Applied rewrites100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), n \cdot 50\right), 100 \cdot n\right)} \]
    11. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{25}{6} \cdot \left({i}^{3} \cdot n\right)} \]
    12. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{25}{6} \cdot {i}^{3}\right) \cdot n} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{n \cdot \left(\frac{25}{6} \cdot {i}^{3}\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{n \cdot \left(\frac{25}{6} \cdot {i}^{3}\right)} \]
      4. unpow3N/A

        \[\leadsto n \cdot \left(\frac{25}{6} \cdot \color{blue}{\left(\left(i \cdot i\right) \cdot i\right)}\right) \]
      5. unpow2N/A

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

        \[\leadsto n \cdot \color{blue}{\left(\left(\frac{25}{6} \cdot {i}^{2}\right) \cdot i\right)} \]
      7. unpow2N/A

        \[\leadsto n \cdot \left(\left(\frac{25}{6} \cdot \color{blue}{\left(i \cdot i\right)}\right) \cdot i\right) \]
      8. associate-*r*N/A

        \[\leadsto n \cdot \left(\color{blue}{\left(\left(\frac{25}{6} \cdot i\right) \cdot i\right)} \cdot i\right) \]
      9. *-commutativeN/A

        \[\leadsto n \cdot \color{blue}{\left(i \cdot \left(\left(\frac{25}{6} \cdot i\right) \cdot i\right)\right)} \]
      10. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\left(i \cdot \left(\left(\frac{25}{6} \cdot i\right) \cdot i\right)\right)} \]
      11. associate-*r*N/A

        \[\leadsto n \cdot \left(i \cdot \color{blue}{\left(\frac{25}{6} \cdot \left(i \cdot i\right)\right)}\right) \]
      12. unpow2N/A

        \[\leadsto n \cdot \left(i \cdot \left(\frac{25}{6} \cdot \color{blue}{{i}^{2}}\right)\right) \]
      13. lower-*.f64N/A

        \[\leadsto n \cdot \left(i \cdot \color{blue}{\left(\frac{25}{6} \cdot {i}^{2}\right)}\right) \]
      14. unpow2N/A

        \[\leadsto n \cdot \left(i \cdot \left(\frac{25}{6} \cdot \color{blue}{\left(i \cdot i\right)}\right)\right) \]
      15. lower-*.f64100.0

        \[\leadsto n \cdot \left(i \cdot \left(4.166666666666667 \cdot \color{blue}{\left(i \cdot i\right)}\right)\right) \]
    13. Applied rewrites100.0%

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

    if -inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 #s(literal 1 binary64) (/.f64 i n)) n) #s(literal 1 binary64)) (/.f64 i n))

    1. Initial program 26.8%

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

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
      3. *-commutativeN/A

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

        \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
      6. lower-expm1.f6475.0

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

      \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
    6. Step-by-step derivation
      1. lift-expm1.f64N/A

        \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
      4. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
      5. associate-/l*N/A

        \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
      7. *-commutativeN/A

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
      8. *-lft-identityN/A

        \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
      9. times-fracN/A

        \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
      10. metadata-evalN/A

        \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
      11. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
      12. lower-/.f6480.3

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

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

      \[\leadsto n \cdot \color{blue}{\left(100 + i \cdot \left(50 + \frac{50}{3} \cdot i\right)\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

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

        \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, 50 + \frac{50}{3} \cdot i, 100\right)} \]
      3. +-commutativeN/A

        \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{\frac{50}{3} \cdot i + 50}, 100\right) \]
      4. *-commutativeN/A

        \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{i \cdot \frac{50}{3}} + 50, 100\right) \]
      5. lower-fma.f6458.4

        \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, 16.666666666666668, 50\right)}, 100\right) \]
    10. Applied rewrites58.4%

      \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -\infty:\\ \;\;\;\;n \cdot \left(i \cdot \left(\left(i \cdot i\right) \cdot 4.166666666666667\right)\right)\\ \mathbf{else}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 82.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;n \leq 6 \cdot 10^{-197}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{1 + -1}{i}\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < -4.5999999999999999e-209 or 8.5999999999999995e-47 < n

    1. Initial program 26.6%

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

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

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

        \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
      3. *-commutativeN/A

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

        \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
      6. lower-expm1.f6483.2

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

      \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
    6. Step-by-step derivation
      1. lift-expm1.f64N/A

        \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
      4. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
      5. associate-/l*N/A

        \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
      6. lower-*.f64N/A

        \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
      7. *-commutativeN/A

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
      8. *-lft-identityN/A

        \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
      9. times-fracN/A

        \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
      10. metadata-evalN/A

        \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
      11. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
      12. lower-/.f6487.3

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

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

    if -4.5999999999999999e-209 < n < 6.00000000000000051e-197

    1. Initial program 62.0%

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

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

        \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
      3. sqr-powN/A

        \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{\left(\frac{n}{2}\right)} \cdot {\left(1 + \frac{i}{n}\right)}^{\left(\frac{n}{2}\right)}} - 1}{\frac{i}{n}} \]
      4. sqr-powN/A

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

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

        \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
      7. *-commutativeN/A

        \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
      8. lower-*.f64N/A

        \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
      9. lift-+.f64N/A

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

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

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

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

        \[\leadsto \frac{\color{blue}{1} + -1}{i} \cdot \left(n \cdot 100\right) \]
      3. Step-by-step derivation
        1. Applied rewrites92.8%

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

        if 6.00000000000000051e-197 < n < 8.5999999999999995e-47

        1. Initial program 3.8%

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

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

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

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

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

            \[\leadsto 100 \cdot \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 1}}{\frac{i}{n}} \]
          6. lift-/.f64N/A

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

            \[\leadsto 100 \cdot \color{blue}{\left(\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot \frac{1}{\frac{i}{n}}\right)} \]
          8. div-invN/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{i \cdot 100}}{\frac{i}{n}} \]
          2. lower-*.f6474.0

            \[\leadsto \frac{\color{blue}{i \cdot 100}}{\frac{i}{n}} \]
        7. Applied rewrites74.0%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -4.6 \cdot 10^{-209}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{elif}\;n \leq 6 \cdot 10^{-197}:\\ \;\;\;\;\left(n \cdot 100\right) \cdot \frac{1 + -1}{i}\\ \mathbf{elif}\;n \leq 8.6 \cdot 10^{-47}:\\ \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \end{array} \]
      6. Add Preprocessing

      Alternative 5: 78.9% accurate, 1.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := 100 \cdot \frac{n \cdot \mathsf{expm1}\left(i\right)}{i}\\ \mathbf{if}\;n \leq -1.4 \cdot 10^{-105}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 1.65 \cdot 10^{-37}:\\ \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (i n)
       :precision binary64
       (let* ((t_0 (* 100.0 (/ (* n (expm1 i)) i))))
         (if (<= n -1.4e-105) t_0 (if (<= n 1.65e-37) (/ (* i 100.0) (/ i n)) t_0))))
      double code(double i, double n) {
      	double t_0 = 100.0 * ((n * expm1(i)) / i);
      	double tmp;
      	if (n <= -1.4e-105) {
      		tmp = t_0;
      	} else if (n <= 1.65e-37) {
      		tmp = (i * 100.0) / (i / n);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      public static double code(double i, double n) {
      	double t_0 = 100.0 * ((n * Math.expm1(i)) / i);
      	double tmp;
      	if (n <= -1.4e-105) {
      		tmp = t_0;
      	} else if (n <= 1.65e-37) {
      		tmp = (i * 100.0) / (i / n);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(i, n):
      	t_0 = 100.0 * ((n * math.expm1(i)) / i)
      	tmp = 0
      	if n <= -1.4e-105:
      		tmp = t_0
      	elif n <= 1.65e-37:
      		tmp = (i * 100.0) / (i / n)
      	else:
      		tmp = t_0
      	return tmp
      
      function code(i, n)
      	t_0 = Float64(100.0 * Float64(Float64(n * expm1(i)) / i))
      	tmp = 0.0
      	if (n <= -1.4e-105)
      		tmp = t_0;
      	elseif (n <= 1.65e-37)
      		tmp = Float64(Float64(i * 100.0) / Float64(i / n));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(N[(n * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.4e-105], t$95$0, If[LessEqual[n, 1.65e-37], N[(N[(i * 100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := 100 \cdot \frac{n \cdot \mathsf{expm1}\left(i\right)}{i}\\
      \mathbf{if}\;n \leq -1.4 \cdot 10^{-105}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;n \leq 1.65 \cdot 10^{-37}:\\
      \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if n < -1.4e-105 or 1.64999999999999991e-37 < n

        1. Initial program 26.3%

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

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

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

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

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

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

        if -1.4e-105 < n < 1.64999999999999991e-37

        1. Initial program 34.1%

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

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

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

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

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

            \[\leadsto 100 \cdot \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 1}}{\frac{i}{n}} \]
          6. lift-/.f64N/A

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

            \[\leadsto 100 \cdot \color{blue}{\left(\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot \frac{1}{\frac{i}{n}}\right)} \]
          8. div-invN/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{i \cdot 100}}{\frac{i}{n}} \]
          2. lower-*.f6472.2

            \[\leadsto \frac{\color{blue}{i \cdot 100}}{\frac{i}{n}} \]
        7. Applied rewrites72.2%

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

      Alternative 6: 67.2% accurate, 2.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{100 \cdot \left(n \cdot \mathsf{fma}\left(i \cdot i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), i\right)\right)}{i}\\ \mathbf{if}\;n \leq -2.4 \cdot 10^{+85}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 1.65 \cdot 10^{-37}:\\ \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (i n)
       :precision binary64
       (let* ((t_0
               (/
                (*
                 100.0
                 (*
                  n
                  (fma
                   (* i i)
                   (fma i (fma i 0.041666666666666664 0.16666666666666666) 0.5)
                   i)))
                i)))
         (if (<= n -2.4e+85) t_0 (if (<= n 1.65e-37) (/ (* i 100.0) (/ i n)) t_0))))
      double code(double i, double n) {
      	double t_0 = (100.0 * (n * fma((i * i), fma(i, fma(i, 0.041666666666666664, 0.16666666666666666), 0.5), i))) / i;
      	double tmp;
      	if (n <= -2.4e+85) {
      		tmp = t_0;
      	} else if (n <= 1.65e-37) {
      		tmp = (i * 100.0) / (i / n);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(i, n)
      	t_0 = Float64(Float64(100.0 * Float64(n * fma(Float64(i * i), fma(i, fma(i, 0.041666666666666664, 0.16666666666666666), 0.5), i))) / i)
      	tmp = 0.0
      	if (n <= -2.4e+85)
      		tmp = t_0;
      	elseif (n <= 1.65e-37)
      		tmp = Float64(Float64(i * 100.0) / Float64(i / n));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[i_, n_] := Block[{t$95$0 = N[(N[(100.0 * N[(n * N[(N[(i * i), $MachinePrecision] * N[(i * N[(i * 0.041666666666666664 + 0.16666666666666666), $MachinePrecision] + 0.5), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]}, If[LessEqual[n, -2.4e+85], t$95$0, If[LessEqual[n, 1.65e-37], N[(N[(i * 100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{100 \cdot \left(n \cdot \mathsf{fma}\left(i \cdot i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), i\right)\right)}{i}\\
      \mathbf{if}\;n \leq -2.4 \cdot 10^{+85}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;n \leq 1.65 \cdot 10^{-37}:\\
      \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if n < -2.39999999999999997e85 or 1.64999999999999991e-37 < n

        1. Initial program 24.2%

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

          \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
        4. Step-by-step derivation
          1. associate-*r/N/A

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

            \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
          3. *-commutativeN/A

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

            \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
          5. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
          6. lower-expm1.f6492.2

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

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

          \[\leadsto \frac{\left(n \cdot \color{blue}{\left(i \cdot \left(1 + i \cdot \left(\frac{1}{2} + i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right)\right)\right)\right)}\right) \cdot 100}{i} \]
        7. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \frac{\left(n \cdot \left(i \cdot \color{blue}{\left(i \cdot \left(\frac{1}{2} + i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right)\right) + 1\right)}\right)\right) \cdot 100}{i} \]
          2. distribute-lft-inN/A

            \[\leadsto \frac{\left(n \cdot \color{blue}{\left(i \cdot \left(i \cdot \left(\frac{1}{2} + i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right)\right)\right) + i \cdot 1\right)}\right) \cdot 100}{i} \]
          3. associate-*r*N/A

            \[\leadsto \frac{\left(n \cdot \left(\color{blue}{\left(i \cdot i\right) \cdot \left(\frac{1}{2} + i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right)\right)} + i \cdot 1\right)\right) \cdot 100}{i} \]
          4. unpow2N/A

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

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

            \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{fma}\left({i}^{2}, \frac{1}{2} + i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right), i\right)}\right) \cdot 100}{i} \]
          7. unpow2N/A

            \[\leadsto \frac{\left(n \cdot \mathsf{fma}\left(\color{blue}{i \cdot i}, \frac{1}{2} + i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right), i\right)\right) \cdot 100}{i} \]
          8. lower-*.f64N/A

            \[\leadsto \frac{\left(n \cdot \mathsf{fma}\left(\color{blue}{i \cdot i}, \frac{1}{2} + i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right), i\right)\right) \cdot 100}{i} \]
          9. +-commutativeN/A

            \[\leadsto \frac{\left(n \cdot \mathsf{fma}\left(i \cdot i, \color{blue}{i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right) + \frac{1}{2}}, i\right)\right) \cdot 100}{i} \]
          10. lower-fma.f64N/A

            \[\leadsto \frac{\left(n \cdot \mathsf{fma}\left(i \cdot i, \color{blue}{\mathsf{fma}\left(i, \frac{1}{6} + \frac{1}{24} \cdot i, \frac{1}{2}\right)}, i\right)\right) \cdot 100}{i} \]
          11. +-commutativeN/A

            \[\leadsto \frac{\left(n \cdot \mathsf{fma}\left(i \cdot i, \mathsf{fma}\left(i, \color{blue}{\frac{1}{24} \cdot i + \frac{1}{6}}, \frac{1}{2}\right), i\right)\right) \cdot 100}{i} \]
          12. *-commutativeN/A

            \[\leadsto \frac{\left(n \cdot \mathsf{fma}\left(i \cdot i, \mathsf{fma}\left(i, \color{blue}{i \cdot \frac{1}{24}} + \frac{1}{6}, \frac{1}{2}\right), i\right)\right) \cdot 100}{i} \]
          13. lower-fma.f6475.8

            \[\leadsto \frac{\left(n \cdot \mathsf{fma}\left(i \cdot i, \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, 0.041666666666666664, 0.16666666666666666\right)}, 0.5\right), i\right)\right) \cdot 100}{i} \]
        8. Applied rewrites75.8%

          \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{fma}\left(i \cdot i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), i\right)}\right) \cdot 100}{i} \]

        if -2.39999999999999997e85 < n < 1.64999999999999991e-37

        1. Initial program 33.6%

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

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

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

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

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

            \[\leadsto 100 \cdot \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 1}}{\frac{i}{n}} \]
          6. lift-/.f64N/A

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

            \[\leadsto 100 \cdot \color{blue}{\left(\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot \frac{1}{\frac{i}{n}}\right)} \]
          8. div-invN/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{i \cdot 100}}{\frac{i}{n}} \]
          2. lower-*.f6465.2

            \[\leadsto \frac{\color{blue}{i \cdot 100}}{\frac{i}{n}} \]
        7. Applied rewrites65.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -2.4 \cdot 10^{+85}:\\ \;\;\;\;\frac{100 \cdot \left(n \cdot \mathsf{fma}\left(i \cdot i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), i\right)\right)}{i}\\ \mathbf{elif}\;n \leq 1.65 \cdot 10^{-37}:\\ \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{100 \cdot \left(n \cdot \mathsf{fma}\left(i \cdot i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), i\right)\right)}{i}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 7: 66.9% accurate, 3.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right)\\ \mathbf{if}\;n \leq -2.4 \cdot 10^{+85}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, t\_0, 100\right)\\ \mathbf{elif}\;n \leq 8.6 \cdot 10^{-47}:\\ \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, n \cdot t\_0, n \cdot 100\right)\\ \end{array} \end{array} \]
      (FPCore (i n)
       :precision binary64
       (let* ((t_0 (fma i (fma i 4.166666666666667 16.666666666666668) 50.0)))
         (if (<= n -2.4e+85)
           (* n (fma i t_0 100.0))
           (if (<= n 8.6e-47)
             (/ (* i 100.0) (/ i n))
             (fma i (* n t_0) (* n 100.0))))))
      double code(double i, double n) {
      	double t_0 = fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0);
      	double tmp;
      	if (n <= -2.4e+85) {
      		tmp = n * fma(i, t_0, 100.0);
      	} else if (n <= 8.6e-47) {
      		tmp = (i * 100.0) / (i / n);
      	} else {
      		tmp = fma(i, (n * t_0), (n * 100.0));
      	}
      	return tmp;
      }
      
      function code(i, n)
      	t_0 = fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0)
      	tmp = 0.0
      	if (n <= -2.4e+85)
      		tmp = Float64(n * fma(i, t_0, 100.0));
      	elseif (n <= 8.6e-47)
      		tmp = Float64(Float64(i * 100.0) / Float64(i / n));
      	else
      		tmp = fma(i, Float64(n * t_0), Float64(n * 100.0));
      	end
      	return tmp
      end
      
      code[i_, n_] := Block[{t$95$0 = N[(i * N[(i * 4.166666666666667 + 16.666666666666668), $MachinePrecision] + 50.0), $MachinePrecision]}, If[LessEqual[n, -2.4e+85], N[(n * N[(i * t$95$0 + 100.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 8.6e-47], N[(N[(i * 100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], N[(i * N[(n * t$95$0), $MachinePrecision] + N[(n * 100.0), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right)\\
      \mathbf{if}\;n \leq -2.4 \cdot 10^{+85}:\\
      \;\;\;\;n \cdot \mathsf{fma}\left(i, t\_0, 100\right)\\
      
      \mathbf{elif}\;n \leq 8.6 \cdot 10^{-47}:\\
      \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(i, n \cdot t\_0, n \cdot 100\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if n < -2.39999999999999997e85

        1. Initial program 29.5%

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

          \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
        4. Step-by-step derivation
          1. associate-*r/N/A

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

            \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
          3. *-commutativeN/A

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

            \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
          5. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
          6. lower-expm1.f6489.5

            \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
        5. Applied rewrites89.5%

          \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
        6. Step-by-step derivation
          1. lift-expm1.f64N/A

            \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
          4. associate-*l*N/A

            \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
          5. associate-/l*N/A

            \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
          6. lower-*.f64N/A

            \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
          7. *-commutativeN/A

            \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
          8. *-lft-identityN/A

            \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
          9. times-fracN/A

            \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
          10. metadata-evalN/A

            \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
          11. lower-*.f64N/A

            \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
          12. lower-/.f6489.8

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

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

          \[\leadsto n \cdot \color{blue}{\left(100 + i \cdot \left(50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right)\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto n \cdot \color{blue}{\left(i \cdot \left(50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right) + 100\right)} \]
          2. lower-fma.f64N/A

            \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, 50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right), 100\right)} \]
          3. +-commutativeN/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right) + 50}, 100\right) \]
          4. lower-fma.f64N/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \frac{50}{3} + \frac{25}{6} \cdot i, 50\right)}, 100\right) \]
          5. +-commutativeN/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\frac{25}{6} \cdot i + \frac{50}{3}}, 50\right), 100\right) \]
          6. *-commutativeN/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{i \cdot \frac{25}{6}} + \frac{50}{3}, 50\right), 100\right) \]
          7. lower-fma.f6461.7

            \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right)}, 50\right), 100\right) \]
        10. Applied rewrites61.7%

          \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)} \]

        if -2.39999999999999997e85 < n < 8.5999999999999995e-47

        1. Initial program 34.1%

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

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

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

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

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

            \[\leadsto 100 \cdot \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 1}}{\frac{i}{n}} \]
          6. lift-/.f64N/A

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

            \[\leadsto 100 \cdot \color{blue}{\left(\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot \frac{1}{\frac{i}{n}}\right)} \]
          8. div-invN/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{i \cdot 100}}{\frac{i}{n}} \]
          2. lower-*.f6465.5

            \[\leadsto \frac{\color{blue}{i \cdot 100}}{\frac{i}{n}} \]
        7. Applied rewrites65.5%

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

        if 8.5999999999999995e-47 < n

        1. Initial program 20.3%

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

          \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
        4. Step-by-step derivation
          1. associate-*r/N/A

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

            \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
          3. *-commutativeN/A

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

            \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
          5. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
          6. lower-expm1.f6492.1

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

          \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
        6. Step-by-step derivation
          1. lift-expm1.f64N/A

            \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
          4. associate-*l*N/A

            \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
          5. associate-/l*N/A

            \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
          6. lower-*.f64N/A

            \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
          7. *-commutativeN/A

            \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
          8. *-lft-identityN/A

            \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
          9. times-fracN/A

            \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
          10. metadata-evalN/A

            \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
          11. lower-*.f64N/A

            \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
          12. lower-/.f6494.4

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

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

          \[\leadsto \color{blue}{100 \cdot n + i \cdot \left(50 \cdot n + i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right)\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{i \cdot \left(50 \cdot n + i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right)\right) + 100 \cdot n} \]
          2. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(i, 50 \cdot n + i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right), 100 \cdot n\right)} \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(i, \color{blue}{i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right) + 50 \cdot n}, 100 \cdot n\right) \]
          4. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n, 50 \cdot n\right)}, 100 \cdot n\right) \]
          5. associate-*r*N/A

            \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\left(\frac{25}{6} \cdot i\right) \cdot n} + \frac{50}{3} \cdot n, 50 \cdot n\right), 100 \cdot n\right) \]
          6. distribute-rgt-outN/A

            \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{n \cdot \left(\frac{25}{6} \cdot i + \frac{50}{3}\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
          7. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \color{blue}{\left(\frac{50}{3} + \frac{25}{6} \cdot i\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
          8. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{n \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
          9. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \color{blue}{\left(\frac{25}{6} \cdot i + \frac{50}{3}\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
          10. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \left(\color{blue}{i \cdot \frac{25}{6}} + \frac{50}{3}\right), 50 \cdot n\right), 100 \cdot n\right) \]
          11. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \color{blue}{\mathsf{fma}\left(i, \frac{25}{6}, \frac{50}{3}\right)}, 50 \cdot n\right), 100 \cdot n\right) \]
          12. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, \frac{25}{6}, \frac{50}{3}\right), \color{blue}{n \cdot 50}\right), 100 \cdot n\right) \]
          13. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, \frac{25}{6}, \frac{50}{3}\right), \color{blue}{n \cdot 50}\right), 100 \cdot n\right) \]
          14. lower-*.f6480.0

            \[\leadsto \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), n \cdot 50\right), \color{blue}{100 \cdot n}\right) \]
        10. Applied rewrites80.0%

          \[\leadsto \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), n \cdot 50\right), 100 \cdot n\right)} \]
        11. Taylor expanded in i around 0

          \[\leadsto \mathsf{fma}\left(i, \color{blue}{50 \cdot n + i \cdot \left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right)}, 100 \cdot n\right) \]
        12. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(i, 50 \cdot n + i \cdot \color{blue}{\left(\frac{50}{3} \cdot n + \frac{25}{6} \cdot \left(i \cdot n\right)\right)}, 100 \cdot n\right) \]
          2. associate-*r*N/A

            \[\leadsto \mathsf{fma}\left(i, 50 \cdot n + i \cdot \left(\frac{50}{3} \cdot n + \color{blue}{\left(\frac{25}{6} \cdot i\right) \cdot n}\right), 100 \cdot n\right) \]
          3. distribute-rgt-inN/A

            \[\leadsto \mathsf{fma}\left(i, 50 \cdot n + i \cdot \color{blue}{\left(n \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right)}, 100 \cdot n\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(i, 50 \cdot n + i \cdot \color{blue}{\left(\left(\frac{50}{3} + \frac{25}{6} \cdot i\right) \cdot n\right)}, 100 \cdot n\right) \]
          5. associate-*r*N/A

            \[\leadsto \mathsf{fma}\left(i, 50 \cdot n + \color{blue}{\left(i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right) \cdot n}, 100 \cdot n\right) \]
          6. distribute-rgt-inN/A

            \[\leadsto \mathsf{fma}\left(i, \color{blue}{n \cdot \left(50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right)}, 100 \cdot n\right) \]
          7. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(i, \color{blue}{n \cdot \left(50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right)}, 100 \cdot n\right) \]
          8. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(i, n \cdot \color{blue}{\left(i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right) + 50\right)}, 100 \cdot n\right) \]
          9. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(i, n \cdot \color{blue}{\mathsf{fma}\left(i, \frac{50}{3} + \frac{25}{6} \cdot i, 50\right)}, 100 \cdot n\right) \]
          10. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, \color{blue}{\frac{25}{6} \cdot i + \frac{50}{3}}, 50\right), 100 \cdot n\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, \color{blue}{i \cdot \frac{25}{6}} + \frac{50}{3}, 50\right), 100 \cdot n\right) \]
          12. lower-fma.f6480.0

            \[\leadsto \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right)}, 50\right), 100 \cdot n\right) \]
        13. Applied rewrites80.0%

          \[\leadsto \mathsf{fma}\left(i, \color{blue}{n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right)}, 100 \cdot n\right) \]
      3. Recombined 3 regimes into one program.
      4. Final simplification69.7%

        \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -2.4 \cdot 10^{+85}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\ \mathbf{elif}\;n \leq 8.6 \cdot 10^{-47}:\\ \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), n \cdot 100\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 67.0% accurate, 3.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\ \mathbf{if}\;n \leq -2.4 \cdot 10^{+85}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 8.6 \cdot 10^{-47}:\\ \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (i n)
       :precision binary64
       (let* ((t_0
               (*
                n
                (fma
                 i
                 (fma i (fma i 4.166666666666667 16.666666666666668) 50.0)
                 100.0))))
         (if (<= n -2.4e+85) t_0 (if (<= n 8.6e-47) (/ (* i 100.0) (/ i n)) t_0))))
      double code(double i, double n) {
      	double t_0 = n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0);
      	double tmp;
      	if (n <= -2.4e+85) {
      		tmp = t_0;
      	} else if (n <= 8.6e-47) {
      		tmp = (i * 100.0) / (i / n);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(i, n)
      	t_0 = Float64(n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0))
      	tmp = 0.0
      	if (n <= -2.4e+85)
      		tmp = t_0;
      	elseif (n <= 8.6e-47)
      		tmp = Float64(Float64(i * 100.0) / Float64(i / n));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[i_, n_] := Block[{t$95$0 = N[(n * N[(i * N[(i * N[(i * 4.166666666666667 + 16.666666666666668), $MachinePrecision] + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -2.4e+85], t$95$0, If[LessEqual[n, 8.6e-47], N[(N[(i * 100.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\
      \mathbf{if}\;n \leq -2.4 \cdot 10^{+85}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;n \leq 8.6 \cdot 10^{-47}:\\
      \;\;\;\;\frac{i \cdot 100}{\frac{i}{n}}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if n < -2.39999999999999997e85 or 8.5999999999999995e-47 < n

        1. Initial program 24.0%

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

          \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
        4. Step-by-step derivation
          1. associate-*r/N/A

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

            \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
          3. *-commutativeN/A

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

            \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
          5. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
          6. lower-expm1.f6491.1

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

          \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
        6. Step-by-step derivation
          1. lift-expm1.f64N/A

            \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
          4. associate-*l*N/A

            \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
          5. associate-/l*N/A

            \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
          6. lower-*.f64N/A

            \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
          7. *-commutativeN/A

            \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
          8. *-lft-identityN/A

            \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
          9. times-fracN/A

            \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
          10. metadata-evalN/A

            \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
          11. lower-*.f64N/A

            \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
          12. lower-/.f6492.6

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

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

          \[\leadsto n \cdot \color{blue}{\left(100 + i \cdot \left(50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right)\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto n \cdot \color{blue}{\left(i \cdot \left(50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right) + 100\right)} \]
          2. lower-fma.f64N/A

            \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, 50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right), 100\right)} \]
          3. +-commutativeN/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right) + 50}, 100\right) \]
          4. lower-fma.f64N/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \frac{50}{3} + \frac{25}{6} \cdot i, 50\right)}, 100\right) \]
          5. +-commutativeN/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\frac{25}{6} \cdot i + \frac{50}{3}}, 50\right), 100\right) \]
          6. *-commutativeN/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{i \cdot \frac{25}{6}} + \frac{50}{3}, 50\right), 100\right) \]
          7. lower-fma.f6472.7

            \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right)}, 50\right), 100\right) \]
        10. Applied rewrites72.7%

          \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)} \]

        if -2.39999999999999997e85 < n < 8.5999999999999995e-47

        1. Initial program 34.1%

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

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

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

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

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

            \[\leadsto 100 \cdot \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 1}}{\frac{i}{n}} \]
          6. lift-/.f64N/A

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

            \[\leadsto 100 \cdot \color{blue}{\left(\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot \frac{1}{\frac{i}{n}}\right)} \]
          8. div-invN/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{100 \cdot i}}{\frac{i}{n}} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{i \cdot 100}}{\frac{i}{n}} \]
          2. lower-*.f6465.5

            \[\leadsto \frac{\color{blue}{i \cdot 100}}{\frac{i}{n}} \]
        7. Applied rewrites65.5%

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

      Alternative 9: 67.4% accurate, 3.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\ \mathbf{if}\;n \leq -8 \cdot 10^{-169}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 8.5 \cdot 10^{-197}:\\ \;\;\;\;\left(n \cdot 100\right) \cdot \frac{1 + -1}{i}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (i n)
       :precision binary64
       (let* ((t_0
               (*
                n
                (fma
                 i
                 (fma i (fma i 4.166666666666667 16.666666666666668) 50.0)
                 100.0))))
         (if (<= n -8e-169)
           t_0
           (if (<= n 8.5e-197) (* (* n 100.0) (/ (+ 1.0 -1.0) i)) t_0))))
      double code(double i, double n) {
      	double t_0 = n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0);
      	double tmp;
      	if (n <= -8e-169) {
      		tmp = t_0;
      	} else if (n <= 8.5e-197) {
      		tmp = (n * 100.0) * ((1.0 + -1.0) / i);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(i, n)
      	t_0 = Float64(n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0))
      	tmp = 0.0
      	if (n <= -8e-169)
      		tmp = t_0;
      	elseif (n <= 8.5e-197)
      		tmp = Float64(Float64(n * 100.0) * Float64(Float64(1.0 + -1.0) / i));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[i_, n_] := Block[{t$95$0 = N[(n * N[(i * N[(i * N[(i * 4.166666666666667 + 16.666666666666668), $MachinePrecision] + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -8e-169], t$95$0, If[LessEqual[n, 8.5e-197], N[(N[(n * 100.0), $MachinePrecision] * N[(N[(1.0 + -1.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\
      \mathbf{if}\;n \leq -8 \cdot 10^{-169}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;n \leq 8.5 \cdot 10^{-197}:\\
      \;\;\;\;\left(n \cdot 100\right) \cdot \frac{1 + -1}{i}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if n < -8.00000000000000016e-169 or 8.5e-197 < n

        1. Initial program 23.3%

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

          \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
        4. Step-by-step derivation
          1. associate-*r/N/A

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

            \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
          3. *-commutativeN/A

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

            \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
          5. lower-*.f64N/A

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

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

          \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
        6. Step-by-step derivation
          1. lift-expm1.f64N/A

            \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
          4. associate-*l*N/A

            \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
          5. associate-/l*N/A

            \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
          6. lower-*.f64N/A

            \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
          7. *-commutativeN/A

            \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
          8. *-lft-identityN/A

            \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
          9. times-fracN/A

            \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
          10. metadata-evalN/A

            \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
          11. lower-*.f64N/A

            \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
          12. lower-/.f6483.3

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

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

          \[\leadsto n \cdot \color{blue}{\left(100 + i \cdot \left(50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right)\right)} \]
        9. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto n \cdot \color{blue}{\left(i \cdot \left(50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right) + 100\right)} \]
          2. lower-fma.f64N/A

            \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, 50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right), 100\right)} \]
          3. +-commutativeN/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right) + 50}, 100\right) \]
          4. lower-fma.f64N/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \frac{50}{3} + \frac{25}{6} \cdot i, 50\right)}, 100\right) \]
          5. +-commutativeN/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\frac{25}{6} \cdot i + \frac{50}{3}}, 50\right), 100\right) \]
          6. *-commutativeN/A

            \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{i \cdot \frac{25}{6}} + \frac{50}{3}, 50\right), 100\right) \]
          7. lower-fma.f6465.8

            \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right)}, 50\right), 100\right) \]
        10. Applied rewrites65.8%

          \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)} \]

        if -8.00000000000000016e-169 < n < 8.5e-197

        1. Initial program 61.5%

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

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

            \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
          3. sqr-powN/A

            \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{\left(\frac{n}{2}\right)} \cdot {\left(1 + \frac{i}{n}\right)}^{\left(\frac{n}{2}\right)}} - 1}{\frac{i}{n}} \]
          4. sqr-powN/A

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

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

            \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
          7. *-commutativeN/A

            \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
          8. lower-*.f64N/A

            \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
          9. lift-+.f64N/A

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

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

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

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

            \[\leadsto \frac{\color{blue}{1} + -1}{i} \cdot \left(n \cdot 100\right) \]
          3. Step-by-step derivation
            1. Applied rewrites85.7%

              \[\leadsto \frac{\color{blue}{1} + -1}{i} \cdot \left(n \cdot 100\right) \]
          4. Recombined 2 regimes into one program.
          5. Final simplification68.4%

            \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -8 \cdot 10^{-169}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\ \mathbf{elif}\;n \leq 8.5 \cdot 10^{-197}:\\ \;\;\;\;\left(n \cdot 100\right) \cdot \frac{1 + -1}{i}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\ \end{array} \]
          6. Add Preprocessing

          Alternative 10: 59.4% accurate, 6.1× speedup?

          \[\begin{array}{l} \\ n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right) \end{array} \]
          (FPCore (i n)
           :precision binary64
           (* n (fma i (fma i (fma i 4.166666666666667 16.666666666666668) 50.0) 100.0)))
          double code(double i, double n) {
          	return n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0);
          }
          
          function code(i, n)
          	return Float64(n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0))
          end
          
          code[i_, n_] := N[(n * N[(i * N[(i * N[(i * 4.166666666666667 + 16.666666666666668), $MachinePrecision] + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)
          \end{array}
          
          Derivation
          1. Initial program 28.2%

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

            \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
          4. Step-by-step derivation
            1. associate-*r/N/A

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

              \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
            3. *-commutativeN/A

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

              \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
            5. lower-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
            6. lower-expm1.f6473.9

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

            \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
          6. Step-by-step derivation
            1. lift-expm1.f64N/A

              \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
            3. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
            4. associate-*l*N/A

              \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
            5. associate-/l*N/A

              \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
            6. lower-*.f64N/A

              \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
            7. *-commutativeN/A

              \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
            8. *-lft-identityN/A

              \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
            9. times-fracN/A

              \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
            10. metadata-evalN/A

              \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
            11. lower-*.f64N/A

              \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
            12. lower-/.f6479.1

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

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

            \[\leadsto n \cdot \color{blue}{\left(100 + i \cdot \left(50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right)\right)} \]
          9. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto n \cdot \color{blue}{\left(i \cdot \left(50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right) + 100\right)} \]
            2. lower-fma.f64N/A

              \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, 50 + i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right), 100\right)} \]
            3. +-commutativeN/A

              \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{i \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right) + 50}, 100\right) \]
            4. lower-fma.f64N/A

              \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \frac{50}{3} + \frac{25}{6} \cdot i, 50\right)}, 100\right) \]
            5. +-commutativeN/A

              \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\frac{25}{6} \cdot i + \frac{50}{3}}, 50\right), 100\right) \]
            6. *-commutativeN/A

              \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{i \cdot \frac{25}{6}} + \frac{50}{3}, 50\right), 100\right) \]
            7. lower-fma.f6459.2

              \[\leadsto n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right)}, 50\right), 100\right) \]
          10. Applied rewrites59.2%

            \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)} \]
          11. Add Preprocessing

          Alternative 11: 57.6% accurate, 8.1× speedup?

          \[\begin{array}{l} \\ n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right) \end{array} \]
          (FPCore (i n)
           :precision binary64
           (* n (fma i (fma i 16.666666666666668 50.0) 100.0)))
          double code(double i, double n) {
          	return n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0);
          }
          
          function code(i, n)
          	return Float64(n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0))
          end
          
          code[i_, n_] := N[(n * N[(i * N[(i * 16.666666666666668 + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)
          \end{array}
          
          Derivation
          1. Initial program 28.2%

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

            \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
          4. Step-by-step derivation
            1. associate-*r/N/A

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

              \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
            3. *-commutativeN/A

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

              \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
            5. lower-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
            6. lower-expm1.f6473.9

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

            \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
          6. Step-by-step derivation
            1. lift-expm1.f64N/A

              \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
            3. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
            4. associate-*l*N/A

              \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
            5. associate-/l*N/A

              \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
            6. lower-*.f64N/A

              \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
            7. *-commutativeN/A

              \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
            8. *-lft-identityN/A

              \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
            9. times-fracN/A

              \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
            10. metadata-evalN/A

              \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
            11. lower-*.f64N/A

              \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
            12. lower-/.f6479.1

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

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

            \[\leadsto n \cdot \color{blue}{\left(100 + i \cdot \left(50 + \frac{50}{3} \cdot i\right)\right)} \]
          9. Step-by-step derivation
            1. +-commutativeN/A

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

              \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, 50 + \frac{50}{3} \cdot i, 100\right)} \]
            3. +-commutativeN/A

              \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{\frac{50}{3} \cdot i + 50}, 100\right) \]
            4. *-commutativeN/A

              \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{i \cdot \frac{50}{3}} + 50, 100\right) \]
            5. lower-fma.f6457.3

              \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, 16.666666666666668, 50\right)}, 100\right) \]
          10. Applied rewrites57.3%

            \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)} \]
          11. Add Preprocessing

          Alternative 12: 55.0% accurate, 8.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq 1.55 \cdot 10^{+20}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;i \cdot \left(n \cdot 50\right)\\ \end{array} \end{array} \]
          (FPCore (i n)
           :precision binary64
           (if (<= i 1.55e+20) (* n 100.0) (* i (* n 50.0))))
          double code(double i, double n) {
          	double tmp;
          	if (i <= 1.55e+20) {
          		tmp = n * 100.0;
          	} else {
          		tmp = i * (n * 50.0);
          	}
          	return tmp;
          }
          
          real(8) function code(i, n)
              real(8), intent (in) :: i
              real(8), intent (in) :: n
              real(8) :: tmp
              if (i <= 1.55d+20) then
                  tmp = n * 100.0d0
              else
                  tmp = i * (n * 50.0d0)
              end if
              code = tmp
          end function
          
          public static double code(double i, double n) {
          	double tmp;
          	if (i <= 1.55e+20) {
          		tmp = n * 100.0;
          	} else {
          		tmp = i * (n * 50.0);
          	}
          	return tmp;
          }
          
          def code(i, n):
          	tmp = 0
          	if i <= 1.55e+20:
          		tmp = n * 100.0
          	else:
          		tmp = i * (n * 50.0)
          	return tmp
          
          function code(i, n)
          	tmp = 0.0
          	if (i <= 1.55e+20)
          		tmp = Float64(n * 100.0);
          	else
          		tmp = Float64(i * Float64(n * 50.0));
          	end
          	return tmp
          end
          
          function tmp_2 = code(i, n)
          	tmp = 0.0;
          	if (i <= 1.55e+20)
          		tmp = n * 100.0;
          	else
          		tmp = i * (n * 50.0);
          	end
          	tmp_2 = tmp;
          end
          
          code[i_, n_] := If[LessEqual[i, 1.55e+20], N[(n * 100.0), $MachinePrecision], N[(i * N[(n * 50.0), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;i \leq 1.55 \cdot 10^{+20}:\\
          \;\;\;\;n \cdot 100\\
          
          \mathbf{else}:\\
          \;\;\;\;i \cdot \left(n \cdot 50\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if i < 1.55e20

            1. Initial program 24.6%

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

              \[\leadsto \color{blue}{100 \cdot n} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{n \cdot 100} \]
              2. lower-*.f6461.4

                \[\leadsto \color{blue}{n \cdot 100} \]
            5. Applied rewrites61.4%

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

            if 1.55e20 < i

            1. Initial program 42.2%

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

              \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
            4. Step-by-step derivation
              1. associate-*r/N/A

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

                \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
              3. *-commutativeN/A

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

                \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
              5. lower-*.f64N/A

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

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

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

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

                \[\leadsto \frac{i \cdot \left(\color{blue}{\left(50 \cdot i\right) \cdot n} + 100 \cdot n\right)}{i} \]
              2. distribute-rgt-outN/A

                \[\leadsto \frac{i \cdot \color{blue}{\left(n \cdot \left(50 \cdot i + 100\right)\right)}}{i} \]
              3. metadata-evalN/A

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

                \[\leadsto \frac{i \cdot \left(n \cdot \left(\color{blue}{100 \cdot \left(\frac{1}{2} \cdot i\right)} + 100\right)\right)}{i} \]
              5. metadata-evalN/A

                \[\leadsto \frac{i \cdot \left(n \cdot \left(100 \cdot \left(\frac{1}{2} \cdot i\right) + \color{blue}{100 \cdot 1}\right)\right)}{i} \]
              6. distribute-lft-inN/A

                \[\leadsto \frac{i \cdot \left(n \cdot \color{blue}{\left(100 \cdot \left(\frac{1}{2} \cdot i + 1\right)\right)}\right)}{i} \]
              7. +-commutativeN/A

                \[\leadsto \frac{i \cdot \left(n \cdot \left(100 \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot i\right)}\right)\right)}{i} \]
              8. lower-*.f64N/A

                \[\leadsto \frac{\color{blue}{i \cdot \left(n \cdot \left(100 \cdot \left(1 + \frac{1}{2} \cdot i\right)\right)\right)}}{i} \]
              9. lower-*.f64N/A

                \[\leadsto \frac{i \cdot \color{blue}{\left(n \cdot \left(100 \cdot \left(1 + \frac{1}{2} \cdot i\right)\right)\right)}}{i} \]
              10. +-commutativeN/A

                \[\leadsto \frac{i \cdot \left(n \cdot \left(100 \cdot \color{blue}{\left(\frac{1}{2} \cdot i + 1\right)}\right)\right)}{i} \]
              11. distribute-lft-inN/A

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

                \[\leadsto \frac{i \cdot \left(n \cdot \left(\color{blue}{\left(100 \cdot \frac{1}{2}\right) \cdot i} + 100 \cdot 1\right)\right)}{i} \]
              13. metadata-evalN/A

                \[\leadsto \frac{i \cdot \left(n \cdot \left(\color{blue}{50} \cdot i + 100 \cdot 1\right)\right)}{i} \]
              14. metadata-evalN/A

                \[\leadsto \frac{i \cdot \left(n \cdot \left(50 \cdot i + \color{blue}{100}\right)\right)}{i} \]
              15. lower-fma.f6439.4

                \[\leadsto \frac{i \cdot \left(n \cdot \color{blue}{\mathsf{fma}\left(50, i, 100\right)}\right)}{i} \]
            8. Applied rewrites39.4%

              \[\leadsto \frac{\color{blue}{i \cdot \left(n \cdot \mathsf{fma}\left(50, i, 100\right)\right)}}{i} \]
            9. Taylor expanded in i around inf

              \[\leadsto \color{blue}{50 \cdot \left(i \cdot n\right)} \]
            10. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{\left(i \cdot n\right) \cdot 50} \]
              2. associate-*r*N/A

                \[\leadsto \color{blue}{i \cdot \left(n \cdot 50\right)} \]
              3. *-commutativeN/A

                \[\leadsto i \cdot \color{blue}{\left(50 \cdot n\right)} \]
              4. lower-*.f64N/A

                \[\leadsto \color{blue}{i \cdot \left(50 \cdot n\right)} \]
              5. *-commutativeN/A

                \[\leadsto i \cdot \color{blue}{\left(n \cdot 50\right)} \]
              6. lower-*.f6432.5

                \[\leadsto i \cdot \color{blue}{\left(n \cdot 50\right)} \]
            11. Applied rewrites32.5%

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

          Alternative 13: 55.1% accurate, 8.6× speedup?

          \[\begin{array}{l} \\ n \cdot \left(100 \cdot \mathsf{fma}\left(i, 0.5, 1\right)\right) \end{array} \]
          (FPCore (i n) :precision binary64 (* n (* 100.0 (fma i 0.5 1.0))))
          double code(double i, double n) {
          	return n * (100.0 * fma(i, 0.5, 1.0));
          }
          
          function code(i, n)
          	return Float64(n * Float64(100.0 * fma(i, 0.5, 1.0)))
          end
          
          code[i_, n_] := N[(n * N[(100.0 * N[(i * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          n \cdot \left(100 \cdot \mathsf{fma}\left(i, 0.5, 1\right)\right)
          \end{array}
          
          Derivation
          1. Initial program 28.2%

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

            \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
          4. Step-by-step derivation
            1. associate-*r/N/A

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

              \[\leadsto \color{blue}{\frac{100 \cdot \left(n \cdot \left(e^{i} - 1\right)\right)}{i}} \]
            3. *-commutativeN/A

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

              \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right) \cdot 100}}{i} \]
            5. lower-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(n \cdot \left(e^{i} - 1\right)\right)} \cdot 100}{i} \]
            6. lower-expm1.f6473.9

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

            \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
          6. Step-by-step derivation
            1. lift-expm1.f64N/A

              \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
            3. lift-*.f64N/A

              \[\leadsto \frac{\color{blue}{\left(n \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100}{i} \]
            4. associate-*l*N/A

              \[\leadsto \frac{\color{blue}{n \cdot \left(\mathsf{expm1}\left(i\right) \cdot 100\right)}}{i} \]
            5. associate-/l*N/A

              \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
            6. lower-*.f64N/A

              \[\leadsto \color{blue}{n \cdot \frac{\mathsf{expm1}\left(i\right) \cdot 100}{i}} \]
            7. *-commutativeN/A

              \[\leadsto n \cdot \frac{\color{blue}{100 \cdot \mathsf{expm1}\left(i\right)}}{i} \]
            8. *-lft-identityN/A

              \[\leadsto n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{\color{blue}{1 \cdot i}} \]
            9. times-fracN/A

              \[\leadsto n \cdot \color{blue}{\left(\frac{100}{1} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
            10. metadata-evalN/A

              \[\leadsto n \cdot \left(\color{blue}{100} \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right) \]
            11. lower-*.f64N/A

              \[\leadsto n \cdot \color{blue}{\left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)} \]
            12. lower-/.f6479.1

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

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

            \[\leadsto n \cdot \left(100 \cdot \color{blue}{\left(1 + \frac{1}{2} \cdot i\right)}\right) \]
          9. Step-by-step derivation
            1. +-commutativeN/A

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

              \[\leadsto n \cdot \left(100 \cdot \left(\color{blue}{i \cdot \frac{1}{2}} + 1\right)\right) \]
            3. lower-fma.f6456.1

              \[\leadsto n \cdot \left(100 \cdot \color{blue}{\mathsf{fma}\left(i, 0.5, 1\right)}\right) \]
          10. Applied rewrites56.1%

            \[\leadsto n \cdot \left(100 \cdot \color{blue}{\mathsf{fma}\left(i, 0.5, 1\right)}\right) \]
          11. Add Preprocessing

          Alternative 14: 55.1% accurate, 8.6× speedup?

          \[\begin{array}{l} \\ 100 \cdot \mathsf{fma}\left(n, i \cdot 0.5, n\right) \end{array} \]
          (FPCore (i n) :precision binary64 (* 100.0 (fma n (* i 0.5) n)))
          double code(double i, double n) {
          	return 100.0 * fma(n, (i * 0.5), n);
          }
          
          function code(i, n)
          	return Float64(100.0 * fma(n, Float64(i * 0.5), n))
          end
          
          code[i_, n_] := N[(100.0 * N[(n * N[(i * 0.5), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          100 \cdot \mathsf{fma}\left(n, i \cdot 0.5, n\right)
          \end{array}
          
          Derivation
          1. Initial program 28.2%

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

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

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

              \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{fma}\left(i, 1 + i \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}\right), 1\right)} - 1}{\frac{i}{n}} \]
            3. +-commutativeN/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \color{blue}{i \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}\right) + 1}, 1\right) - 1}{\frac{i}{n}} \]
            4. lower-fma.f64N/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}, 1\right)}, 1\right) - 1}{\frac{i}{n}} \]
            5. lower--.f64N/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
            6. associate-*r/N/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \frac{1}{2} - \color{blue}{\frac{\frac{1}{2} \cdot 1}{n}}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
            7. metadata-evalN/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \frac{1}{2} - \frac{\color{blue}{\frac{1}{2}}}{n}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
            8. lower-/.f6410.9

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.5 - \color{blue}{\frac{0.5}{n}}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
          5. Applied rewrites10.9%

            \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.5 - \frac{0.5}{n}, 1\right), 1\right)} - 1}{\frac{i}{n}} \]
          6. Taylor expanded in n around inf

            \[\leadsto 100 \cdot \color{blue}{\left(n \cdot \left(1 + \frac{1}{2} \cdot i\right)\right)} \]
          7. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto 100 \cdot \left(n \cdot \color{blue}{\left(\frac{1}{2} \cdot i + 1\right)}\right) \]
            2. distribute-lft-inN/A

              \[\leadsto 100 \cdot \color{blue}{\left(n \cdot \left(\frac{1}{2} \cdot i\right) + n \cdot 1\right)} \]
            3. *-rgt-identityN/A

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

              \[\leadsto 100 \cdot \color{blue}{\mathsf{fma}\left(n, \frac{1}{2} \cdot i, n\right)} \]
            5. *-commutativeN/A

              \[\leadsto 100 \cdot \mathsf{fma}\left(n, \color{blue}{i \cdot \frac{1}{2}}, n\right) \]
            6. lower-*.f6456.1

              \[\leadsto 100 \cdot \mathsf{fma}\left(n, \color{blue}{i \cdot 0.5}, n\right) \]
          8. Applied rewrites56.1%

            \[\leadsto 100 \cdot \color{blue}{\mathsf{fma}\left(n, i \cdot 0.5, n\right)} \]
          9. Add Preprocessing

          Alternative 15: 55.1% accurate, 12.2× speedup?

          \[\begin{array}{l} \\ n \cdot \mathsf{fma}\left(50, i, 100\right) \end{array} \]
          (FPCore (i n) :precision binary64 (* n (fma 50.0 i 100.0)))
          double code(double i, double n) {
          	return n * fma(50.0, i, 100.0);
          }
          
          function code(i, n)
          	return Float64(n * fma(50.0, i, 100.0))
          end
          
          code[i_, n_] := N[(n * N[(50.0 * i + 100.0), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          n \cdot \mathsf{fma}\left(50, i, 100\right)
          \end{array}
          
          Derivation
          1. Initial program 28.2%

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

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

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

              \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{fma}\left(i, 1 + i \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}\right), 1\right)} - 1}{\frac{i}{n}} \]
            3. +-commutativeN/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \color{blue}{i \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}\right) + 1}, 1\right) - 1}{\frac{i}{n}} \]
            4. lower-fma.f64N/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}, 1\right)}, 1\right) - 1}{\frac{i}{n}} \]
            5. lower--.f64N/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
            6. associate-*r/N/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \frac{1}{2} - \color{blue}{\frac{\frac{1}{2} \cdot 1}{n}}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
            7. metadata-evalN/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \frac{1}{2} - \frac{\color{blue}{\frac{1}{2}}}{n}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
            8. lower-/.f6410.9

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.5 - \color{blue}{\frac{0.5}{n}}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
          5. Applied rewrites10.9%

            \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.5 - \frac{0.5}{n}, 1\right), 1\right)} - 1}{\frac{i}{n}} \]
          6. Taylor expanded in n around inf

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

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

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

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

              \[\leadsto \color{blue}{n \cdot \left(100 \cdot \left(1 + \frac{1}{2} \cdot i\right)\right)} \]
            5. +-commutativeN/A

              \[\leadsto n \cdot \left(100 \cdot \color{blue}{\left(\frac{1}{2} \cdot i + 1\right)}\right) \]
            6. distribute-lft-inN/A

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

              \[\leadsto n \cdot \left(\color{blue}{\left(100 \cdot \frac{1}{2}\right) \cdot i} + 100 \cdot 1\right) \]
            8. metadata-evalN/A

              \[\leadsto n \cdot \left(\color{blue}{50} \cdot i + 100 \cdot 1\right) \]
            9. metadata-evalN/A

              \[\leadsto n \cdot \left(50 \cdot i + \color{blue}{100}\right) \]
            10. lower-fma.f6456.1

              \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(50, i, 100\right)} \]
          8. Applied rewrites56.1%

            \[\leadsto \color{blue}{n \cdot \mathsf{fma}\left(50, i, 100\right)} \]
          9. Add Preprocessing

          Alternative 16: 49.8% accurate, 24.3× 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 28.2%

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

            \[\leadsto \color{blue}{100 \cdot n} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{n \cdot 100} \]
            2. lower-*.f6449.7

              \[\leadsto \color{blue}{n \cdot 100} \]
          5. Applied rewrites49.7%

            \[\leadsto \color{blue}{n \cdot 100} \]
          6. Add Preprocessing

          Alternative 17: 2.8% accurate, 24.3× 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 28.2%

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

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

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

              \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{fma}\left(i, 1 + i \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}\right), 1\right)} - 1}{\frac{i}{n}} \]
            3. +-commutativeN/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \color{blue}{i \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}\right) + 1}, 1\right) - 1}{\frac{i}{n}} \]
            4. lower-fma.f64N/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}, 1\right)}, 1\right) - 1}{\frac{i}{n}} \]
            5. lower--.f64N/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
            6. associate-*r/N/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \frac{1}{2} - \color{blue}{\frac{\frac{1}{2} \cdot 1}{n}}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
            7. metadata-evalN/A

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, \frac{1}{2} - \frac{\color{blue}{\frac{1}{2}}}{n}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
            8. lower-/.f6410.9

              \[\leadsto 100 \cdot \frac{\mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.5 - \color{blue}{\frac{0.5}{n}}, 1\right), 1\right) - 1}{\frac{i}{n}} \]
          5. Applied rewrites10.9%

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

            \[\leadsto \color{blue}{-50 \cdot i} \]
          7. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{i \cdot -50} \]
            2. lower-*.f642.7

              \[\leadsto \color{blue}{i \cdot -50} \]
          8. Applied rewrites2.7%

            \[\leadsto \color{blue}{i \cdot -50} \]
          9. Add Preprocessing

          Developer Target 1: 34.3% 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 2024220 
          (FPCore (i n)
            :name "Compound Interest"
            :precision binary64
          
            :alt
            (! :herbie-platform default (let ((lnbase (if (== (+ 1 (/ i n)) 1) (/ i n) (/ (* (/ i n) (log (+ 1 (/ i n)))) (- (+ (/ i n) 1) 1))))) (* 100 (/ (- (exp (* n lnbase)) 1) (/ i n)))))
          
            (* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))