Compound Interest

Percentage Accurate: 28.1% → 94.7%
Time: 17.0s
Alternatives: 21
Speedup: 38.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

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

\\
\begin{array}{l}
t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\
t_1 := \frac{t\_0 + -1}{\frac{i}{n}}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\

\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{-100 + t\_0 \cdot 100}{\frac{i}{n}}\\

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


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

    1. Initial program 24.0%

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n} - 1\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      2. expm1-defineN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\left(n \cdot \log \left(1 + \frac{i}{n}\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \log \left(1 + \frac{i}{n}\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      6. log1p-defineN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{log1p}\left(\frac{i}{n}\right)\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      7. log1p-lowering-log1p.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\left(\frac{i}{n}\right)\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      8. /-lowering-/.f6498.6%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\mathsf{/.f64}\left(i, n\right)\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
    4. Applied egg-rr98.6%

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

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

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{100 \cdot n} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6467.8%

        \[\leadsto \mathsf{*.f64}\left(100, \color{blue}{n}\right) \]
    5. Simplified67.8%

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

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

Alternative 2: 76.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq 3.4 \cdot 10^{+62}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{1}{n}} - n}{i}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i 3.4e+62)
   (* n (* 100.0 (/ (expm1 i) i)))
   (* 100.0 (/ (- (/ (pow (+ 1.0 (/ i n)) n) (/ 1.0 n)) n) i))))
double code(double i, double n) {
	double tmp;
	if (i <= 3.4e+62) {
		tmp = n * (100.0 * (expm1(i) / i));
	} else {
		tmp = 100.0 * (((pow((1.0 + (i / n)), n) / (1.0 / n)) - n) / i);
	}
	return tmp;
}
public static double code(double i, double n) {
	double tmp;
	if (i <= 3.4e+62) {
		tmp = n * (100.0 * (Math.expm1(i) / i));
	} else {
		tmp = 100.0 * (((Math.pow((1.0 + (i / n)), n) / (1.0 / n)) - n) / i);
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if i <= 3.4e+62:
		tmp = n * (100.0 * (math.expm1(i) / i))
	else:
		tmp = 100.0 * (((math.pow((1.0 + (i / n)), n) / (1.0 / n)) - n) / i)
	return tmp
function code(i, n)
	tmp = 0.0
	if (i <= 3.4e+62)
		tmp = Float64(n * Float64(100.0 * Float64(expm1(i) / i)));
	else
		tmp = Float64(100.0 * Float64(Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) / Float64(1.0 / n)) - n) / i));
	end
	return tmp
end
code[i_, n_] := If[LessEqual[i, 3.4e+62], N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] / N[(1.0 / n), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq 3.4 \cdot 10^{+62}:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < 3.40000000000000014e62

    1. Initial program 18.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
      3. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
      4. expm1-lowering-expm1.f6469.7%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
    5. Simplified69.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\left(\frac{e^{i} - 1}{i}\right), \color{blue}{100}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(e^{i} - 1\right), i\right), 100\right)\right) \]
      7. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{expm1}\left(i\right)\right), i\right), 100\right)\right) \]
      8. expm1-lowering-expm1.f6481.0%

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{expm1.f64}\left(i\right), i\right), 100\right)\right) \]
    7. Applied egg-rr81.0%

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

    if 3.40000000000000014e62 < i

    1. Initial program 62.7%

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n} - 1\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      2. expm1-defineN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\left(n \cdot \log \left(1 + \frac{i}{n}\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \log \left(1 + \frac{i}{n}\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      6. log1p-defineN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{log1p}\left(\frac{i}{n}\right)\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      7. log1p-lowering-log1p.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\left(\frac{i}{n}\right)\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      8. /-lowering-/.f6454.9%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\mathsf{/.f64}\left(i, n\right)\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
    4. Applied egg-rr54.9%

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\mathsf{/.f64}\left(i, n\right)\right)\right)\right), \left(\frac{1}{\color{blue}{\frac{n}{i}}}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\mathsf{/.f64}\left(i, n\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{n}{i}\right)}\right)\right)\right) \]
      3. /-lowering-/.f6454.9%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\mathsf{/.f64}\left(i, n\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(n, \color{blue}{i}\right)\right)\right)\right) \]
    6. Applied egg-rr54.9%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(100, \left(\frac{\frac{e^{n \cdot \log \left(1 + \frac{i}{n}\right)}}{\frac{1}{n}}}{i} - \frac{\color{blue}{1}}{\frac{1}{\frac{n}{i}}}\right)\right) \]
      4. remove-double-divN/A

        \[\leadsto \mathsf{*.f64}\left(100, \left(\frac{\frac{e^{n \cdot \log \left(1 + \frac{i}{n}\right)}}{\frac{1}{n}}}{i} - \frac{n}{\color{blue}{i}}\right)\right) \]
      5. sub-divN/A

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\left(\frac{e^{n \cdot \log \left(1 + \frac{i}{n}\right)}}{\frac{1}{n}} - n\right), \color{blue}{i}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{n \cdot \log \left(1 + \frac{i}{n}\right)}}{\frac{1}{n}}\right), n\right), i\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{n \cdot \log \left(1 + \frac{i}{n}\right)}\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      10. pow-to-expN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left({\left(1 + \frac{i}{n}\right)}^{n}\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      11. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(1 + \frac{i}{n}\right), n\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{i}{n}\right)\right), n\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(i, n\right)\right), n\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      14. /-lowering-/.f6463.1%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(i, n\right)\right), n\right), \mathsf{/.f64}\left(1, n\right)\right), n\right), i\right)\right) \]
    8. Applied egg-rr63.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 3.4 \cdot 10^{+62}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{1}{n}} - n}{i}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 76.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq 2.1 \cdot 10^{+63}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-100 + {\left(1 + \frac{i}{n}\right)}^{n} \cdot 100}{\frac{i}{n}}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i 2.1e+63)
   (* n (* 100.0 (/ (expm1 i) i)))
   (/ (+ -100.0 (* (pow (+ 1.0 (/ i n)) n) 100.0)) (/ i n))))
double code(double i, double n) {
	double tmp;
	if (i <= 2.1e+63) {
		tmp = n * (100.0 * (expm1(i) / i));
	} else {
		tmp = (-100.0 + (pow((1.0 + (i / n)), n) * 100.0)) / (i / n);
	}
	return tmp;
}
public static double code(double i, double n) {
	double tmp;
	if (i <= 2.1e+63) {
		tmp = n * (100.0 * (Math.expm1(i) / i));
	} else {
		tmp = (-100.0 + (Math.pow((1.0 + (i / n)), n) * 100.0)) / (i / n);
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if i <= 2.1e+63:
		tmp = n * (100.0 * (math.expm1(i) / i))
	else:
		tmp = (-100.0 + (math.pow((1.0 + (i / n)), n) * 100.0)) / (i / n)
	return tmp
function code(i, n)
	tmp = 0.0
	if (i <= 2.1e+63)
		tmp = Float64(n * Float64(100.0 * Float64(expm1(i) / i)));
	else
		tmp = Float64(Float64(-100.0 + Float64((Float64(1.0 + Float64(i / n)) ^ n) * 100.0)) / Float64(i / n));
	end
	return tmp
end
code[i_, n_] := If[LessEqual[i, 2.1e+63], N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-100.0 + N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] * 100.0), $MachinePrecision]), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq 2.1 \cdot 10^{+63}:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < 2.1000000000000002e63

    1. Initial program 18.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
      3. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
      4. expm1-lowering-expm1.f6469.7%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
    5. Simplified69.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\left(\frac{e^{i} - 1}{i}\right), \color{blue}{100}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(e^{i} - 1\right), i\right), 100\right)\right) \]
      7. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{expm1}\left(i\right)\right), i\right), 100\right)\right) \]
      8. expm1-lowering-expm1.f6481.0%

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{expm1.f64}\left(i\right), i\right), 100\right)\right) \]
    7. Applied egg-rr81.0%

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

    if 2.1000000000000002e63 < i

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(-100 \cdot \left(1 - {\left(1 + \frac{i}{n}\right)}^{n}\right)\right), \color{blue}{\left(\frac{i}{n}\right)}\right) \]
    4. Applied egg-rr62.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 2.1 \cdot 10^{+63}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-100 + {\left(1 + \frac{i}{n}\right)}^{n} \cdot 100}{\frac{i}{n}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 76.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq 1.35 \cdot 10^{+64}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{n}{\frac{i}{-100}} \cdot \left(1 - {\left(1 + \frac{i}{n}\right)}^{n}\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i 1.35e+64)
   (* n (* 100.0 (/ (expm1 i) i)))
   (* (/ n (/ i -100.0)) (- 1.0 (pow (+ 1.0 (/ i n)) n)))))
