Compound Interest

Percentage Accurate: 28.5% → 95.9%
Time: 14.3s
Alternatives: 13
Speedup: 8.1×

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 13 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.5% 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.9% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 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 or -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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
      2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left({\left(1 + \frac{i}{n}\right)}^{n}, 100, \color{blue}{-100}\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 -inf.0 < (/.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 25.3%

      \[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{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} - 1}}{\frac{i}{n}} \]
      2. lift-pow.f64N/A

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

        \[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}} \]
      4. 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}} \]
      5. *-commutativeN/A

        \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
      6. 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}} \]
      7. 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}} \]
      8. lower-log1p.f6499.6

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

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

    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-*.f6478.1

        \[\leadsto \color{blue}{n \cdot 100} \]
    5. Applied rewrites78.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq -\infty:\\ \;\;\;\;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:\\ \;\;\;\;n \cdot \frac{\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: 81.8% accurate, 0.6× 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 -1.25 \cdot 10^{-197}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 6.2 \cdot 10^{-267}:\\ \;\;\;\;0\\ \mathbf{elif}\;n \leq 4 \cdot 10^{-91}:\\ \;\;\;\;n \cdot \frac{\left(n \cdot 100\right) \cdot \left(\log i - \log n\right)}{i}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (let* ((t_0 (* n (* 100.0 (/ (expm1 i) i)))))
   (if (<= n -1.25e-197)
     t_0
     (if (<= n 6.2e-267)
       0.0
       (if (<= n 4e-91)
         (* n (/ (* (* n 100.0) (- (log i) (log n))) i))
         t_0)))))
