Average Error: 42.1 → 27.4
Time: 1.9m
Precision: 64
\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
\[\begin{array}{l} \mathbf{if}\;i \le -2.2920532433751285 \cdot 10^{-92}:\\ \;\;\;\;\mathsf{fma}\left(100, \left(e^{\mathsf{log1p}\left(\left(\frac{i}{n}\right)\right) \cdot n}\right), -100\right) \cdot \frac{n}{i}\\ \mathbf{elif}\;i \le -6.547047229389803 \cdot 10^{-148}:\\ \;\;\;\;\frac{i \cdot \mathsf{fma}\left(i, \left(\mathsf{fma}\left(i, \frac{50}{3}, 50\right)\right), 100\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le -9.429451325520378 \cdot 10^{-161}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(100, \left({\left(\frac{i}{n} + 1\right)}^{n}\right), -100\right)}{\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}}}{\sqrt[3]{\frac{i}{n}}}\\ \mathbf{elif}\;i \le 2.448607663119347:\\ \;\;\;\;\frac{i \cdot \mathsf{fma}\left(i, \left(\mathsf{fma}\left(i, \frac{50}{3}, 50\right)\right), 100\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 2.7000146131065657 \cdot 10^{+237}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right), \left(\mathsf{fma}\left(\frac{50}{3}, \left(\left(n \cdot \left(\left(\log i \cdot n\right) \cdot \left(\log i \cdot n\right)\right)\right) \cdot \log i\right), \left(\mathsf{fma}\left(100, \left(\log i \cdot n\right), \left(50 \cdot \left(\log i \cdot \left(n \cdot \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right)\right)\right) + \left(\left(\log i \cdot n\right) \cdot \left(\log i \cdot n\right)\right) \cdot 50\right)\right)\right)\right)\right)\right) - \left(\left(\mathsf{fma}\left(\left(\left(\log i \cdot \log i\right) \cdot \left(\left(\log n \cdot n\right) \cdot \left(n \cdot n\right)\right)\right), \frac{100}{3}, \left(\left(\log i \cdot 50\right) \cdot \left(\left(n \cdot n\right) \cdot \log n\right)\right)\right) + \left(\log i \cdot 50\right) \cdot \left(\left(n \cdot n\right) \cdot \log n\right)\right) + \mathsf{fma}\left(\frac{50}{3}, \left(\log n \cdot \left(n \cdot \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right)\right)\right), \left(\mathsf{fma}\left(\left(\left(\log i \cdot \log i\right) \cdot \left(\left(\log n \cdot n\right) \cdot \left(n \cdot n\right)\right)\right), \frac{50}{3}, \left(100 \cdot \left(\log n \cdot n\right)\right)\right)\right)\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 1.7504058567965248 \cdot 10^{+288}:\\ \;\;\;\;\frac{\log \left(e^{\mathsf{fma}\left(100, \left({\left(\frac{i}{n} + 1\right)}^{n}\right), -100\right)}\right)}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{n}{i} \cdot \left(\mathsf{fma}\left(50, \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right), \left(\mathsf{fma}\left(\frac{50}{3}, \left(\left(n \cdot \left(\left(\log i \cdot n\right) \cdot \left(\log i \cdot n\right)\right)\right) \cdot \log i\right), \left(\mathsf{fma}\left(100, \left(\log i \cdot n\right), \left(50 \cdot \left(\log i \cdot \left(n \cdot \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right)\right)\right) + \left(\left(\log i \cdot n\right) \cdot \left(\log i \cdot n\right)\right) \cdot 50\right)\right)\right)\right)\right)\right) - \left(\left(\mathsf{fma}\left(\left(\left(\log i \cdot \log i\right) \cdot \left(\left(\log n \cdot n\right) \cdot \left(n \cdot n\right)\right)\right), \frac{100}{3}, \left(\left(\log i \cdot 50\right) \cdot \left(\left(n \cdot n\right) \cdot \log n\right)\right)\right) + \left(\log i \cdot 50\right) \cdot \left(\left(n \cdot n\right) \cdot \log n\right)\right) + \mathsf{fma}\left(\frac{50}{3}, \left(\log n \cdot \left(n \cdot \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right)\right)\right), \left(\mathsf{fma}\left(\left(\left(\log i \cdot \log i\right) \cdot \left(\left(\log n \cdot n\right) \cdot \left(n \cdot n\right)\right)\right), \frac{50}{3}, \left(100 \cdot \left(\log n \cdot n\right)\right)\right)\right)\right)\right)\right)\\ \end{array}\]
100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}
\begin{array}{l}
\mathbf{if}\;i \le -2.2920532433751285 \cdot 10^{-92}:\\
\;\;\;\;\mathsf{fma}\left(100, \left(e^{\mathsf{log1p}\left(\left(\frac{i}{n}\right)\right) \cdot n}\right), -100\right) \cdot \frac{n}{i}\\

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

