Average Error: 42.6 → 29.6
Time: 24.3s
Precision: 64
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
\[\begin{array}{l} \mathbf{if}\;n \le -6.246516767500982 \cdot 10^{+112}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(\frac{50}{3} \cdot i, i \cdot i, i \cdot 100\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le -1.0933259526011947 \cdot 10^{+64}:\\ \;\;\;\;\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i} \cdot n\\ \mathbf{elif}\;n \le -0.13295556128930017:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(\frac{50}{3} \cdot i, i \cdot i, i \cdot 100\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le -1.7065727457962 \cdot 10^{-312}:\\ \;\;\;\;\frac{1}{i} \cdot \left(\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right) \cdot n\right)\\ \mathbf{elif}\;n \le 5.811229823508011 \cdot 10^{-78}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log n \cdot \log n, \mathsf{fma}\left(\left(\left(n \cdot n\right) \cdot n\right) \cdot \frac{50}{3}, \log i \cdot \left(\log i \cdot \log i\right), \mathsf{fma}\left(n \cdot \log i, 100, \mathsf{fma}\left(\frac{100}{3}, \left(\log n \cdot \log n\right) \cdot \left(\log i \cdot \left(\left(n \cdot n\right) \cdot n\right)\right), \mathsf{fma}\left(\frac{50}{3}, \left(\log n \cdot \log n\right) \cdot \left(\log i \cdot \left(\left(n \cdot n\right) \cdot n\right)\right), \left(\log i \cdot \log i\right) \cdot \left(50 \cdot \left(n \cdot n\right)\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(\left(n \cdot n\right) \cdot n\right) \cdot \frac{100}{3}, \log n \cdot \left(\log i \cdot \log i\right), \mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log n \cdot \log i, \mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log n \cdot \log i, \left(n \cdot 100\right) \cdot \log n + \left(\left(\left(n \cdot n\right) \cdot n\right) \cdot \frac{50}{3}\right) \cdot \left(\log n \cdot \left(\log i \cdot \log i\right) + \left(\log n \cdot \log n\right) \cdot \log n\right)\right)\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le 2.5555363937413246 \cdot 10^{+221}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(\frac{50}{3} \cdot i, i \cdot i, i \cdot 100\right)\right)}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)} \cdot \sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}} \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{\frac{i}{n}}} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{i}{n}}} \cdot \sqrt[3]{\sqrt[3]{\frac{i}{n}}}\right)}\right)} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}}}\\ \end{array}\]
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\begin{array}{l}
\mathbf{if}\;n \le -6.246516767500982 \cdot 10^{+112}:\\
\;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(\frac{50}{3} \cdot i, i \cdot i, i \cdot 100\right)\right)}{\frac{i}{n}}\\

\mathbf{elif}\;n \le -1.0933259526011947 \cdot 10^{+64}:\\
\;\;\;\;\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i} \cdot n\\

\mathbf{elif}\;n \le -0.13295556128930017:\\
\;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(\frac{50}{3} \cdot i, i \cdot i, i \cdot 100\right)\right)}{\frac{i}{n}}\\

\mathbf{elif}\;n \le -1.7065727457962 \cdot 10^{-312}:\\
\;\;\;\;\frac{1}{i} \cdot \left(\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right) \cdot n\right)\\