double code(double i, double n) {
	double t_0 = n * (100.0 * (expm1(i) / i));
	double tmp;
	if (n <= -1.25e-197) {
		tmp = t_0;
	} else if (n <= 6.2e-267) {
		tmp = 0.0;
	} else if (n <= 4e-91) {
		tmp = n * (((n * 100.0) * (log(i) - log(n))) / i);
	} 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 <= -1.25e-197) {
		tmp = t_0;
	} else if (n <= 6.2e-267) {
		tmp = 0.0;
	} else if (n <= 4e-91) {
		tmp = n * (((n * 100.0) * (Math.log(i) - Math.log(n))) / i);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(i, n):
	t_0 = n * (100.0 * (math.expm1(i) / i))
	tmp = 0
	if n <= -1.25e-197:
		tmp = t_0
	elif n <= 6.2e-267:
		tmp = 0.0
	elif n <= 4e-91:
		tmp = n * (((n * 100.0) * (math.log(i) - math.log(n))) / i)
	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 <= -1.25e-197)
		tmp = t_0;
	elseif (n <= 6.2e-267)
		tmp = 0.0;
	elseif (n <= 4e-91)
		tmp = Float64(n * Float64(Float64(Float64(n * 100.0) * Float64(log(i) - log(n))) / i));
	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, -1.25e-197], t$95$0, If[LessEqual[n, 6.2e-267], 0.0, If[LessEqual[n, 4e-91], N[(n * N[(N[(N[(n * 100.0), $MachinePrecision] * N[(N[Log[i], $MachinePrecision] - N[Log[n], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $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 -1.25 \cdot 10^{-197}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;n \leq 6.2 \cdot 10^{-267}:\\
\;\;\;\;0\\

\mathbf{elif}\;n \leq 4 \cdot 10^{-91}:\\
\;\;\;\;n \cdot \frac{\left(n \cdot 100\right) \cdot \left(\log i - \log n\right)}{i}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < -1.2500000000000001e-197 or 4.00000000000000009e-91 < n

    1. Initial program 23.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
      2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{100 \cdot e^{i} - 100}{i}} \cdot n \]
    6. Step-by-step derivation
      1. div-subN/A

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

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

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

        \[\leadsto \left(100 \cdot \frac{e^{i}}{i} - \color{blue}{100 \cdot \frac{1}{i}}\right) \cdot n \]
      5. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

      if -1.2500000000000001e-197 < n < 6.2000000000000002e-267

      1. Initial program 80.7%

        \[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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
        2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
        12. associate-*l/N/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
        16. distribute-neg-fracN/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
      6. Step-by-step derivation
        1. distribute-rgt-outN/A

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

          \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
        3. mul0-rgtN/A

          \[\leadsto \frac{\color{blue}{0}}{i} \]
        4. lower-/.f6490.7

          \[\leadsto \color{blue}{\frac{0}{i}} \]
      7. Applied rewrites90.7%

        \[\leadsto \color{blue}{\frac{0}{i}} \]
      8. Taylor expanded in i around 0

        \[\leadsto 0 \]
      9. Step-by-step derivation
        1. Applied rewrites90.7%

          \[\leadsto 0 \]

        if 6.2000000000000002e-267 < n < 4.00000000000000009e-91

        1. Initial program 23.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
          2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\left(n \cdot 100\right) \cdot \left(\log i + \color{blue}{\left(\mathsf{neg}\left(\log n\right)\right)}\right)}{i} \cdot n \]
          6. unsub-negN/A

            \[\leadsto \frac{\left(n \cdot 100\right) \cdot \color{blue}{\left(\log i - \log n\right)}}{i} \cdot n \]
          7. lower--.f64N/A

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

            \[\leadsto \frac{\left(n \cdot 100\right) \cdot \left(\color{blue}{\log i} - \log n\right)}{i} \cdot n \]
          9. lower-log.f6482.7

            \[\leadsto \frac{\left(n \cdot 100\right) \cdot \left(\log i - \color{blue}{\log n}\right)}{i} \cdot n \]
        7. Applied rewrites82.7%

          \[\leadsto \frac{\color{blue}{\left(n \cdot 100\right) \cdot \left(\log i - \log n\right)}}{i} \cdot n \]
      10. Recombined 3 regimes into one program.
      11. Final simplification85.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.25 \cdot 10^{-197}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{elif}\;n \leq 6.2 \cdot 10^{-267}:\\ \;\;\;\;0\\ \mathbf{elif}\;n \leq 4 \cdot 10^{-91}:\\ \;\;\;\;n \cdot \frac{\left(n \cdot 100\right) \cdot \left(\log i - \log n\right)}{i}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \end{array} \]
      12. Add Preprocessing

      Alternative 3: 81.2% accurate, 0.6× 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 -1.25 \cdot 10^{-197}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 4.8 \cdot 10^{-170}:\\ \;\;\;\;100 \cdot \frac{1 + -1}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 4 \cdot 10^{-91}:\\ \;\;\;\;\frac{\left(\log i - \log n\right) \cdot \left(100 \cdot \left(n \cdot n\right)\right)}{i}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (i n)
       :precision binary64
       (let* ((t_0 (* n (* 100.0 (/ (expm1 i) i)))))
         (if (<= n -1.25e-197)
           t_0
           (if (<= n 4.8e-170)
             (* 100.0 (/ (+ 1.0 -1.0) (/ i n)))
             (if (<= n 4e-91)
               (/ (* (- (log i) (log n)) (* 100.0 (* n n))) i)
               t_0)))))
      double code(double i, double n) {
      	double t_0 = n * (100.0 * (expm1(i) / i));
      	double tmp;
      	if (n <= -1.25e-197) {
      		tmp = t_0;
      	} else if (n <= 4.8e-170) {
      		tmp = 100.0 * ((1.0 + -1.0) / (i / n));
      	} else if (n <= 4e-91) {
      		tmp = ((log(i) - log(n)) * (100.0 * (n * n))) / i;
      	} 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 <= -1.25e-197) {
      		tmp = t_0;
      	} else if (n <= 4.8e-170) {
      		tmp = 100.0 * ((1.0 + -1.0) / (i / n));
      	} else if (n <= 4e-91) {
      		tmp = ((Math.log(i) - Math.log(n)) * (100.0 * (n * n))) / i;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(i, n):
      	t_0 = n * (100.0 * (math.expm1(i) / i))
      	tmp = 0
      	if n <= -1.25e-197:
      		tmp = t_0
      	elif n <= 4.8e-170:
      		tmp = 100.0 * ((1.0 + -1.0) / (i / n))
      	elif n <= 4e-91:
      		tmp = ((math.log(i) - math.log(n)) * (100.0 * (n * n))) / i
      	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 <= -1.25e-197)
      		tmp = t_0;
      	elseif (n <= 4.8e-170)
      		tmp = Float64(100.0 * Float64(Float64(1.0 + -1.0) / Float64(i / n)));
      	elseif (n <= 4e-91)
      		tmp = Float64(Float64(Float64(log(i) - log(n)) * Float64(100.0 * Float64(n * n))) / i);
      	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, -1.25e-197], t$95$0, If[LessEqual[n, 4.8e-170], N[(100.0 * N[(N[(1.0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4e-91], N[(N[(N[(N[Log[i], $MachinePrecision] - N[Log[n], $MachinePrecision]), $MachinePrecision] * N[(100.0 * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $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 -1.25 \cdot 10^{-197}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;n \leq 4.8 \cdot 10^{-170}:\\
      \;\;\;\;100 \cdot \frac{1 + -1}{\frac{i}{n}}\\
      
      \mathbf{elif}\;n \leq 4 \cdot 10^{-91}:\\
      \;\;\;\;\frac{\left(\log i - \log n\right) \cdot \left(100 \cdot \left(n \cdot n\right)\right)}{i}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if n < -1.2500000000000001e-197 or 4.00000000000000009e-91 < n

        1. Initial program 23.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
          2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{100 \cdot e^{i} - 100}{i}} \cdot n \]
        6. Step-by-step derivation
          1. div-subN/A

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

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

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

            \[\leadsto \left(100 \cdot \frac{e^{i}}{i} - \color{blue}{100 \cdot \frac{1}{i}}\right) \cdot n \]
          5. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

          if -1.2500000000000001e-197 < n < 4.7999999999999999e-170

          1. Initial program 58.1%

            \[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}{1} - 1}{\frac{i}{n}} \]
          4. Step-by-step derivation
            1. Applied rewrites79.7%

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

            if 4.7999999999999999e-170 < n < 4.00000000000000009e-91

            1. Initial program 12.2%

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\left(100 \cdot \left(n \cdot n\right)\right) \cdot \left(\log i + \color{blue}{\left(\mathsf{neg}\left(\log n\right)\right)}\right)}{i} \]
              9. unsub-negN/A

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

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

                \[\leadsto \frac{\left(100 \cdot \left(n \cdot n\right)\right) \cdot \left(\color{blue}{\log i} - \log n\right)}{i} \]
              12. lower-log.f6475.1

                \[\leadsto \frac{\left(100 \cdot \left(n \cdot n\right)\right) \cdot \left(\log i - \color{blue}{\log n}\right)}{i} \]
            5. Applied rewrites75.1%

              \[\leadsto \color{blue}{\frac{\left(100 \cdot \left(n \cdot n\right)\right) \cdot \left(\log i - \log n\right)}{i}} \]
          5. Recombined 3 regimes into one program.
          6. Final simplification83.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.25 \cdot 10^{-197}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{elif}\;n \leq 4.8 \cdot 10^{-170}:\\ \;\;\;\;100 \cdot \frac{1 + -1}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 4 \cdot 10^{-91}:\\ \;\;\;\;\frac{\left(\log i - \log n\right) \cdot \left(100 \cdot \left(n \cdot n\right)\right)}{i}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \end{array} \]
          7. Add Preprocessing

          Alternative 4: 80.4% accurate, 1.1× 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 -1.25 \cdot 10^{-197}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (i n)
           :precision binary64
           (let* ((t_0 (* n (* 100.0 (/ (expm1 i) i)))))
             (if (<= n -1.25e-197) t_0 (if (<= n 2.45e-91) 0.0 t_0))))
          double code(double i, double n) {
          	double t_0 = n * (100.0 * (expm1(i) / i));
          	double tmp;
          	if (n <= -1.25e-197) {
          		tmp = t_0;
          	} else if (n <= 2.45e-91) {
          		tmp = 0.0;
          	} 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 <= -1.25e-197) {
          		tmp = t_0;
          	} else if (n <= 2.45e-91) {
          		tmp = 0.0;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          def code(i, n):
          	t_0 = n * (100.0 * (math.expm1(i) / i))
          	tmp = 0
          	if n <= -1.25e-197:
          		tmp = t_0
          	elif n <= 2.45e-91:
          		tmp = 0.0
          	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 <= -1.25e-197)
          		tmp = t_0;
          	elseif (n <= 2.45e-91)
          		tmp = 0.0;
          	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, -1.25e-197], t$95$0, If[LessEqual[n, 2.45e-91], 0.0, 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 -1.25 \cdot 10^{-197}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\
          \;\;\;\;0\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if n < -1.2500000000000001e-197 or 2.4499999999999999e-91 < n

            1. Initial program 23.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
              2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{100 \cdot e^{i} - 100}{i}} \cdot n \]
            6. Step-by-step derivation
              1. div-subN/A

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

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

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

                \[\leadsto \left(100 \cdot \frac{e^{i}}{i} - \color{blue}{100 \cdot \frac{1}{i}}\right) \cdot n \]
              5. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

              if -1.2500000000000001e-197 < n < 2.4499999999999999e-91

              1. Initial program 46.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
                12. associate-*l/N/A

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

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
                16. distribute-neg-fracN/A

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

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

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

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

                \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
              6. Step-by-step derivation
                1. distribute-rgt-outN/A

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

                  \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
                3. mul0-rgtN/A

                  \[\leadsto \frac{\color{blue}{0}}{i} \]
                4. lower-/.f6469.3

                  \[\leadsto \color{blue}{\frac{0}{i}} \]
              7. Applied rewrites69.3%

                \[\leadsto \color{blue}{\frac{0}{i}} \]
              8. Taylor expanded in i around 0

                \[\leadsto 0 \]
              9. Step-by-step derivation
                1. Applied rewrites69.3%

                  \[\leadsto 0 \]
              10. Recombined 2 regimes into one program.
              11. Final simplification82.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.25 \cdot 10^{-197}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \end{array} \]
              12. Add Preprocessing

              Alternative 5: 77.7% 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.12 \cdot 10^{-92}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \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.12e-92) t_0 (if (<= n 2.45e-91) 0.0 t_0))))
              double code(double i, double n) {
              	double t_0 = 100.0 * ((n * expm1(i)) / i);
              	double tmp;
              	if (n <= -1.12e-92) {
              		tmp = t_0;
              	} else if (n <= 2.45e-91) {
              		tmp = 0.0;
              	} 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.12e-92) {
              		tmp = t_0;
              	} else if (n <= 2.45e-91) {
              		tmp = 0.0;
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(i, n):
              	t_0 = 100.0 * ((n * math.expm1(i)) / i)
              	tmp = 0
              	if n <= -1.12e-92:
              		tmp = t_0
              	elif n <= 2.45e-91:
              		tmp = 0.0
              	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.12e-92)
              		tmp = t_0;
              	elseif (n <= 2.45e-91)
              		tmp = 0.0;
              	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.12e-92], t$95$0, If[LessEqual[n, 2.45e-91], 0.0, 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.12 \cdot 10^{-92}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\
              \;\;\;\;0\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if n < -1.11999999999999999e-92 or 2.4499999999999999e-91 < n

                1. Initial program 20.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 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.f6486.2

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

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

                if -1.11999999999999999e-92 < n < 2.4499999999999999e-91

                1. Initial program 47.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                  2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
                  12. associate-*l/N/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
                  16. distribute-neg-fracN/A

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

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

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

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

                  \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
                6. Step-by-step derivation
                  1. distribute-rgt-outN/A

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

                    \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
                  3. mul0-rgtN/A

                    \[\leadsto \frac{\color{blue}{0}}{i} \]
                  4. lower-/.f6463.4

                    \[\leadsto \color{blue}{\frac{0}{i}} \]
                7. Applied rewrites63.4%

                  \[\leadsto \color{blue}{\frac{0}{i}} \]
                8. Taylor expanded in i around 0

                  \[\leadsto 0 \]
                9. Step-by-step derivation
                  1. Applied rewrites63.4%

                    \[\leadsto 0 \]
                10. Recombined 2 regimes into one program.
                11. Add Preprocessing

                Alternative 6: 77.5% accurate, 1.1× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{100 \cdot \left(n \cdot \mathsf{expm1}\left(i\right)\right)}{i}\\ \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \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.12e-92) t_0 (if (<= n 2.45e-91) 0.0 t_0))))
                double code(double i, double n) {
                	double t_0 = (100.0 * (n * expm1(i))) / i;
                	double tmp;
                	if (n <= -1.12e-92) {
                		tmp = t_0;
                	} else if (n <= 2.45e-91) {
                		tmp = 0.0;
                	} 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.12e-92) {
                		tmp = t_0;
                	} else if (n <= 2.45e-91) {
                		tmp = 0.0;
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(i, n):
                	t_0 = (100.0 * (n * math.expm1(i))) / i
                	tmp = 0
                	if n <= -1.12e-92:
                		tmp = t_0
                	elif n <= 2.45e-91:
                		tmp = 0.0
                	else:
                		tmp = t_0
                	return tmp
                
                function code(i, n)
                	t_0 = Float64(Float64(100.0 * Float64(n * expm1(i))) / i)
                	tmp = 0.0
                	if (n <= -1.12e-92)
                		tmp = t_0;
                	elseif (n <= 2.45e-91)
                		tmp = 0.0;
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                code[i_, n_] := Block[{t$95$0 = N[(N[(100.0 * N[(n * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]}, If[LessEqual[n, -1.12e-92], t$95$0, If[LessEqual[n, 2.45e-91], 0.0, t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \frac{100 \cdot \left(n \cdot \mathsf{expm1}\left(i\right)\right)}{i}\\
                \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\
                \;\;\;\;0\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if n < -1.11999999999999999e-92 or 2.4499999999999999e-91 < n

                  1. Initial program 20.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.f6485.5

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

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

                  if -1.11999999999999999e-92 < n < 2.4499999999999999e-91

                  1. Initial program 47.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                    2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
                    12. associate-*l/N/A

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

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

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

                      \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
                    16. distribute-neg-fracN/A

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

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

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

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

                    \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
                  6. Step-by-step derivation
                    1. distribute-rgt-outN/A

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

                      \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
                    3. mul0-rgtN/A

                      \[\leadsto \frac{\color{blue}{0}}{i} \]
                    4. lower-/.f6463.4

                      \[\leadsto \color{blue}{\frac{0}{i}} \]
                  7. Applied rewrites63.4%

                    \[\leadsto \color{blue}{\frac{0}{i}} \]
                  8. Taylor expanded in i around 0

                    \[\leadsto 0 \]
                  9. Step-by-step derivation
                    1. Applied rewrites63.4%

                      \[\leadsto 0 \]
                  10. Recombined 2 regimes into one program.
                  11. Final simplification79.7%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\ \;\;\;\;\frac{100 \cdot \left(n \cdot \mathsf{expm1}\left(i\right)\right)}{i}\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{100 \cdot \left(n \cdot \mathsf{expm1}\left(i\right)\right)}{i}\\ \end{array} \]
                  12. Add Preprocessing

                  Alternative 7: 64.5% accurate, 2.4× speedup?

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

                    1. Initial program 20.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.f6485.5

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

                      \[\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(i \cdot \left(n + i \cdot \left(\frac{1}{2} \cdot n + i \cdot \left(\frac{1}{24} \cdot \left(i \cdot n\right) + \frac{1}{6} \cdot n\right)\right)\right)\right) \cdot 100}{i} \]
                    7. Step-by-step derivation
                      1. Applied rewrites68.4%

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

                      if -1.15000000000000008e-92 < n < 2.4499999999999999e-91

                      1. Initial program 47.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                        2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
                        12. associate-*l/N/A

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

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
                        16. distribute-neg-fracN/A

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

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

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

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

                        \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
                      6. Step-by-step derivation
                        1. distribute-rgt-outN/A

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

                          \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
                        3. mul0-rgtN/A

                          \[\leadsto \frac{\color{blue}{0}}{i} \]
                        4. lower-/.f6463.4

                          \[\leadsto \color{blue}{\frac{0}{i}} \]
                      7. Applied rewrites63.4%

                        \[\leadsto \color{blue}{\frac{0}{i}} \]
                      8. Taylor expanded in i around 0

                        \[\leadsto 0 \]
                      9. Step-by-step derivation
                        1. Applied rewrites63.4%

                          \[\leadsto 0 \]
                      10. Recombined 2 regimes into one program.
                      11. Final simplification67.1%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.15 \cdot 10^{-92}:\\ \;\;\;\;\frac{100 \cdot \left(i \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(n, 0.5, i \cdot \left(n \cdot \mathsf{fma}\left(0.041666666666666664, i, 0.16666666666666666\right)\right)\right), n\right)\right)}{i}\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{100 \cdot \left(i \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(n, 0.5, i \cdot \left(n \cdot \mathsf{fma}\left(0.041666666666666664, i, 0.16666666666666666\right)\right)\right), n\right)\right)}{i}\\ \end{array} \]
                      12. Add Preprocessing

                      Alternative 8: 65.1% accurate, 4.1× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \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} \end{array} \]
                      (FPCore (i n)
                       :precision binary64
                       (if (<= n -1.12e-92)
                         (* n (fma i (fma i 16.666666666666668 50.0) 100.0))
                         (if (<= n 2.45e-91)
                           0.0
                           (*
                            n
                            (fma
                             i
                             (fma i (fma i 4.166666666666667 16.666666666666668) 50.0)
                             100.0)))))
                      double code(double i, double n) {
                      	double tmp;
                      	if (n <= -1.12e-92) {
                      		tmp = n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0);
                      	} else if (n <= 2.45e-91) {
                      		tmp = 0.0;
                      	} else {
                      		tmp = n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0);
                      	}
                      	return tmp;
                      }
                      
                      function code(i, n)
                      	tmp = 0.0
                      	if (n <= -1.12e-92)
                      		tmp = Float64(n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0));
                      	elseif (n <= 2.45e-91)
                      		tmp = 0.0;
                      	else
                      		tmp = Float64(n * fma(i, fma(i, fma(i, 4.166666666666667, 16.666666666666668), 50.0), 100.0));
                      	end
                      	return tmp
                      end
                      
                      code[i_, n_] := If[LessEqual[n, -1.12e-92], N[(n * N[(i * N[(i * 16.666666666666668 + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.45e-91], 0.0, N[(n * N[(i * N[(i * N[(i * 4.166666666666667 + 16.666666666666668), $MachinePrecision] + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\
                      \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\
                      
                      \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\
                      \;\;\;\;0\\
                      
                      \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}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if n < -1.11999999999999999e-92

                        1. Initial program 24.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                          2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\frac{100 \cdot e^{i} - 100}{i}} \cdot n \]
                        6. Step-by-step derivation
                          1. div-subN/A

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

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

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

                            \[\leadsto \left(100 \cdot \frac{e^{i}}{i} - \color{blue}{100 \cdot \frac{1}{i}}\right) \cdot n \]
                          5. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

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

                          if -1.11999999999999999e-92 < n < 2.4499999999999999e-91

                          1. Initial program 47.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                            2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
                            12. associate-*l/N/A

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

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

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

                              \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
                            16. distribute-neg-fracN/A

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

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

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

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

                            \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
                          6. Step-by-step derivation
                            1. distribute-rgt-outN/A

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

                              \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
                            3. mul0-rgtN/A

                              \[\leadsto \frac{\color{blue}{0}}{i} \]
                            4. lower-/.f6463.4

                              \[\leadsto \color{blue}{\frac{0}{i}} \]
                          7. Applied rewrites63.4%

                            \[\leadsto \color{blue}{\frac{0}{i}} \]
                          8. Taylor expanded in i around 0

                            \[\leadsto 0 \]
                          9. Step-by-step derivation
                            1. Applied rewrites63.4%

                              \[\leadsto 0 \]

                            if 2.4499999999999999e-91 < n

                            1. Initial program 17.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                              2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\frac{100 \cdot e^{i} - 100}{i}} \cdot n \]
                            6. Step-by-step derivation
                              1. div-subN/A

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

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

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

                                \[\leadsto \left(100 \cdot \frac{e^{i}}{i} - \color{blue}{100 \cdot \frac{1}{i}}\right) \cdot n \]
                              5. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \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} \]
                            12. Add Preprocessing

                            Alternative 9: 63.5% accurate, 4.2× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left(n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.16666666666666666, 0.5\right), 1\right)\right)\\ \end{array} \end{array} \]
                            (FPCore (i n)
                             :precision binary64
                             (if (<= n -1.12e-92)
                               (* n (fma i (fma i 16.666666666666668 50.0) 100.0))
                               (if (<= n 2.45e-91)
                                 0.0
                                 (* 100.0 (* n (fma i (fma i 0.16666666666666666 0.5) 1.0))))))
                            double code(double i, double n) {
                            	double tmp;
                            	if (n <= -1.12e-92) {
                            		tmp = n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0);
                            	} else if (n <= 2.45e-91) {
                            		tmp = 0.0;
                            	} else {
                            		tmp = 100.0 * (n * fma(i, fma(i, 0.16666666666666666, 0.5), 1.0));
                            	}
                            	return tmp;
                            }
                            
                            function code(i, n)
                            	tmp = 0.0
                            	if (n <= -1.12e-92)
                            		tmp = Float64(n * fma(i, fma(i, 16.666666666666668, 50.0), 100.0));
                            	elseif (n <= 2.45e-91)
                            		tmp = 0.0;
                            	else
                            		tmp = Float64(100.0 * Float64(n * fma(i, fma(i, 0.16666666666666666, 0.5), 1.0)));
                            	end
                            	return tmp
                            end
                            
                            code[i_, n_] := If[LessEqual[n, -1.12e-92], N[(n * N[(i * N[(i * 16.666666666666668 + 50.0), $MachinePrecision] + 100.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.45e-91], 0.0, N[(100.0 * N[(n * N[(i * N[(i * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\
                            \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\
                            
                            \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\
                            \;\;\;\;0\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;100 \cdot \left(n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.16666666666666666, 0.5\right), 1\right)\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if n < -1.11999999999999999e-92

                              1. Initial program 24.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \color{blue}{\frac{100 \cdot e^{i} - 100}{i}} \cdot n \]
                              6. Step-by-step derivation
                                1. div-subN/A

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

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

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

                                  \[\leadsto \left(100 \cdot \frac{e^{i}}{i} - \color{blue}{100 \cdot \frac{1}{i}}\right) \cdot n \]
                                5. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

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

                                if -1.11999999999999999e-92 < n < 2.4499999999999999e-91

                                1. Initial program 47.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                  2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
                                  12. associate-*l/N/A

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
                                  16. distribute-neg-fracN/A

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

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

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

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

                                  \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
                                6. Step-by-step derivation
                                  1. distribute-rgt-outN/A

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

                                    \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
                                  3. mul0-rgtN/A

                                    \[\leadsto \frac{\color{blue}{0}}{i} \]
                                  4. lower-/.f6463.4

                                    \[\leadsto \color{blue}{\frac{0}{i}} \]
                                7. Applied rewrites63.4%

                                  \[\leadsto \color{blue}{\frac{0}{i}} \]
                                8. Taylor expanded in i around 0

                                  \[\leadsto 0 \]
                                9. Step-by-step derivation
                                  1. Applied rewrites63.4%

                                    \[\leadsto 0 \]

                                  if 2.4499999999999999e-91 < n

                                  1. Initial program 17.5%

                                    \[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 \color{blue}{\left(n + i \cdot \left(i \cdot \left(n \cdot \left(\left(\frac{1}{6} + \frac{1}{3} \cdot \frac{1}{{n}^{2}}\right) - \frac{1}{2} \cdot \frac{1}{n}\right)\right) + n \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}\right)\right)\right)} \]
                                  4. Step-by-step derivation
                                    1. +-commutativeN/A

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

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

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

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

                                      \[\leadsto 100 \cdot \left(n \cdot \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.16666666666666666, 0.5\right), 1\right)}\right) \]
                                  8. Recombined 3 regimes into one program.
                                  9. Final simplification64.4%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left(n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.16666666666666666, 0.5\right), 1\right)\right)\\ \end{array} \]
                                  10. Add Preprocessing

                                  Alternative 10: 63.5% accurate, 4.9× speedup?

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

                                    1. Initial program 20.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                      2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{\frac{100 \cdot e^{i} - 100}{i}} \cdot n \]
                                    6. Step-by-step derivation
                                      1. div-subN/A

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

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

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

                                        \[\leadsto \left(100 \cdot \frac{e^{i}}{i} - \color{blue}{100 \cdot \frac{1}{i}}\right) \cdot n \]
                                      5. distribute-lft-out--N/A

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

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

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

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

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

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

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

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

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

                                      if -1.11999999999999999e-92 < n < 2.4499999999999999e-91

                                      1. Initial program 47.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                        2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
                                        12. associate-*l/N/A

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
                                        16. distribute-neg-fracN/A

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

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

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

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

                                        \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
                                      6. Step-by-step derivation
                                        1. distribute-rgt-outN/A

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

                                          \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
                                        3. mul0-rgtN/A

                                          \[\leadsto \frac{\color{blue}{0}}{i} \]
                                        4. lower-/.f6463.4

                                          \[\leadsto \color{blue}{\frac{0}{i}} \]
                                      7. Applied rewrites63.4%

                                        \[\leadsto \color{blue}{\frac{0}{i}} \]
                                      8. Taylor expanded in i around 0

                                        \[\leadsto 0 \]
                                      9. Step-by-step derivation
                                        1. Applied rewrites63.4%

                                          \[\leadsto 0 \]
                                      10. Recombined 2 regimes into one program.
                                      11. Final simplification64.4%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)\\ \end{array} \]
                                      12. Add Preprocessing

                                      Alternative 11: 61.1% accurate, 6.1× speedup?

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

                                        1. Initial program 20.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                          2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{\frac{100 \cdot e^{i} - 100}{i}} \cdot n \]
                                        6. Step-by-step derivation
                                          1. div-subN/A

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

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

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

                                            \[\leadsto \left(100 \cdot \frac{e^{i}}{i} - \color{blue}{100 \cdot \frac{1}{i}}\right) \cdot n \]
                                          5. distribute-lft-out--N/A

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

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

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

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

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

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

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

                                          \[\leadsto \left(100 + \color{blue}{50 \cdot i}\right) \cdot n \]
                                        9. Step-by-step derivation
                                          1. Applied rewrites60.9%

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

                                          if -1.11999999999999999e-92 < n < 2.4499999999999999e-91

                                          1. Initial program 47.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                            2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
                                            12. associate-*l/N/A

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

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

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

                                              \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
                                            16. distribute-neg-fracN/A

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

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

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

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

                                            \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
                                          6. Step-by-step derivation
                                            1. distribute-rgt-outN/A

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

                                              \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
                                            3. mul0-rgtN/A

                                              \[\leadsto \frac{\color{blue}{0}}{i} \]
                                            4. lower-/.f6463.4

                                              \[\leadsto \color{blue}{\frac{0}{i}} \]
                                          7. Applied rewrites63.4%

                                            \[\leadsto \color{blue}{\frac{0}{i}} \]
                                          8. Taylor expanded in i around 0

                                            \[\leadsto 0 \]
                                          9. Step-by-step derivation
                                            1. Applied rewrites63.4%

                                              \[\leadsto 0 \]
                                          10. Recombined 2 regimes into one program.
                                          11. Final simplification61.5%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.12 \cdot 10^{-92}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, 50, 100\right)\\ \mathbf{elif}\;n \leq 2.45 \cdot 10^{-91}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, 50, 100\right)\\ \end{array} \]
                                          12. Add Preprocessing

                                          Alternative 12: 58.5% accurate, 8.1× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -215:\\ \;\;\;\;0\\ \mathbf{elif}\;i \leq 1.02 \cdot 10^{+61}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                                          (FPCore (i n)
                                           :precision binary64
                                           (if (<= i -215.0) 0.0 (if (<= i 1.02e+61) (* n 100.0) 0.0)))
                                          double code(double i, double n) {
                                          	double tmp;
                                          	if (i <= -215.0) {
                                          		tmp = 0.0;
                                          	} else if (i <= 1.02e+61) {
                                          		tmp = n * 100.0;
                                          	} else {
                                          		tmp = 0.0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          real(8) function code(i, n)
                                              real(8), intent (in) :: i
                                              real(8), intent (in) :: n
                                              real(8) :: tmp
                                              if (i <= (-215.0d0)) then
                                                  tmp = 0.0d0
                                              else if (i <= 1.02d+61) then
                                                  tmp = n * 100.0d0
                                              else
                                                  tmp = 0.0d0
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double i, double n) {
                                          	double tmp;
                                          	if (i <= -215.0) {
                                          		tmp = 0.0;
                                          	} else if (i <= 1.02e+61) {
                                          		tmp = n * 100.0;
                                          	} else {
                                          		tmp = 0.0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(i, n):
                                          	tmp = 0
                                          	if i <= -215.0:
                                          		tmp = 0.0
                                          	elif i <= 1.02e+61:
                                          		tmp = n * 100.0
                                          	else:
                                          		tmp = 0.0
                                          	return tmp
                                          
                                          function code(i, n)
                                          	tmp = 0.0
                                          	if (i <= -215.0)
                                          		tmp = 0.0;
                                          	elseif (i <= 1.02e+61)
                                          		tmp = Float64(n * 100.0);
                                          	else
                                          		tmp = 0.0;
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(i, n)
                                          	tmp = 0.0;
                                          	if (i <= -215.0)
                                          		tmp = 0.0;
                                          	elseif (i <= 1.02e+61)
                                          		tmp = n * 100.0;
                                          	else
                                          		tmp = 0.0;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[i_, n_] := If[LessEqual[i, -215.0], 0.0, If[LessEqual[i, 1.02e+61], N[(n * 100.0), $MachinePrecision], 0.0]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;i \leq -215:\\
                                          \;\;\;\;0\\
                                          
                                          \mathbf{elif}\;i \leq 1.02 \cdot 10^{+61}:\\
                                          \;\;\;\;n \cdot 100\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;0\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if i < -215 or 1.01999999999999999e61 < i

                                            1. Initial program 51.7%

                                              \[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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                              2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
                                              12. associate-*l/N/A

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

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

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

                                                \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
                                              16. distribute-neg-fracN/A

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

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

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

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

                                              \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
                                            6. Step-by-step derivation
                                              1. distribute-rgt-outN/A

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

                                                \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
                                              3. mul0-rgtN/A

                                                \[\leadsto \frac{\color{blue}{0}}{i} \]
                                              4. lower-/.f6432.8

                                                \[\leadsto \color{blue}{\frac{0}{i}} \]
                                            7. Applied rewrites32.8%

                                              \[\leadsto \color{blue}{\frac{0}{i}} \]
                                            8. Taylor expanded in i around 0

                                              \[\leadsto 0 \]
                                            9. Step-by-step derivation
                                              1. Applied rewrites32.8%

                                                \[\leadsto 0 \]

                                              if -215 < i < 1.01999999999999999e61

                                              1. Initial program 10.3%

                                                \[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-*.f6475.5

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

                                                \[\leadsto \color{blue}{n \cdot 100} \]
                                            10. Recombined 2 regimes into one program.
                                            11. Add Preprocessing

                                            Alternative 13: 17.7% accurate, 146.0× speedup?

                                            \[\begin{array}{l} \\ 0 \end{array} \]
                                            (FPCore (i n) :precision binary64 0.0)
                                            double code(double i, double n) {
                                            	return 0.0;
                                            }
                                            
                                            real(8) function code(i, n)
                                                real(8), intent (in) :: i
                                                real(8), intent (in) :: n
                                                code = 0.0d0
                                            end function
                                            
                                            public static double code(double i, double n) {
                                            	return 0.0;
                                            }
                                            
                                            def code(i, n):
                                            	return 0.0
                                            
                                            function code(i, n)
                                            	return 0.0
                                            end
                                            
                                            function tmp = code(i, n)
                                            	tmp = 0.0;
                                            end
                                            
                                            code[i_, n_] := 0.0
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            0
                                            \end{array}
                                            
                                            Derivation
                                            1. Initial program 27.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 \color{blue}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                              2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n}, 100, \left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100\right) \]
                                              12. associate-*l/N/A

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

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

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

                                                \[\leadsto \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i}, 100, \color{blue}{\left(\mathsf{neg}\left(\frac{n}{i}\right)\right) \cdot 100}\right) \]
                                              16. distribute-neg-fracN/A

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

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

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

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

                                              \[\leadsto \color{blue}{\frac{-100 \cdot n + 100 \cdot n}{i}} \]
                                            6. Step-by-step derivation
                                              1. distribute-rgt-outN/A

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

                                                \[\leadsto \frac{n \cdot \color{blue}{0}}{i} \]
                                              3. mul0-rgtN/A

                                                \[\leadsto \frac{\color{blue}{0}}{i} \]
                                              4. lower-/.f6419.6

                                                \[\leadsto \color{blue}{\frac{0}{i}} \]
                                            7. Applied rewrites19.6%

                                              \[\leadsto \color{blue}{\frac{0}{i}} \]
                                            8. Taylor expanded in i around 0

                                              \[\leadsto 0 \]
                                            9. Step-by-step derivation
                                              1. Applied rewrites19.6%

                                                \[\leadsto 0 \]
                                              2. Add Preprocessing

                                              Developer Target 1: 34.9% 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 2024237 
                                              (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))))