\mathbf{elif}\;i \le -9.429451325520378 \cdot 10^{-161}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(100, \left({\left(\frac{i}{n} + 1\right)}^{n}\right), -100\right)}{\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}}}{\sqrt[3]{\frac{i}{n}}}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{n}{i} \cdot \left(\mathsf{fma}\left(50, \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right), \left(\mathsf{fma}\left(\frac{50}{3}, \left(\left(n \cdot \left(\left(\log i \cdot n\right) \cdot \left(\log i \cdot n\right)\right)\right) \cdot \log i\right), \left(\mathsf{fma}\left(100, \left(\log i \cdot n\right), \left(50 \cdot \left(\log i \cdot \left(n \cdot \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right)\right)\right) + \left(\left(\log i \cdot n\right) \cdot \left(\log i \cdot n\right)\right) \cdot 50\right)\right)\right)\right)\right)\right) - \left(\left(\mathsf{fma}\left(\left(\left(\log i \cdot \log i\right) \cdot \left(\left(\log n \cdot n\right) \cdot \left(n \cdot n\right)\right)\right), \frac{100}{3}, \left(\left(\log i \cdot 50\right) \cdot \left(\left(n \cdot n\right) \cdot \log n\right)\right)\right) + \left(\log i \cdot 50\right) \cdot \left(\left(n \cdot n\right) \cdot \log n\right)\right) + \mathsf{fma}\left(\frac{50}{3}, \left(\log n \cdot \left(n \cdot \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right)\right)\right), \left(\mathsf{fma}\left(\left(\left(\log i \cdot \log i\right) \cdot \left(\left(\log n \cdot n\right) \cdot \left(n \cdot n\right)\right)\right), \frac{50}{3}, \left(100 \cdot \left(\log n \cdot n\right)\right)\right)\right)\right)\right)\right)\\

\end{array}
double f(double i, double n) {
        double r33435252 = 100.0;
        double r33435253 = 1.0;
        double r33435254 = i;
        double r33435255 = n;
        double r33435256 = r33435254 / r33435255;
        double r33435257 = r33435253 + r33435256;
        double r33435258 = pow(r33435257, r33435255);
        double r33435259 = r33435258 - r33435253;
        double r33435260 = r33435259 / r33435256;
        double r33435261 = r33435252 * r33435260;
        return r33435261;
}