\mathbf{elif}\;n \le 5.811229823508011 \cdot 10^{-78}:\\
\;\;\;\;\frac{\mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log n \cdot \log n, \mathsf{fma}\left(\left(\left(n \cdot n\right) \cdot n\right) \cdot \frac{50}{3}, \log i \cdot \left(\log i \cdot \log i\right), \mathsf{fma}\left(n \cdot \log i, 100, \mathsf{fma}\left(\frac{100}{3}, \left(\log n \cdot \log n\right) \cdot \left(\log i \cdot \left(\left(n \cdot n\right) \cdot n\right)\right), \mathsf{fma}\left(\frac{50}{3}, \left(\log n \cdot \log n\right) \cdot \left(\log i \cdot \left(\left(n \cdot n\right) \cdot n\right)\right), \left(\log i \cdot \log i\right) \cdot \left(50 \cdot \left(n \cdot n\right)\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(\left(n \cdot n\right) \cdot n\right) \cdot \frac{100}{3}, \log n \cdot \left(\log i \cdot \log i\right), \mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log n \cdot \log i, \mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log n \cdot \log i, \left(n \cdot 100\right) \cdot \log n + \left(\left(\left(n \cdot n\right) \cdot n\right) \cdot \frac{50}{3}\right) \cdot \left(\log n \cdot \left(\log i \cdot \log i\right) + \left(\log n \cdot \log n\right) \cdot \log n\right)\right)\right)\right)}{\frac{i}{n}}\\

\mathbf{elif}\;n \le 2.5555363937413246 \cdot 10^{+221}:\\
\;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(\frac{50}{3} \cdot i, i \cdot i, i \cdot 100\right)\right)}{\frac{i}{n}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)} \cdot \sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}} \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{\frac{i}{n}}} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{i}{n}}} \cdot \sqrt[3]{\sqrt[3]{\frac{i}{n}}}\right)}\right)} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}}}\\

\end{array}
double f(double i, double n) {
        double r2164698 = 100.0;
        double r2164699 = 1.0;
        double r2164700 = i;
        double r2164701 = n;
        double r2164702 = r2164700 / r2164701;
        double r2164703 = r2164699 + r2164702;
        double r2164704 = pow(r2164703, r2164701);
        double r2164705 = r2164704 - r2164699;
        double r2164706 = r2164705 / r2164702;
        double r2164707 = r2164698 * r2164706;
        return r2164707;
}

