Average Error: 42.4 → 26.6
Time: 37.0s
Precision: 64
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
\[\begin{array}{l} \mathbf{if}\;i \le -8.64473136240284 \cdot 10^{-06}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, 100, -100\right)}{i}}{\frac{1}{n}}\\ \mathbf{elif}\;i \le -1.3724256626812409 \cdot 10^{-191}:\\ \;\;\;\;\frac{\mathsf{fma}\left(100, i, \left(i \cdot i\right) \cdot \left(50 + i \cdot \frac{50}{3}\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le -2.4975427968587587 \cdot 10^{-298}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, 100, -100\right)}{i}}{\frac{1}{n}}\\ \mathbf{elif}\;i \le 1.4951161488388485:\\ \;\;\;\;\frac{\mathsf{fma}\left(100, i, \left(i \cdot i\right) \cdot \left(50 + i \cdot \frac{50}{3}\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 6.023686335920959 \cdot 10^{+212}:\\ \;\;\;\;\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}, \left(\log i \cdot \log i\right) \cdot \log i, \mathsf{fma}\left(n \cdot \log i, 100, \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), \left(\left(n \cdot n\right) \cdot 50\right) \cdot \left(\log i \cdot \log i\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{100}{3}, \left(\log i \cdot \log i\right) \cdot \log n, \log n \cdot \left(100 \cdot n\right) + \left(\left(\left(\log n \cdot \log n\right) \cdot \log n + \left(\log i \cdot \log i\right) \cdot \log n\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}\right) + \left(\left(\log n \cdot \log i\right) \cdot \left(n \cdot n\right)\right) \cdot 100\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 2.4667133503465437 \cdot 10^{+265}:\\ \;\;\;\;\frac{1}{i} \cdot \left(\mathsf{fma}\left(e^{n \cdot \left(\left(\mathsf{log1p}\left(\frac{i}{n}\right)\right)\right)}, 100, -100\right) \cdot n\right)\\ \mathbf{else}:\\ \;\;\;\;\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}, \left(\log i \cdot \log i\right) \cdot \log i, \mathsf{fma}\left(n \cdot \log i, 100, \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), \left(\left(n \cdot n\right) \cdot 50\right) \cdot \left(\log i \cdot \log i\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{100}{3}, \left(\log i \cdot \log i\right) \cdot \log n, \log n \cdot \left(100 \cdot n\right) + \left(\left(\left(\log n \cdot \log n\right) \cdot \log n + \left(\log i \cdot \log i\right) \cdot \log n\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}\right) + \left(\left(\log n \cdot \log i\right) \cdot \left(n \cdot n\right)\right) \cdot 100\right)\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}\;i \le -8.64473136240284 \cdot 10^{-06}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, 100, -100\right)}{i}}{\frac{1}{n}}\\

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

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

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

\mathbf{elif}\;i \le 6.023686335920959 \cdot 10^{+212}:\\
\;\;\;\;\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}, \left(\log i \cdot \log i\right) \cdot \log i, \mathsf{fma}\left(n \cdot \log i, 100, \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), \left(\left(n \cdot n\right) \cdot 50\right) \cdot \left(\log i \cdot \log i\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{100}{3}, \left(\log i \cdot \log i\right) \cdot \log n, \log n \cdot \left(100 \cdot n\right) + \left(\left(\left(\log n \cdot \log n\right) \cdot \log n + \left(\log i \cdot \log i\right) \cdot \log n\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}\right) + \left(\left(\log n \cdot \log i\right) \cdot \left(n \cdot n\right)\right) \cdot 100\right)\right)}{\frac{i}{n}}\\

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

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

\end{array}
double f(double i, double n) {
        double r4599082 = 100.0;
        double r4599083 = 1.0;
        double r4599084 = i;
        double r4599085 = n;
        double r4599086 = r4599084 / r4599085;
        double r4599087 = r4599083 + r4599086;
        double r4599088 = pow(r4599087, r4599085);
        double r4599089 = r4599088 - r4599083;
        double r4599090 = r4599089 / r4599086;
        double r4599091 = r4599082 * r4599090;
        return r4599091;
}