double code(double i, double n) {
	double tmp;
	if (i <= 1.35e+64) {
		tmp = n * (100.0 * (expm1(i) / i));
	} else {
		tmp = (n / (i / -100.0)) * (1.0 - pow((1.0 + (i / n)), n));
	}
	return tmp;
}
public static double code(double i, double n) {
	double tmp;
	if (i <= 1.35e+64) {
		tmp = n * (100.0 * (Math.expm1(i) / i));
	} else {
		tmp = (n / (i / -100.0)) * (1.0 - Math.pow((1.0 + (i / n)), n));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if i <= 1.35e+64:
		tmp = n * (100.0 * (math.expm1(i) / i))
	else:
		tmp = (n / (i / -100.0)) * (1.0 - math.pow((1.0 + (i / n)), n))
	return tmp
function code(i, n)
	tmp = 0.0
	if (i <= 1.35e+64)
		tmp = Float64(n * Float64(100.0 * Float64(expm1(i) / i)));
	else
		tmp = Float64(Float64(n / Float64(i / -100.0)) * Float64(1.0 - (Float64(1.0 + Float64(i / n)) ^ n)));
	end
	return tmp
end
code[i_, n_] := If[LessEqual[i, 1.35e+64], N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(n / N[(i / -100.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.35 \cdot 10^{+64}:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < 1.35e64

    1. Initial program 18.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
      3. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
      4. expm1-lowering-expm1.f6469.7%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
    5. Simplified69.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\left(\frac{e^{i} - 1}{i}\right), \color{blue}{100}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(e^{i} - 1\right), i\right), 100\right)\right) \]
      7. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{expm1}\left(i\right)\right), i\right), 100\right)\right) \]
      8. expm1-lowering-expm1.f6481.0%

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{expm1.f64}\left(i\right), i\right), 100\right)\right) \]
    7. Applied egg-rr81.0%

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

    if 1.35e64 < i

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(n \cdot \frac{1}{\frac{i}{-100}}\right), \left(1 - {\left(1 + \frac{i}{n}\right)}^{n}\right)\right) \]
      15. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{n}{\frac{i}{-100}}\right), \left(\color{blue}{1} - {\left(1 + \frac{i}{n}\right)}^{n}\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(n, \left(\frac{i}{-100}\right)\right), \left(\color{blue}{1} - {\left(1 + \frac{i}{n}\right)}^{n}\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(n, \mathsf{/.f64}\left(i, -100\right)\right), \left(1 - {\left(1 + \frac{i}{n}\right)}^{n}\right)\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(n, \mathsf{/.f64}\left(i, -100\right)\right), \mathsf{\_.f64}\left(1, \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}\right)\right) \]
      19. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(n, \mathsf{/.f64}\left(i, -100\right)\right), \mathsf{\_.f64}\left(1, \mathsf{pow.f64}\left(\left(1 + \frac{i}{n}\right), \color{blue}{n}\right)\right)\right) \]
    4. Applied egg-rr62.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 1.35 \cdot 10^{+64}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{n}{\frac{i}{-100}} \cdot \left(1 - {\left(1 + \frac{i}{n}\right)}^{n}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 76.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq 5 \cdot 10^{+63}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - {\left(1 + \frac{i}{n}\right)}^{n}\right) \cdot \frac{-100}{\frac{i}{n}}\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i 5e+63)
   (* n (* 100.0 (/ (expm1 i) i)))
   (* (- 1.0 (pow (+ 1.0 (/ i n)) n)) (/ -100.0 (/ i n)))))
double code(double i, double n) {
	double tmp;
	if (i <= 5e+63) {
		tmp = n * (100.0 * (expm1(i) / i));
	} else {
		tmp = (1.0 - pow((1.0 + (i / n)), n)) * (-100.0 / (i / n));
	}
	return tmp;
}
public static double code(double i, double n) {
	double tmp;
	if (i <= 5e+63) {
		tmp = n * (100.0 * (Math.expm1(i) / i));
	} else {
		tmp = (1.0 - Math.pow((1.0 + (i / n)), n)) * (-100.0 / (i / n));
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if i <= 5e+63:
		tmp = n * (100.0 * (math.expm1(i) / i))
	else:
		tmp = (1.0 - math.pow((1.0 + (i / n)), n)) * (-100.0 / (i / n))
	return tmp
function code(i, n)
	tmp = 0.0
	if (i <= 5e+63)
		tmp = Float64(n * Float64(100.0 * Float64(expm1(i) / i)));
	else
		tmp = Float64(Float64(1.0 - (Float64(1.0 + Float64(i / n)) ^ n)) * Float64(-100.0 / Float64(i / n)));
	end
	return tmp
end
code[i_, n_] := If[LessEqual[i, 5e+63], N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision] * N[(-100.0 / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < 5.00000000000000011e63

    1. Initial program 18.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
      3. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
      4. expm1-lowering-expm1.f6469.7%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
    5. Simplified69.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\left(\frac{e^{i} - 1}{i}\right), \color{blue}{100}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(e^{i} - 1\right), i\right), 100\right)\right) \]
      7. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{expm1}\left(i\right)\right), i\right), 100\right)\right) \]
      8. expm1-lowering-expm1.f6481.0%

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{expm1.f64}\left(i\right), i\right), 100\right)\right) \]
    7. Applied egg-rr81.0%

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

    if 5.00000000000000011e63 < i

    1. Initial program 62.7%

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

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

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

        \[\leadsto \frac{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(\mathsf{neg}\left(1\right)\right)\right) \cdot 100}{\frac{i}{n}} \]
      4. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\mathsf{neg}\left(\frac{1}{\frac{i}{n}}\right)\right) \cdot 100\right), \color{blue}{\left(1 - {\left(1 + \frac{i}{n}\right)}^{n}\right)}\right) \]
    3. Simplified62.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 5 \cdot 10^{+63}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - {\left(1 + \frac{i}{n}\right)}^{n}\right) \cdot \frac{-100}{\frac{i}{n}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 76.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq 1.12 \cdot 10^{+64}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \cdot 100\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i 1.12e+64)
   (* n (* 100.0 (/ (expm1 i) i)))
   (* (/ (+ (pow (+ 1.0 (/ i n)) n) -1.0) (/ i n)) 100.0)))
double code(double i, double n) {
	double tmp;
	if (i <= 1.12e+64) {
		tmp = n * (100.0 * (expm1(i) / i));
	} else {
		tmp = ((pow((1.0 + (i / n)), n) + -1.0) / (i / n)) * 100.0;
	}
	return tmp;
}
public static double code(double i, double n) {
	double tmp;
	if (i <= 1.12e+64) {
		tmp = n * (100.0 * (Math.expm1(i) / i));
	} else {
		tmp = ((Math.pow((1.0 + (i / n)), n) + -1.0) / (i / n)) * 100.0;
	}
	return tmp;
}
def code(i, n):
	tmp = 0
	if i <= 1.12e+64:
		tmp = n * (100.0 * (math.expm1(i) / i))
	else:
		tmp = ((math.pow((1.0 + (i / n)), n) + -1.0) / (i / n)) * 100.0
	return tmp
function code(i, n)
	tmp = 0.0
	if (i <= 1.12e+64)
		tmp = Float64(n * Float64(100.0 * Float64(expm1(i) / i)));
	else
		tmp = Float64(Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) / Float64(i / n)) * 100.0);
	end
	return tmp
