Average Error: 42.7 → 25.6
Time: 28.2s
Precision: 64
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
\[\begin{array}{l} \mathbf{if}\;i \le -1.1676448974447302 \cdot 10^{-14}:\\ \;\;\;\;\frac{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100} \cdot \sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}{\frac{\frac{i}{n}}{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}}\\ \mathbf{elif}\;i \le -4.745225464100608 \cdot 10^{-198}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(i \cdot \frac{50}{3}, i \cdot i, 100 \cdot i\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le -5.102830896109795 \cdot 10^{-218}:\\ \;\;\;\;\frac{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100} \cdot \sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}{\frac{\frac{i}{n}}{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}}\\ \mathbf{elif}\;i \le 8.045186793396293 \cdot 10^{-206}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(i \cdot \frac{50}{3}, i \cdot i, 100 \cdot i\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 1.2043330665713129 \cdot 10^{-191}:\\ \;\;\;\;\frac{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100} \cdot \sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}{\frac{\frac{i}{n}}{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}}\\ \mathbf{elif}\;i \le 0.06286762942468366:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(i \cdot \frac{50}{3}, i \cdot i, 100 \cdot i\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 2.1565169088621677 \cdot 10^{+254}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \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(\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), \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(n \cdot \left(n \cdot n\right)\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(100 \cdot n\right) \cdot \log n + \left(\left(n \cdot \left(n \cdot n\right)\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}\;i \le 1.3330696406606884 \cdot 10^{+297}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}}{\frac{1}{n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \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(\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), \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(n \cdot \left(n \cdot n\right)\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(100 \cdot n\right) \cdot \log n + \left(\left(n \cdot \left(n \cdot n\right)\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}}\\ \end{array}\]
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\begin{array}{l}
\mathbf{if}\;i \le -1.1676448974447302 \cdot 10^{-14}:\\
\;\;\;\;\frac{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100} \cdot \sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}{\frac{\frac{i}{n}}{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}}\\

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

\mathbf{elif}\;i \le -5.102830896109795 \cdot 10^{-218}:\\
\;\;\;\;\frac{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100} \cdot \sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}{\frac{\frac{i}{n}}{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}}\\

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

\mathbf{elif}\;i \le 1.2043330665713129 \cdot 10^{-191}:\\
\;\;\;\;\frac{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100} \cdot \sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}{\frac{\frac{i}{n}}{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}}\\

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

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

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

\end{array}
double f(double i, double n) {
        double r2432149 = 100.0;
        double r2432150 = 1.0;
        double r2432151 = i;
        double r2432152 = n;
        double r2432153 = r2432151 / r2432152;
        double r2432154 = r2432150 + r2432153;
        double r2432155 = pow(r2432154, r2432152);
        double r2432156 = r2432155 - r2432150;
        double r2432157 = r2432156 / r2432153;
        double r2432158 = r2432149 * r2432157;
        return r2432158;
}

double f(double i, double n) {
        double r2432159 = i;
        double r2432160 = -1.1676448974447302e-14;
        bool r2432161 = r2432159 <= r2432160;
        double r2432162 = -100.0;
        double r2432163 = n;
        double r2432164 = r2432159 / r2432163;
        double r2432165 = log1p(r2432164);
        double r2432166 = r2432165 * r2432163;
        double r2432167 = exp(r2432166);
        double r2432168 = 100.0;
        double r2432169 = r2432167 * r2432168;
        double r2432170 = r2432162 + r2432169;
        double r2432171 = cbrt(r2432170);
        double r2432172 = r2432171 * r2432171;
        double r2432173 = r2432164 / r2432171;
        double r2432174 = r2432172 / r2432173;
        double r2432175 = -4.745225464100608e-198;
        bool r2432176 = r2432159 <= r2432175;
        double r2432177 = 50.0;
        double r2432178 = r2432159 * r2432159;
        double r2432179 = 16.666666666666668;
        double r2432180 = r2432159 * r2432179;
        double r2432181 = r2432168 * r2432159;
        double r2432182 = fma(r2432180, r2432178, r2432181);
        double r2432183 = fma(r2432177, r2432178, r2432182);
        double r2432184 = r2432183 / r2432164;
        double r2432185 = -5.102830896109795e-218;
        bool r2432186 = r2432159 <= r2432185;
        double r2432187 = 8.045186793396293e-206;
        bool r2432188 = r2432159 <= r2432187;
        double r2432189 = 1.2043330665713129e-191;
        bool r2432190 = r2432159 <= r2432189;
        double r2432191 = 0.06286762942468366;
        bool r2432192 = r2432159 <= r2432191;
        double r2432193 = 2.1565169088621677e+254;
        bool r2432194 = r2432159 <= r2432193;
        double r2432195 = r2432163 * r2432163;
        double r2432196 = r2432177 * r2432195;
        double r2432197 = log(r2432163);
        double r2432198 = r2432197 * r2432197;
        double r2432199 = r2432163 * r2432195;
        double r2432200 = r2432199 * r2432179;
        double r2432201 = log(r2432159);
        double r2432202 = r2432201 * r2432201;
        double r2432203 = r2432201 * r2432202;
        double r2432204 = r2432201 * r2432163;
        double r2432205 = 33.333333333333336;
        double r2432206 = r2432201 * r2432199;
        double r2432207 = r2432198 * r2432206;
        double r2432208 = r2432202 * r2432196;
        double r2432209 = fma(r2432179, r2432207, r2432208);
        double r2432210 = fma(r2432205, r2432207, r2432209);
        double r2432211 = fma(r2432204, r2432168, r2432210);
        double r2432212 = fma(r2432200, r2432203, r2432211);
        double r2432213 = fma(r2432196, r2432198, r2432212);
        double r2432214 = r2432199 * r2432205;
        double r2432215 = r2432197 * r2432202;
        double r2432216 = r2432197 * r2432201;
        double r2432217 = r2432168 * r2432163;
        double r2432218 = r2432217 * r2432197;
        double r2432219 = r2432198 * r2432197;
        double r2432220 = r2432215 + r2432219;
        double r2432221 = r2432200 * r2432220;
        double r2432222 = r2432218 + r2432221;
        double r2432223 = fma(r2432196, r2432216, r2432222);
        double r2432224 = fma(r2432196, r2432216, r2432223);
        double r2432225 = fma(r2432214, r2432215, r2432224);
        double r2432226 = r2432213 - r2432225;
        double r2432227 = r2432226 / r2432164;
        double r2432228 = 1.3330696406606884e+297;
        bool r2432229 = r2432159 <= r2432228;
        double r2432230 = 1.0;
        double r2432231 = r2432230 + r2432164;
        double r2432232 = pow(r2432231, r2432163);
        double r2432233 = fma(r2432168, r2432232, r2432162);
        double r2432234 = r2432233 / r2432159;
        double r2432235 = r2432230 / r2432163;
        double r2432236 = r2432234 / r2432235;
        double r2432237 = r2432229 ? r2432236 : r2432227;
        double r2432238 = r2432194 ? r2432227 : r2432237;
        double r2432239 = r2432192 ? r2432184 : r2432238;
        double r2432240 = r2432190 ? r2432174 : r2432239;
        double r2432241 = r2432188 ? r2432184 : r2432240;
        double r2432242 = r2432186 ? r2432174 : r2432241;
        double r2432243 = r2432176 ? r2432184 : r2432242;
        double r2432244 = r2432161 ? r2432174 : r2432243;
        return r2432244;
}