double f(double i, double n) {
        double r2164708 = n;
        double r2164709 = -6.246516767500982e+112;
        bool r2164710 = r2164708 <= r2164709;
        double r2164711 = 50.0;
        double r2164712 = i;
        double r2164713 = r2164712 * r2164712;
        double r2164714 = 16.666666666666668;
        double r2164715 = r2164714 * r2164712;
        double r2164716 = 100.0;
        double r2164717 = r2164712 * r2164716;
        double r2164718 = fma(r2164715, r2164713, r2164717);
        double r2164719 = fma(r2164711, r2164713, r2164718);
        double r2164720 = r2164712 / r2164708;
        double r2164721 = r2164719 / r2164720;
        double r2164722 = -1.0933259526011947e+64;
        bool r2164723 = r2164708 <= r2164722;
        double r2164724 = 1.0;
        double r2164725 = r2164724 + r2164720;
        double r2164726 = pow(r2164725, r2164708);
        double r2164727 = -100.0;
        double r2164728 = fma(r2164716, r2164726, r2164727);
        double r2164729 = r2164728 / r2164712;
        double r2164730 = r2164729 * r2164708;
        double r2164731 = -0.13295556128930017;
        bool r2164732 = r2164708 <= r2164731;
        double r2164733 = -1.7065727457962e-312;
        bool r2164734 = r2164708 <= r2164733;
        double r2164735 = r2164724 / r2164712;
        double r2164736 = log1p(r2164720);
        double r2164737 = r2164708 * r2164736;
        double r2164738 = exp(r2164737);
        double r2164739 = fma(r2164716, r2164738, r2164727);
        double r2164740 = r2164739 * r2164708;
        double r2164741 = r2164735 * r2164740;
        double r2164742 = 5.811229823508011e-78;
        bool r2164743 = r2164708 <= r2164742;
        double r2164744 = r2164708 * r2164708;
        double r2164745 = r2164711 * r2164744;
        double r2164746 = log(r2164708);
        double r2164747 = r2164746 * r2164746;
        double r2164748 = r2164744 * r2164708;
        double r2164749 = r2164748 * r2164714;
        double r2164750 = log(r2164712);
        double r2164751 = r2164750 * r2164750;
        double r2164752 = r2164750 * r2164751;
        double r2164753 = r2164708 * r2164750;
        double r2164754 = 33.333333333333336;
        double r2164755 = r2164750 * r2164748;
        double r2164756 = r2164747 * r2164755;
        double r2164757 = r2164751 * r2164745;
        double r2164758 = fma(r2164714, r2164756, r2164757);
        double r2164759 = fma(r2164754, r2164756, r2164758);
        double r2164760 = fma(r2164753, r2164716, r2164759);
        double r2164761 = fma(r2164749, r2164752, r2164760);
        double r2164762 = fma(r2164745, r2164747, r2164761);
        double r2164763 = r2164748 * r2164754;
        double r2164764 = r2164746 * r2164751;
        double r2164765 = r2164746 * r2164750;
        double r2164766 = r2164708 * r2164716;
        double r2164767 = r2164766 * r2164746;
        double r2164768 = r2164747 * r2164746;
        double r2164769 = r2164764 + r2164768;
        double r2164770 = r2164749 * r2164769;
        double r2164771 = r2164767 + r2164770;
        double r2164772 = fma(r2164745, r2164765, r2164771);
        double r2164773 = fma(r2164745, r2164765, r2164772);
        double r2164774 = fma(r2164763, r2164764, r2164773);
        double r2164775 = r2164762 - r2164774;
        double r2164776 = r2164775 / r2164720;
        double r2164777 = 2.5555363937413246e+221;
        bool r2164778 = r2164708 <= r2164777;
        double r2164779 = cbrt(r2164739);
        double r2164780 = r2164779 * r2164779;
        double r2164781 = cbrt(r2164720);
        double r2164782 = r2164781 * r2164781;
        double r2164783 = cbrt(r2164782);
        double r2164784 = cbrt(r2164781);
        double r2164785 = r2164784 * r2164784;
        double r2164786 = r2164784 * r2164785;
        double r2164787 = cbrt(r2164786);
        double r2164788 = r2164783 * r2164787;
        double r2164789 = r2164781 * r2164788;
        double r2164790 = r2164780 / r2164789;
        double r2164791 = r2164779 / r2164781;
        double r2164792 = r2164790 * r2164791;
        double r2164793 = r2164778 ? r2164721 : r2164792;
        double r2164794 = r2164743 ? r2164776 : r2164793;
        double r2164795 = r2164734 ? r2164741 : r2164794;
        double r2164796 = r2164732 ? r2164721 : r2164795;
        double r2164797 = r2164723 ? r2164730 : r2164796;
        double r2164798 = r2164710 ? r2164721 : r2164797;
        return r2164798;
}

Error

Bits error versus i

Bits error versus n

Target

Original42.6
Target42.3
Herbie29.6
\[100 \cdot \frac{e^{n \cdot \begin{array}{l} \mathbf{if}\;1 + \frac{i}{n} = 1:\\ \;\;\;\;\frac{i}{n}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{i}{n} \cdot \log \left(1 + \frac{i}{n}\right)}{\left(\frac{i}{n} + 1\right) - 1}\\ \end{array}} - 1}{\frac{i}{n}}\]