end
code[i_, n_] := If[LessEqual[i, 1.12e+64], N[(n * N[(100.0 * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] + -1.0), $MachinePrecision] / N[(i / n), $MachinePrecision]), $MachinePrecision] * 100.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq 1.12 \cdot 10^{+64}:\\
\;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < 1.11999999999999995e64

    1. Initial program 18.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
      3. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
      4. expm1-lowering-expm1.f6469.7%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
    5. Simplified69.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\left(\frac{e^{i} - 1}{i}\right), \color{blue}{100}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(e^{i} - 1\right), i\right), 100\right)\right) \]
      7. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{expm1}\left(i\right)\right), i\right), 100\right)\right) \]
      8. expm1-lowering-expm1.f6481.0%

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{expm1.f64}\left(i\right), i\right), 100\right)\right) \]
    7. Applied egg-rr81.0%

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

    if 1.11999999999999995e64 < i

    1. Initial program 62.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification76.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 1.12 \cdot 10^{+64}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \cdot 100\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 81.0% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -1.05000000000000007e-247 or 2.80000000000000023e-112 < n

    1. Initial program 28.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
      3. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
      4. expm1-lowering-expm1.f6471.7%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
    5. Simplified71.7%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\left(\frac{e^{i} - 1}{i}\right), \color{blue}{100}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(e^{i} - 1\right), i\right), 100\right)\right) \]
      7. expm1-defineN/A

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{expm1}\left(i\right)\right), i\right), 100\right)\right) \]
      8. expm1-lowering-expm1.f6480.0%

        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{expm1.f64}\left(i\right), i\right), 100\right)\right) \]
    7. Applied egg-rr80.0%

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

    if -1.05000000000000007e-247 < n < 2.80000000000000023e-112

    1. Initial program 31.8%

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n} - 1\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      2. expm1-defineN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\left(n \cdot \log \left(1 + \frac{i}{n}\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \log \left(1 + \frac{i}{n}\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      6. log1p-defineN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{log1p}\left(\frac{i}{n}\right)\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      7. log1p-lowering-log1p.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\left(\frac{i}{n}\right)\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      8. /-lowering-/.f6470.9%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\mathsf{/.f64}\left(i, n\right)\right)\right)\right), \mathsf{/.f64}\left(i, n\right)\right)\right) \]
    4. Applied egg-rr70.9%

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\mathsf{/.f64}\left(i, n\right)\right)\right)\right), \left(\frac{1}{\color{blue}{\frac{n}{i}}}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\mathsf{/.f64}\left(i, n\right)\right)\right)\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{n}{i}\right)}\right)\right)\right) \]
      3. /-lowering-/.f6471.0%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{expm1.f64}\left(\mathsf{*.f64}\left(n, \mathsf{log1p.f64}\left(\mathsf{/.f64}\left(i, n\right)\right)\right)\right), \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(n, \color{blue}{i}\right)\right)\right)\right) \]
    6. Applied egg-rr71.0%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(100, \left(\frac{\frac{e^{n \cdot \log \left(1 + \frac{i}{n}\right)}}{\frac{1}{n}}}{i} - \frac{\color{blue}{1}}{\frac{1}{\frac{n}{i}}}\right)\right) \]
      4. remove-double-divN/A

        \[\leadsto \mathsf{*.f64}\left(100, \left(\frac{\frac{e^{n \cdot \log \left(1 + \frac{i}{n}\right)}}{\frac{1}{n}}}{i} - \frac{n}{\color{blue}{i}}\right)\right) \]
      5. sub-divN/A

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

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\left(\frac{e^{n \cdot \log \left(1 + \frac{i}{n}\right)}}{\frac{1}{n}} - n\right), \color{blue}{i}\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{e^{n \cdot \log \left(1 + \frac{i}{n}\right)}}{\frac{1}{n}}\right), n\right), i\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{n \cdot \log \left(1 + \frac{i}{n}\right)}\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(e^{\log \left(1 + \frac{i}{n}\right) \cdot n}\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      10. pow-to-expN/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left({\left(1 + \frac{i}{n}\right)}^{n}\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      11. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(1 + \frac{i}{n}\right), n\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{i}{n}\right)\right), n\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(i, n\right)\right), n\right), \left(\frac{1}{n}\right)\right), n\right), i\right)\right) \]
      14. /-lowering-/.f6426.3%

        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(i, n\right)\right), n\right), \mathsf{/.f64}\left(1, n\right)\right), n\right), i\right)\right) \]
    8. Applied egg-rr26.3%

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

      \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{n}, n\right), i\right)\right) \]
    10. Step-by-step derivation
      1. Simplified60.7%

        \[\leadsto 100 \cdot \frac{\color{blue}{n} - n}{i} \]
    11. Recombined 2 regimes into one program.
    12. Final simplification76.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.05 \cdot 10^{-247}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \mathbf{elif}\;n \leq 2.8 \cdot 10^{-112}:\\ \;\;\;\;100 \cdot \frac{n - n}{i}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\right)\\ \end{array} \]
    13. Add Preprocessing

    Alternative 8: 79.9% accurate, 1.0× speedup?

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

      1. Initial program 30.8%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
        3. expm1-defineN/A

          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
        4. expm1-lowering-expm1.f6486.6%

          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
      5. Simplified86.6%

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

      if -3.1000000000000003e-67 < n < 0.419999999999999984

      1. Initial program 26.7%

        \[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 \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
      4. Step-by-step derivation
        1. Simplified60.0%

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

      Alternative 9: 66.9% accurate, 3.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -9.5 \cdot 10^{+21}:\\ \;\;\;\;n \cdot 100 + i \cdot \left(n \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\ \mathbf{elif}\;n \leq 0.42:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n \cdot \left(i \cdot \left(1 + i \cdot \left(0.5 + i \cdot \left(0.16666666666666666 + i \cdot 0.041666666666666664\right)\right)\right)\right)}{i}\\ \end{array} \end{array} \]
      (FPCore (i n)
       :precision binary64
       (if (<= n -9.5e+21)
         (+ (* n 100.0) (* i (* n (+ 50.0 (* i 16.666666666666668)))))
         (if (<= n 0.42)
           (* 100.0 (/ i (/ i n)))
           (*
            100.0
            (/
             (*
              n
              (*
               i
               (+
                1.0
                (*
                 i
                 (+ 0.5 (* i (+ 0.16666666666666666 (* i 0.041666666666666664))))))))
             i)))))
      double code(double i, double n) {
      	double tmp;
      	if (n <= -9.5e+21) {
      		tmp = (n * 100.0) + (i * (n * (50.0 + (i * 16.666666666666668))));
      	} else if (n <= 0.42) {
      		tmp = 100.0 * (i / (i / n));
      	} else {
      		tmp = 100.0 * ((n * (i * (1.0 + (i * (0.5 + (i * (0.16666666666666666 + (i * 0.041666666666666664)))))))) / i);
      	}
      	return tmp;
      }
      
      real(8) function code(i, n)
          real(8), intent (in) :: i
          real(8), intent (in) :: n
          real(8) :: tmp
          if (n <= (-9.5d+21)) then
              tmp = (n * 100.0d0) + (i * (n * (50.0d0 + (i * 16.666666666666668d0))))
          else if (n <= 0.42d0) then
              tmp = 100.0d0 * (i / (i / n))
          else
              tmp = 100.0d0 * ((n * (i * (1.0d0 + (i * (0.5d0 + (i * (0.16666666666666666d0 + (i * 0.041666666666666664d0)))))))) / i)
          end if
          code = tmp
      end function
      
      public static double code(double i, double n) {
      	double tmp;
      	if (n <= -9.5e+21) {
      		tmp = (n * 100.0) + (i * (n * (50.0 + (i * 16.666666666666668))));
      	} else if (n <= 0.42) {
      		tmp = 100.0 * (i / (i / n));
      	} else {
      		tmp = 100.0 * ((n * (i * (1.0 + (i * (0.5 + (i * (0.16666666666666666 + (i * 0.041666666666666664)))))))) / i);
      	}
      	return tmp;
      }
      
      def code(i, n):
      	tmp = 0
      	if n <= -9.5e+21:
      		tmp = (n * 100.0) + (i * (n * (50.0 + (i * 16.666666666666668))))
      	elif n <= 0.42:
      		tmp = 100.0 * (i / (i / n))
      	else:
      		tmp = 100.0 * ((n * (i * (1.0 + (i * (0.5 + (i * (0.16666666666666666 + (i * 0.041666666666666664)))))))) / i)
      	return tmp
      
      function code(i, n)
      	tmp = 0.0
      	if (n <= -9.5e+21)
      		tmp = Float64(Float64(n * 100.0) + Float64(i * Float64(n * Float64(50.0 + Float64(i * 16.666666666666668)))));
      	elseif (n <= 0.42)
      		tmp = Float64(100.0 * Float64(i / Float64(i / n)));
      	else
      		tmp = Float64(100.0 * Float64(Float64(n * Float64(i * Float64(1.0 + Float64(i * Float64(0.5 + Float64(i * Float64(0.16666666666666666 + Float64(i * 0.041666666666666664)))))))) / i));
      	end
      	return tmp
      end
      
      function tmp_2 = code(i, n)
      	tmp = 0.0;
      	if (n <= -9.5e+21)
      		tmp = (n * 100.0) + (i * (n * (50.0 + (i * 16.666666666666668))));
      	elseif (n <= 0.42)
      		tmp = 100.0 * (i / (i / n));
      	else
      		tmp = 100.0 * ((n * (i * (1.0 + (i * (0.5 + (i * (0.16666666666666666 + (i * 0.041666666666666664)))))))) / i);
      	end
      	tmp_2 = tmp;
      end
      
      code[i_, n_] := If[LessEqual[n, -9.5e+21], N[(N[(n * 100.0), $MachinePrecision] + N[(i * N[(n * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.42], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[(n * N[(i * N[(1.0 + N[(i * N[(0.5 + N[(i * N[(0.16666666666666666 + N[(i * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;n \leq -9.5 \cdot 10^{+21}:\\
      \;\;\;\;n \cdot 100 + i \cdot \left(n \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
      
      \mathbf{elif}\;n \leq 0.42:\\
      \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
      
      \mathbf{else}:\\
      \;\;\;\;100 \cdot \frac{n \cdot \left(i \cdot \left(1 + i \cdot \left(0.5 + i \cdot \left(0.16666666666666666 + i \cdot 0.041666666666666664\right)\right)\right)\right)}{i}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if n < -9.500000000000001e21

        1. Initial program 38.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
        4. Step-by-step derivation
          1. /-lowering-/.f64N/A

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

            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
          3. expm1-defineN/A

            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
          4. expm1-lowering-expm1.f6481.3%

            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
        5. Simplified81.3%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{50}{3} \cdot i\right), \color{blue}{50}\right)\right)\right)\right) \]
          12. *-lowering-*.f6452.3%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{50}{3}, i\right), 50\right)\right)\right)\right) \]
        8. Simplified52.3%

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

        if -9.500000000000001e21 < n < 0.419999999999999984

        1. Initial program 25.1%

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

          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
        4. Step-by-step derivation
          1. Simplified60.5%

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

          if 0.419999999999999984 < n

          1. Initial program 28.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
          4. Step-by-step derivation
            1. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
            3. expm1-defineN/A

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
            4. expm1-lowering-expm1.f6496.9%

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
          5. Simplified96.9%

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

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

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

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \left(i \cdot \left(\frac{1}{2} + i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right)\right)\right)\right)\right)\right), i\right)\right) \]
            3. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(i, \left(\frac{1}{2} + i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right)\right)\right)\right)\right)\right), i\right)\right) \]
            4. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(\frac{1}{2}, \left(i \cdot \left(\frac{1}{6} + \frac{1}{24} \cdot i\right)\right)\right)\right)\right)\right)\right), i\right)\right) \]
            5. *-lowering-*.f64N/A

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

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

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(\frac{1}{6}, \left(i \cdot \frac{1}{24}\right)\right)\right)\right)\right)\right)\right)\right), i\right)\right) \]
            8. *-lowering-*.f6482.2%

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(i, \frac{1}{24}\right)\right)\right)\right)\right)\right)\right)\right), i\right)\right) \]
          8. Simplified82.2%

            \[\leadsto 100 \cdot \frac{n \cdot \color{blue}{\left(i \cdot \left(1 + i \cdot \left(0.5 + i \cdot \left(0.16666666666666666 + i \cdot 0.041666666666666664\right)\right)\right)\right)}}{i} \]
        5. Recombined 3 regimes into one program.
        6. Final simplification64.2%

          \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -9.5 \cdot 10^{+21}:\\ \;\;\;\;n \cdot 100 + i \cdot \left(n \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\ \mathbf{elif}\;n \leq 0.42:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n \cdot \left(i \cdot \left(1 + i \cdot \left(0.5 + i \cdot \left(0.16666666666666666 + i \cdot 0.041666666666666664\right)\right)\right)\right)}{i}\\ \end{array} \]
        7. Add Preprocessing

        Alternative 10: 66.5% accurate, 4.2× speedup?

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

          1. Initial program 38.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
          4. Step-by-step derivation
            1. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
            3. expm1-defineN/A

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
            4. expm1-lowering-expm1.f6481.3%

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
          5. Simplified81.3%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{50}{3} \cdot i\right), \color{blue}{50}\right)\right)\right)\right) \]
            12. *-lowering-*.f6452.3%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{50}{3}, i\right), 50\right)\right)\right)\right) \]
          8. Simplified52.3%

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

          if -7.2e22 < n < 0.419999999999999984

          1. Initial program 25.1%

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

            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
          4. Step-by-step derivation
            1. Simplified60.5%

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

            if 0.419999999999999984 < n

            1. Initial program 28.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
            4. Step-by-step derivation
              1. /-lowering-/.f64N/A

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

                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
              3. expm1-defineN/A

                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
              4. expm1-lowering-expm1.f6496.9%

                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
            5. Simplified96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(50, i\right)\right)\right), \left({i}^{2} \cdot \left(\color{blue}{\frac{25}{6} \cdot \left(i \cdot n\right)} + \frac{50}{3} \cdot n\right)\right)\right) \]
              14. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(50, i\right)\right)\right), \mathsf{*.f64}\left(\left({i}^{2}\right), \color{blue}{\left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right)}\right)\right) \]
              15. unpow2N/A

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

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(50, i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(i, i\right), \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{25}{6} \cdot i\right), \color{blue}{\frac{50}{3}}\right)\right)\right)\right) \]
              21. *-lowering-*.f6479.6%

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(50, i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(i, i\right), \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{25}{6}, i\right), \frac{50}{3}\right)\right)\right)\right) \]
            8. Simplified79.6%

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

              \[\leadsto \color{blue}{n \cdot \left(100 + \left(50 \cdot i + {i}^{2} \cdot \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right)\right)} \]
            10. Step-by-step derivation
              1. *-lowering-*.f64N/A

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({i}^{2}\right), \left(\frac{50}{3} + \frac{25}{6} \cdot i\right)\right), \left(\color{blue}{100} + 50 \cdot i\right)\right)\right) \]
              8. unpow2N/A

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

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

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

                \[\leadsto \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(i, i\right), \mathsf{+.f64}\left(\frac{50}{3}, \left(i \cdot \frac{25}{6}\right)\right)\right), \left(100 + 50 \cdot i\right)\right)\right) \]
              12. *-lowering-*.f64N/A

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

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

                \[\leadsto \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(i, i\right), \mathsf{+.f64}\left(\frac{50}{3}, \mathsf{*.f64}\left(i, \frac{25}{6}\right)\right)\right), \mathsf{+.f64}\left(100, \left(i \cdot \color{blue}{50}\right)\right)\right)\right) \]
              15. *-lowering-*.f6479.6%

                \[\leadsto \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(i, i\right), \mathsf{+.f64}\left(\frac{50}{3}, \mathsf{*.f64}\left(i, \frac{25}{6}\right)\right)\right), \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(i, \color{blue}{50}\right)\right)\right)\right) \]
            11. Simplified79.6%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -7.2 \cdot 10^{+22}:\\ \;\;\;\;n \cdot 100 + i \cdot \left(n \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\ \mathbf{elif}\;n \leq 0.42:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(\left(i \cdot i\right) \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right) + \left(100 + i \cdot 50\right)\right)\\ \end{array} \]
          7. Add Preprocessing

          Alternative 11: 65.7% accurate, 4.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -3.7 \cdot 10^{+22}:\\ \;\;\;\;n \cdot 100 + i \cdot \left(n \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\ \mathbf{elif}\;n \leq 0.42:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n \cdot \left(i \cdot \left(1 + i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)}{i}\\ \end{array} \end{array} \]
          (FPCore (i n)
           :precision binary64
           (if (<= n -3.7e+22)
             (+ (* n 100.0) (* i (* n (+ 50.0 (* i 16.666666666666668)))))
             (if (<= n 0.42)
               (* 100.0 (/ i (/ i n)))
               (*
                100.0
                (/ (* n (* i (+ 1.0 (* i (+ 0.5 (* i 0.16666666666666666)))))) i)))))
          double code(double i, double n) {
          	double tmp;
          	if (n <= -3.7e+22) {
          		tmp = (n * 100.0) + (i * (n * (50.0 + (i * 16.666666666666668))));
          	} else if (n <= 0.42) {
          		tmp = 100.0 * (i / (i / n));
          	} else {
          		tmp = 100.0 * ((n * (i * (1.0 + (i * (0.5 + (i * 0.16666666666666666)))))) / i);
          	}
          	return tmp;
          }
          
          real(8) function code(i, n)
              real(8), intent (in) :: i
              real(8), intent (in) :: n
              real(8) :: tmp
              if (n <= (-3.7d+22)) then
                  tmp = (n * 100.0d0) + (i * (n * (50.0d0 + (i * 16.666666666666668d0))))
              else if (n <= 0.42d0) then
                  tmp = 100.0d0 * (i / (i / n))
              else
                  tmp = 100.0d0 * ((n * (i * (1.0d0 + (i * (0.5d0 + (i * 0.16666666666666666d0)))))) / i)
              end if
              code = tmp
          end function
          
          public static double code(double i, double n) {
          	double tmp;
          	if (n <= -3.7e+22) {
          		tmp = (n * 100.0) + (i * (n * (50.0 + (i * 16.666666666666668))));
          	} else if (n <= 0.42) {
          		tmp = 100.0 * (i / (i / n));
          	} else {
          		tmp = 100.0 * ((n * (i * (1.0 + (i * (0.5 + (i * 0.16666666666666666)))))) / i);
          	}
          	return tmp;
          }
          
          def code(i, n):
          	tmp = 0
          	if n <= -3.7e+22:
          		tmp = (n * 100.0) + (i * (n * (50.0 + (i * 16.666666666666668))))
          	elif n <= 0.42:
          		tmp = 100.0 * (i / (i / n))
          	else:
          		tmp = 100.0 * ((n * (i * (1.0 + (i * (0.5 + (i * 0.16666666666666666)))))) / i)
          	return tmp
          
          function code(i, n)
          	tmp = 0.0
          	if (n <= -3.7e+22)
          		tmp = Float64(Float64(n * 100.0) + Float64(i * Float64(n * Float64(50.0 + Float64(i * 16.666666666666668)))));
          	elseif (n <= 0.42)
          		tmp = Float64(100.0 * Float64(i / Float64(i / n)));
          	else
          		tmp = Float64(100.0 * Float64(Float64(n * Float64(i * Float64(1.0 + Float64(i * Float64(0.5 + Float64(i * 0.16666666666666666)))))) / i));
          	end
          	return tmp
          end
          
          function tmp_2 = code(i, n)
          	tmp = 0.0;
          	if (n <= -3.7e+22)
          		tmp = (n * 100.0) + (i * (n * (50.0 + (i * 16.666666666666668))));
          	elseif (n <= 0.42)
          		tmp = 100.0 * (i / (i / n));
          	else
          		tmp = 100.0 * ((n * (i * (1.0 + (i * (0.5 + (i * 0.16666666666666666)))))) / i);
          	end
          	tmp_2 = tmp;
          end
          
          code[i_, n_] := If[LessEqual[n, -3.7e+22], N[(N[(n * 100.0), $MachinePrecision] + N[(i * N[(n * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.42], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[(n * N[(i * N[(1.0 + N[(i * N[(0.5 + N[(i * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;n \leq -3.7 \cdot 10^{+22}:\\
          \;\;\;\;n \cdot 100 + i \cdot \left(n \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
          
          \mathbf{elif}\;n \leq 0.42:\\
          \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
          
          \mathbf{else}:\\
          \;\;\;\;100 \cdot \frac{n \cdot \left(i \cdot \left(1 + i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)}{i}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if n < -3.6999999999999998e22

            1. Initial program 38.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
            4. Step-by-step derivation
              1. /-lowering-/.f64N/A

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

                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
              3. expm1-defineN/A

                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
              4. expm1-lowering-expm1.f6481.3%

                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
            5. Simplified81.3%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{50}{3} \cdot i\right), \color{blue}{50}\right)\right)\right)\right) \]
              12. *-lowering-*.f6452.3%

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{50}{3}, i\right), 50\right)\right)\right)\right) \]
            8. Simplified52.3%

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

            if -3.6999999999999998e22 < n < 0.419999999999999984

            1. Initial program 25.1%

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

              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
            4. Step-by-step derivation
              1. Simplified60.5%

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

              if 0.419999999999999984 < n

              1. Initial program 28.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
              4. Step-by-step derivation
                1. /-lowering-/.f64N/A

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

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                3. expm1-defineN/A

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                4. expm1-lowering-expm1.f6496.9%

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
              5. Simplified96.9%

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

                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \color{blue}{\left(i \cdot \left(1 + i \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot i\right)\right)\right)}\right), i\right)\right) \]
              7. Step-by-step derivation
                1. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \left(1 + i \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot i\right)\right)\right)\right), i\right)\right) \]
                2. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \left(i \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot i\right)\right)\right)\right)\right), i\right)\right) \]
                3. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(i, \left(\frac{1}{2} + \frac{1}{6} \cdot i\right)\right)\right)\right)\right), i\right)\right) \]
                4. +-lowering-+.f64N/A

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

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(\frac{1}{2}, \left(i \cdot \frac{1}{6}\right)\right)\right)\right)\right)\right), i\right)\right) \]
                6. *-lowering-*.f6478.3%

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(i, \frac{1}{6}\right)\right)\right)\right)\right)\right), i\right)\right) \]
              8. Simplified78.3%

                \[\leadsto 100 \cdot \frac{n \cdot \color{blue}{\left(i \cdot \left(1 + i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)}}{i} \]
            5. Recombined 3 regimes into one program.
            6. Final simplification63.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -3.7 \cdot 10^{+22}:\\ \;\;\;\;n \cdot 100 + i \cdot \left(n \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\ \mathbf{elif}\;n \leq 0.42:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n \cdot \left(i \cdot \left(1 + i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)}{i}\\ \end{array} \]
            7. Add Preprocessing

            Alternative 12: 66.3% accurate, 4.6× speedup?

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

              1. Initial program 38.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
              4. Step-by-step derivation
                1. /-lowering-/.f64N/A

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

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                3. expm1-defineN/A

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                4. expm1-lowering-expm1.f6481.3%

                  \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
              5. Simplified81.3%

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{50}{3} \cdot i\right), \color{blue}{50}\right)\right)\right)\right) \]
                12. *-lowering-*.f6452.3%

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{50}{3}, i\right), 50\right)\right)\right)\right) \]
              8. Simplified52.3%

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

              if -1.3499999999999999e23 < n < 0.419999999999999984

              1. Initial program 25.1%

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

                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
              4. Step-by-step derivation
                1. Simplified60.5%

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

                if 0.419999999999999984 < n

                1. Initial program 28.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                4. Step-by-step derivation
                  1. /-lowering-/.f64N/A

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

                    \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                  3. expm1-defineN/A

                    \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                  4. expm1-lowering-expm1.f6496.9%

                    \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                5. Simplified96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(50, i\right)\right)\right), \left({i}^{2} \cdot \left(\color{blue}{\frac{25}{6} \cdot \left(i \cdot n\right)} + \frac{50}{3} \cdot n\right)\right)\right) \]
                  14. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(50, i\right)\right)\right), \mathsf{*.f64}\left(\left({i}^{2}\right), \color{blue}{\left(\frac{25}{6} \cdot \left(i \cdot n\right) + \frac{50}{3} \cdot n\right)}\right)\right) \]
                  15. unpow2N/A

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(50, i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(i, i\right), \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{25}{6} \cdot i\right), \color{blue}{\frac{50}{3}}\right)\right)\right)\right) \]
                  21. *-lowering-*.f6479.6%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(50, i\right)\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(i, i\right), \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{25}{6}, i\right), \frac{50}{3}\right)\right)\right)\right) \]
                8. Simplified79.6%

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(n, \color{blue}{100}\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(i, i\right), \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{25}{6}, i\right), \frac{50}{3}\right)\right)\right)\right) \]
                10. Step-by-step derivation
                  1. Simplified78.3%

                    \[\leadsto n \cdot \color{blue}{100} + \left(i \cdot i\right) \cdot \left(n \cdot \left(4.166666666666667 \cdot i + 16.666666666666668\right)\right) \]
                11. Recombined 3 regimes into one program.
                12. Final simplification63.1%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.35 \cdot 10^{+23}:\\ \;\;\;\;n \cdot 100 + i \cdot \left(n \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\ \mathbf{elif}\;n \leq 0.42:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot 100 + \left(i \cdot i\right) \cdot \left(n \cdot \left(16.666666666666668 + i \cdot 4.166666666666667\right)\right)\\ \end{array} \]
                13. Add Preprocessing

                Alternative 13: 65.7% accurate, 4.9× speedup?

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

                  1. Initial program 38.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                  4. Step-by-step derivation
                    1. /-lowering-/.f64N/A

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

                      \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                    3. expm1-defineN/A

                      \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                    4. expm1-lowering-expm1.f6481.3%

                      \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                  5. Simplified81.3%

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{50}{3} \cdot i\right), \color{blue}{50}\right)\right)\right)\right) \]
                    12. *-lowering-*.f6452.3%

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{50}{3}, i\right), 50\right)\right)\right)\right) \]
                  8. Simplified52.3%

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

                  if -3.4e22 < n < 0.419999999999999984

                  1. Initial program 25.1%

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

                    \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
                  4. Step-by-step derivation
                    1. Simplified60.5%

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

                    if 0.419999999999999984 < n

                    1. Initial program 28.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                    4. Step-by-step derivation
                      1. /-lowering-/.f64N/A

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

                        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                      3. expm1-defineN/A

                        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                      4. expm1-lowering-expm1.f6496.9%

                        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                    5. Simplified96.9%

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

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

                        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \left(1 + \frac{1}{2} \cdot i\right)\right)\right), i\right)\right) \]
                      2. +-lowering-+.f64N/A

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

                        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \left(i \cdot \frac{1}{2}\right)\right)\right)\right), i\right)\right) \]
                      4. *-lowering-*.f6476.2%

                        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(i, \frac{1}{2}\right)\right)\right)\right), i\right)\right) \]
                    8. Simplified76.2%

                      \[\leadsto 100 \cdot \frac{n \cdot \color{blue}{\left(i \cdot \left(1 + i \cdot 0.5\right)\right)}}{i} \]
                  5. Recombined 3 regimes into one program.
                  6. Final simplification62.6%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -3.4 \cdot 10^{+22}:\\ \;\;\;\;n \cdot 100 + i \cdot \left(n \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\ \mathbf{elif}\;n \leq 0.42:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n \cdot \left(i \cdot \left(1 + i \cdot 0.5\right)\right)}{i}\\ \end{array} \]
                  7. Add Preprocessing

                  Alternative 14: 65.8% accurate, 4.9× speedup?

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

                    1. Initial program 38.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                    4. Step-by-step derivation
                      1. /-lowering-/.f64N/A

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

                        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                      3. expm1-defineN/A

                        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                      4. expm1-lowering-expm1.f6481.3%

                        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                    5. Simplified81.3%

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{50}{3} \cdot i\right), \color{blue}{50}\right)\right)\right)\right) \]
                      12. *-lowering-*.f6452.3%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{50}{3}, i\right), 50\right)\right)\right)\right) \]
                    8. Simplified52.3%

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

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

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

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(50, \left(i \cdot \color{blue}{\frac{50}{3}}\right)\right)\right)\right)\right) \]
                      6. *-lowering-*.f6452.3%

                        \[\leadsto \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(50, \mathsf{*.f64}\left(i, \color{blue}{\frac{50}{3}}\right)\right)\right)\right)\right) \]
                    11. Simplified52.3%

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

                    if -2.59999999999999992e23 < n < 0.419999999999999984

                    1. Initial program 25.1%

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

                      \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
                    4. Step-by-step derivation
                      1. Simplified60.5%

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

                      if 0.419999999999999984 < n

                      1. Initial program 28.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                      4. Step-by-step derivation
                        1. /-lowering-/.f64N/A

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

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                        3. expm1-defineN/A

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                        4. expm1-lowering-expm1.f6496.9%

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                      5. Simplified96.9%

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

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

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \left(1 + \frac{1}{2} \cdot i\right)\right)\right), i\right)\right) \]
                        2. +-lowering-+.f64N/A

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

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \left(i \cdot \frac{1}{2}\right)\right)\right)\right), i\right)\right) \]
                        4. *-lowering-*.f6476.2%

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(i, \frac{1}{2}\right)\right)\right)\right), i\right)\right) \]
                      8. Simplified76.2%

                        \[\leadsto 100 \cdot \frac{n \cdot \color{blue}{\left(i \cdot \left(1 + i \cdot 0.5\right)\right)}}{i} \]
                    5. Recombined 3 regimes into one program.
                    6. Add Preprocessing

                    Alternative 15: 65.3% accurate, 5.4× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\ \mathbf{if}\;n \leq -2.8 \cdot 10^{+22}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 0.42:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (i n)
                     :precision binary64
                     (let* ((t_0 (* n (+ 100.0 (* i (+ 50.0 (* i 16.666666666666668)))))))
                       (if (<= n -2.8e+22) t_0 (if (<= n 0.42) (* 100.0 (/ i (/ i n))) t_0))))
                    double code(double i, double n) {
                    	double t_0 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
                    	double tmp;
                    	if (n <= -2.8e+22) {
                    		tmp = t_0;
                    	} else if (n <= 0.42) {
                    		tmp = 100.0 * (i / (i / n));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    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 = n * (100.0d0 + (i * (50.0d0 + (i * 16.666666666666668d0))))
                        if (n <= (-2.8d+22)) then
                            tmp = t_0
                        else if (n <= 0.42d0) then
                            tmp = 100.0d0 * (i / (i / n))
                        else
                            tmp = t_0
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double i, double n) {
                    	double t_0 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
                    	double tmp;
                    	if (n <= -2.8e+22) {
                    		tmp = t_0;
                    	} else if (n <= 0.42) {
                    		tmp = 100.0 * (i / (i / n));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(i, n):
                    	t_0 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))))
                    	tmp = 0
                    	if n <= -2.8e+22:
                    		tmp = t_0
                    	elif n <= 0.42:
                    		tmp = 100.0 * (i / (i / n))
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(i, n)
                    	t_0 = Float64(n * Float64(100.0 + Float64(i * Float64(50.0 + Float64(i * 16.666666666666668)))))
                    	tmp = 0.0
                    	if (n <= -2.8e+22)
                    		tmp = t_0;
                    	elseif (n <= 0.42)
                    		tmp = Float64(100.0 * Float64(i / Float64(i / n)));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(i, n)
                    	t_0 = n * (100.0 + (i * (50.0 + (i * 16.666666666666668))));
                    	tmp = 0.0;
                    	if (n <= -2.8e+22)
                    		tmp = t_0;
                    	elseif (n <= 0.42)
                    		tmp = 100.0 * (i / (i / n));
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[i_, n_] := Block[{t$95$0 = N[(n * N[(100.0 + N[(i * N[(50.0 + N[(i * 16.666666666666668), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -2.8e+22], t$95$0, If[LessEqual[n, 0.42], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := n \cdot \left(100 + i \cdot \left(50 + i \cdot 16.666666666666668\right)\right)\\
                    \mathbf{if}\;n \leq -2.8 \cdot 10^{+22}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;n \leq 0.42:\\
                    \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if n < -2.8e22 or 0.419999999999999984 < n

                      1. Initial program 33.1%

                        \[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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                      4. Step-by-step derivation
                        1. /-lowering-/.f64N/A

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

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                        3. expm1-defineN/A

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                        4. expm1-lowering-expm1.f6489.3%

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                      5. Simplified89.3%

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{50}{3} \cdot i\right), \color{blue}{50}\right)\right)\right)\right) \]
                        12. *-lowering-*.f6464.3%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{50}{3}, i\right), 50\right)\right)\right)\right) \]
                      8. Simplified64.3%

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(50, \left(i \cdot \color{blue}{\frac{50}{3}}\right)\right)\right)\right)\right) \]
                        6. *-lowering-*.f6464.3%

                          \[\leadsto \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(i, \mathsf{+.f64}\left(50, \mathsf{*.f64}\left(i, \color{blue}{\frac{50}{3}}\right)\right)\right)\right)\right) \]
                      11. Simplified64.3%

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

                      if -2.8e22 < n < 0.419999999999999984

                      1. Initial program 25.1%

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

                        \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
                      4. Step-by-step derivation
                        1. Simplified60.5%

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

                      Alternative 16: 62.6% accurate, 6.0× speedup?

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

                        1. Initial program 34.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                        4. Step-by-step derivation
                          1. /-lowering-/.f64N/A

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

                            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                          3. expm1-defineN/A

                            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                          4. expm1-lowering-expm1.f6480.2%

                            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                        5. Simplified80.2%

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

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{\left(i \cdot n\right)}, i\right)\right) \]
                        7. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\left(n \cdot i\right), i\right)\right) \]
                          2. *-lowering-*.f6453.4%

                            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, i\right), i\right)\right) \]
                        8. Simplified53.4%

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

                        if -1.12e-60 < n < 0.419999999999999984

                        1. Initial program 26.1%

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

                          \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
                        4. Step-by-step derivation
                          1. Simplified59.4%

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

                          if 0.419999999999999984 < n

                          1. Initial program 28.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                          4. Step-by-step derivation
                            1. /-lowering-/.f64N/A

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

                              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                            3. expm1-defineN/A

                              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                            4. expm1-lowering-expm1.f6496.9%

                              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                          5. Simplified96.9%

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{50}{3} \cdot i\right), \color{blue}{50}\right)\right)\right)\right) \]
                            12. *-lowering-*.f6475.7%

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{50}{3}, i\right), 50\right)\right)\right)\right) \]
                          8. Simplified75.7%

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

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

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \left(n \cdot \color{blue}{50}\right)\right)\right) \]
                            2. *-lowering-*.f6469.3%

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \color{blue}{50}\right)\right)\right) \]
                          11. Simplified69.3%

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.12 \cdot 10^{-60}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq 0.42:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot 100 + i \cdot \left(n \cdot 50\right)\\ \end{array} \]
                        7. Add Preprocessing

                        Alternative 17: 62.6% accurate, 6.7× speedup?

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

                          1. Initial program 34.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                          4. Step-by-step derivation
                            1. /-lowering-/.f64N/A

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

                              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                            3. expm1-defineN/A

                              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                            4. expm1-lowering-expm1.f6480.2%

                              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                          5. Simplified80.2%

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

                            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{\left(i \cdot n\right)}, i\right)\right) \]
                          7. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\left(n \cdot i\right), i\right)\right) \]
                            2. *-lowering-*.f6453.4%

                              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, i\right), i\right)\right) \]
                          8. Simplified53.4%

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

                          if -1.12e-60 < n < 0.419999999999999984

                          1. Initial program 26.1%

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

                            \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
                          4. Step-by-step derivation
                            1. Simplified59.4%

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

                            if 0.419999999999999984 < n

                            1. Initial program 28.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                            4. Step-by-step derivation
                              1. /-lowering-/.f64N/A

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

                                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                              3. expm1-defineN/A

                                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                              4. expm1-lowering-expm1.f6496.9%

                                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                            5. Simplified96.9%

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

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \color{blue}{\left(50 \cdot i\right)}\right)\right) \]
                              6. *-lowering-*.f6469.3%

                                \[\leadsto \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(100, \mathsf{*.f64}\left(50, \color{blue}{i}\right)\right)\right) \]
                            8. Simplified69.3%

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.12 \cdot 10^{-60}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq 0.42:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\ \end{array} \]
                          7. Add Preprocessing

                          Alternative 18: 62.0% accurate, 6.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := 100 \cdot \frac{i \cdot n}{i}\\ \mathbf{if}\;n \leq -1.12 \cdot 10^{-60}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 5 \cdot 10^{-19}:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                          (FPCore (i n)
                           :precision binary64
                           (let* ((t_0 (* 100.0 (/ (* i n) i))))
                             (if (<= n -1.12e-60) t_0 (if (<= n 5e-19) (* 100.0 (/ i (/ i n))) t_0))))
                          double code(double i, double n) {
                          	double t_0 = 100.0 * ((i * n) / i);
                          	double tmp;
                          	if (n <= -1.12e-60) {
                          		tmp = t_0;
                          	} else if (n <= 5e-19) {
                          		tmp = 100.0 * (i / (i / n));
                          	} else {
                          		tmp = t_0;
                          	}
                          	return tmp;
                          }
                          
                          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 = 100.0d0 * ((i * n) / i)
                              if (n <= (-1.12d-60)) then
                                  tmp = t_0
                              else if (n <= 5d-19) then
                                  tmp = 100.0d0 * (i / (i / n))
                              else
                                  tmp = t_0
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double i, double n) {
                          	double t_0 = 100.0 * ((i * n) / i);
                          	double tmp;
                          	if (n <= -1.12e-60) {
                          		tmp = t_0;
                          	} else if (n <= 5e-19) {
                          		tmp = 100.0 * (i / (i / n));
                          	} else {
                          		tmp = t_0;
                          	}
                          	return tmp;
                          }
                          
                          def code(i, n):
                          	t_0 = 100.0 * ((i * n) / i)
                          	tmp = 0
                          	if n <= -1.12e-60:
                          		tmp = t_0
                          	elif n <= 5e-19:
                          		tmp = 100.0 * (i / (i / n))
                          	else:
                          		tmp = t_0
                          	return tmp
                          
                          function code(i, n)
                          	t_0 = Float64(100.0 * Float64(Float64(i * n) / i))
                          	tmp = 0.0
                          	if (n <= -1.12e-60)
                          		tmp = t_0;
                          	elseif (n <= 5e-19)
                          		tmp = Float64(100.0 * Float64(i / Float64(i / n)));
                          	else
                          		tmp = t_0;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(i, n)
                          	t_0 = 100.0 * ((i * n) / i);
                          	tmp = 0.0;
                          	if (n <= -1.12e-60)
                          		tmp = t_0;
                          	elseif (n <= 5e-19)
                          		tmp = 100.0 * (i / (i / n));
                          	else
                          		tmp = t_0;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[i_, n_] := Block[{t$95$0 = N[(100.0 * N[(N[(i * n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.12e-60], t$95$0, If[LessEqual[n, 5e-19], N[(100.0 * N[(i / N[(i / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := 100 \cdot \frac{i \cdot n}{i}\\
                          \mathbf{if}\;n \leq -1.12 \cdot 10^{-60}:\\
                          \;\;\;\;t\_0\\
                          
                          \mathbf{elif}\;n \leq 5 \cdot 10^{-19}:\\
                          \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_0\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if n < -1.12e-60 or 5.0000000000000004e-19 < n

                            1. Initial program 31.7%

                              \[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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                            4. Step-by-step derivation
                              1. /-lowering-/.f64N/A

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

                                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                              3. expm1-defineN/A

                                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                              4. expm1-lowering-expm1.f6486.1%

                                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                            5. Simplified86.1%

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

                              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{\left(i \cdot n\right)}, i\right)\right) \]
                            7. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\left(n \cdot i\right), i\right)\right) \]
                              2. *-lowering-*.f6459.4%

                                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, i\right), i\right)\right) \]
                            8. Simplified59.4%

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

                            if -1.12e-60 < n < 5.0000000000000004e-19

                            1. Initial program 25.3%

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

                              \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
                            4. Step-by-step derivation
                              1. Simplified60.5%

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.12 \cdot 10^{-60}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \mathbf{elif}\;n \leq 5 \cdot 10^{-19}:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{i \cdot n}{i}\\ \end{array} \]
                            7. Add Preprocessing

                            Alternative 19: 61.0% accurate, 6.7× speedup?

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

                              1. Initial program 57.1%

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

                                \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\color{blue}{i}, \mathsf{/.f64}\left(i, n\right)\right)\right) \]
                              4. Step-by-step derivation
                                1. Simplified15.8%

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

                                if -4.99999999999999957e28 < i < 1.4000000000000001e24

                                1. Initial program 7.4%

                                  \[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. *-lowering-*.f6480.8%

                                    \[\leadsto \mathsf{*.f64}\left(100, \color{blue}{n}\right) \]
                                5. Simplified80.8%

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

                                if 1.4000000000000001e24 < i

                                1. Initial program 58.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                                4. Step-by-step derivation
                                  1. /-lowering-/.f64N/A

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

                                    \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                                  3. expm1-defineN/A

                                    \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                                  4. expm1-lowering-expm1.f6439.7%

                                    \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                                5. Simplified39.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{50}{3} \cdot i\right), \color{blue}{50}\right)\right)\right)\right) \]
                                  12. *-lowering-*.f6431.5%

                                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{50}{3}, i\right), 50\right)\right)\right)\right) \]
                                8. Simplified31.5%

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

                                  \[\leadsto \color{blue}{\frac{50}{3} \cdot \left({i}^{2} \cdot n\right)} \]
                                10. Step-by-step derivation
                                  1. *-lowering-*.f64N/A

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

                                    \[\leadsto \mathsf{*.f64}\left(\frac{50}{3}, \left(n \cdot \color{blue}{{i}^{2}}\right)\right) \]
                                  3. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{*.f64}\left(\frac{50}{3}, \mathsf{*.f64}\left(n, \color{blue}{\left({i}^{2}\right)}\right)\right) \]
                                  4. unpow2N/A

                                    \[\leadsto \mathsf{*.f64}\left(\frac{50}{3}, \mathsf{*.f64}\left(n, \left(i \cdot \color{blue}{i}\right)\right)\right) \]
                                  5. *-lowering-*.f6431.5%

                                    \[\leadsto \mathsf{*.f64}\left(\frac{50}{3}, \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \color{blue}{i}\right)\right)\right) \]
                                11. Simplified31.5%

                                  \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)} \]
                              5. Recombined 3 regimes into one program.
                              6. Final simplification56.7%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -5 \cdot 10^{+28}:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 1.4 \cdot 10^{+24}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \]
                              7. Add Preprocessing

                              Alternative 20: 57.3% accurate, 9.5× speedup?

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

                                1. Initial program 19.0%

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

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

                                    \[\leadsto \mathsf{*.f64}\left(100, \color{blue}{n}\right) \]
                                5. Simplified63.2%

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

                                if 1.85e24 < i

                                1. Initial program 58.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 \mathsf{*.f64}\left(100, \color{blue}{\left(\frac{n \cdot \left(e^{i} - 1\right)}{i}\right)}\right) \]
                                4. Step-by-step derivation
                                  1. /-lowering-/.f64N/A

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

                                    \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(e^{i} - 1\right)\right), i\right)\right) \]
                                  3. expm1-defineN/A

                                    \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \left(\mathsf{expm1}\left(i\right)\right)\right), i\right)\right) \]
                                  4. expm1-lowering-expm1.f6439.7%

                                    \[\leadsto \mathsf{*.f64}\left(100, \mathsf{/.f64}\left(\mathsf{*.f64}\left(n, \mathsf{expm1.f64}\left(i\right)\right), i\right)\right) \]
                                5. Simplified39.7%

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\left(\frac{50}{3} \cdot i\right), \color{blue}{50}\right)\right)\right)\right) \]
                                  12. *-lowering-*.f6431.5%

                                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(100, n\right), \mathsf{*.f64}\left(i, \mathsf{*.f64}\left(n, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{50}{3}, i\right), 50\right)\right)\right)\right) \]
                                8. Simplified31.5%

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

                                  \[\leadsto \color{blue}{\frac{50}{3} \cdot \left({i}^{2} \cdot n\right)} \]
                                10. Step-by-step derivation
                                  1. *-lowering-*.f64N/A

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

                                    \[\leadsto \mathsf{*.f64}\left(\frac{50}{3}, \left(n \cdot \color{blue}{{i}^{2}}\right)\right) \]
                                  3. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{*.f64}\left(\frac{50}{3}, \mathsf{*.f64}\left(n, \color{blue}{\left({i}^{2}\right)}\right)\right) \]
                                  4. unpow2N/A

                                    \[\leadsto \mathsf{*.f64}\left(\frac{50}{3}, \mathsf{*.f64}\left(n, \left(i \cdot \color{blue}{i}\right)\right)\right) \]
                                  5. *-lowering-*.f6431.5%

                                    \[\leadsto \mathsf{*.f64}\left(\frac{50}{3}, \mathsf{*.f64}\left(n, \mathsf{*.f64}\left(i, \color{blue}{i}\right)\right)\right) \]
                                11. Simplified31.5%

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 1.85 \cdot 10^{+24}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \]
                              5. Add Preprocessing

                              Alternative 21: 50.0% accurate, 38.0× speedup?

                              \[\begin{array}{l} \\ n \cdot 100 \end{array} \]
                              (FPCore (i n) :precision binary64 (* n 100.0))
                              double code(double i, double n) {
                              	return n * 100.0;
                              }
                              
                              real(8) function code(i, n)
                                  real(8), intent (in) :: i
                                  real(8), intent (in) :: n
                                  code = n * 100.0d0
                              end function
                              
                              public static double code(double i, double n) {
                              	return n * 100.0;
                              }
                              
                              def code(i, n):
                              	return n * 100.0
                              
                              function code(i, n)
                              	return Float64(n * 100.0)
                              end
                              
                              function tmp = code(i, n)
                              	tmp = n * 100.0;
                              end
                              
                              code[i_, n_] := N[(n * 100.0), $MachinePrecision]
                              
                              \begin{array}{l}
                              
                              \\
                              n \cdot 100
                              \end{array}
                              
                              Derivation
                              1. Initial program 29.2%

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

                                \[\leadsto \color{blue}{100 \cdot n} \]
                              4. Step-by-step derivation
                                1. *-lowering-*.f6447.9%

                                  \[\leadsto \mathsf{*.f64}\left(100, \color{blue}{n}\right) \]
                              5. Simplified47.9%

                                \[\leadsto \color{blue}{100 \cdot n} \]
                              6. Final simplification47.9%

                                \[\leadsto n \cdot 100 \]
                              7. Add Preprocessing

                              Developer Target 1: 33.8% 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 2024139 
                              (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))))