- Split input into 4 regimes
if i < -3.7647908108250176e-06
Initial program 27.6
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
- Using strategy
rm Applied add-exp-log27.7
\[\leadsto 100 \cdot \frac{{\color{blue}{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}}^{n} - 1}{\frac{i}{n}}\]
Applied pow-exp27.7
\[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}}\]
Applied simplify5.4
\[\leadsto 100 \cdot \frac{e^{\color{blue}{n \cdot \log_* (1 + \frac{i}{n})}} - 1}{\frac{i}{n}}\]
if -3.7647908108250176e-06 < i < 1.8831286213482759
Initial program 57.6
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
Taylor expanded around 0 25.2
\[\leadsto 100 \cdot \frac{\color{blue}{\frac{1}{2} \cdot {i}^{2} + \left(\frac{1}{6} \cdot {i}^{3} + i\right)}}{\frac{i}{n}}\]
Applied simplify25.6
\[\leadsto \color{blue}{\frac{(\left(i \cdot i\right) \cdot \left((i \cdot \frac{1}{6} + \frac{1}{2})_*\right) + i)_*}{\frac{\frac{i}{n}}{100}}}\]
Taylor expanded around 0 9.2
\[\leadsto \color{blue}{\frac{50}{3} \cdot \left(n \cdot {i}^{2}\right) + \left(100 \cdot n + 50 \cdot \left(n \cdot i\right)\right)}\]
Applied simplify9.2
\[\leadsto \color{blue}{(\frac{50}{3} \cdot \left(i \cdot \left(i \cdot n\right)\right) + \left(n \cdot (i \cdot 50 + 100)_*\right))_*}\]
if 1.8831286213482759 < i < 3.189350282604906e+149
Initial program 28.8
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
- Using strategy
rm Applied add-exp-log40.6
\[\leadsto 100 \cdot \frac{{\color{blue}{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}}^{n} - 1}{\frac{i}{n}}\]
Applied pow-exp40.6
\[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}}\]
Applied expm1-def24.6
\[\leadsto 100 \cdot \frac{\color{blue}{(e^{\log \left(1 + \frac{i}{n}\right) \cdot n} - 1)^*}}{\frac{i}{n}}\]
if 3.189350282604906e+149 < i
Initial program 32.0
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
Taylor expanded around inf 34.0
\[\leadsto 100 \cdot \frac{\color{blue}{e^{\frac{\log n - \log i}{n}} - 1}}{\frac{i}{n}}\]
Applied simplify35.1
\[\leadsto \color{blue}{\left(100 \cdot \frac{n}{i}\right) \cdot (e^{\frac{\log n - \log i}{n}} - 1)^*}\]
- Recombined 4 regimes into one program.
- Removed slow
pow expressions. Applied simplify10.2
\[\leadsto \color{blue}{\begin{array}{l}
\mathbf{if}\;i \le -3.7647908108250176 \cdot 10^{-06}:\\
\;\;\;\;\frac{100 \cdot n}{i} \cdot (e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^*\\
\mathbf{if}\;i \le 1.8831286213482759:\\
\;\;\;\;(\frac{50}{3} \cdot \left(n \cdot \left(i \cdot i\right)\right) + \left(n \cdot (i \cdot 50 + 100)_*\right))_*\\
\mathbf{if}\;i \le 3.189350282604906 \cdot 10^{+149}:\\
\;\;\;\;\frac{100 \cdot n}{i} \cdot (e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^*\\
\mathbf{else}:\\
\;\;\;\;\frac{100 \cdot n}{i} \cdot (e^{\frac{\log n - \log i}{n}} - 1)^*\\
\end{array}}\]