Compound Interest

Percentage Accurate: 28.9% → 96.0%
Time: 16.7s
Alternatives: 18
Speedup: 8.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 28.9% 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: 96.0% accurate, 0.3× speedup?

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

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

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

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

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


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

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 25.1%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{100 \cdot n} \]
    9. Step-by-step derivation
      1. lower-*.f6473.8

        \[\leadsto \color{blue}{100 \cdot n} \]
    10. Simplified73.8%

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

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

Alternative 2: 79.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -4.6 \cdot 10^{+194}:\\ \;\;\;\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \cdot 100\\ \mathbf{elif}\;i \leq 3.8 \cdot 10^{+37}:\\ \;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\ \mathbf{elif}\;i \leq 7.6 \cdot 10^{+140}:\\ \;\;\;\;100 \cdot \frac{n \cdot {\left(\frac{i}{n}\right)}^{n} - n}{i}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({\left(\frac{i}{n}\right)}^{\left(n + -1\right)}, 100, \frac{n}{i} \cdot \left(-100\right)\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i -4.6e+194)
   (* (/ (+ (pow (+ 1.0 (/ i n)) n) -1.0) (/ i n)) 100.0)
   (if (<= i 3.8e+37)
     (* (* n 100.0) (/ (expm1 i) i))
     (if (<= i 7.6e+140)
       (* 100.0 (/ (- (* n (pow (/ i n) n)) n) i))
       (fma (pow (/ i n) (+ n -1.0)) 100.0 (* (/ n i) (- 100.0)))))))
double code(double i, double n) {
	double tmp;
	if (i <= -4.6e+194) {
		tmp = ((pow((1.0 + (i / n)), n) + -1.0) / (i / n)) * 100.0;
	} else if (i <= 3.8e+37) {
		tmp = (n * 100.0) * (expm1(i) / i);
	} else if (i <= 7.6e+140) {
		tmp = 100.0 * (((n * pow((i / n), n)) - n) / i);
	} else {
		tmp = fma(pow((i / n), (n + -1.0)), 100.0, ((n / i) * -100.0));
	}
	return tmp;
}
function code(i, n)
	tmp = 0.0
	if (i <= -4.6e+194)
		tmp = Float64(Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) + -1.0) / Float64(i / n)) * 100.0);
	elseif (i <= 3.8e+37)
		tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i));
	elseif (i <= 7.6e+140)
		tmp = Float64(100.0 * Float64(Float64(Float64(n * (Float64(i / n) ^ n)) - n) / i));
	else
		tmp = fma((Float64(i / n) ^ Float64(n + -1.0)), 100.0, Float64(Float64(n / i) * Float64(-100.0)));
	end
	return tmp