Error

Bits error versus i

Bits error versus n

Target

Original42.7
Target42.3
Herbie25.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 < -1.1676448974447302e-14 or -4.745225464100608e-198 < i < -5.102830896109795e-218 or 8.045186793396293e-206 < i < 1.2043330665713129e-191

    1. Initial program 31.8

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
    2. Simplified31.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-log31.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-exp31.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. Simplified12.1

      \[\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 fma-udef12.2

      \[\leadsto \frac{\color{blue}{100 \cdot e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)} + -100}}{\frac{i}{n}}\]
    9. Using strategy rm
    10. Applied add-cube-cbrt12.7

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{100 \cdot e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)} + -100} \cdot \sqrt[3]{100 \cdot e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)} + -100}\right) \cdot \sqrt[3]{100 \cdot e^{n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)} + -100}}}{\frac{i}{n}}\]
    11. Applied associate-/l*12.8

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

    if -1.1676448974447302e-14 < i < -4.745225464100608e-198 or -5.102830896109795e-218 < i < 8.045186793396293e-206 or 1.2043330665713129e-191 < i < 0.06286762942468366

    1. Initial program 49.7

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

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

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

      \[\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 0.06286762942468366 < i < 2.1565169088621677e+254 or 1.3330696406606884e+297 < i

    1. Initial program 34.0

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
    2. Simplified33.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 add-exp-log49.1

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

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

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

      \[\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. Simplified16.7

      \[\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.1565169088621677e+254 < i < 1.3330696406606884e+297

    1. Initial program 31.2

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
    2. Simplified31.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 div-inv31.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \le -1.1676448974447302 \cdot 10^{-14}:\\ \;\;\;\;\frac{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100} \cdot \sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}{\frac{\frac{i}{n}}{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}}\\ \mathbf{elif}\;i \le -4.745225464100608 \cdot 10^{-198}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(i \cdot \frac{50}{3}, i \cdot i, 100 \cdot i\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le -5.102830896109795 \cdot 10^{-218}:\\ \;\;\;\;\frac{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100} \cdot \sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}{\frac{\frac{i}{n}}{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}}\\ \mathbf{elif}\;i \le 8.045186793396293 \cdot 10^{-206}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(i \cdot \frac{50}{3}, i \cdot i, 100 \cdot i\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 1.2043330665713129 \cdot 10^{-191}:\\ \;\;\;\;\frac{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100} \cdot \sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}{\frac{\frac{i}{n}}{\sqrt[3]{-100 + e^{\mathsf{log1p}\left(\frac{i}{n}\right) \cdot n} \cdot 100}}}\\ \mathbf{elif}\;i \le 0.06286762942468366:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, i \cdot i, \mathsf{fma}\left(i \cdot \frac{50}{3}, i \cdot i, 100 \cdot i\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 2.1565169088621677 \cdot 10^{+254}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \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(\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), \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(n \cdot \left(n \cdot n\right)\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(100 \cdot n\right) \cdot \log n + \left(\left(n \cdot \left(n \cdot n\right)\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}\;i \le 1.3330696406606884 \cdot 10^{+297}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}}{\frac{1}{n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50 \cdot \left(n \cdot n\right), \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(\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), \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(n \cdot \left(n \cdot n\right)\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(100 \cdot n\right) \cdot \log n + \left(\left(n \cdot \left(n \cdot n\right)\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}}\\ \end{array}\]

Reproduce

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