Average Error: 42.3 → 29.4
Time: 28.7s
Precision: 64
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
\[\begin{array}{l} \mathbf{if}\;n \le -4.6511036455496 \cdot 10^{+137}:\\ \;\;\;\;\frac{\mathsf{fma}\left(e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n}, 100, -100\right)}{i} \cdot n\\ \mathbf{elif}\;n \le 1.9360594076256 \cdot 10^{-310}:\\ \;\;\;\;n \cdot \frac{\mathsf{fma}\left(100, {\left(\frac{i}{n} + 1\right)}^{n}, -100\right)}{i}\\ \mathbf{elif}\;n \le 1.547355740653275 \cdot 10^{-211}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log n \cdot \log n, \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}, \log i \cdot \left(\log i \cdot \log i\right), \mathsf{fma}\left(\log i \cdot n, 100, \mathsf{fma}\left(\frac{100}{3}, \left(n \cdot \left(n \cdot n\right)\right) \cdot \left(\log i \cdot \left(\log n \cdot \log n\right)\right), \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}, \log i \cdot \left(\log n \cdot \log n\right), \left(50 \cdot \left(\log i \cdot \log i\right)\right) \cdot \left(n \cdot n\right)\right)\right)\right)\right) - \mathsf{fma}\left(n \cdot \left(\frac{100}{3} \cdot \left(n \cdot n\right)\right), \left(\log i \cdot \log n\right) \cdot \log i, \mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log i \cdot \log n, \mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log i \cdot \log n, \left(\left(\log n \cdot \log n\right) \cdot \log n + \left(\log i \cdot \log n\right) \cdot \log i\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}\right) + n \cdot \left(\log n \cdot 100\right)\right)\right)\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le 3.2388182495466635 \cdot 10^{-96}:\\ \;\;\;\;\frac{\mathsf{fma}\left(i \cdot i, 50, \mathsf{fma}\left(i \cdot i, \frac{50}{3} \cdot i, 100 \cdot i\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le 4.809293212884638 \cdot 10^{-44}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log n \cdot \log n, \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}, \log i \cdot \left(\log i \cdot \log i\right), \mathsf{fma}\left(n \cdot 100, \log i, \mathsf{fma}\left(\frac{100}{3}, \left(\log n \cdot \log n\right) \cdot \left(\log i \cdot \left(n \cdot \left(n \cdot n\right)\right)\right), \mathsf{fma}\left(\frac{50}{3}, \left(\log n \cdot \log n\right) \cdot \left(\log i \cdot \left(n \cdot \left(n \cdot n\right)\right)\right), 50 \cdot \left(\left(n \cdot n\right) \cdot \left(\log i \cdot \log i\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(\log i \cdot \log i\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \log n\right), \frac{100}{3}, \mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log i \cdot \log n, \mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log i \cdot \log n, \frac{50}{3} \cdot \left(\left(\log i \cdot \log i\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \log n\right) + \left(n \cdot \left(n \cdot n\right)\right) \cdot \left(\left(\log n \cdot \log n\right) \cdot \log n\right)\right) + \log n \cdot \left(n \cdot 100\right)\right)\right)\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le 7.855089357782943 \cdot 10^{+198}:\\ \;\;\;\;\frac{\mathsf{fma}\left(i \cdot i, 50, \mathsf{fma}\left(i \cdot i, \frac{50}{3} \cdot i, 100 \cdot i\right)\right)}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(100, e^{\left(\left(\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n\right)\right)}, -100\right)}{\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 -4.6511036455496 \cdot 10^{+137}:\\
\;\;\;\;\frac{\mathsf{fma}\left(e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n}, 100, -100\right)}{i} \cdot n\\

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

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

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

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

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

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

\end{array}
double f(double i, double n) {
        double r2290847 = 100.0;
        double r2290848 = 1.0;
        double r2290849 = i;
        double r2290850 = n;
        double r2290851 = r2290849 / r2290850;
        double r2290852 = r2290848 + r2290851;
        double r2290853 = pow(r2290852, r2290850);
        double r2290854 = r2290853 - r2290848;
        double r2290855 = r2290854 / r2290851;
        double r2290856 = r2290847 * r2290855;
        return r2290856;
}

double f(double i, double n) {
        double r2290857 = n;
        double r2290858 = -4.6511036455496e+137;
        bool r2290859 = r2290857 <= r2290858;
        double r2290860 = i;
        double r2290861 = r2290860 / r2290857;
        double r2290862 = log1p(r2290861);
        double r2290863 = r2290862 * r2290857;
        double r2290864 = exp(r2290863);
        double r2290865 = 100.0;
        double r2290866 = -100.0;
        double r2290867 = fma(r2290864, r2290865, r2290866);
        double r2290868 = r2290867 / r2290860;
        double r2290869 = r2290868 * r2290857;
        double r2290870 = 1.9360594076256e-310;
        bool r2290871 = r2290857 <= r2290870;
        double r2290872 = 1.0;
        double r2290873 = r2290861 + r2290872;
        double r2290874 = pow(r2290873, r2290857);
        double r2290875 = fma(r2290865, r2290874, r2290866);
        double r2290876 = r2290875 / r2290860;
        double r2290877 = r2290857 * r2290876;
        double r2290878 = 1.547355740653275e-211;
        bool r2290879 = r2290857 <= r2290878;
        double r2290880 = r2290857 * r2290857;
        double r2290881 = 50.0;
        double r2290882 = r2290880 * r2290881;
        double r2290883 = log(r2290857);
        double r2290884 = r2290883 * r2290883;
        double r2290885 = r2290857 * r2290880;
        double r2290886 = 16.666666666666668;
        double r2290887 = r2290885 * r2290886;
        double r2290888 = log(r2290860);
        double r2290889 = r2290888 * r2290888;
        double r2290890 = r2290888 * r2290889;
        double r2290891 = r2290888 * r2290857;
        double r2290892 = 33.333333333333336;
        double r2290893 = r2290888 * r2290884;
        double r2290894 = r2290885 * r2290893;
        double r2290895 = r2290881 * r2290889;
        double r2290896 = r2290895 * r2290880;
        double r2290897 = fma(r2290887, r2290893, r2290896);
        double r2290898 = fma(r2290892, r2290894, r2290897);
        double r2290899 = fma(r2290891, r2290865, r2290898);
        double r2290900 = fma(r2290887, r2290890, r2290899);
        double r2290901 = r2290892 * r2290880;
        double r2290902 = r2290857 * r2290901;
        double r2290903 = r2290888 * r2290883;
        double r2290904 = r2290903 * r2290888;
        double r2290905 = r2290884 * r2290883;
        double r2290906 = r2290905 + r2290904;
        double r2290907 = r2290906 * r2290887;
        double r2290908 = r2290883 * r2290865;
        double r2290909 = r2290857 * r2290908;
        double r2290910 = r2290907 + r2290909;
        double r2290911 = fma(r2290882, r2290903, r2290910);
        double r2290912 = fma(r2290882, r2290903, r2290911);
        double r2290913 = fma(r2290902, r2290904, r2290912);
        double r2290914 = r2290900 - r2290913;
        double r2290915 = fma(r2290882, r2290884, r2290914);
        double r2290916 = r2290915 / r2290861;
        double r2290917 = 3.2388182495466635e-96;
        bool r2290918 = r2290857 <= r2290917;
        double r2290919 = r2290860 * r2290860;
        double r2290920 = r2290886 * r2290860;
        double r2290921 = r2290865 * r2290860;
        double r2290922 = fma(r2290919, r2290920, r2290921);
        double r2290923 = fma(r2290919, r2290881, r2290922);
        double r2290924 = r2290923 / r2290861;
        double r2290925 = 4.809293212884638e-44;
        bool r2290926 = r2290857 <= r2290925;
        double r2290927 = r2290857 * r2290865;
        double r2290928 = r2290888 * r2290885;
        double r2290929 = r2290884 * r2290928;
        double r2290930 = r2290880 * r2290889;
        double r2290931 = r2290881 * r2290930;
        double r2290932 = fma(r2290886, r2290929, r2290931);
        double r2290933 = fma(r2290892, r2290929, r2290932);
        double r2290934 = fma(r2290927, r2290888, r2290933);
        double r2290935 = fma(r2290887, r2290890, r2290934);
        double r2290936 = r2290885 * r2290883;
        double r2290937 = r2290889 * r2290936;
        double r2290938 = r2290885 * r2290905;
        double r2290939 = r2290937 + r2290938;
        double r2290940 = r2290886 * r2290939;
        double r2290941 = r2290883 * r2290927;
        double r2290942 = r2290940 + r2290941;
        double r2290943 = fma(r2290882, r2290903, r2290942);
        double r2290944 = fma(r2290882, r2290903, r2290943);
        double r2290945 = fma(r2290937, r2290892, r2290944);
        double r2290946 = r2290935 - r2290945;
        double r2290947 = fma(r2290882, r2290884, r2290946);
        double r2290948 = r2290947 / r2290861;
        double r2290949 = 7.855089357782943e+198;
        bool r2290950 = r2290857 <= r2290949;
        double r2290951 = /* ERROR: no posit support in C */;
        double r2290952 = /* ERROR: no posit support in C */;
        double r2290953 = exp(r2290952);
        double r2290954 = fma(r2290865, r2290953, r2290866);
        double r2290955 = r2290954 / r2290861;
        double r2290956 = r2290950 ? r2290924 : r2290955;
        double r2290957 = r2290926 ? r2290948 : r2290956;
        double r2290958 = r2290918 ? r2290924 : r2290957;
        double r2290959 = r2290879 ? r2290916 : r2290958;
        double r2290960 = r2290871 ? r2290877 : r2290959;
        double r2290961 = r2290859 ? r2290869 : r2290960;
        return r2290961;
}

Error

Bits error versus i

Bits error versus n

Target

Original42.3
Target42.2
Herbie29.4
\[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 6 regimes
  2. if n < -4.6511036455496e+137

    1. Initial program 50.9

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
    2. Simplified50.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 pow-to-exp56.5

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

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

      \[\leadsto \frac{\color{blue}{100 \cdot e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)} + -100}}{\frac{i}{n}}\]
    8. Using strategy rm
    9. Applied associate-/r/42.2

      \[\leadsto \color{blue}{\frac{100 \cdot e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)} + -100}{i} \cdot n}\]
    10. Simplified42.2

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

    if -4.6511036455496e+137 < n < 1.9360594076256e-310

    1. Initial program 23.7

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

      \[\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/23.8

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

    if 1.9360594076256e-310 < n < 1.547355740653275e-211

    1. Initial program 39.2

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

      \[\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 pow-to-exp39.2

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

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

      \[\leadsto \frac{\color{blue}{100 \cdot e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)} + -100}}{\frac{i}{n}}\]
    8. Taylor expanded around 0 9.5

      \[\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}}\]
    9. Simplified9.5

      \[\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(\log i \cdot \left(\log n \cdot \log n\right)\right) \cdot \left(\left(n \cdot n\right) \cdot n\right), \mathsf{fma}\left(\frac{50}{3} \cdot \left(\left(n \cdot n\right) \cdot n\right), \log i \cdot \left(\log n \cdot \log n\right), \left(50 \cdot \left(\log i \cdot \log i\right)\right) \cdot \left(n \cdot n\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(\frac{100}{3} \cdot \left(n \cdot n\right)\right) \cdot n, \left(\log n \cdot \log i\right) \cdot \log i, \mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log i \cdot \log n, \mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \log i \cdot \log n, \left(\frac{50}{3} \cdot \left(\left(n \cdot n\right) \cdot n\right)\right) \cdot \left(\log n \cdot \left(\log n \cdot \log n\right) + \left(\log n \cdot \log i\right) \cdot \log i\right) + n \cdot \left(\log n \cdot 100\right)\right)\right)\right)\right)}}{\frac{i}{n}}\]

    if 1.547355740653275e-211 < n < 3.2388182495466635e-96 or 4.809293212884638e-44 < n < 7.855089357782943e+198

    1. Initial program 55.9

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

      \[\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 28.4

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

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

    if 3.2388182495466635e-96 < n < 4.809293212884638e-44

    1. Initial program 58.2

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

      \[\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 pow-to-exp58.2

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

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

      \[\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}}\]
    7. Simplified36.5

      \[\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(n \cdot \left(n \cdot n\right)\right), \left(\log i \cdot \log i\right) \cdot \log i, \mathsf{fma}\left(100 \cdot n, \log i, \mathsf{fma}\left(\frac{100}{3}, \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \log i\right) \cdot \left(\log n \cdot \log n\right), \mathsf{fma}\left(\frac{50}{3}, \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \log i\right) \cdot \left(\log n \cdot \log n\right), 50 \cdot \left(\left(n \cdot n\right) \cdot \left(\log i \cdot \log i\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \log n\right) \cdot \left(\log i \cdot \log i\right), \frac{100}{3}, \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, \frac{50}{3} \cdot \left(\left(\log n \cdot \left(\log n \cdot \log n\right)\right) \cdot \left(n \cdot \left(n \cdot n\right)\right) + \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \log n\right) \cdot \left(\log i \cdot \log i\right)\right) + \log n \cdot \left(n \cdot 100\right)\right)\right)\right)\right)}}{\frac{i}{n}}\]

    if 7.855089357782943e+198 < n

    1. Initial program 59.7

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

      \[\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 pow-to-exp59.8

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

      \[\leadsto \frac{\mathsf{fma}\left(100, e^{\color{blue}{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}}, -100\right)}{\frac{i}{n}}\]
    6. Using strategy rm
    7. Applied insert-posit1642.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \le -4.6511036455496 \cdot 10^{+137}:\\ \;\;\;\;\frac{\mathsf{fma}\left(e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n}, 100, -100\right)}{i} \cdot n\\ \mathbf{elif}\;n \le 1.9360594076256 \cdot 10^{-310}:\\ \;\;\;\;n \cdot \frac{\mathsf{fma}\left(100, {\left(\frac{i}{n} + 1\right)}^{n}, -100\right)}{i}\\ \mathbf{elif}\;n \le 1.547355740653275 \cdot 10^{-211}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log n \cdot \log n, \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}, \log i \cdot \left(\log i \cdot \log i\right), \mathsf{fma}\left(\log i \cdot n, 100, \mathsf{fma}\left(\frac{100}{3}, \left(n \cdot \left(n \cdot n\right)\right) \cdot \left(\log i \cdot \left(\log n \cdot \log n\right)\right), \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}, \log i \cdot \left(\log n \cdot \log n\right), \left(50 \cdot \left(\log i \cdot \log i\right)\right) \cdot \left(n \cdot n\right)\right)\right)\right)\right) - \mathsf{fma}\left(n \cdot \left(\frac{100}{3} \cdot \left(n \cdot n\right)\right), \left(\log i \cdot \log n\right) \cdot \log i, \mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log i \cdot \log n, \mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log i \cdot \log n, \left(\left(\log n \cdot \log n\right) \cdot \log n + \left(\log i \cdot \log n\right) \cdot \log i\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}\right) + n \cdot \left(\log n \cdot 100\right)\right)\right)\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le 3.2388182495466635 \cdot 10^{-96}:\\ \;\;\;\;\frac{\mathsf{fma}\left(i \cdot i, 50, \mathsf{fma}\left(i \cdot i, \frac{50}{3} \cdot i, 100 \cdot i\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le 4.809293212884638 \cdot 10^{-44}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log n \cdot \log n, \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}, \log i \cdot \left(\log i \cdot \log i\right), \mathsf{fma}\left(n \cdot 100, \log i, \mathsf{fma}\left(\frac{100}{3}, \left(\log n \cdot \log n\right) \cdot \left(\log i \cdot \left(n \cdot \left(n \cdot n\right)\right)\right), \mathsf{fma}\left(\frac{50}{3}, \left(\log n \cdot \log n\right) \cdot \left(\log i \cdot \left(n \cdot \left(n \cdot n\right)\right)\right), 50 \cdot \left(\left(n \cdot n\right) \cdot \left(\log i \cdot \log i\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(\log i \cdot \log i\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \log n\right), \frac{100}{3}, \mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log i \cdot \log n, \mathsf{fma}\left(\left(n \cdot n\right) \cdot 50, \log i \cdot \log n, \frac{50}{3} \cdot \left(\left(\log i \cdot \log i\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \log n\right) + \left(n \cdot \left(n \cdot n\right)\right) \cdot \left(\left(\log n \cdot \log n\right) \cdot \log n\right)\right) + \log n \cdot \left(n \cdot 100\right)\right)\right)\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;n \le 7.855089357782943 \cdot 10^{+198}:\\ \;\;\;\;\frac{\mathsf{fma}\left(i \cdot i, 50, \mathsf{fma}\left(i \cdot i, \frac{50}{3} \cdot i, 100 \cdot i\right)\right)}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(100, e^{\left(\left(\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n\right)\right)}, -100\right)}{\frac{i}{n}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019151 +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))))