end
code[i_, n_] := If[LessEqual[i, -4.6e+194], 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], If[LessEqual[i, 3.8e+37], N[(N[(n * 100.0), $MachinePrecision] * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.6e+140], N[(100.0 * N[(N[(N[(n * N[Power[N[(i / n), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(i / n), $MachinePrecision], N[(n + -1.0), $MachinePrecision]], $MachinePrecision] * 100.0 + N[(N[(n / i), $MachinePrecision] * (-100.0)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;i \leq 3.8 \cdot 10^{+37}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -4.6000000000000001e194

    1. Initial program 99.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Add Preprocessing

    if -4.6000000000000001e194 < i < 3.7999999999999999e37

    1. Initial program 15.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7999999999999999e37 < i < 7.6000000000000002e140

    1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    6. Step-by-step derivation
      1. lower-/.f6490.2

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

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

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

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

        \[\leadsto 100 \cdot \left(\frac{\color{blue}{{\left(\frac{i}{n}\right)}^{n} \cdot n}}{i} - \frac{n}{i}\right) \]
      4. sub-divN/A

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

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

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

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

        \[\leadsto 100 \cdot \frac{\color{blue}{n \cdot {\left(\frac{i}{n}\right)}^{n}} - n}{i} \]
      9. lower-*.f6490.3

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

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

    if 7.6000000000000002e140 < i

    1. Initial program 47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    6. Step-by-step derivation
      1. lower-/.f6448.3

        \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    7. Simplified48.3%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -4.6 \cdot 10^{+194}:\\ \;\;\;\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \cdot 100\\ \mathbf{elif}\;i \leq 3.8 \cdot 10^{+37}:\\ \;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\ \mathbf{elif}\;i \leq 7.6 \cdot 10^{+140}:\\ \;\;\;\;100 \cdot \frac{n \cdot {\left(\frac{i}{n}\right)}^{n} - n}{i}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({\left(\frac{i}{n}\right)}^{\left(n + -1\right)}, 100, \frac{n}{i} \cdot \left(-100\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -4.6 \cdot 10^{+194}:\\ \;\;\;\;n \cdot \frac{\mathsf{fma}\left({\left(1 + \frac{i}{n}\right)}^{n}, 100, -100\right)}{i}\\ \mathbf{elif}\;i \leq 3.8 \cdot 10^{+37}:\\ \;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\ \mathbf{elif}\;i \leq 7.6 \cdot 10^{+140}:\\ \;\;\;\;100 \cdot \frac{n \cdot {\left(\frac{i}{n}\right)}^{n} - n}{i}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({\left(\frac{i}{n}\right)}^{\left(n + -1\right)}, 100, \frac{n}{i} \cdot \left(-100\right)\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i -4.6e+194)
   (* n (/ (fma (pow (+ 1.0 (/ i n)) n) 100.0 -100.0) i))
   (if (<= i 3.8e+37)
     (* (* n 100.0) (/ (expm1 i) i))
     (if (<= i 7.6e+140)
       (* 100.0 (/ (- (* n (pow (/ i n) n)) n) i))
       (fma (pow (/ i n) (+ n -1.0)) 100.0 (* (/ n i) (- 100.0)))))))
double code(double i, double n) {
	double tmp;
	if (i <= -4.6e+194) {
		tmp = n * (fma(pow((1.0 + (i / n)), n), 100.0, -100.0) / i);
	} else if (i <= 3.8e+37) {
		tmp = (n * 100.0) * (expm1(i) / i);
	} else if (i <= 7.6e+140) {
		tmp = 100.0 * (((n * pow((i / n), n)) - n) / i);
	} else {
		tmp = fma(pow((i / n), (n + -1.0)), 100.0, ((n / i) * -100.0));
	}
	return tmp;
}
function code(i, n)
	tmp = 0.0
	if (i <= -4.6e+194)
		tmp = Float64(n * Float64(fma((Float64(1.0 + Float64(i / n)) ^ n), 100.0, -100.0) / i));
	elseif (i <= 3.8e+37)
		tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i));
	elseif (i <= 7.6e+140)
		tmp = Float64(100.0 * Float64(Float64(Float64(n * (Float64(i / n) ^ n)) - n) / i));
	else
		tmp = fma((Float64(i / n) ^ Float64(n + -1.0)), 100.0, Float64(Float64(n / i) * Float64(-100.0)));
	end
	return tmp
end
code[i_, n_] := If[LessEqual[i, -4.6e+194], N[(n * N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] * 100.0 + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.8e+37], N[(N[(n * 100.0), $MachinePrecision] * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.6e+140], N[(100.0 * N[(N[(N[(n * N[Power[N[(i / n), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(i / n), $MachinePrecision], N[(n + -1.0), $MachinePrecision]], $MachinePrecision] * 100.0 + N[(N[(n / i), $MachinePrecision] * (-100.0)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.6 \cdot 10^{+194}:\\
\;\;\;\;n \cdot \frac{\mathsf{fma}\left({\left(1 + \frac{i}{n}\right)}^{n}, 100, -100\right)}{i}\\

\mathbf{elif}\;i \leq 3.8 \cdot 10^{+37}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -4.6000000000000001e194

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.6000000000000001e194 < i < 3.7999999999999999e37

    1. Initial program 15.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7999999999999999e37 < i < 7.6000000000000002e140

    1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    6. Step-by-step derivation
      1. lower-/.f6490.2

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

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

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

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

        \[\leadsto 100 \cdot \left(\frac{\color{blue}{{\left(\frac{i}{n}\right)}^{n} \cdot n}}{i} - \frac{n}{i}\right) \]
      4. sub-divN/A

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

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

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

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

        \[\leadsto 100 \cdot \frac{\color{blue}{n \cdot {\left(\frac{i}{n}\right)}^{n}} - n}{i} \]
      9. lower-*.f6490.3

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

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

    if 7.6000000000000002e140 < i

    1. Initial program 47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    6. Step-by-step derivation
      1. lower-/.f6448.3

        \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    7. Simplified48.3%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -4.6 \cdot 10^{+194}:\\ \;\;\;\;n \cdot \frac{\mathsf{fma}\left({\left(1 + \frac{i}{n}\right)}^{n}, 100, -100\right)}{i}\\ \mathbf{elif}\;i \leq 3.8 \cdot 10^{+37}:\\ \;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\ \mathbf{elif}\;i \leq 7.6 \cdot 10^{+140}:\\ \;\;\;\;100 \cdot \frac{n \cdot {\left(\frac{i}{n}\right)}^{n} - n}{i}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({\left(\frac{i}{n}\right)}^{\left(n + -1\right)}, 100, \frac{n}{i} \cdot \left(-100\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -4.6 \cdot 10^{+194}:\\ \;\;\;\;n \cdot \frac{\mathsf{fma}\left({\left(1 + \frac{i}{n}\right)}^{n}, 100, -100\right)}{i}\\ \mathbf{elif}\;i \leq 3.8 \cdot 10^{+37}:\\ \;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\ \mathbf{elif}\;i \leq 7.5 \cdot 10^{+140}:\\ \;\;\;\;100 \cdot \frac{n \cdot {\left(\frac{i}{n}\right)}^{n} - n}{i}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left({\left(\frac{i}{n}\right)}^{\left(n + -1\right)} - \frac{n}{i}\right)\\ \end{array} \end{array} \]
(FPCore (i n)
 :precision binary64
 (if (<= i -4.6e+194)
   (* n (/ (fma (pow (+ 1.0 (/ i n)) n) 100.0 -100.0) i))
   (if (<= i 3.8e+37)
     (* (* n 100.0) (/ (expm1 i) i))
     (if (<= i 7.5e+140)
       (* 100.0 (/ (- (* n (pow (/ i n) n)) n) i))
       (* 100.0 (- (pow (/ i n) (+ n -1.0)) (/ n i)))))))
double code(double i, double n) {
	double tmp;
	if (i <= -4.6e+194) {
		tmp = n * (fma(pow((1.0 + (i / n)), n), 100.0, -100.0) / i);
	} else if (i <= 3.8e+37) {
		tmp = (n * 100.0) * (expm1(i) / i);
	} else if (i <= 7.5e+140) {
		tmp = 100.0 * (((n * pow((i / n), n)) - n) / i);
	} else {
		tmp = 100.0 * (pow((i / n), (n + -1.0)) - (n / i));
	}
	return tmp;
}
function code(i, n)
	tmp = 0.0
	if (i <= -4.6e+194)
		tmp = Float64(n * Float64(fma((Float64(1.0 + Float64(i / n)) ^ n), 100.0, -100.0) / i));
	elseif (i <= 3.8e+37)
		tmp = Float64(Float64(n * 100.0) * Float64(expm1(i) / i));
	elseif (i <= 7.5e+140)
		tmp = Float64(100.0 * Float64(Float64(Float64(n * (Float64(i / n) ^ n)) - n) / i));
	else
		tmp = Float64(100.0 * Float64((Float64(i / n) ^ Float64(n + -1.0)) - Float64(n / i)));
	end
	return tmp
end
code[i_, n_] := If[LessEqual[i, -4.6e+194], N[(n * N[(N[(N[Power[N[(1.0 + N[(i / n), $MachinePrecision]), $MachinePrecision], n], $MachinePrecision] * 100.0 + -100.0), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.8e+37], N[(N[(n * 100.0), $MachinePrecision] * N[(N[(Exp[i] - 1), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.5e+140], N[(100.0 * N[(N[(N[(n * N[Power[N[(i / n), $MachinePrecision], n], $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision], N[(100.0 * N[(N[Power[N[(i / n), $MachinePrecision], N[(n + -1.0), $MachinePrecision]], $MachinePrecision] - N[(n / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.6 \cdot 10^{+194}:\\
\;\;\;\;n \cdot \frac{\mathsf{fma}\left({\left(1 + \frac{i}{n}\right)}^{n}, 100, -100\right)}{i}\\

\mathbf{elif}\;i \leq 3.8 \cdot 10^{+37}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if i < -4.6000000000000001e194

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.6000000000000001e194 < i < 3.7999999999999999e37

    1. Initial program 15.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7999999999999999e37 < i < 7.4999999999999997e140

    1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    6. Step-by-step derivation
      1. lower-/.f6490.2

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

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

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

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

        \[\leadsto 100 \cdot \left(\frac{\color{blue}{{\left(\frac{i}{n}\right)}^{n} \cdot n}}{i} - \frac{n}{i}\right) \]
      4. sub-divN/A

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

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

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

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

        \[\leadsto 100 \cdot \frac{\color{blue}{n \cdot {\left(\frac{i}{n}\right)}^{n}} - n}{i} \]
      9. lower-*.f6490.3

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

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

    if 7.4999999999999997e140 < i

    1. Initial program 47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    6. Step-by-step derivation
      1. lower-/.f6448.3

        \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    7. Simplified48.3%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{{\left(\frac{i}{n}\right)}^{n} \cdot n}{i} - \frac{n}{i}\right) \cdot 100} \]
      8. lower-*.f6448.3

        \[\leadsto \color{blue}{\left(\frac{{\left(\frac{i}{n}\right)}^{n} \cdot n}{i} - \frac{n}{i}\right) \cdot 100} \]
    9. Applied egg-rr83.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -4.6 \cdot 10^{+194}:\\ \;\;\;\;n \cdot \frac{\mathsf{fma}\left({\left(1 + \frac{i}{n}\right)}^{n}, 100, -100\right)}{i}\\ \mathbf{elif}\;i \leq 3.8 \cdot 10^{+37}:\\ \;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\ \mathbf{elif}\;i \leq 7.5 \cdot 10^{+140}:\\ \;\;\;\;100 \cdot \frac{n \cdot {\left(\frac{i}{n}\right)}^{n} - n}{i}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left({\left(\frac{i}{n}\right)}^{\left(n + -1\right)} - \frac{n}{i}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 79.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_0 := 100 \cdot \frac{n \cdot {\left(\frac{i}{n}\right)}^{n} - n}{i}\\
\mathbf{if}\;i \leq -3.5 \cdot 10^{+143}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;i \leq 3.8 \cdot 10^{+37}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}\\

\mathbf{elif}\;i \leq 7.5 \cdot 10^{+140}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -3.50000000000000008e143 or 3.7999999999999999e37 < i < 7.4999999999999997e140

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    6. Step-by-step derivation
      1. lower-/.f6493.3

        \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    7. Simplified93.3%

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

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

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

        \[\leadsto 100 \cdot \left(\frac{\color{blue}{{\left(\frac{i}{n}\right)}^{n} \cdot n}}{i} - \frac{n}{i}\right) \]
      4. sub-divN/A

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

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

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

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

        \[\leadsto 100 \cdot \frac{\color{blue}{n \cdot {\left(\frac{i}{n}\right)}^{n}} - n}{i} \]
      9. lower-*.f6493.4

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

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

    if -3.50000000000000008e143 < i < 3.7999999999999999e37

    1. Initial program 13.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.4999999999999997e140 < i

    1. Initial program 47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    6. Step-by-step derivation
      1. lower-/.f6448.3

        \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    7. Simplified48.3%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{{\left(\frac{i}{n}\right)}^{n} \cdot n}{i} - \frac{n}{i}\right) \cdot 100} \]
      8. lower-*.f6448.3

        \[\leadsto \color{blue}{\left(\frac{{\left(\frac{i}{n}\right)}^{n} \cdot n}{i} - \frac{n}{i}\right) \cdot 100} \]
    9. Applied egg-rr83.3%

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

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

Alternative 6: 79.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 24.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.1999999999999992e134 < i

    1. Initial program 47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    6. Step-by-step derivation
      1. lower-/.f6448.3

        \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
    7. Simplified48.3%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{{\left(\frac{i}{n}\right)}^{n} \cdot n}{i} - \frac{n}{i}\right) \cdot 100} \]
      8. lower-*.f6448.3

        \[\leadsto \color{blue}{\left(\frac{{\left(\frac{i}{n}\right)}^{n} \cdot n}{i} - \frac{n}{i}\right) \cdot 100} \]
    9. Applied egg-rr83.3%

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

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

Alternative 7: 79.1% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;n \leq 1.05 \cdot 10^{-33}:\\
\;\;\;\;100 \cdot \frac{1 + -1}{\frac{i}{n}}\\

\mathbf{else}:\\
\;\;\;\;\left(n \cdot 100\right) \cdot t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < -2.29999999999999988e-219

    1. Initial program 26.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\frac{\mathsf{expm1}\left(i\right)}{i} \cdot 100\right) \cdot n} \]
      8. lower-*.f6478.9

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

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

    if -2.29999999999999988e-219 < n < 1.05e-33

    1. Initial program 36.9%

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

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

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

      if 1.05e-33 < n

      1. Initial program 21.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 79.0% accurate, 1.1× speedup?

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

      1. Initial program 24.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.29999999999999988e-219 < n < 1.05e-33

      1. Initial program 36.9%

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

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

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

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

      Alternative 9: 76.6% accurate, 1.1× speedup?

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

        1. Initial program 22.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -4.2000000000000002e-128 < n < 1.05e-33

        1. Initial program 40.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 100 \cdot \frac{\color{blue}{1} - 1}{\frac{i}{n}} \]
        4. Step-by-step derivation
          1. Simplified61.8%

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

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

        Alternative 10: 73.4% accurate, 2.6× speedup?

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

          1. Initial program 62.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto 100 \cdot \color{blue}{\frac{-1 \cdot n}{i}} \]
            2. lower-/.f64N/A

              \[\leadsto 100 \cdot \color{blue}{\frac{-1 \cdot n}{i}} \]
            3. mul-1-negN/A

              \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{neg}\left(n\right)}}{i} \]
            4. lower-neg.f6467.7

              \[\leadsto 100 \cdot \frac{\color{blue}{-n}}{i} \]
          10. Simplified67.7%

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

          if -1.8999999999999999 < i < 7.6000000000000002e140

          1. Initial program 15.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 7.6000000000000002e140 < i

          1. Initial program 47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto 100 \cdot \frac{\color{blue}{1} \cdot i - \frac{i}{n} \cdot n}{\frac{i \cdot i}{n}} \]
            2. Applied egg-rr60.7%

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

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

          Alternative 11: 73.7% accurate, 2.6× speedup?

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

            1. Initial program 56.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto 100 \cdot \color{blue}{\frac{-1 \cdot n}{i}} \]
              2. lower-/.f64N/A

                \[\leadsto 100 \cdot \color{blue}{\frac{-1 \cdot n}{i}} \]
              3. mul-1-negN/A

                \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{neg}\left(n\right)}}{i} \]
              4. lower-neg.f6465.6

                \[\leadsto 100 \cdot \frac{\color{blue}{-n}}{i} \]
            10. Simplified65.6%

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

            if -1.8999999999999999 < i < 5.00000000000000004e154

            1. Initial program 15.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(100 \cdot n\right) \cdot \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(i, \mathsf{fma}\left(i, 0.041666666666666664, 0.16666666666666666\right), 0.5\right), i \cdot i, i\right)}}{i} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification73.7%

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

          Alternative 12: 73.6% accurate, 3.6× speedup?

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

            1. Initial program 56.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto 100 \cdot \color{blue}{\frac{-1 \cdot n}{i}} \]
              2. lower-/.f64N/A

                \[\leadsto 100 \cdot \color{blue}{\frac{-1 \cdot n}{i}} \]
              3. mul-1-negN/A

                \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{neg}\left(n\right)}}{i} \]
              4. lower-neg.f6465.6

                \[\leadsto 100 \cdot \frac{\color{blue}{-n}}{i} \]
            10. Simplified65.6%

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

            if -1.8999999999999999 < i < 5.00000000000000004e154

            1. Initial program 15.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(100, 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)\right)} \]
              2. distribute-lft-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(100, n, \left(i \cdot n\right) \cdot 50 + \left(\left(i \cdot n\right) \cdot \left(i \cdot \left(\frac{25}{6} \cdot i\right)\right) + \color{blue}{\left(i \cdot n\right) \cdot \left(\frac{50}{3} \cdot i\right)}\right)\right) \]
            10. Simplified76.4%

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

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

          Alternative 13: 72.7% accurate, 4.7× speedup?

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

            1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
            6. Step-by-step derivation
              1. lower-/.f6462.2

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

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

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

                \[\leadsto 100 \cdot \color{blue}{\frac{-1 \cdot n}{i}} \]
              2. lower-/.f64N/A

                \[\leadsto 100 \cdot \color{blue}{\frac{-1 \cdot n}{i}} \]
              3. mul-1-negN/A

                \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{neg}\left(n\right)}}{i} \]
              4. lower-neg.f6464.8

                \[\leadsto 100 \cdot \frac{\color{blue}{-n}}{i} \]
            10. Simplified64.8%

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

            if -1.6000000000000001 < i < 5.00000000000000004e154

            1. Initial program 15.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}} \]
            8. 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)} \]
            9. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto n \cdot \color{blue}{\left(\left(50 \cdot i + i \cdot \left(\frac{50}{3} \cdot i\right)\right) + 100\right)} \]
            10. Simplified76.0%

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

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

          Alternative 14: 72.6% accurate, 4.9× speedup?

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

            1. Initial program 55.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
            6. Step-by-step derivation
              1. lower-/.f6462.2

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

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

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

                \[\leadsto \color{blue}{\frac{-100 \cdot n}{i}} \]
              2. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{-100 \cdot n}{i}} \]
              3. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{n \cdot -100}}{i} \]
              4. lower-*.f6464.7

                \[\leadsto \frac{\color{blue}{n \cdot -100}}{i} \]
            10. Simplified64.7%

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

            if -1.6000000000000001 < i < 5.00000000000000004e154

            1. Initial program 15.8%

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

                \[\leadsto 100 \cdot \frac{{\left(1 + \color{blue}{\frac{i}{n}}\right)}^{n} - 1}{\frac{i}{n}} \]
              2. lift-+.f64N/A

                \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
              3. pow-to-expN/A

                \[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}} \]
              4. lower-expm1.f64N/A

                \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
              5. *-commutativeN/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              6. lower-*.f64N/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              7. lift-+.f64N/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \log \color{blue}{\left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              8. lower-log1p.f6475.8

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
            4. Applied egg-rr75.8%

              \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
            5. Taylor expanded in n around inf

              \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
            6. Step-by-step derivation
              1. associate-/l*N/A

                \[\leadsto 100 \cdot \color{blue}{\left(n \cdot \frac{e^{i} - 1}{i}\right)} \]
              2. associate-*r*N/A

                \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{e^{i} - 1}{i}} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{e^{i} - 1}{i}} \]
              4. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(100 \cdot n\right)} \cdot \frac{e^{i} - 1}{i} \]
              5. lower-/.f64N/A

                \[\leadsto \left(100 \cdot n\right) \cdot \color{blue}{\frac{e^{i} - 1}{i}} \]
              6. lower-expm1.f6480.3

                \[\leadsto \left(100 \cdot n\right) \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{i} \]
            7. Simplified80.3%

              \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}} \]
            8. 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)} \]
            9. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{i \cdot \left(\frac{50}{3} \cdot \left(i \cdot n\right) + 50 \cdot n\right) + 100 \cdot n} \]
              2. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\frac{50}{3} \cdot \left(i \cdot n\right) + 50 \cdot n\right) \cdot i} + 100 \cdot n \]
              3. associate-*r*N/A

                \[\leadsto \left(\color{blue}{\left(\frac{50}{3} \cdot i\right) \cdot n} + 50 \cdot n\right) \cdot i + 100 \cdot n \]
              4. distribute-rgt-outN/A

                \[\leadsto \color{blue}{\left(n \cdot \left(\frac{50}{3} \cdot i + 50\right)\right)} \cdot i + 100 \cdot n \]
              5. associate-*l*N/A

                \[\leadsto \color{blue}{n \cdot \left(\left(\frac{50}{3} \cdot i + 50\right) \cdot i\right)} + 100 \cdot n \]
              6. *-commutativeN/A

                \[\leadsto n \cdot \left(\left(\frac{50}{3} \cdot i + 50\right) \cdot i\right) + \color{blue}{n \cdot 100} \]
              7. distribute-lft-outN/A

                \[\leadsto \color{blue}{n \cdot \left(\left(\frac{50}{3} \cdot i + 50\right) \cdot i + 100\right)} \]
              8. *-commutativeN/A

                \[\leadsto n \cdot \left(\color{blue}{i \cdot \left(\frac{50}{3} \cdot i + 50\right)} + 100\right) \]
              9. +-commutativeN/A

                \[\leadsto n \cdot \left(i \cdot \color{blue}{\left(50 + \frac{50}{3} \cdot i\right)} + 100\right) \]
              10. distribute-lft-outN/A

                \[\leadsto n \cdot \left(\color{blue}{\left(i \cdot 50 + i \cdot \left(\frac{50}{3} \cdot i\right)\right)} + 100\right) \]
              11. *-commutativeN/A

                \[\leadsto n \cdot \left(\left(\color{blue}{50 \cdot i} + i \cdot \left(\frac{50}{3} \cdot i\right)\right) + 100\right) \]
              12. associate-+r+N/A

                \[\leadsto n \cdot \color{blue}{\left(50 \cdot i + \left(i \cdot \left(\frac{50}{3} \cdot i\right) + 100\right)\right)} \]
              13. +-commutativeN/A

                \[\leadsto n \cdot \left(50 \cdot i + \color{blue}{\left(100 + i \cdot \left(\frac{50}{3} \cdot i\right)\right)}\right) \]
              14. lower-*.f64N/A

                \[\leadsto \color{blue}{n \cdot \left(50 \cdot i + \left(100 + i \cdot \left(\frac{50}{3} \cdot i\right)\right)\right)} \]
              15. +-commutativeN/A

                \[\leadsto n \cdot \left(50 \cdot i + \color{blue}{\left(i \cdot \left(\frac{50}{3} \cdot i\right) + 100\right)}\right) \]
              16. associate-+r+N/A

                \[\leadsto n \cdot \color{blue}{\left(\left(50 \cdot i + i \cdot \left(\frac{50}{3} \cdot i\right)\right) + 100\right)} \]
            10. Simplified76.0%

              \[\leadsto \color{blue}{n \cdot \mathsf{fma}\left(i, \mathsf{fma}\left(i, 16.666666666666668, 50\right), 100\right)} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 15: 70.3% accurate, 5.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{n \cdot -100}{i}\\ \mathbf{if}\;i \leq -1.9:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;i \leq 1.65 \cdot 10^{+78}:\\ \;\;\;\;n \cdot \mathsf{fma}\left(i, 50, 100\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (i n)
           :precision binary64
           (let* ((t_0 (/ (* n -100.0) i)))
             (if (<= i -1.9) t_0 (if (<= i 1.65e+78) (* n (fma i 50.0 100.0)) t_0))))
          double code(double i, double n) {
          	double t_0 = (n * -100.0) / i;
          	double tmp;
          	if (i <= -1.9) {
          		tmp = t_0;
          	} else if (i <= 1.65e+78) {
          		tmp = n * fma(i, 50.0, 100.0);
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          function code(i, n)
          	t_0 = Float64(Float64(n * -100.0) / i)
          	tmp = 0.0
          	if (i <= -1.9)
          		tmp = t_0;
          	elseif (i <= 1.65e+78)
          		tmp = Float64(n * fma(i, 50.0, 100.0));
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          code[i_, n_] := Block[{t$95$0 = N[(N[(n * -100.0), $MachinePrecision] / i), $MachinePrecision]}, If[LessEqual[i, -1.9], t$95$0, If[LessEqual[i, 1.65e+78], N[(n * N[(i * 50.0 + 100.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{n \cdot -100}{i}\\
          \mathbf{if}\;i \leq -1.9:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;i \leq 1.65 \cdot 10^{+78}:\\
          \;\;\;\;n \cdot \mathsf{fma}\left(i, 50, 100\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if i < -1.8999999999999999 or 1.65e78 < i

            1. Initial program 55.2%

              \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto 100 \cdot \frac{{\left(1 + \color{blue}{\frac{i}{n}}\right)}^{n} - 1}{\frac{i}{n}} \]
              2. lift-+.f64N/A

                \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
              3. sqr-powN/A

                \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{\left(\frac{n}{2}\right)} \cdot {\left(1 + \frac{i}{n}\right)}^{\left(\frac{n}{2}\right)}} - 1}{\frac{i}{n}} \]
              4. sqr-powN/A

                \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n}} - 1}{\frac{i}{n}} \]
              5. lift-pow.f64N/A

                \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n}} - 1}{\frac{i}{n}} \]
              6. lift--.f64N/A

                \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} - 1}}{\frac{i}{n}} \]
              7. *-rgt-identityN/A

                \[\leadsto 100 \cdot \frac{\color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 1}}{\frac{i}{n}} \]
              8. lift-/.f64N/A

                \[\leadsto 100 \cdot \frac{\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot 1}{\color{blue}{\frac{i}{n}}} \]
              9. associate-*r/N/A

                \[\leadsto 100 \cdot \color{blue}{\left(\left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) \cdot \frac{1}{\frac{i}{n}}\right)} \]
              10. div-invN/A

                \[\leadsto 100 \cdot \color{blue}{\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \]
              11. lift--.f64N/A

                \[\leadsto 100 \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} - 1}}{\frac{i}{n}} \]
              12. div-subN/A

                \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \frac{1}{\frac{i}{n}}\right)} \]
              13. lift-/.f64N/A

                \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \frac{1}{\color{blue}{\frac{i}{n}}}\right) \]
              14. clear-numN/A

                \[\leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \color{blue}{\frac{n}{i}}\right) \]
              15. lower--.f64N/A

                \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \frac{n}{i}\right)} \]
            4. Applied egg-rr54.0%

              \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot n}{i} - \frac{n}{i}\right)} \]
            5. Taylor expanded in i around inf

              \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
            6. Step-by-step derivation
              1. lower-/.f6464.4

                \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
            7. Simplified64.4%

              \[\leadsto 100 \cdot \left(\frac{{\color{blue}{\left(\frac{i}{n}\right)}}^{n} \cdot n}{i} - \frac{n}{i}\right) \]
            8. Taylor expanded in n around inf

              \[\leadsto \color{blue}{-100 \cdot \frac{n}{i}} \]
            9. Step-by-step derivation
              1. associate-*r/N/A

                \[\leadsto \color{blue}{\frac{-100 \cdot n}{i}} \]
              2. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{-100 \cdot n}{i}} \]
              3. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{n \cdot -100}}{i} \]
              4. lower-*.f6460.0

                \[\leadsto \frac{\color{blue}{n \cdot -100}}{i} \]
            10. Simplified60.0%

              \[\leadsto \color{blue}{\frac{n \cdot -100}{i}} \]

            if -1.8999999999999999 < i < 1.65e78

            1. Initial program 13.8%

              \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto 100 \cdot \frac{{\left(1 + \color{blue}{\frac{i}{n}}\right)}^{n} - 1}{\frac{i}{n}} \]
              2. lift-+.f64N/A

                \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
              3. pow-to-expN/A

                \[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}} \]
              4. lower-expm1.f64N/A

                \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
              5. *-commutativeN/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              6. lower-*.f64N/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              7. lift-+.f64N/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \log \color{blue}{\left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              8. lower-log1p.f6476.8

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
            4. Applied egg-rr76.8%

              \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
            5. Taylor expanded in n around inf

              \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
            6. Step-by-step derivation
              1. associate-/l*N/A

                \[\leadsto 100 \cdot \color{blue}{\left(n \cdot \frac{e^{i} - 1}{i}\right)} \]
              2. associate-*r*N/A

                \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{e^{i} - 1}{i}} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{e^{i} - 1}{i}} \]
              4. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(100 \cdot n\right)} \cdot \frac{e^{i} - 1}{i} \]
              5. lower-/.f64N/A

                \[\leadsto \left(100 \cdot n\right) \cdot \color{blue}{\frac{e^{i} - 1}{i}} \]
              6. lower-expm1.f6481.5

                \[\leadsto \left(100 \cdot n\right) \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{i} \]
            7. Simplified81.5%

              \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}} \]
            8. Taylor expanded in i around 0

              \[\leadsto \color{blue}{50 \cdot \left(i \cdot n\right) + 100 \cdot n} \]
            9. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{100 \cdot n + 50 \cdot \left(i \cdot n\right)} \]
              2. associate-*r*N/A

                \[\leadsto 100 \cdot n + \color{blue}{\left(50 \cdot i\right) \cdot n} \]
              3. distribute-rgt-outN/A

                \[\leadsto \color{blue}{n \cdot \left(100 + 50 \cdot i\right)} \]
              4. lower-*.f64N/A

                \[\leadsto \color{blue}{n \cdot \left(100 + 50 \cdot i\right)} \]
              5. +-commutativeN/A

                \[\leadsto n \cdot \color{blue}{\left(50 \cdot i + 100\right)} \]
              6. *-commutativeN/A

                \[\leadsto n \cdot \left(\color{blue}{i \cdot 50} + 100\right) \]
              7. lower-fma.f6475.7

                \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, 50, 100\right)} \]
            10. Simplified75.7%

              \[\leadsto \color{blue}{n \cdot \mathsf{fma}\left(i, 50, 100\right)} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 16: 59.8% accurate, 6.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := n \cdot \mathsf{fma}\left(i, 50, 100\right)\\ \mathbf{if}\;n \leq -1.02 \cdot 10^{-156}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;n \leq 1.05 \cdot 10^{-33}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (i n)
           :precision binary64
           (let* ((t_0 (* n (fma i 50.0 100.0))))
             (if (<= n -1.02e-156) t_0 (if (<= n 1.05e-33) 0.0 t_0))))
          double code(double i, double n) {
          	double t_0 = n * fma(i, 50.0, 100.0);
          	double tmp;
          	if (n <= -1.02e-156) {
          		tmp = t_0;
          	} else if (n <= 1.05e-33) {
          		tmp = 0.0;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          function code(i, n)
          	t_0 = Float64(n * fma(i, 50.0, 100.0))
          	tmp = 0.0
          	if (n <= -1.02e-156)
          		tmp = t_0;
          	elseif (n <= 1.05e-33)
          		tmp = 0.0;
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          code[i_, n_] := Block[{t$95$0 = N[(n * N[(i * 50.0 + 100.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -1.02e-156], t$95$0, If[LessEqual[n, 1.05e-33], 0.0, t$95$0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := n \cdot \mathsf{fma}\left(i, 50, 100\right)\\
          \mathbf{if}\;n \leq -1.02 \cdot 10^{-156}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;n \leq 1.05 \cdot 10^{-33}:\\
          \;\;\;\;0\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if n < -1.02e-156 or 1.05e-33 < n

            1. Initial program 22.7%

              \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto 100 \cdot \frac{{\left(1 + \color{blue}{\frac{i}{n}}\right)}^{n} - 1}{\frac{i}{n}} \]
              2. lift-+.f64N/A

                \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
              3. pow-to-expN/A

                \[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}} \]
              4. lower-expm1.f64N/A

                \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
              5. *-commutativeN/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              6. lower-*.f64N/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              7. lift-+.f64N/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \log \color{blue}{\left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              8. lower-log1p.f6473.1

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
            4. Applied egg-rr73.1%

              \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
            5. Taylor expanded in n around inf

              \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
            6. Step-by-step derivation
              1. associate-/l*N/A

                \[\leadsto 100 \cdot \color{blue}{\left(n \cdot \frac{e^{i} - 1}{i}\right)} \]
              2. associate-*r*N/A

                \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{e^{i} - 1}{i}} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{e^{i} - 1}{i}} \]
              4. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(100 \cdot n\right)} \cdot \frac{e^{i} - 1}{i} \]
              5. lower-/.f64N/A

                \[\leadsto \left(100 \cdot n\right) \cdot \color{blue}{\frac{e^{i} - 1}{i}} \]
              6. lower-expm1.f6483.9

                \[\leadsto \left(100 \cdot n\right) \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{i} \]
            7. Simplified83.9%

              \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}} \]
            8. Taylor expanded in i around 0

              \[\leadsto \color{blue}{50 \cdot \left(i \cdot n\right) + 100 \cdot n} \]
            9. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{100 \cdot n + 50 \cdot \left(i \cdot n\right)} \]
              2. associate-*r*N/A

                \[\leadsto 100 \cdot n + \color{blue}{\left(50 \cdot i\right) \cdot n} \]
              3. distribute-rgt-outN/A

                \[\leadsto \color{blue}{n \cdot \left(100 + 50 \cdot i\right)} \]
              4. lower-*.f64N/A

                \[\leadsto \color{blue}{n \cdot \left(100 + 50 \cdot i\right)} \]
              5. +-commutativeN/A

                \[\leadsto n \cdot \color{blue}{\left(50 \cdot i + 100\right)} \]
              6. *-commutativeN/A

                \[\leadsto n \cdot \left(\color{blue}{i \cdot 50} + 100\right) \]
              7. lower-fma.f6465.4

                \[\leadsto n \cdot \color{blue}{\mathsf{fma}\left(i, 50, 100\right)} \]
            10. Simplified65.4%

              \[\leadsto \color{blue}{n \cdot \mathsf{fma}\left(i, 50, 100\right)} \]

            if -1.02e-156 < n < 1.05e-33

            1. Initial program 40.2%

              \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto 100 \cdot \frac{{\left(1 + \color{blue}{\frac{i}{n}}\right)}^{n} - 1}{\frac{i}{n}} \]
              2. lift-+.f64N/A

                \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
              3. pow-to-expN/A

                \[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}} \]
              4. lower-expm1.f64N/A

                \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
              5. *-commutativeN/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              6. lower-*.f64N/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              7. lift-+.f64N/A

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \log \color{blue}{\left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              8. lower-log1p.f6477.1

                \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
            4. Applied egg-rr77.1%

              \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
            5. Taylor expanded in n around 0

              \[\leadsto \color{blue}{0} \]
            6. Step-by-step derivation
              1. Simplified62.9%

                \[\leadsto \color{blue}{0} \]
            7. Recombined 2 regimes into one program.
            8. Add Preprocessing

            Alternative 17: 57.8% accurate, 8.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -0.0065:\\ \;\;\;\;0\\ \mathbf{elif}\;i \leq 9.5 \cdot 10^{-29}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
            (FPCore (i n)
             :precision binary64
             (if (<= i -0.0065) 0.0 (if (<= i 9.5e-29) (* n 100.0) 0.0)))
            double code(double i, double n) {
            	double tmp;
            	if (i <= -0.0065) {
            		tmp = 0.0;
            	} else if (i <= 9.5e-29) {
            		tmp = n * 100.0;
            	} else {
            		tmp = 0.0;
            	}
            	return tmp;
            }
            
            real(8) function code(i, n)
                real(8), intent (in) :: i
                real(8), intent (in) :: n
                real(8) :: tmp
                if (i <= (-0.0065d0)) then
                    tmp = 0.0d0
                else if (i <= 9.5d-29) then
                    tmp = n * 100.0d0
                else
                    tmp = 0.0d0
                end if
                code = tmp
            end function
            
            public static double code(double i, double n) {
            	double tmp;
            	if (i <= -0.0065) {
            		tmp = 0.0;
            	} else if (i <= 9.5e-29) {
            		tmp = n * 100.0;
            	} else {
            		tmp = 0.0;
            	}
            	return tmp;
            }
            
            def code(i, n):
            	tmp = 0
            	if i <= -0.0065:
            		tmp = 0.0
            	elif i <= 9.5e-29:
            		tmp = n * 100.0
            	else:
            		tmp = 0.0
            	return tmp
            
            function code(i, n)
            	tmp = 0.0
            	if (i <= -0.0065)
            		tmp = 0.0;
            	elseif (i <= 9.5e-29)
            		tmp = Float64(n * 100.0);
            	else
            		tmp = 0.0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(i, n)
            	tmp = 0.0;
            	if (i <= -0.0065)
            		tmp = 0.0;
            	elseif (i <= 9.5e-29)
            		tmp = n * 100.0;
            	else
            		tmp = 0.0;
            	end
            	tmp_2 = tmp;
            end
            
            code[i_, n_] := If[LessEqual[i, -0.0065], 0.0, If[LessEqual[i, 9.5e-29], N[(n * 100.0), $MachinePrecision], 0.0]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;i \leq -0.0065:\\
            \;\;\;\;0\\
            
            \mathbf{elif}\;i \leq 9.5 \cdot 10^{-29}:\\
            \;\;\;\;n \cdot 100\\
            
            \mathbf{else}:\\
            \;\;\;\;0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if i < -0.0064999999999999997 or 9.50000000000000023e-29 < i

              1. Initial program 50.6%

                \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto 100 \cdot \frac{{\left(1 + \color{blue}{\frac{i}{n}}\right)}^{n} - 1}{\frac{i}{n}} \]
                2. lift-+.f64N/A

                  \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
                3. pow-to-expN/A

                  \[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}} \]
                4. lower-expm1.f64N/A

                  \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
                5. *-commutativeN/A

                  \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
                6. lower-*.f64N/A

                  \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
                7. lift-+.f64N/A

                  \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \log \color{blue}{\left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
                8. lower-log1p.f6475.1

                  \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              4. Applied egg-rr75.1%

                \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
              5. Taylor expanded in n around 0

                \[\leadsto \color{blue}{0} \]
              6. Step-by-step derivation
                1. Simplified34.2%

                  \[\leadsto \color{blue}{0} \]

                if -0.0064999999999999997 < i < 9.50000000000000023e-29

                1. Initial program 9.9%

                  \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto 100 \cdot \frac{{\left(1 + \color{blue}{\frac{i}{n}}\right)}^{n} - 1}{\frac{i}{n}} \]
                  2. lift-+.f64N/A

                    \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
                  3. pow-to-expN/A

                    \[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}} \]
                  4. lower-expm1.f64N/A

                    \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
                  5. *-commutativeN/A

                    \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
                  6. lower-*.f64N/A

                    \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
                  7. lift-+.f64N/A

                    \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \log \color{blue}{\left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
                  8. lower-log1p.f6473.4

                    \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
                4. Applied egg-rr73.4%

                  \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
                5. Taylor expanded in n around inf

                  \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
                6. Step-by-step derivation
                  1. associate-/l*N/A

                    \[\leadsto 100 \cdot \color{blue}{\left(n \cdot \frac{e^{i} - 1}{i}\right)} \]
                  2. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{e^{i} - 1}{i}} \]
                  3. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{e^{i} - 1}{i}} \]
                  4. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(100 \cdot n\right)} \cdot \frac{e^{i} - 1}{i} \]
                  5. lower-/.f64N/A

                    \[\leadsto \left(100 \cdot n\right) \cdot \color{blue}{\frac{e^{i} - 1}{i}} \]
                  6. lower-expm1.f6485.4

                    \[\leadsto \left(100 \cdot n\right) \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{i} \]
                7. Simplified85.4%

                  \[\leadsto \color{blue}{\left(100 \cdot n\right) \cdot \frac{\mathsf{expm1}\left(i\right)}{i}} \]
                8. Taylor expanded in i around 0

                  \[\leadsto \color{blue}{100 \cdot n} \]
                9. Step-by-step derivation
                  1. lower-*.f6484.8

                    \[\leadsto \color{blue}{100 \cdot n} \]
                10. Simplified84.8%

                  \[\leadsto \color{blue}{100 \cdot n} \]
              7. Recombined 2 regimes into one program.
              8. Final simplification63.3%

                \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -0.0065:\\ \;\;\;\;0\\ \mathbf{elif}\;i \leq 9.5 \cdot 10^{-29}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
              9. Add Preprocessing

              Alternative 18: 17.8% accurate, 146.0× speedup?

              \[\begin{array}{l} \\ 0 \end{array} \]
              (FPCore (i n) :precision binary64 0.0)
              double code(double i, double n) {
              	return 0.0;
              }
              
              real(8) function code(i, n)
                  real(8), intent (in) :: i
                  real(8), intent (in) :: n
                  code = 0.0d0
              end function
              
              public static double code(double i, double n) {
              	return 0.0;
              }
              
              def code(i, n):
              	return 0.0
              
              function code(i, n)
              	return 0.0
              end
              
              function tmp = code(i, n)
              	tmp = 0.0;
              end
              
              code[i_, n_] := 0.0
              
              \begin{array}{l}
              
              \\
              0
              \end{array}
              
              Derivation
              1. Initial program 27.2%

                \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift-/.f64N/A

                  \[\leadsto 100 \cdot \frac{{\left(1 + \color{blue}{\frac{i}{n}}\right)}^{n} - 1}{\frac{i}{n}} \]
                2. lift-+.f64N/A

                  \[\leadsto 100 \cdot \frac{{\color{blue}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \]
                3. pow-to-expN/A

                  \[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}} \]
                4. lower-expm1.f64N/A

                  \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
                5. *-commutativeN/A

                  \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
                6. lower-*.f64N/A

                  \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
                7. lift-+.f64N/A

                  \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \log \color{blue}{\left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
                8. lower-log1p.f6474.1

                  \[\leadsto 100 \cdot \frac{\mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
              4. Applied egg-rr74.1%

                \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
              5. Taylor expanded in n around 0

                \[\leadsto \color{blue}{0} \]
              6. Step-by-step derivation
                1. Simplified20.6%

                  \[\leadsto \color{blue}{0} \]
                2. Add Preprocessing

                Developer Target 1: 35.2% 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 2024214 
                (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))))