double f(double i, double n) {
        double r33435262 = i;
        double r33435263 = -2.2920532433751285e-92;
        bool r33435264 = r33435262 <= r33435263;
        double r33435265 = 100.0;
        double r33435266 = n;
        double r33435267 = r33435262 / r33435266;
        double r33435268 = log1p(r33435267);
        double r33435269 = r33435268 * r33435266;
        double r33435270 = exp(r33435269);
        double r33435271 = -100.0;
        double r33435272 = fma(r33435265, r33435270, r33435271);
        double r33435273 = r33435266 / r33435262;
        double r33435274 = r33435272 * r33435273;
        double r33435275 = -6.547047229389803e-148;
        bool r33435276 = r33435262 <= r33435275;
        double r33435277 = 16.666666666666668;
        double r33435278 = 50.0;
        double r33435279 = fma(r33435262, r33435277, r33435278);
        double r33435280 = fma(r33435262, r33435279, r33435265);
        double r33435281 = r33435262 * r33435280;
        double r33435282 = r33435281 / r33435267;
        double r33435283 = -9.429451325520378e-161;
        bool r33435284 = r33435262 <= r33435283;
        double r33435285 = 1.0;
        double r33435286 = r33435267 + r33435285;
        double r33435287 = pow(r33435286, r33435266);
        double r33435288 = fma(r33435265, r33435287, r33435271);
        double r33435289 = cbrt(r33435267);
        double r33435290 = r33435289 * r33435289;
        double r33435291 = r33435288 / r33435290;
        double r33435292 = r33435291 / r33435289;
        double r33435293 = 2.448607663119347;
        bool r33435294 = r33435262 <= r33435293;
        double r33435295 = 2.7000146131065657e+237;
        bool r33435296 = r33435262 <= r33435295;
        double r33435297 = log(r33435266);
        double r33435298 = r33435297 * r33435266;
        double r33435299 = r33435298 * r33435298;
        double r33435300 = log(r33435262);
        double r33435301 = r33435300 * r33435266;
        double r33435302 = r33435301 * r33435301;
        double r33435303 = r33435266 * r33435302;
        double r33435304 = r33435303 * r33435300;
        double r33435305 = r33435266 * r33435299;
        double r33435306 = r33435300 * r33435305;
        double r33435307 = r33435278 * r33435306;
        double r33435308 = r33435302 * r33435278;
        double r33435309 = r33435307 + r33435308;
        double r33435310 = fma(r33435265, r33435301, r33435309);
        double r33435311 = fma(r33435277, r33435304, r33435310);
        double r33435312 = fma(r33435278, r33435299, r33435311);
        double r33435313 = r33435300 * r33435300;
        double r33435314 = r33435266 * r33435266;
        double r33435315 = r33435298 * r33435314;
        double r33435316 = r33435313 * r33435315;
        double r33435317 = 33.333333333333336;
        double r33435318 = r33435300 * r33435278;
        double r33435319 = r33435314 * r33435297;
        double r33435320 = r33435318 * r33435319;
        double r33435321 = fma(r33435316, r33435317, r33435320);
        double r33435322 = r33435321 + r33435320;
        double r33435323 = r33435297 * r33435305;
        double r33435324 = r33435265 * r33435298;
        double r33435325 = fma(r33435316, r33435277, r33435324);
        double r33435326 = fma(r33435277, r33435323, r33435325);
        double r33435327 = r33435322 + r33435326;
        double r33435328 = r33435312 - r33435327;
        double r33435329 = r33435328 / r33435267;
        double r33435330 = 1.7504058567965248e+288;
        bool r33435331 = r33435262 <= r33435330;
        double r33435332 = exp(r33435288);
        double r33435333 = log(r33435332);
        double r33435334 = r33435333 / r33435267;
        double r33435335 = r33435273 * r33435328;
        double r33435336 = r33435331 ? r33435334 : r33435335;
        double r33435337 = r33435296 ? r33435329 : r33435336;
        double r33435338 = r33435294 ? r33435282 : r33435337;
        double r33435339 = r33435284 ? r33435292 : r33435338;
        double r33435340 = r33435276 ? r33435282 : r33435339;
        double r33435341 = r33435264 ? r33435274 : r33435340;
        return r33435341;
}

Error

Bits error versus i

Bits error versus n

Target

