- Split input into 4 regimes
if i < -0.00012047330594640052
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.6
\[\leadsto 100 \cdot \frac{{\color{blue}{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}}^{n} - 1}{\frac{i}{n}}\]
Applied pow-exp27.6
\[\leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}}\]
Applied simplify5.3
\[\leadsto 100 \cdot \frac{e^{\color{blue}{n \cdot \log_* (1 + \frac{i}{n})}} - 1}{\frac{i}{n}}\]
if -0.00012047330594640052 < i < 1.0456180401234767
Initial program 57.6
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
Taylor expanded around 0 25.3
\[\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.0456180401234767 < i < 2.2741584621052686e+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.7
\[\leadsto 100 \cdot \frac{{\color{blue}{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}}^{n} - 1}{\frac{i}{n}}\]
Applied pow-exp40.7
\[\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 2.2741584621052686e+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 -0.00012047330594640052:\\
\;\;\;\;\frac{100 \cdot n}{i} \cdot (e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^*\\
\mathbf{if}\;i \le 1.0456180401234767:\\
\;\;\;\;(\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 2.2741584621052686 \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}}\]