double f(double i, double n) {
        double r4599092 = i;
        double r4599093 = -8.64473136240284e-06;
        bool r4599094 = r4599092 <= r4599093;
        double r4599095 = n;
        double r4599096 = r4599092 / r4599095;
        double r4599097 = log1p(r4599096);
        double r4599098 = r4599095 * r4599097;
        double r4599099 = exp(r4599098);
        double r4599100 = 100.0;
        double r4599101 = -100.0;
        double r4599102 = fma(r4599099, r4599100, r4599101);
        double r4599103 = r4599102 / r4599092;
        double r4599104 = 1.0;
        double r4599105 = r4599104 / r4599095;
        double r4599106 = r4599103 / r4599105;
        double r4599107 = -1.3724256626812409e-191;
        bool r4599108 = r4599092 <= r4599107;
        double r4599109 = r4599092 * r4599092;
        double r4599110 = 50.0;
        double r4599111 = 16.666666666666668;
        double r4599112 = r4599092 * r4599111;
        double r4599113 = r4599110 + r4599112;
        double r4599114 = r4599109 * r4599113;
        double r4599115 = fma(r4599100, r4599092, r4599114);
        double r4599116 = r4599115 / r4599096;
        double r4599117 = -2.4975427968587587e-298;
        bool r4599118 = r4599092 <= r4599117;
        double r4599119 = 1.4951161488388485;
        bool r4599120 = r4599092 <= r4599119;
        double r4599121 = 6.023686335920959e+212;
        bool r4599122 = r4599092 <= r4599121;
        double r4599123 = r4599095 * r4599095;
        double r4599124 = r4599123 * r4599110;
        double r4599125 = log(r4599095);
        double r4599126 = r4599125 * r4599125;
        double r4599127 = r4599095 * r4599123;
        double r4599128 = r4599127 * r4599111;
        double r4599129 = log(r4599092);
        double r4599130 = r4599129 * r4599129;
        double r4599131 = r4599130 * r4599129;
        double r4599132 = r4599095 * r4599129;
        double r4599133 = 33.333333333333336;
        double r4599134 = r4599127 * r4599129;
        double r4599135 = r4599134 * r4599126;
        double r4599136 = r4599124 * r4599130;
        double r4599137 = fma(r4599111, r4599135, r4599136);
        double r4599138 = fma(r4599133, r4599135, r4599137);
        double r4599139 = fma(r4599132, r4599100, r4599138);
        double r4599140 = fma(r4599128, r4599131, r4599139);
        double r4599141 = fma(r4599124, r4599126, r4599140);
        double r4599142 = r4599127 * r4599133;
        double r4599143 = r4599130 * r4599125;
        double r4599144 = r4599100 * r4599095;
        double r4599145 = r4599125 * r4599144;
        double r4599146 = r4599126 * r4599125;
        double r4599147 = r4599146 + r4599143;
        double r4599148 = r4599147 * r4599128;
        double r4599149 = r4599125 * r4599129;
        double r4599150 = r4599149 * r4599123;
        double r4599151 = r4599150 * r4599100;
        double r4599152 = r4599148 + r4599151;
        double r4599153 = r4599145 + r4599152;
        double r4599154 = fma(r4599142, r4599143, r4599153);
        double r4599155 = r4599141 - r4599154;
        double r4599156 = r4599155 / r4599096;
        double r4599157 = 2.4667133503465437e+265;
        bool r4599158 = r4599092 <= r4599157;
        double r4599159 = r4599104 / r4599092;
        double r4599160 = /* ERROR: no posit support in C */;
        double r4599161 = /* ERROR: no posit support in C */;
        double r4599162 = r4599095 * r4599161;
        double r4599163 = exp(r4599162);
        double r4599164 = fma(r4599163, r4599100, r4599101);
        double r4599165 = r4599164 * r4599095;
        double r4599166 = r4599159 * r4599165;
        double r4599167 = r4599158 ? r4599166 : r4599156;
        double r4599168 = r4599122 ? r4599156 : r4599167;
        double r4599169 = r4599120 ? r4599116 : r4599168;
        double r4599170 = r4599118 ? r4599106 : r4599169;
        double r4599171 = r4599108 ? r4599116 : r4599170;
        double r4599172 = r4599094 ? r4599106 : r4599171;
        return r4599172;
}

