Compound Interest

Percentage Accurate: 28.1% → 98.0%
Time: 21.1s
Alternatives: 18
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 18 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.1% 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: 98.0% 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}}\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{-236}:\\ \;\;\;\;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:\\ \;\;\;\;n \cdot \frac{\mathsf{fma}\left(t\_0, 100, -100\right)}{i}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (let* ((t_0 (pow (+ 1.0 (/ i n)) n)) (t_1 (/ (+ t_0 -1.0) (/ i n))))
   (if (<= t_1 5e-236)
     (* 100.0 (/ (expm1 (* n (log1p (/ i n)))) (/ i n)))
     (if (<= t_1 INFINITY)
       (* n (/ (fma t_0 100.0 -100.0) i))
       (* 100.0 (/ 1.0 (/ (fma i -0.5 1.0) n)))))))
double code(double i, double n) {
	double t_0 = pow((1.0 + (i / n)), n);
	double t_1 = (t_0 + -1.0) / (i / n);
	double tmp;
	if (t_1 <= 5e-236) {
		tmp = 100.0 * (expm1((n * log1p((i / n)))) / (i / n));
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = n * (fma(t_0, 100.0, -100.0) / i);
	} else {
		tmp = 100.0 * (1.0 / (fma(i, -0.5, 1.0) / n));
	}
	return tmp;
}
function code(i, n)
	t_0 = Float64(1.0 + Float64(i / n)) ^ n
	t_1 = Float64(Float64(t_0 + -1.0) / Float64(i / n))
	tmp = 0.0
	if (t_1 <= 5e-236)
		tmp = Float64(100.0 * Float64(expm1(Float64(n * log1p(Float64(i / n)))) / Float64(i / n)));
	elseif (t_1 <= Inf)
		tmp = Float64(n * Float64(fma(t_0, 100.0, -100.0) / i));
	else
		tmp = Float64(100.0 * Float64(1.0 / Float64(fma(i, -0.5, 1.0) / n)));
	end
	return tmp