Original42.1
Target42.2
Herbie27.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 i < -2.2920532433751285e-92

    1. Initial program 33.6

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

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

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

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

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

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

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

    if -2.2920532433751285e-92 < i < -6.547047229389803e-148 or -9.429451325520378e-161 < i < 2.448607663119347

    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({\left(1 + \frac{i}{n}\right)}^{n}\right), -100\right)}{\frac{i}{n}}}\]
    3. Taylor expanded around 0 34.5

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

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

    if -6.547047229389803e-148 < i < -9.429451325520378e-161

    1. Initial program 47.7

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

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

      \[\leadsto \frac{\mathsf{fma}\left(100, \left({\left(1 + \frac{i}{n}\right)}^{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}}}}\]
    5. Applied associate-/r*47.7

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

    if 2.448607663119347 < i < 2.7000146131065657e+237

    1. Initial program 30.9

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

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

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

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

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

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

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

    if 2.7000146131065657e+237 < i < 1.7504058567965248e+288

    1. Initial program 29.0

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

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

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

    if 1.7504058567965248e+288 < i

    1. Initial program 31.7

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\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)\right)} \cdot \frac{n}{i}\]
    11. Simplified31.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \le -2.2920532433751285 \cdot 10^{-92}:\\ \;\;\;\;\mathsf{fma}\left(100, \left(e^{\mathsf{log1p}\left(\left(\frac{i}{n}\right)\right) \cdot n}\right), -100\right) \cdot \frac{n}{i}\\ \mathbf{elif}\;i \le -6.547047229389803 \cdot 10^{-148}:\\ \;\;\;\;\frac{i \cdot \mathsf{fma}\left(i, \left(\mathsf{fma}\left(i, \frac{50}{3}, 50\right)\right), 100\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le -9.429451325520378 \cdot 10^{-161}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(100, \left({\left(\frac{i}{n} + 1\right)}^{n}\right), -100\right)}{\sqrt[3]{\frac{i}{n}} \cdot \sqrt[3]{\frac{i}{n}}}}{\sqrt[3]{\frac{i}{n}}}\\ \mathbf{elif}\;i \le 2.448607663119347:\\ \;\;\;\;\frac{i \cdot \mathsf{fma}\left(i, \left(\mathsf{fma}\left(i, \frac{50}{3}, 50\right)\right), 100\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 2.7000146131065657 \cdot 10^{+237}:\\ \;\;\;\;\frac{\mathsf{fma}\left(50, \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right), \left(\mathsf{fma}\left(\frac{50}{3}, \left(\left(n \cdot \left(\left(\log i \cdot n\right) \cdot \left(\log i \cdot n\right)\right)\right) \cdot \log i\right), \left(\mathsf{fma}\left(100, \left(\log i \cdot n\right), \left(50 \cdot \left(\log i \cdot \left(n \cdot \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right)\right)\right) + \left(\left(\log i \cdot n\right) \cdot \left(\log i \cdot n\right)\right) \cdot 50\right)\right)\right)\right)\right)\right) - \left(\left(\mathsf{fma}\left(\left(\left(\log i \cdot \log i\right) \cdot \left(\left(\log n \cdot n\right) \cdot \left(n \cdot n\right)\right)\right), \frac{100}{3}, \left(\left(\log i \cdot 50\right) \cdot \left(\left(n \cdot n\right) \cdot \log n\right)\right)\right) + \left(\log i \cdot 50\right) \cdot \left(\left(n \cdot n\right) \cdot \log n\right)\right) + \mathsf{fma}\left(\frac{50}{3}, \left(\log n \cdot \left(n \cdot \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right)\right)\right), \left(\mathsf{fma}\left(\left(\left(\log i \cdot \log i\right) \cdot \left(\left(\log n \cdot n\right) \cdot \left(n \cdot n\right)\right)\right), \frac{50}{3}, \left(100 \cdot \left(\log n \cdot n\right)\right)\right)\right)\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \le 1.7504058567965248 \cdot 10^{+288}:\\ \;\;\;\;\frac{\log \left(e^{\mathsf{fma}\left(100, \left({\left(\frac{i}{n} + 1\right)}^{n}\right), -100\right)}\right)}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{n}{i} \cdot \left(\mathsf{fma}\left(50, \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right), \left(\mathsf{fma}\left(\frac{50}{3}, \left(\left(n \cdot \left(\left(\log i \cdot n\right) \cdot \left(\log i \cdot n\right)\right)\right) \cdot \log i\right), \left(\mathsf{fma}\left(100, \left(\log i \cdot n\right), \left(50 \cdot \left(\log i \cdot \left(n \cdot \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right)\right)\right) + \left(\left(\log i \cdot n\right) \cdot \left(\log i \cdot n\right)\right) \cdot 50\right)\right)\right)\right)\right)\right) - \left(\left(\mathsf{fma}\left(\left(\left(\log i \cdot \log i\right) \cdot \left(\left(\log n \cdot n\right) \cdot \left(n \cdot n\right)\right)\right), \frac{100}{3}, \left(\left(\log i \cdot 50\right) \cdot \left(\left(n \cdot n\right) \cdot \log n\right)\right)\right) + \left(\log i \cdot 50\right) \cdot \left(\left(n \cdot n\right) \cdot \log n\right)\right) + \mathsf{fma}\left(\frac{50}{3}, \left(\log n \cdot \left(n \cdot \left(\left(\log n \cdot n\right) \cdot \left(\log n \cdot n\right)\right)\right)\right), \left(\mathsf{fma}\left(\left(\left(\log i \cdot \log i\right) \cdot \left(\left(\log n \cdot n\right) \cdot \left(n \cdot n\right)\right)\right), \frac{50}{3}, \left(100 \cdot \left(\log n \cdot n\right)\right)\right)\right)\right)\right)\right)\\ \end{array}\]

Reproduce

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