Error

Bits error versus i

Bits error versus n

Target

Original42.4
Target42.2
Herbie26.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 4 regimes
  2. if i < -8.64473136240284e-06 or -1.3724256626812409e-191 < i < -2.4975427968587587e-298

    1. Initial program 35.1

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

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, 100, -100\right)}{\color{blue}{i \cdot \frac{1}{n}}}\]
    8. Applied associate-/r*20.2

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

    if -8.64473136240284e-06 < i < -1.3724256626812409e-191 or -2.4975427968587587e-298 < i < 1.4951161488388485

    1. Initial program 50.3

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

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

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

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

    if 1.4951161488388485 < i < 6.023686335920959e+212 or 2.4667133503465437e+265 < i

    1. Initial program 32.5

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

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

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

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

      \[\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. Simplified19.1

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

    if 6.023686335920959e+212 < i < 2.4667133503465437e+265

    1. Initial program 32.5

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(e^{n \cdot \left(\left(\mathsf{log1p}\left(\frac{i}{n}\right)\right)\right)}, 100, -100\right) \cdot \color{blue}{\left(n \cdot \frac{1}{i}\right)}\]
    13. Applied associate-*r*32.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \le -8.64473136240284 \cdot 10^{-06}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, 100, -100\right)}{i}}{\frac{1}{n}}\\ \mathbf{elif}\;i \le -1.3724256626812409 \cdot 10^{-191}:\\ \;\;\;\;\frac{\mathsf{fma}\left(100, i, \left(i \cdot i\right) \cdot \left(50 + i \cdot \frac{50}{3}\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le -2.4975427968587587 \cdot 10^{-298}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)}, 100, -100\right)}{i}}{\frac{1}{n}}\\ \mathbf{elif}\;i \le 1.4951161488388485:\\ \;\;\;\;\frac{\mathsf{fma}\left(100, i, \left(i \cdot i\right) \cdot \left(50 + i \cdot \frac{50}{3}\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 6.023686335920959 \cdot 10^{+212}:\\ \;\;\;\;\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}, \left(\log i \cdot \log i\right) \cdot \log i, \mathsf{fma}\left(n \cdot \log i, 100, \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), \left(\left(n \cdot n\right) \cdot 50\right) \cdot \left(\log i \cdot \log i\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{100}{3}, \left(\log i \cdot \log i\right) \cdot \log n, \log n \cdot \left(100 \cdot n\right) + \left(\left(\left(\log n \cdot \log n\right) \cdot \log n + \left(\log i \cdot \log i\right) \cdot \log n\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}\right) + \left(\left(\log n \cdot \log i\right) \cdot \left(n \cdot n\right)\right) \cdot 100\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 2.4667133503465437 \cdot 10^{+265}:\\ \;\;\;\;\frac{1}{i} \cdot \left(\mathsf{fma}\left(e^{n \cdot \left(\left(\mathsf{log1p}\left(\frac{i}{n}\right)\right)\right)}, 100, -100\right) \cdot n\right)\\ \mathbf{else}:\\ \;\;\;\;\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}, \left(\log i \cdot \log i\right) \cdot \log i, \mathsf{fma}\left(n \cdot \log i, 100, \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), \left(\left(n \cdot n\right) \cdot 50\right) \cdot \left(\log i \cdot \log i\right)\right)\right)\right)\right)\right) - \mathsf{fma}\left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{100}{3}, \left(\log i \cdot \log i\right) \cdot \log n, \log n \cdot \left(100 \cdot n\right) + \left(\left(\left(\log n \cdot \log n\right) \cdot \log n + \left(\log i \cdot \log i\right) \cdot \log n\right) \cdot \left(\left(n \cdot \left(n \cdot n\right)\right) \cdot \frac{50}{3}\right) + \left(\left(\log n \cdot \log i\right) \cdot \left(n \cdot n\right)\right) \cdot 100\right)\right)}{\frac{i}{n}}\\ \end{array}\]

Reproduce

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