Derivation

  1. Split input into 5 regimes
  2. if n < -6.246516767500982e+112 or -1.0933259526011947e+64 < n < -0.13295556128930017 or 5.811229823508011e-78 < n < 2.5555363937413246e+221

    1. Initial program 52.3

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

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

      \[\leadsto \frac{\color{blue}{100 \cdot i + \left(50 \cdot {i}^{2} + \frac{50}{3} \cdot {i}^{3}\right)}}{\frac{i}{n}}\]
    4. Simplified36.0

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

    if -6.246516767500982e+112 < n < -1.0933259526011947e+64

    1. Initial program 35.9

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}}\]
    3. Using strategy rm
    4. Applied associate-/r/35.8

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

    if -0.13295556128930017 < n < -1.7065727457962e-312

    1. Initial program 16.5

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}}\]
    3. Using strategy rm
    4. Applied add-exp-log16.5

      \[\leadsto \frac{\mathsf{fma}\left(100, {\color{blue}{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}}^{n}, -100\right)}{\frac{i}{n}}\]
    5. Applied pow-exp16.5

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

      \[\leadsto \frac{\mathsf{fma}\left(100, e^{\color{blue}{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}}, -100\right)}{\frac{i}{n}}\]
    7. Using strategy rm
    8. Applied div-inv16.5

      \[\leadsto \frac{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}{\color{blue}{i \cdot \frac{1}{n}}}\]
    9. Applied *-un-lft-identity16.5

      \[\leadsto \frac{\color{blue}{1 \cdot \mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{i \cdot \frac{1}{n}}\]
    10. Applied times-frac17.2

      \[\leadsto \color{blue}{\frac{1}{i} \cdot \frac{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}{\frac{1}{n}}}\]
    11. Simplified17.2

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

    if -1.7065727457962e-312 < n < 5.811229823508011e-78

    1. Initial program 46.8

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}}\]
    3. Using strategy rm
    4. Applied add-exp-log46.8

      \[\leadsto \frac{\mathsf{fma}\left(100, {\color{blue}{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}}^{n}, -100\right)}{\frac{i}{n}}\]
    5. Applied pow-exp46.8

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

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

      \[\leadsto \frac{\color{blue}{\left(50 \cdot \left({n}^{2} \cdot {\left(\log n\right)}^{2}\right) + \left(\frac{50}{3} \cdot \left({n}^{3} \cdot {\left(\log i\right)}^{3}\right) + \left(100 \cdot \left(n \cdot \log i\right) + \left(\frac{100}{3} \cdot \left({n}^{3} \cdot \left({\left(\log n\right)}^{2} \cdot \log i\right)\right) + \left(\frac{50}{3} \cdot \left({n}^{3} \cdot \left(\log i \cdot {\left(\log n\right)}^{2}\right)\right) + 50 \cdot \left({n}^{2} \cdot {\left(\log i\right)}^{2}\right)\right)\right)\right)\right)\right) - \left(\frac{100}{3} \cdot \left({n}^{3} \cdot \left({\left(\log i\right)}^{2} \cdot \log n\right)\right) + \left(50 \cdot \left({n}^{2} \cdot \left(\log n \cdot \log i\right)\right) + \left(50 \cdot \left({n}^{2} \cdot \left(\log i \cdot \log n\right)\right) + \left(\frac{50}{3} \cdot \left({n}^{3} \cdot {\left(\log n\right)}^{3}\right) + \left(\frac{50}{3} \cdot \left({n}^{3} \cdot \left(\log n \cdot {\left(\log i\right)}^{2}\right)\right) + 100 \cdot \left(n \cdot \log n\right)\right)\right)\right)\right)\right)}}{\frac{i}{n}}\]
    8. Simplified20.9

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

    if 2.5555363937413246e+221 < n

    1. Initial program 59.6

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}}\]
    3. Using strategy rm
    4. Applied add-exp-log59.6

      \[\leadsto \frac{\mathsf{fma}\left(100, {\color{blue}{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}}^{n}, -100\right)}{\frac{i}{n}}\]
    5. Applied pow-exp59.6

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

      \[\leadsto \frac{\mathsf{fma}\left(100, e^{\color{blue}{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}}, -100\right)}{\frac{i}{n}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt41.8

      \[\leadsto \frac{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}{\color{blue}{\left(\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}\right) \cdot \sqrt[3]{\frac{i}{n}}}}\]
    9. Applied add-cube-cbrt41.7

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)} \cdot \sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}}{\left(\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}\right) \cdot \sqrt[3]{\frac{i}{n}}}\]
    10. Applied times-frac41.7

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)} \cdot \sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}}}}\]
    11. Using strategy rm
    12. Applied add-cube-cbrt41.8

      \[\leadsto \frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)} \cdot \sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\color{blue}{\left(\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}\right) \cdot \sqrt[3]{\frac{i}{n}}}}} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}}}\]
    13. Applied cbrt-prod41.8

      \[\leadsto \frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)} \cdot \sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}} \cdot \color{blue}{\left(\sqrt[3]{\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}} \cdot \sqrt[3]{\sqrt[3]{\frac{i}{n}}}\right)}} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}}}\]
    14. Using strategy rm
    15. Applied add-cube-cbrt41.8

      \[\leadsto \frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)} \cdot \sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}} \cdot \sqrt[3]{\color{blue}{\left(\sqrt[3]{\sqrt[3]{\frac{i}{n}}} \cdot \sqrt[3]{\sqrt[3]{\frac{i}{n}}}\right) \cdot \sqrt[3]{\sqrt[3]{\frac{i}{n}}}}}\right)} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}}}\]
  3. Recombined 5 regimes into one program.
  4. Final simplification29.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \le -6.246516767500982 \cdot 10^{+112}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(\frac{50}{3} \cdot i, i \cdot i, i \cdot 100\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le -1.0933259526011947 \cdot 10^{+64}:\\ \;\;\;\;\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i} \cdot n\\ \mathbf{elif}\;n \le -0.13295556128930017:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(\frac{50}{3} \cdot i, i \cdot i, i \cdot 100\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le -1.7065727457962 \cdot 10^{-312}:\\ \;\;\;\;\frac{1}{i} \cdot \left(\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right) \cdot n\right)\\ \mathbf{elif}\;n \le 5.811229823508011 \cdot 10^{-78}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log n \cdot \log n, \mathsf{fma}\left(\left(\left(n \cdot n\right) \cdot n\right) \cdot \frac{50}{3}, \log i \cdot \left(\log i \cdot \log i\right), \mathsf{fma}\left(n \cdot \log i, 100, \mathsf{fma}\left(\frac{100}{3}, \left(\log n \cdot \log n\right) \cdot \left(\log i \cdot \left(\left(n \cdot n\right) \cdot n\right)\right), \mathsf{fma}\left(\frac{50}{3}, \left(\log n \cdot \log n\right) \cdot \left(\log i \cdot \left(\left(n \cdot n\right) \cdot n\right)\right), \left(\log i \cdot \log i\right) \cdot \left(50 \cdot \left(n \cdot n\right)\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(\left(n \cdot n\right) \cdot n\right) \cdot \frac{100}{3}, \log n \cdot \left(\log i \cdot \log i\right), \mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log n \cdot \log i, \mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log n \cdot \log i, \left(n \cdot 100\right) \cdot \log n + \left(\left(\left(n \cdot n\right) \cdot n\right) \cdot \frac{50}{3}\right) \cdot \left(\log n \cdot \left(\log i \cdot \log i\right) + \left(\log n \cdot \log n\right) \cdot \log n\right)\right)\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le 2.5555363937413246 \cdot 10^{+221}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(\frac{50}{3} \cdot i, i \cdot i, i \cdot 100\right)\right)}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)} \cdot \sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}} \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{\frac{i}{n}}} \cdot \left(\sqrt[3]{\sqrt[3]{\frac{i}{n}}} \cdot \sqrt[3]{\sqrt[3]{\frac{i}{n}}}\right)}\right)} \cdot \frac{\sqrt[3]{\mathsf{fma}\left(100, e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, -100\right)}}{\sqrt[3]{\frac{i}{n}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019153 +o rules:numerics
(FPCore (i n)
  :name "Compound Interest"

  :herbie-target
  (* 100 (/ (- (exp (* n (if (== (+ 1 (/ i n)) 1) (/ i n) (/ (* (/ i n) (log (+ 1 (/ i n)))) (- (+ (/ i n) 1) 1))))) 1) (/ i n)))

  (* 100 (/ (- (pow (+ 1 (/ i n)) n) 1) (/ i n))))