end
code[i_, n_] := Block[{t$95$0 = N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-236], 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], N[(n * N[(N[(t$95$0 * 100.0 + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(1.0 / N[(N[(i * -0.5 + 1.0), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-236}:\\
\;\;\;\;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:\\
\;\;\;\;n \cdot \frac{\mathsf{fma}\left(t\_0, 100, -100\right)}{i}\\

\mathbf{else}:\\
\;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\


\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)) < 4.9999999999999998e-236

    1. Initial program 29.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 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.f6498.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 rewrites98.6%

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

    if 4.9999999999999998e-236 < (/.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 95.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-eval95.9

        \[\leadsto \frac{\mathsf{fma}\left({\left(1 + \frac{i}{n}\right)}^{n}, 100, \color{blue}{-100}\right)}{i} \cdot n \]
    4. Applied rewrites95.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))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 100 \cdot \frac{1}{\frac{i \cdot \left(\mathsf{neg}\left(\frac{i}{n}\right)\right)}{\left({\left(1 + \frac{i}{n}\right)}^{n} \cdot n\right) \cdot \frac{i}{\mathsf{neg}\left(n\right)} + \color{blue}{i}}} \]
    6. Applied rewrites2.7%

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

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

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

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

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

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

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

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

        \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
      8. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 100 \cdot \frac{1}{\frac{1 + \frac{-1}{2} \cdot i}{\color{blue}{n}}} \]
    11. Step-by-step derivation
      1. Applied rewrites99.8%

        \[\leadsto 100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{\color{blue}{n}}} \]
    12. Recombined 3 regimes into one program.
    13. Final simplification98.6%

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

    Alternative 2: 87.3% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -3 \cdot 10^{-5}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(\frac{i \cdot e^{i}}{n}, -50, 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{elif}\;n \leq 1.15 \cdot 10^{-6}:\\ \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(-0.5, \frac{i}{n}, \mathsf{fma}\left(i, 0.5, -1\right)\right)}{-n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\ \end{array} \end{array} \]
    (FPCore (i n)
     :precision binary64
     (if (<= n -3e-5)
       (* n (fma (/ (* i (exp i)) n) -50.0 (* 100.0 (/ (expm1 i) i))))
       (if (<= n 1.15e-6)
         (* 100.0 (/ 1.0 (/ (fma -0.5 (/ i n) (fma i 0.5 -1.0)) (- n))))
         (* n (/ (* 100.0 (expm1 i)) i)))))
    double code(double i, double n) {
    	double tmp;
    	if (n <= -3e-5) {
    		tmp = n * fma(((i * exp(i)) / n), -50.0, (100.0 * (expm1(i) / i)));
    	} else if (n <= 1.15e-6) {
    		tmp = 100.0 * (1.0 / (fma(-0.5, (i / n), fma(i, 0.5, -1.0)) / -n));
    	} else {
    		tmp = n * ((100.0 * expm1(i)) / i);
    	}
    	return tmp;
    }
    
    function code(i, n)
    	tmp = 0.0
    	if (n <= -3e-5)
    		tmp = Float64(n * fma(Float64(Float64(i * exp(i)) / n), -50.0, Float64(100.0 * Float64(expm1(i) / i))));
    	elseif (n <= 1.15e-6)
    		tmp = Float64(100.0 * Float64(1.0 / Float64(fma(-0.5, Float64(i / n), fma(i, 0.5, -1.0)) / Float64(-n))));
    	else
    		tmp = Float64(n * Float64(Float64(100.0 * expm1(i)) / i));
    	end
    	return tmp
    end
    
    code[i_, n_] := If[LessEqual[n, -3e-5], N[(n * N[(N[(N[(i * N[Exp[i], $MachinePrecision]), $MachinePrecision] / n), $MachinePrecision] * -50.0 + N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.15e-6], N[(100.0 * N[(1.0 / N[(N[(-0.5 * N[(i / n), $MachinePrecision] + N[(i * 0.5 + -1.0), $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;n \leq -3 \cdot 10^{-5}:\\
    \;\;\;\;n \cdot \mathsf{fma}\left(\frac{i \cdot e^{i}}{n}, -50, 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\
    
    \mathbf{elif}\;n \leq 1.15 \cdot 10^{-6}:\\
    \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(-0.5, \frac{i}{n}, \mathsf{fma}\left(i, 0.5, -1\right)\right)}{-n}}\\
    
    \mathbf{else}:\\
    \;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if n < -3.00000000000000008e-5

      1. Initial program 31.0%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto n \cdot \mathsf{fma}\left(\frac{i \cdot e^{i}}{n}, -50, \color{blue}{\frac{e^{i} - 1}{i}} \cdot 100\right) \]
        10. lower-expm1.f6482.7

          \[\leadsto n \cdot \mathsf{fma}\left(\frac{i \cdot e^{i}}{n}, -50, \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{i} \cdot 100\right) \]
      5. Applied rewrites82.7%

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

      if -3.00000000000000008e-5 < n < 1.15e-6

      1. Initial program 44.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
        8. mul-1-negN/A

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

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

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

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

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

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

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

          \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \frac{\frac{1}{2} - \frac{\frac{1}{2}}{n}}{\color{blue}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
        16. lower-/.f6478.3

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

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

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

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

        if 1.15e-6 < n

        1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

            \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}} \]
        7. Recombined 3 regimes into one program.
        8. Final simplification88.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -3 \cdot 10^{-5}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(\frac{i \cdot e^{i}}{n}, -50, 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{elif}\;n \leq 1.15 \cdot 10^{-6}:\\ \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(-0.5, \frac{i}{n}, \mathsf{fma}\left(i, 0.5, -1\right)\right)}{-n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\ \end{array} \]
        9. Add Preprocessing

        Alternative 3: 87.3% accurate, 1.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -3 \cdot 10^{-5}:\\ \;\;\;\;100 \cdot \frac{n \cdot \mathsf{expm1}\left(i\right)}{i}\\ \mathbf{elif}\;n \leq 1.15 \cdot 10^{-6}:\\ \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(-0.5, \frac{i}{n}, \mathsf{fma}\left(i, 0.5, -1\right)\right)}{-n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\ \end{array} \end{array} \]
        (FPCore (i n)
         :precision binary64
         (if (<= n -3e-5)
           (* 100.0 (/ (* n (expm1 i)) i))
           (if (<= n 1.15e-6)
             (* 100.0 (/ 1.0 (/ (fma -0.5 (/ i n) (fma i 0.5 -1.0)) (- n))))
             (* n (/ (* 100.0 (expm1 i)) i)))))
        double code(double i, double n) {
        	double tmp;
        	if (n <= -3e-5) {
        		tmp = 100.0 * ((n * expm1(i)) / i);
        	} else if (n <= 1.15e-6) {
        		tmp = 100.0 * (1.0 / (fma(-0.5, (i / n), fma(i, 0.5, -1.0)) / -n));
        	} else {
        		tmp = n * ((100.0 * expm1(i)) / i);
        	}
        	return tmp;
        }
        
        function code(i, n)
        	tmp = 0.0
        	if (n <= -3e-5)
        		tmp = Float64(100.0 * Float64(Float64(n * expm1(i)) / i));
        	elseif (n <= 1.15e-6)
        		tmp = Float64(100.0 * Float64(1.0 / Float64(fma(-0.5, Float64(i / n), fma(i, 0.5, -1.0)) / Float64(-n))));
        	else
        		tmp = Float64(n * Float64(Float64(100.0 * expm1(i)) / i));
        	end
        	return tmp
        end
        
        code[i_, n_] := If[LessEqual[n, -3e-5], N[(100.0 * N[(N[(n * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.15e-6], N[(100.0 * N[(1.0 / N[(N[(-0.5 * N[(i / n), $MachinePrecision] + N[(i * 0.5 + -1.0), $MachinePrecision]), $MachinePrecision] / (-n)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(n * N[(N[(100.0 * N[(Exp[i] - 1), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;n \leq -3 \cdot 10^{-5}:\\
        \;\;\;\;100 \cdot \frac{n \cdot \mathsf{expm1}\left(i\right)}{i}\\
        
        \mathbf{elif}\;n \leq 1.15 \cdot 10^{-6}:\\
        \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(-0.5, \frac{i}{n}, \mathsf{fma}\left(i, 0.5, -1\right)\right)}{-n}}\\
        
        \mathbf{else}:\\
        \;\;\;\;n \cdot \frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if n < -3.00000000000000008e-5

          1. Initial program 31.0%

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

            \[\leadsto 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.f6482.7

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

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

          if -3.00000000000000008e-5 < n < 1.15e-6

          1. Initial program 44.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
            8. mul-1-negN/A

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

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

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

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

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

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

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

              \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \frac{\frac{1}{2} - \frac{\frac{1}{2}}{n}}{\color{blue}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
            16. lower-/.f6478.3

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

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

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

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

            if 1.15e-6 < n

            1. Initial program 18.6%

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

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

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

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

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

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

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

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

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

                \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \mathsf{expm1}\left(i\right)}{i}} \]
            7. Recombined 3 regimes into one program.
            8. Add Preprocessing

            Alternative 4: 87.3% accurate, 1.1× speedup?

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

              1. Initial program 24.6%

                \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
              2. Add Preprocessing
              3. Taylor expanded in 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.f6490.2

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

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

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

                if -3.4e-5 < n < 1.15e-6

                1. Initial program 44.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
                  8. mul-1-negN/A

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

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

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

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

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

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

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

                    \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \frac{\frac{1}{2} - \frac{\frac{1}{2}}{n}}{\color{blue}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
                  16. lower-/.f6478.3

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

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

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

                    \[\leadsto 100 \cdot \frac{1}{\frac{\mathsf{fma}\left(-0.5, \frac{i}{n}, \mathsf{fma}\left(i, 0.5, -1\right)\right)}{\color{blue}{-n}}} \]
                12. Recombined 2 regimes into one program.
                13. Add Preprocessing

                Alternative 5: 67.0% accurate, 2.1× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -2.8 \cdot 10^{+142}:\\ \;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\ \mathbf{elif}\;n \leq -5.5 \cdot 10^{-168}:\\ \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\ \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\ \;\;\;\;100 \cdot \frac{1}{\frac{i \cdot 0.5}{n \cdot n}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{i \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(0.041666666666666664, i, 0.16666666666666666\right), n \cdot 0.5\right), n\right)}{i}\\ \end{array} \end{array} \]
                (FPCore (i n)
                 :precision binary64
                 (if (<= n -2.8e+142)
                   (fma
                    n
                    (fma 50.0 i 100.0)
                    (* (* i i) (* n (fma 4.166666666666667 i 16.666666666666668))))
                   (if (<= n -5.5e-168)
                     (* 100.0 (/ 1.0 (/ (fma i -0.5 1.0) n)))
                     (if (<= n 2.65e-52)
                       (* 100.0 (/ 1.0 (/ (* i 0.5) (* n n))))
                       (*
                        100.0
                        (/
                         (*
                          i
                          (fma
                           i
                           (fma
                            i
                            (* n (fma 0.041666666666666664 i 0.16666666666666666))
                            (* n 0.5))
                           n))
                         i))))))
                double code(double i, double n) {
                	double tmp;
                	if (n <= -2.8e+142) {
                		tmp = fma(n, fma(50.0, i, 100.0), ((i * i) * (n * fma(4.166666666666667, i, 16.666666666666668))));
                	} else if (n <= -5.5e-168) {
                		tmp = 100.0 * (1.0 / (fma(i, -0.5, 1.0) / n));
                	} else if (n <= 2.65e-52) {
                		tmp = 100.0 * (1.0 / ((i * 0.5) / (n * n)));
                	} else {
                		tmp = 100.0 * ((i * fma(i, fma(i, (n * fma(0.041666666666666664, i, 0.16666666666666666)), (n * 0.5)), n)) / i);
                	}
                	return tmp;
                }
                
                function code(i, n)
                	tmp = 0.0
                	if (n <= -2.8e+142)
                		tmp = fma(n, fma(50.0, i, 100.0), Float64(Float64(i * i) * Float64(n * fma(4.166666666666667, i, 16.666666666666668))));
                	elseif (n <= -5.5e-168)
                		tmp = Float64(100.0 * Float64(1.0 / Float64(fma(i, -0.5, 1.0) / n)));
                	elseif (n <= 2.65e-52)
                		tmp = Float64(100.0 * Float64(1.0 / Float64(Float64(i * 0.5) / Float64(n * n))));
                	else
                		tmp = Float64(100.0 * Float64(Float64(i * fma(i, fma(i, Float64(n * fma(0.041666666666666664, i, 0.16666666666666666)), Float64(n * 0.5)), n)) / i));
                	end
                	return tmp
                end
                
                code[i_, n_] := If[LessEqual[n, -2.8e+142], N[(n * N[(50.0 * i + 100.0), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] * N[(n * N[(4.166666666666667 * i + 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -5.5e-168], N[(100.0 * N[(1.0 / N[(N[(i * -0.5 + 1.0), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.65e-52], N[(100.0 * N[(1.0 / N[(N[(i * 0.5), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[(i * N[(i * N[(i * N[(n * N[(0.041666666666666664 * i + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(n * 0.5), $MachinePrecision]), $MachinePrecision] + n), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;n \leq -2.8 \cdot 10^{+142}:\\
                \;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\
                
                \mathbf{elif}\;n \leq -5.5 \cdot 10^{-168}:\\
                \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\
                
                \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
                \;\;\;\;100 \cdot \frac{1}{\frac{i \cdot 0.5}{n \cdot n}}\\
                
                \mathbf{else}:\\
                \;\;\;\;100 \cdot \frac{i \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(0.041666666666666664, i, 0.16666666666666666\right), n \cdot 0.5\right), n\right)}{i}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if n < -2.8e142

                  1. Initial program 20.5%

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

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

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

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

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

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

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

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

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

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

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

                    if -2.8e142 < n < -5.4999999999999999e-168

                    1. Initial program 37.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto 100 \cdot \frac{1}{\frac{i \cdot \left(\mathsf{neg}\left(\frac{i}{n}\right)\right)}{\left({\left(1 + \frac{i}{n}\right)}^{n} \cdot n\right) \cdot \frac{i}{\mathsf{neg}\left(n\right)} + \color{blue}{i}}} \]
                    6. Applied rewrites14.9%

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

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

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

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

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

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

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

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

                        \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
                      8. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto 100 \cdot \frac{1}{\frac{1 + \frac{-1}{2} \cdot i}{\color{blue}{n}}} \]
                    11. Step-by-step derivation
                      1. Applied rewrites65.7%

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

                      if -5.4999999999999999e-168 < n < 2.6500000000000002e-52

                      1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto 100 \cdot \frac{1}{\frac{i \cdot \left(\mathsf{neg}\left(\frac{i}{n}\right)\right)}{\left({\left(1 + \frac{i}{n}\right)}^{n} \cdot n\right) \cdot \frac{i}{\mathsf{neg}\left(n\right)} + \color{blue}{i}}} \]
                      6. Applied rewrites10.3%

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

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

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

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

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

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

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

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

                          \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
                        8. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto 100 \cdot \frac{1}{\frac{1}{2} \cdot \color{blue}{\frac{i}{{n}^{2}}}} \]
                      11. Step-by-step derivation
                        1. Applied rewrites72.9%

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

                        if 2.6500000000000002e-52 < n

                        1. Initial program 19.9%

                          \[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.f6493.0

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

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

                          \[\leadsto 100 \cdot \frac{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)}{i} \]
                        7. Step-by-step derivation
                          1. Applied rewrites85.7%

                            \[\leadsto 100 \cdot \frac{i \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(0.041666666666666664, i, 0.16666666666666666\right), n \cdot 0.5\right), n\right)}{i} \]
                        8. Recombined 4 regimes into one program.
                        9. Add Preprocessing

                        Alternative 6: 75.3% accurate, 2.2× speedup?

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

                          1. Initial program 20.5%

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

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

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

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

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

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

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

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

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

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

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

                            if -2.8e142 < n < 1.15e-6

                            1. Initial program 43.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto 100 \cdot \frac{1}{\frac{i \cdot \left(\mathsf{neg}\left(\frac{i}{n}\right)\right)}{\left({\left(1 + \frac{i}{n}\right)}^{n} \cdot n\right) \cdot \frac{i}{\mathsf{neg}\left(n\right)} + \color{blue}{i}}} \]
                            6. Applied rewrites13.7%

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

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

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

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

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

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

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

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

                                \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
                              8. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

                              if 1.15e-6 < n

                              1. Initial program 18.6%

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

                                \[\leadsto 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.f6497.7

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

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

                                \[\leadsto 100 \cdot \frac{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)}{i} \]
                              7. Step-by-step derivation
                                1. Applied rewrites89.9%

                                  \[\leadsto 100 \cdot \frac{i \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(0.041666666666666664, i, 0.16666666666666666\right), n \cdot 0.5\right), n\right)}{i} \]
                              8. Recombined 3 regimes into one program.
                              9. Add Preprocessing

                              Alternative 7: 71.6% accurate, 2.4× speedup?

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

                                1. Initial program 20.5%

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

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

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

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

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

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

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

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

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

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

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

                                  if -5.2000000000000002e140 < n < 1.15e-6

                                  1. Initial program 43.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto 100 \cdot \frac{1}{\frac{i \cdot \left(\mathsf{neg}\left(\frac{i}{n}\right)\right)}{\left({\left(1 + \frac{i}{n}\right)}^{n} \cdot n\right) \cdot \frac{i}{\mathsf{neg}\left(n\right)} + \color{blue}{i}}} \]
                                  6. Applied rewrites13.7%

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

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

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

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

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

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

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

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

                                      \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
                                    8. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                    if 1.15e-6 < n

                                    1. Initial program 18.6%

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

                                      \[\leadsto 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.f6497.7

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

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

                                      \[\leadsto 100 \cdot \frac{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)}{i} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites89.9%

                                        \[\leadsto 100 \cdot \frac{i \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, n \cdot \mathsf{fma}\left(0.041666666666666664, i, 0.16666666666666666\right), n \cdot 0.5\right), n\right)}{i} \]
                                    8. Recombined 3 regimes into one program.
                                    9. Add Preprocessing

                                    Alternative 8: 66.7% accurate, 2.6× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -2.8 \cdot 10^{+142}:\\ \;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\ \mathbf{elif}\;n \leq -5.5 \cdot 10^{-168}:\\ \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\ \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\ \;\;\;\;100 \cdot \frac{1}{\frac{i \cdot 0.5}{n \cdot n}}\\ \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 -2.8e+142)
                                       (fma
                                        n
                                        (fma 50.0 i 100.0)
                                        (* (* i i) (* n (fma 4.166666666666667 i 16.666666666666668))))
                                       (if (<= n -5.5e-168)
                                         (* 100.0 (/ 1.0 (/ (fma i -0.5 1.0) n)))
                                         (if (<= n 2.65e-52)
                                           (* 100.0 (/ 1.0 (/ (* i 0.5) (* n n))))
                                           (*
                                            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 <= -2.8e+142) {
                                    		tmp = fma(n, fma(50.0, i, 100.0), ((i * i) * (n * fma(4.166666666666667, i, 16.666666666666668))));
                                    	} else if (n <= -5.5e-168) {
                                    		tmp = 100.0 * (1.0 / (fma(i, -0.5, 1.0) / n));
                                    	} else if (n <= 2.65e-52) {
                                    		tmp = 100.0 * (1.0 / ((i * 0.5) / (n * n)));
                                    	} 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 <= -2.8e+142)
                                    		tmp = fma(n, fma(50.0, i, 100.0), Float64(Float64(i * i) * Float64(n * fma(4.166666666666667, i, 16.666666666666668))));
                                    	elseif (n <= -5.5e-168)
                                    		tmp = Float64(100.0 * Float64(1.0 / Float64(fma(i, -0.5, 1.0) / n)));
                                    	elseif (n <= 2.65e-52)
                                    		tmp = Float64(100.0 * Float64(1.0 / Float64(Float64(i * 0.5) / Float64(n * n))));
                                    	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, -2.8e+142], N[(n * N[(50.0 * i + 100.0), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] * N[(n * N[(4.166666666666667 * i + 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -5.5e-168], N[(100.0 * N[(1.0 / N[(N[(i * -0.5 + 1.0), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.65e-52], N[(100.0 * N[(1.0 / N[(N[(i * 0.5), $MachinePrecision] / N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 -2.8 \cdot 10^{+142}:\\
                                    \;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\
                                    
                                    \mathbf{elif}\;n \leq -5.5 \cdot 10^{-168}:\\
                                    \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\
                                    
                                    \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
                                    \;\;\;\;100 \cdot \frac{1}{\frac{i \cdot 0.5}{n \cdot n}}\\
                                    
                                    \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 4 regimes
                                    2. if n < -2.8e142

                                      1. Initial program 20.5%

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

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

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

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

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

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

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

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

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

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

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

                                        if -2.8e142 < n < -5.4999999999999999e-168

                                        1. Initial program 37.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto 100 \cdot \frac{1}{\frac{i \cdot \left(\mathsf{neg}\left(\frac{i}{n}\right)\right)}{\left({\left(1 + \frac{i}{n}\right)}^{n} \cdot n\right) \cdot \frac{i}{\mathsf{neg}\left(n\right)} + \color{blue}{i}}} \]
                                        6. Applied rewrites14.9%

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

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

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

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

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

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

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

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

                                            \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
                                          8. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto 100 \cdot \frac{1}{\frac{1 + \frac{-1}{2} \cdot i}{\color{blue}{n}}} \]
                                        11. Step-by-step derivation
                                          1. Applied rewrites65.7%

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

                                          if -5.4999999999999999e-168 < n < 2.6500000000000002e-52

                                          1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto 100 \cdot \frac{1}{\frac{i \cdot \left(\mathsf{neg}\left(\frac{i}{n}\right)\right)}{\left({\left(1 + \frac{i}{n}\right)}^{n} \cdot n\right) \cdot \frac{i}{\mathsf{neg}\left(n\right)} + \color{blue}{i}}} \]
                                          6. Applied rewrites10.3%

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

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

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

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

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

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

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

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

                                              \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
                                            8. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto 100 \cdot \frac{1}{\frac{1}{2} \cdot \color{blue}{\frac{i}{{n}^{2}}}} \]
                                          11. Step-by-step derivation
                                            1. Applied rewrites72.9%

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

                                            if 2.6500000000000002e-52 < n

                                            1. Initial program 19.9%

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto n \cdot \mathsf{fma}\left(i, \color{blue}{\mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right)}, 100\right) \]
                                              4. Recombined 4 regimes into one program.
                                              5. Add Preprocessing

                                              Alternative 9: 66.6% accurate, 3.0× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -2.8 \cdot 10^{+142}:\\ \;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\ \mathbf{elif}\;n \leq -5.5 \cdot 10^{-168}:\\ \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\ \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\ \;\;\;\;100 \cdot \frac{-1 + 1}{\frac{i}{n}}\\ \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 -2.8e+142)
                                                 (fma
                                                  n
                                                  (fma 50.0 i 100.0)
                                                  (* (* i i) (* n (fma 4.166666666666667 i 16.666666666666668))))
                                                 (if (<= n -5.5e-168)
                                                   (* 100.0 (/ 1.0 (/ (fma i -0.5 1.0) n)))
                                                   (if (<= n 2.65e-52)
                                                     (* 100.0 (/ (+ -1.0 1.0) (/ i n)))
                                                     (*
                                                      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 <= -2.8e+142) {
                                              		tmp = fma(n, fma(50.0, i, 100.0), ((i * i) * (n * fma(4.166666666666667, i, 16.666666666666668))));
                                              	} else if (n <= -5.5e-168) {
                                              		tmp = 100.0 * (1.0 / (fma(i, -0.5, 1.0) / n));
                                              	} else if (n <= 2.65e-52) {
                                              		tmp = 100.0 * ((-1.0 + 1.0) / (i / n));
                                              	} 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 <= -2.8e+142)
                                              		tmp = fma(n, fma(50.0, i, 100.0), Float64(Float64(i * i) * Float64(n * fma(4.166666666666667, i, 16.666666666666668))));
                                              	elseif (n <= -5.5e-168)
                                              		tmp = Float64(100.0 * Float64(1.0 / Float64(fma(i, -0.5, 1.0) / n)));
                                              	elseif (n <= 2.65e-52)
                                              		tmp = Float64(100.0 * Float64(Float64(-1.0 + 1.0) / Float64(i / n)));
                                              	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, -2.8e+142], N[(n * N[(50.0 * i + 100.0), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] * N[(n * N[(4.166666666666667 * i + 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, -5.5e-168], N[(100.0 * N[(1.0 / N[(N[(i * -0.5 + 1.0), $MachinePrecision] / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.65e-52], N[(100.0 * N[(N[(-1.0 + 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 -2.8 \cdot 10^{+142}:\\
                                              \;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\
                                              
                                              \mathbf{elif}\;n \leq -5.5 \cdot 10^{-168}:\\
                                              \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\
                                              
                                              \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
                                              \;\;\;\;100 \cdot \frac{-1 + 1}{\frac{i}{n}}\\
                                              
                                              \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 4 regimes
                                              2. if n < -2.8e142

                                                1. Initial program 20.5%

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

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

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

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

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

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

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

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

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

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

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

                                                  if -2.8e142 < n < -5.4999999999999999e-168

                                                  1. Initial program 37.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      \[\leadsto 100 \cdot \frac{1}{\frac{i \cdot \left(\mathsf{neg}\left(\frac{i}{n}\right)\right)}{\left({\left(1 + \frac{i}{n}\right)}^{n} \cdot n\right) \cdot \frac{i}{\mathsf{neg}\left(n\right)} + \color{blue}{i}}} \]
                                                  6. Applied rewrites14.9%

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

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

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

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

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

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

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

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

                                                      \[\leadsto 100 \cdot \frac{1}{\mathsf{fma}\left(i, \color{blue}{\frac{\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{n}}{\mathsf{neg}\left(n\right)}}, \frac{1}{n}\right)} \]
                                                    8. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto 100 \cdot \frac{1}{\frac{1 + \frac{-1}{2} \cdot i}{\color{blue}{n}}} \]
                                                  11. Step-by-step derivation
                                                    1. Applied rewrites65.7%

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

                                                    if -5.4999999999999999e-168 < n < 2.6500000000000002e-52

                                                    1. Initial program 53.8%

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

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

                                                      if 2.6500000000000002e-52 < n

                                                      1. Initial program 19.9%

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

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -2.8 \cdot 10^{+142}:\\ \;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\ \mathbf{elif}\;n \leq -5.5 \cdot 10^{-168}:\\ \;\;\;\;100 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, -0.5, 1\right)}{n}}\\ \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\ \;\;\;\;100 \cdot \frac{-1 + 1}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\ \end{array} \]
                                                        6. Add Preprocessing

                                                        Alternative 10: 64.3% accurate, 3.4× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\ \;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\ \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\ \;\;\;\;100 \cdot \frac{-1 + 1}{\frac{i}{n}}\\ \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.15e-109)
                                                           (fma
                                                            n
                                                            (fma 50.0 i 100.0)
                                                            (* (* i i) (* n (fma 4.166666666666667 i 16.666666666666668))))
                                                           (if (<= n 2.65e-52)
                                                             (* 100.0 (/ (+ -1.0 1.0) (/ i n)))
                                                             (*
                                                              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.15e-109) {
                                                        		tmp = fma(n, fma(50.0, i, 100.0), ((i * i) * (n * fma(4.166666666666667, i, 16.666666666666668))));
                                                        	} else if (n <= 2.65e-52) {
                                                        		tmp = 100.0 * ((-1.0 + 1.0) / (i / n));
                                                        	} 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.15e-109)
                                                        		tmp = fma(n, fma(50.0, i, 100.0), Float64(Float64(i * i) * Float64(n * fma(4.166666666666667, i, 16.666666666666668))));
                                                        	elseif (n <= 2.65e-52)
                                                        		tmp = Float64(100.0 * Float64(Float64(-1.0 + 1.0) / Float64(i / n)));
                                                        	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.15e-109], N[(n * N[(50.0 * i + 100.0), $MachinePrecision] + N[(N[(i * i), $MachinePrecision] * N[(n * N[(4.166666666666667 * i + 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 2.65e-52], N[(100.0 * N[(N[(-1.0 + 1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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.15 \cdot 10^{-109}:\\
                                                        \;\;\;\;\mathsf{fma}\left(n, \mathsf{fma}\left(50, i, 100\right), \left(i \cdot i\right) \cdot \left(n \cdot \mathsf{fma}\left(4.166666666666667, i, 16.666666666666668\right)\right)\right)\\
                                                        
                                                        \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
                                                        \;\;\;\;100 \cdot \frac{-1 + 1}{\frac{i}{n}}\\
                                                        
                                                        \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.1500000000000001e-109

                                                          1. Initial program 29.3%

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

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

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

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

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

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

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

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

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

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

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

                                                            if -1.1500000000000001e-109 < n < 2.6500000000000002e-52

                                                            1. Initial program 52.8%

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

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

                                                              if 2.6500000000000002e-52 < n

                                                              1. Initial program 19.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                Alternative 11: 64.4% accurate, 3.4× speedup?

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

                                                                  1. Initial program 24.6%

                                                                    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in 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.f6487.0

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

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

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

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

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

                                                                      if -1.1500000000000001e-109 < n < 2.6500000000000002e-52

                                                                      1. Initial program 52.8%

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

                                                                          \[\leadsto 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]
                                                                      5. Recombined 2 regimes into one program.
                                                                      6. Final simplification72.7%

                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, \mathsf{fma}\left(i, 4.166666666666667, 16.666666666666668\right), 50\right), 100\right)\\ \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\ \;\;\;\;100 \cdot \frac{-1 + 1}{\frac{i}{n}}\\ \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} \]
                                                                      7. Add Preprocessing

                                                                      Alternative 12: 64.4% accurate, 4.1× speedup?

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

                                                                        1. Initial program 24.6%

                                                                          \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in 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.f6487.0

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

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

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

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

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

                                                                            if -1.1500000000000001e-109 < n < 2.6500000000000002e-52

                                                                            1. Initial program 52.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                \[\leadsto \frac{100 \cdot \left(\color{blue}{0} \cdot n\right)}{i} \]
                                                                              4. mul0-lftN/A

                                                                                \[\leadsto \frac{100 \cdot \color{blue}{0}}{i} \]
                                                                              5. metadata-evalN/A

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

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

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

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

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

                                                                            Alternative 13: 62.6% accurate, 4.2× speedup?

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

                                                                              1. Initial program 29.3%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                  if -1.1500000000000001e-109 < n < 2.6500000000000002e-52

                                                                                  1. Initial program 52.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                      \[\leadsto \frac{100 \cdot \left(\color{blue}{0} \cdot n\right)}{i} \]
                                                                                    4. mul0-lftN/A

                                                                                      \[\leadsto \frac{100 \cdot \color{blue}{0}}{i} \]
                                                                                    5. metadata-evalN/A

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

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

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

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

                                                                                      \[\leadsto 0 \]

                                                                                    if 2.6500000000000002e-52 < n

                                                                                    1. Initial program 19.9%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                    Alternative 14: 62.6% 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.15 \cdot 10^{-109}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\ \;\;\;\;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.15e-109) t_0 (if (<= n 2.65e-52) 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.15e-109) {
                                                                                    		tmp = t_0;
                                                                                    	} else if (n <= 2.65e-52) {
                                                                                    		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.15e-109)
                                                                                    		tmp = t_0;
                                                                                    	elseif (n <= 2.65e-52)
                                                                                    		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.15e-109], t$95$0, If[LessEqual[n, 2.65e-52], 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.15 \cdot 10^{-109}:\\
                                                                                    \;\;\;\;t\_0\\
                                                                                    
                                                                                    \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
                                                                                    \;\;\;\;0\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;t\_0\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 2 regimes
                                                                                    2. if n < -1.1500000000000001e-109 or 2.6500000000000002e-52 < n

                                                                                      1. Initial program 24.6%

                                                                                        \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in 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.f6487.0

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

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

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

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

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

                                                                                          if -1.1500000000000001e-109 < n < 2.6500000000000002e-52

                                                                                          1. Initial program 52.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                              \[\leadsto \frac{100 \cdot \left(\color{blue}{0} \cdot n\right)}{i} \]
                                                                                            4. mul0-lftN/A

                                                                                              \[\leadsto \frac{100 \cdot \color{blue}{0}}{i} \]
                                                                                            5. metadata-evalN/A

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

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

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

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

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

                                                                                          Alternative 15: 60.1% accurate, 5.0× speedup?

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

                                                                                            1. Initial program 29.3%

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

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

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

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

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

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

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

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

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

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

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

                                                                                              if -1.1500000000000001e-109 < n < 2.6500000000000002e-52

                                                                                              1. Initial program 52.8%

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                                \[\leadsto \color{blue}{100 \cdot \frac{n + -1 \cdot n}{i}} \]
                                                                                              6. Step-by-step derivation
                                                                                                1. associate-*r/N/A

                                                                                                  \[\leadsto \color{blue}{\frac{100 \cdot \left(n + -1 \cdot n\right)}{i}} \]
                                                                                                2. distribute-rgt1-inN/A

                                                                                                  \[\leadsto \frac{100 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot n\right)}}{i} \]
                                                                                                3. metadata-evalN/A

                                                                                                  \[\leadsto \frac{100 \cdot \left(\color{blue}{0} \cdot n\right)}{i} \]
                                                                                                4. mul0-lftN/A

                                                                                                  \[\leadsto \frac{100 \cdot \color{blue}{0}}{i} \]
                                                                                                5. metadata-evalN/A

                                                                                                  \[\leadsto \frac{\color{blue}{0}}{i} \]
                                                                                                6. lower-/.f6469.1

                                                                                                  \[\leadsto \color{blue}{\frac{0}{i}} \]
                                                                                              7. Applied rewrites69.1%

                                                                                                \[\leadsto \color{blue}{\frac{0}{i}} \]
                                                                                              8. Taylor expanded in i around 0

                                                                                                \[\leadsto 0 \]
                                                                                              9. Step-by-step derivation
                                                                                                1. Applied rewrites69.1%

                                                                                                  \[\leadsto 0 \]

                                                                                                if 2.6500000000000002e-52 < n

                                                                                                1. Initial program 19.9%

                                                                                                  \[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.f6493.0

                                                                                                    \[\leadsto 100 \cdot \frac{n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}}{i} \]
                                                                                                5. Applied rewrites93.0%

                                                                                                  \[\leadsto 100 \cdot \color{blue}{\frac{n \cdot \mathsf{expm1}\left(i\right)}{i}} \]
                                                                                                6. Taylor expanded in i around 0

                                                                                                  \[\leadsto 100 \cdot \left(n + \color{blue}{\frac{1}{2} \cdot \left(i \cdot n\right)}\right) \]
                                                                                                7. Step-by-step derivation
                                                                                                  1. Applied rewrites73.3%

                                                                                                    \[\leadsto 100 \cdot \mathsf{fma}\left(n, \color{blue}{0.5 \cdot i}, n\right) \]
                                                                                                8. Recombined 3 regimes into one program.
                                                                                                9. Final simplification67.2%

                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(50, i, 100\right)\\ \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \mathsf{fma}\left(n, i \cdot 0.5, n\right)\\ \end{array} \]
                                                                                                10. Add Preprocessing

                                                                                                Alternative 16: 60.1% accurate, 6.1× speedup?

                                                                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := n \cdot \mathsf{fma}\left(50, i, 100\right)\\ \mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                                                (FPCore (i n)
                                                                                                 :precision binary64
                                                                                                 (let* ((t_0 (* n (fma 50.0 i 100.0))))
                                                                                                   (if (<= n -1.15e-109) t_0 (if (<= n 2.65e-52) 0.0 t_0))))
                                                                                                double code(double i, double n) {
                                                                                                	double t_0 = n * fma(50.0, i, 100.0);
                                                                                                	double tmp;
                                                                                                	if (n <= -1.15e-109) {
                                                                                                		tmp = t_0;
                                                                                                	} else if (n <= 2.65e-52) {
                                                                                                		tmp = 0.0;
                                                                                                	} else {
                                                                                                		tmp = t_0;
                                                                                                	}
                                                                                                	return tmp;
                                                                                                }
                                                                                                
                                                                                                function code(i, n)
                                                                                                	t_0 = Float64(n * fma(50.0, i, 100.0))
                                                                                                	tmp = 0.0
                                                                                                	if (n <= -1.15e-109)
                                                                                                		tmp = t_0;
                                                                                                	elseif (n <= 2.65e-52)
                                                                                                		tmp = 0.0;
                                                                                                	else
                                                                                                		tmp = t_0;
                                                                                                	end
                                                                                                	return tmp
                                                                                                end
                                                                                                
                                                                                                code[i_, n_] := Block[{t$95$0 = N[(n * N[(50.0 * i + 100.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.15e-109], t$95$0, If[LessEqual[n, 2.65e-52], 0.0, t$95$0]]]
                                                                                                
                                                                                                \begin{array}{l}
                                                                                                
                                                                                                \\
                                                                                                \begin{array}{l}
                                                                                                t_0 := n \cdot \mathsf{fma}\left(50, i, 100\right)\\
                                                                                                \mathbf{if}\;n \leq -1.15 \cdot 10^{-109}:\\
                                                                                                \;\;\;\;t\_0\\
                                                                                                
                                                                                                \mathbf{elif}\;n \leq 2.65 \cdot 10^{-52}:\\
                                                                                                \;\;\;\;0\\
                                                                                                
                                                                                                \mathbf{else}:\\
                                                                                                \;\;\;\;t\_0\\
                                                                                                
                                                                                                
                                                                                                \end{array}
                                                                                                \end{array}
                                                                                                
                                                                                                Derivation
                                                                                                1. Split input into 2 regimes
                                                                                                2. if n < -1.1500000000000001e-109 or 2.6500000000000002e-52 < n

                                                                                                  1. Initial program 24.6%

                                                                                                    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
                                                                                                  2. Add Preprocessing
                                                                                                  3. Taylor expanded in 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.f6487.0

                                                                                                      \[\leadsto \frac{\left(n \cdot \color{blue}{\mathsf{expm1}\left(i\right)}\right) \cdot 100}{i} \]
                                                                                                  5. Applied rewrites87.0%

                                                                                                    \[\leadsto \color{blue}{\frac{\left(n \cdot \mathsf{expm1}\left(i\right)\right) \cdot 100}{i}} \]
                                                                                                  6. Taylor expanded in i around 0

                                                                                                    \[\leadsto 50 \cdot \left(i \cdot n\right) + \color{blue}{100 \cdot n} \]
                                                                                                  7. Step-by-step derivation
                                                                                                    1. Applied rewrites66.6%

                                                                                                      \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(50, i, 100\right)} \]

                                                                                                    if -1.1500000000000001e-109 < n < 2.6500000000000002e-52

                                                                                                    1. Initial program 52.8%

                                                                                                      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
                                                                                                    2. Add Preprocessing
                                                                                                    3. Step-by-step derivation
                                                                                                      1. lift-/.f64N/A

                                                                                                        \[\leadsto 100 \cdot \color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                                                                                      2. lift--.f64N/A

                                                                                                        \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} - 1}}{\frac{i}{n}} \]
                                                                                                      3. 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)} \]
                                                                                                      4. 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) \]
                                                                                                      5. clear-numN/A

                                                                                                        \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \color{blue}{\frac{n}{i}}\right) \]
                                                                                                      6. 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)} \]
                                                                                                      7. lift-/.f64N/A

                                                                                                        \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\color{blue}{\frac{i}{n}}} + \left(\mathsf{neg}\left(\frac{n}{i}\right)\right)\right) \]
                                                                                                      8. associate-/r/N/A

                                                                                                        \[\leadsto 100 \cdot \left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n} + \left(\mathsf{neg}\left(\frac{n}{i}\right)\right)\right) \]
                                                                                                      9. lower-fma.f64N/A

                                                                                                        \[\leadsto 100 \cdot \color{blue}{\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \mathsf{neg}\left(\frac{n}{i}\right)\right)} \]
                                                                                                      10. lower-/.f64N/A

                                                                                                        \[\leadsto 100 \cdot \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}}, n, \mathsf{neg}\left(\frac{n}{i}\right)\right) \]
                                                                                                      11. distribute-neg-fracN/A

                                                                                                        \[\leadsto 100 \cdot \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \color{blue}{\frac{\mathsf{neg}\left(n\right)}{i}}\right) \]
                                                                                                      12. lower-/.f64N/A

                                                                                                        \[\leadsto 100 \cdot \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \color{blue}{\frac{\mathsf{neg}\left(n\right)}{i}}\right) \]
                                                                                                      13. lower-neg.f6429.3

                                                                                                        \[\leadsto 100 \cdot \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \frac{\color{blue}{-n}}{i}\right) \]
                                                                                                    4. Applied rewrites29.3%

                                                                                                      \[\leadsto 100 \cdot \color{blue}{\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \frac{-n}{i}\right)} \]
                                                                                                    5. Taylor expanded in i around 0

                                                                                                      \[\leadsto \color{blue}{100 \cdot \frac{n + -1 \cdot n}{i}} \]
                                                                                                    6. Step-by-step derivation
                                                                                                      1. associate-*r/N/A

                                                                                                        \[\leadsto \color{blue}{\frac{100 \cdot \left(n + -1 \cdot n\right)}{i}} \]
                                                                                                      2. distribute-rgt1-inN/A

                                                                                                        \[\leadsto \frac{100 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot n\right)}}{i} \]
                                                                                                      3. metadata-evalN/A

                                                                                                        \[\leadsto \frac{100 \cdot \left(\color{blue}{0} \cdot n\right)}{i} \]
                                                                                                      4. mul0-lftN/A

                                                                                                        \[\leadsto \frac{100 \cdot \color{blue}{0}}{i} \]
                                                                                                      5. metadata-evalN/A

                                                                                                        \[\leadsto \frac{\color{blue}{0}}{i} \]
                                                                                                      6. lower-/.f6469.1

                                                                                                        \[\leadsto \color{blue}{\frac{0}{i}} \]
                                                                                                    7. Applied rewrites69.1%

                                                                                                      \[\leadsto \color{blue}{\frac{0}{i}} \]
                                                                                                    8. Taylor expanded in i around 0

                                                                                                      \[\leadsto 0 \]
                                                                                                    9. Step-by-step derivation
                                                                                                      1. Applied rewrites69.1%

                                                                                                        \[\leadsto 0 \]
                                                                                                    10. Recombined 2 regimes into one program.
                                                                                                    11. Add Preprocessing

                                                                                                    Alternative 17: 57.1% accurate, 8.1× speedup?

                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -1.6 \cdot 10^{+84}:\\ \;\;\;\;0\\ \mathbf{elif}\;i \leq 7 \cdot 10^{+65}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                                                                                                    (FPCore (i n)
                                                                                                     :precision binary64
                                                                                                     (if (<= i -1.6e+84) 0.0 (if (<= i 7e+65) (* n 100.0) 0.0)))
                                                                                                    double code(double i, double n) {
                                                                                                    	double tmp;
                                                                                                    	if (i <= -1.6e+84) {
                                                                                                    		tmp = 0.0;
                                                                                                    	} else if (i <= 7e+65) {
                                                                                                    		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 <= (-1.6d+84)) then
                                                                                                            tmp = 0.0d0
                                                                                                        else if (i <= 7d+65) 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 <= -1.6e+84) {
                                                                                                    		tmp = 0.0;
                                                                                                    	} else if (i <= 7e+65) {
                                                                                                    		tmp = n * 100.0;
                                                                                                    	} else {
                                                                                                    		tmp = 0.0;
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    def code(i, n):
                                                                                                    	tmp = 0
                                                                                                    	if i <= -1.6e+84:
                                                                                                    		tmp = 0.0
                                                                                                    	elif i <= 7e+65:
                                                                                                    		tmp = n * 100.0
                                                                                                    	else:
                                                                                                    		tmp = 0.0
                                                                                                    	return tmp
                                                                                                    
                                                                                                    function code(i, n)
                                                                                                    	tmp = 0.0
                                                                                                    	if (i <= -1.6e+84)
                                                                                                    		tmp = 0.0;
                                                                                                    	elseif (i <= 7e+65)
                                                                                                    		tmp = Float64(n * 100.0);
                                                                                                    	else
                                                                                                    		tmp = 0.0;
                                                                                                    	end
                                                                                                    	return tmp
                                                                                                    end
                                                                                                    
                                                                                                    function tmp_2 = code(i, n)
                                                                                                    	tmp = 0.0;
                                                                                                    	if (i <= -1.6e+84)
                                                                                                    		tmp = 0.0;
                                                                                                    	elseif (i <= 7e+65)
                                                                                                    		tmp = n * 100.0;
                                                                                                    	else
                                                                                                    		tmp = 0.0;
                                                                                                    	end
                                                                                                    	tmp_2 = tmp;
                                                                                                    end
                                                                                                    
                                                                                                    code[i_, n_] := If[LessEqual[i, -1.6e+84], 0.0, If[LessEqual[i, 7e+65], N[(n * 100.0), $MachinePrecision], 0.0]]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    \mathbf{if}\;i \leq -1.6 \cdot 10^{+84}:\\
                                                                                                    \;\;\;\;0\\
                                                                                                    
                                                                                                    \mathbf{elif}\;i \leq 7 \cdot 10^{+65}:\\
                                                                                                    \;\;\;\;n \cdot 100\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;0\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 2 regimes
                                                                                                    2. if i < -1.60000000000000005e84 or 7.0000000000000002e65 < i

                                                                                                      1. Initial program 71.6%

                                                                                                        \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
                                                                                                      2. Add Preprocessing
                                                                                                      3. Step-by-step derivation
                                                                                                        1. lift-/.f64N/A

                                                                                                          \[\leadsto 100 \cdot \color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                                                                                        2. lift--.f64N/A

                                                                                                          \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} - 1}}{\frac{i}{n}} \]
                                                                                                        3. 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)} \]
                                                                                                        4. 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) \]
                                                                                                        5. clear-numN/A

                                                                                                          \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \color{blue}{\frac{n}{i}}\right) \]
                                                                                                        6. 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)} \]
                                                                                                        7. lift-/.f64N/A

                                                                                                          \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\color{blue}{\frac{i}{n}}} + \left(\mathsf{neg}\left(\frac{n}{i}\right)\right)\right) \]
                                                                                                        8. associate-/r/N/A

                                                                                                          \[\leadsto 100 \cdot \left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n} + \left(\mathsf{neg}\left(\frac{n}{i}\right)\right)\right) \]
                                                                                                        9. lower-fma.f64N/A

                                                                                                          \[\leadsto 100 \cdot \color{blue}{\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \mathsf{neg}\left(\frac{n}{i}\right)\right)} \]
                                                                                                        10. lower-/.f64N/A

                                                                                                          \[\leadsto 100 \cdot \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}}, n, \mathsf{neg}\left(\frac{n}{i}\right)\right) \]
                                                                                                        11. distribute-neg-fracN/A

                                                                                                          \[\leadsto 100 \cdot \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \color{blue}{\frac{\mathsf{neg}\left(n\right)}{i}}\right) \]
                                                                                                        12. lower-/.f64N/A

                                                                                                          \[\leadsto 100 \cdot \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \color{blue}{\frac{\mathsf{neg}\left(n\right)}{i}}\right) \]
                                                                                                        13. lower-neg.f6468.1

                                                                                                          \[\leadsto 100 \cdot \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \frac{\color{blue}{-n}}{i}\right) \]
                                                                                                      4. Applied rewrites68.1%

                                                                                                        \[\leadsto 100 \cdot \color{blue}{\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \frac{-n}{i}\right)} \]
                                                                                                      5. Taylor expanded in i around 0

                                                                                                        \[\leadsto \color{blue}{100 \cdot \frac{n + -1 \cdot n}{i}} \]
                                                                                                      6. Step-by-step derivation
                                                                                                        1. associate-*r/N/A

                                                                                                          \[\leadsto \color{blue}{\frac{100 \cdot \left(n + -1 \cdot n\right)}{i}} \]
                                                                                                        2. distribute-rgt1-inN/A

                                                                                                          \[\leadsto \frac{100 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot n\right)}}{i} \]
                                                                                                        3. metadata-evalN/A

                                                                                                          \[\leadsto \frac{100 \cdot \left(\color{blue}{0} \cdot n\right)}{i} \]
                                                                                                        4. mul0-lftN/A

                                                                                                          \[\leadsto \frac{100 \cdot \color{blue}{0}}{i} \]
                                                                                                        5. metadata-evalN/A

                                                                                                          \[\leadsto \frac{\color{blue}{0}}{i} \]
                                                                                                        6. lower-/.f6436.7

                                                                                                          \[\leadsto \color{blue}{\frac{0}{i}} \]
                                                                                                      7. Applied rewrites36.7%

                                                                                                        \[\leadsto \color{blue}{\frac{0}{i}} \]
                                                                                                      8. Taylor expanded in i around 0

                                                                                                        \[\leadsto 0 \]
                                                                                                      9. Step-by-step derivation
                                                                                                        1. Applied rewrites36.7%

                                                                                                          \[\leadsto 0 \]

                                                                                                        if -1.60000000000000005e84 < i < 7.0000000000000002e65

                                                                                                        1. Initial program 9.6%

                                                                                                          \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
                                                                                                        2. Add Preprocessing
                                                                                                        3. Taylor expanded in i around 0

                                                                                                          \[\leadsto \color{blue}{100 \cdot n} \]
                                                                                                        4. Step-by-step derivation
                                                                                                          1. *-commutativeN/A

                                                                                                            \[\leadsto \color{blue}{n \cdot 100} \]
                                                                                                          2. lower-*.f6477.9

                                                                                                            \[\leadsto \color{blue}{n \cdot 100} \]
                                                                                                        5. Applied rewrites77.9%

                                                                                                          \[\leadsto \color{blue}{n \cdot 100} \]
                                                                                                      10. Recombined 2 regimes into one program.
                                                                                                      11. Add Preprocessing

                                                                                                      Alternative 18: 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 30.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 100 \cdot \color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
                                                                                                        2. lift--.f64N/A

                                                                                                          \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} - 1}}{\frac{i}{n}} \]
                                                                                                        3. 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)} \]
                                                                                                        4. 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) \]
                                                                                                        5. clear-numN/A

                                                                                                          \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \color{blue}{\frac{n}{i}}\right) \]
                                                                                                        6. 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)} \]
                                                                                                        7. lift-/.f64N/A

                                                                                                          \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\color{blue}{\frac{i}{n}}} + \left(\mathsf{neg}\left(\frac{n}{i}\right)\right)\right) \]
                                                                                                        8. associate-/r/N/A

                                                                                                          \[\leadsto 100 \cdot \left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i} \cdot n} + \left(\mathsf{neg}\left(\frac{n}{i}\right)\right)\right) \]
                                                                                                        9. lower-fma.f64N/A

                                                                                                          \[\leadsto 100 \cdot \color{blue}{\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \mathsf{neg}\left(\frac{n}{i}\right)\right)} \]
                                                                                                        10. lower-/.f64N/A

                                                                                                          \[\leadsto 100 \cdot \mathsf{fma}\left(\color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}}, n, \mathsf{neg}\left(\frac{n}{i}\right)\right) \]
                                                                                                        11. distribute-neg-fracN/A

                                                                                                          \[\leadsto 100 \cdot \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \color{blue}{\frac{\mathsf{neg}\left(n\right)}{i}}\right) \]
                                                                                                        12. lower-/.f64N/A

                                                                                                          \[\leadsto 100 \cdot \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \color{blue}{\frac{\mathsf{neg}\left(n\right)}{i}}\right) \]
                                                                                                        13. lower-neg.f6426.6

                                                                                                          \[\leadsto 100 \cdot \mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \frac{\color{blue}{-n}}{i}\right) \]
                                                                                                      4. Applied rewrites26.6%

                                                                                                        \[\leadsto 100 \cdot \color{blue}{\mathsf{fma}\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{i}, n, \frac{-n}{i}\right)} \]
                                                                                                      5. Taylor expanded in i around 0

                                                                                                        \[\leadsto \color{blue}{100 \cdot \frac{n + -1 \cdot n}{i}} \]
                                                                                                      6. Step-by-step derivation
                                                                                                        1. associate-*r/N/A

                                                                                                          \[\leadsto \color{blue}{\frac{100 \cdot \left(n + -1 \cdot n\right)}{i}} \]
                                                                                                        2. distribute-rgt1-inN/A

                                                                                                          \[\leadsto \frac{100 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot n\right)}}{i} \]
                                                                                                        3. metadata-evalN/A

                                                                                                          \[\leadsto \frac{100 \cdot \left(\color{blue}{0} \cdot n\right)}{i} \]
                                                                                                        4. mul0-lftN/A

                                                                                                          \[\leadsto \frac{100 \cdot \color{blue}{0}}{i} \]
                                                                                                        5. metadata-evalN/A

                                                                                                          \[\leadsto \frac{\color{blue}{0}}{i} \]
                                                                                                        6. lower-/.f6418.0

                                                                                                          \[\leadsto \color{blue}{\frac{0}{i}} \]
                                                                                                      7. Applied rewrites18.0%

                                                                                                        \[\leadsto \color{blue}{\frac{0}{i}} \]
                                                                                                      8. Taylor expanded in i around 0

                                                                                                        \[\leadsto 0 \]
                                                                                                      9. Step-by-step derivation
                                                                                                        1. Applied rewrites18.0%

                                                                                                          \[\leadsto 0 \]
                                                                                                        2. Add Preprocessing

                                                                                                        Developer Target 1: 34.7% 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 2024221 
                                                                                                        (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))))