Compound Interest

Percentage Accurate: 28.1% → 98.0%
Time: 19.6s
Alternatives: 18
Speedup: 38.0×

Specification

?
\[\begin{array}{l} t_0 := \frac{i}{n}\\ 100 \cdot \frac{{\left(1 + t_0\right)}^{n} - 1}{t_0} \end{array} \]

Your Program's Arguments

Results

Enter valid numbers for all inputs

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 18 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Alternative 1: 98.0% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\ t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\ \mathbf{if}\;t_1 \leq 0:\\ \;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;n \cdot \frac{t_0 \cdot 100 + -100}{i}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0

    1. Initial program 28.1%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity28.1%

        \[\leadsto 100 \cdot \frac{\color{blue}{1 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}}{\frac{i}{n}} \]
      2. pow-to-exp26.5%

        \[\leadsto 100 \cdot \frac{1 \cdot \left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right)}{\frac{i}{n}} \]
      3. expm1-def38.3%

        \[\leadsto 100 \cdot \frac{1 \cdot \color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
      4. *-commutative38.3%

        \[\leadsto 100 \cdot \frac{1 \cdot \mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
      5. log1p-udef98.1%

        \[\leadsto 100 \cdot \frac{1 \cdot \mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
    3. Applied egg-rr98.1%

      \[\leadsto 100 \cdot \frac{\color{blue}{1 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
    4. Step-by-step derivation
      1. *-lft-identity98.1%

        \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
    5. Simplified98.1%

      \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]

    if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0

    1. Initial program 98.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/98.5%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*98.5%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative98.5%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/98.5%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg98.5%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in98.5%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def98.5%

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

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

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

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Step-by-step derivation
      1. fma-udef98.5%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + -100}}{i} \]
      2. *-commutative98.5%

        \[\leadsto n \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100} + -100}{i} \]
    5. Applied egg-rr98.5%

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

    if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n))

    1. Initial program 0.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 1.9%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative1.9%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*1.9%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def80.8%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified80.8%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification98.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq 0:\\ \;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}{\frac{i}{n}}\\ \mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq \infty:\\ \;\;\;\;n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100 + -100}{i}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \]

Alternative 2: 83.1% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := \frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \mathbf{elif}\;t_0 \leq \infty:\\ \;\;\;\;t_0 \cdot 100\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0

    1. Initial program 28.1%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 44.3%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative44.3%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*44.3%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def75.7%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified75.7%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]

    if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0

    1. Initial program 98.3%

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

    if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n))

    1. Initial program 0.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 1.9%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative1.9%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*1.9%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def80.8%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified80.8%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq 0:\\ \;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq \infty:\\ \;\;\;\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \cdot 100\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \]

Alternative 3: 83.1% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := {\left(1 + \frac{i}{n}\right)}^{n}\\ t_1 := \frac{t_0 + -1}{\frac{i}{n}}\\ \mathbf{if}\;t_1 \leq 0:\\ \;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;n \cdot \frac{t_0 \cdot 100 + -100}{i}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < 0.0

    1. Initial program 28.1%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 44.3%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative44.3%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*44.3%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def75.7%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified75.7%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]

    if 0.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n)) < +inf.0

    1. Initial program 98.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/98.5%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*98.5%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative98.5%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/98.5%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg98.5%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in98.5%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def98.5%

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

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

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

      \[\leadsto \color{blue}{n \cdot \frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{i}} \]
    4. Step-by-step derivation
      1. fma-udef98.5%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + -100}}{i} \]
      2. *-commutative98.5%

        \[\leadsto n \cdot \frac{\color{blue}{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100} + -100}{i} \]
    5. Applied egg-rr98.5%

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

    if +inf.0 < (/.f64 (-.f64 (pow.f64 (+.f64 1 (/.f64 i n)) n) 1) (/.f64 i n))

    1. Initial program 0.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 1.9%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative1.9%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*1.9%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def80.8%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified80.8%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified100.0%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq 0:\\ \;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \mathbf{elif}\;\frac{{\left(1 + \frac{i}{n}\right)}^{n} + -1}{\frac{i}{n}} \leq \infty:\\ \;\;\;\;n \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} \cdot 100 + -100}{i}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \end{array} \]

Alternative 4: 74.9% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := 100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\ \mathbf{if}\;i \leq -1.3 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;i \leq 1.35 \cdot 10^{-9}:\\ \;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\ \mathbf{elif}\;i \leq 1.82 \cdot 10^{+177}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;i \leq 2.8 \cdot 10^{+286}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{else}:\\ \;\;\;\;50 \cdot \left(i \cdot n\right)\\ \end{array} \]
Derivation
  1. Split input into 4 regimes
  2. if i < -1.29999999999999992e-5 or 1.3500000000000001e-9 < i < 1.82e177

    1. Initial program 43.8%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 70.5%

      \[\leadsto 100 \cdot \frac{\color{blue}{e^{i} - 1}}{\frac{i}{n}} \]
    3. Step-by-step derivation
      1. expm1-def71.3%

        \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{\frac{i}{n}} \]
    4. Simplified71.3%

      \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{\frac{i}{n}} \]

    if -1.29999999999999992e-5 < i < 1.3500000000000001e-9

    1. Initial program 9.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 10.4%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative10.4%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*10.4%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def86.6%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified86.6%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Step-by-step derivation
      1. associate-*l/86.6%

        \[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}} \]
    6. Applied egg-rr86.6%

      \[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}} \]
    7. Taylor expanded in i around 0 86.6%

      \[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + 100 \cdot n\right)} \]
    8. Step-by-step derivation
      1. *-commutative86.6%

        \[\leadsto 50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + \color{blue}{n \cdot 100}\right) \]
      2. associate-+r+86.6%

        \[\leadsto \color{blue}{\left(50 \cdot \left(n \cdot i\right) + 16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)\right) + n \cdot 100} \]
    9. Simplified86.6%

      \[\leadsto \color{blue}{n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)} \]

    if 1.82e177 < i < 2.7999999999999998e286

    1. Initial program 68.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 13.0%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative13.0%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*13.0%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def13.0%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified13.0%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 31.5%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative31.5%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified31.5%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]

    if 2.7999999999999998e286 < i

    1. Initial program 99.5%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 50.5%

      \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*50.5%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
      2. *-commutative50.5%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
      3. associate-*r/50.5%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
      4. metadata-eval50.5%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
    4. Simplified50.5%

      \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]
    5. Taylor expanded in n around inf 50.5%

      \[\leadsto 100 \cdot \color{blue}{\left(\left(1 + 0.5 \cdot i\right) \cdot n\right)} \]
    6. Taylor expanded in i around inf 50.5%

      \[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification74.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.3 \cdot 10^{-5}:\\ \;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 1.35 \cdot 10^{-9}:\\ \;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\ \mathbf{elif}\;i \leq 1.82 \cdot 10^{+177}:\\ \;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 2.8 \cdot 10^{+286}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{else}:\\ \;\;\;\;50 \cdot \left(i \cdot n\right)\\ \end{array} \]

Alternative 5: 74.9% accurate, 1.0× speedup?

\[\begin{array}{l} \mathbf{if}\;i \leq -1.1 \cdot 10^{-7}:\\ \;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 3 \cdot 10^{-12}:\\ \;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\ \mathbf{elif}\;i \leq 1.82 \cdot 10^{+177}:\\ \;\;\;\;100 \cdot \left(\mathsf{expm1}\left(i\right) \cdot \frac{n}{i}\right)\\ \mathbf{elif}\;i \leq 5.1 \cdot 10^{+286}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{else}:\\ \;\;\;\;50 \cdot \left(i \cdot n\right)\\ \end{array} \]
Derivation
  1. Split input into 5 regimes
  2. if i < -1.1000000000000001e-7

    1. Initial program 55.8%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 74.1%

      \[\leadsto 100 \cdot \frac{\color{blue}{e^{i} - 1}}{\frac{i}{n}} \]
    3. Step-by-step derivation
      1. expm1-def74.2%

        \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{\frac{i}{n}} \]
    4. Simplified74.2%

      \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(i\right)}}{\frac{i}{n}} \]

    if -1.1000000000000001e-7 < i < 3.0000000000000001e-12

    1. Initial program 9.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 9.6%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative9.6%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*9.6%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def86.3%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified86.3%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Step-by-step derivation
      1. associate-*l/86.3%

        \[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}} \]
    6. Applied egg-rr86.3%

      \[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}} \]
    7. Taylor expanded in i around 0 86.3%

      \[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + 100 \cdot n\right)} \]
    8. Step-by-step derivation
      1. *-commutative86.3%

        \[\leadsto 50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + \color{blue}{n \cdot 100}\right) \]
      2. associate-+r+86.3%

        \[\leadsto \color{blue}{\left(50 \cdot \left(n \cdot i\right) + 16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)\right) + n \cdot 100} \]
    9. Simplified86.3%

      \[\leadsto \color{blue}{n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)} \]

    if 3.0000000000000001e-12 < i < 1.82e177

    1. Initial program 26.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 65.3%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative65.3%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*65.3%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def68.7%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified68.7%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Step-by-step derivation
      1. associate-/r/68.6%

        \[\leadsto \color{blue}{\left(\frac{n}{i} \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100 \]
    6. Applied egg-rr68.6%

      \[\leadsto \color{blue}{\left(\frac{n}{i} \cdot \mathsf{expm1}\left(i\right)\right)} \cdot 100 \]

    if 1.82e177 < i < 5.09999999999999998e286

    1. Initial program 68.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 13.0%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative13.0%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*13.0%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def13.0%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified13.0%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 31.5%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative31.5%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified31.5%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]

    if 5.09999999999999998e286 < i

    1. Initial program 99.5%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 50.5%

      \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*50.5%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
      2. *-commutative50.5%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
      3. associate-*r/50.5%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
      4. metadata-eval50.5%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
    4. Simplified50.5%

      \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]
    5. Taylor expanded in n around inf 50.5%

      \[\leadsto 100 \cdot \color{blue}{\left(\left(1 + 0.5 \cdot i\right) \cdot n\right)} \]
    6. Taylor expanded in i around inf 50.5%

      \[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification74.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.1 \cdot 10^{-7}:\\ \;\;\;\;100 \cdot \frac{\mathsf{expm1}\left(i\right)}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 3 \cdot 10^{-12}:\\ \;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\ \mathbf{elif}\;i \leq 1.82 \cdot 10^{+177}:\\ \;\;\;\;100 \cdot \left(\mathsf{expm1}\left(i\right) \cdot \frac{n}{i}\right)\\ \mathbf{elif}\;i \leq 5.1 \cdot 10^{+286}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{else}:\\ \;\;\;\;50 \cdot \left(i \cdot n\right)\\ \end{array} \]

Alternative 6: 82.0% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := 100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \mathbf{if}\;n \leq -1.15 \cdot 10^{-178}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;n \leq 2.25 \cdot 10^{-213}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 3 \cdot 10^{-25}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if n < -1.14999999999999997e-178 or 2.9999999999999998e-25 < n

    1. Initial program 27.5%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 40.4%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative40.4%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*40.4%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def82.6%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified82.6%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]

    if -1.14999999999999997e-178 < n < 2.2500000000000001e-213

    1. Initial program 73.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/73.2%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. sub-neg73.2%

        \[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}} \]
      3. distribute-lft-in73.2%

        \[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}} \]
      4. fma-def73.2%

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}} \]
    4. Taylor expanded in n around inf 50.1%

      \[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}} \]
    5. Taylor expanded in i around 0 85.7%

      \[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}} \]

    if 2.2500000000000001e-213 < n < 2.9999999999999998e-25

    1. Initial program 15.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 3.4%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative3.4%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*3.4%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def45.4%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified45.4%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 58.2%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative58.2%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified58.2%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.15 \cdot 10^{-178}:\\ \;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \mathbf{elif}\;n \leq 2.25 \cdot 10^{-213}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 3 \cdot 10^{-25}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}}\\ \end{array} \]

Alternative 7: 67.2% accurate, 5.9× speedup?

\[\begin{array}{l} t_0 := 100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{if}\;n \leq -1.85 \cdot 10^{-179}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;n \leq 7 \cdot 10^{-215}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 1.2 \cdot 10^{-25}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left(n + n \cdot \left(i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if n < -1.84999999999999995e-179 or 7.0000000000000004e-215 < n < 1.20000000000000005e-25

    1. Initial program 28.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 28.9%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative28.9%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*28.9%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def68.4%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified68.4%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 53.5%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative53.5%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified53.5%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]

    if -1.84999999999999995e-179 < n < 7.0000000000000004e-215

    1. Initial program 73.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/73.2%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. sub-neg73.2%

        \[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}} \]
      3. distribute-lft-in73.2%

        \[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}} \]
      4. fma-def73.2%

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}} \]
    4. Taylor expanded in n around inf 50.1%

      \[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}} \]
    5. Taylor expanded in i around 0 85.7%

      \[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}} \]

    if 1.20000000000000005e-25 < n

    1. Initial program 19.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity19.3%

        \[\leadsto 100 \cdot \frac{\color{blue}{1 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}}{\frac{i}{n}} \]
      2. pow-to-exp15.3%

        \[\leadsto 100 \cdot \frac{1 \cdot \left(\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1\right)}{\frac{i}{n}} \]
      3. expm1-def17.1%

        \[\leadsto 100 \cdot \frac{1 \cdot \color{blue}{\mathsf{expm1}\left(\log \left(1 + \frac{i}{n}\right) \cdot n\right)}}{\frac{i}{n}} \]
      4. *-commutative17.1%

        \[\leadsto 100 \cdot \frac{1 \cdot \mathsf{expm1}\left(\color{blue}{n \cdot \log \left(1 + \frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
      5. log1p-udef72.2%

        \[\leadsto 100 \cdot \frac{1 \cdot \mathsf{expm1}\left(n \cdot \color{blue}{\mathsf{log1p}\left(\frac{i}{n}\right)}\right)}{\frac{i}{n}} \]
    3. Applied egg-rr72.2%

      \[\leadsto 100 \cdot \frac{\color{blue}{1 \cdot \mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
    4. Step-by-step derivation
      1. *-lft-identity72.2%

        \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
    5. Simplified72.2%

      \[\leadsto 100 \cdot \frac{\color{blue}{\mathsf{expm1}\left(n \cdot \mathsf{log1p}\left(\frac{i}{n}\right)\right)}}{\frac{i}{n}} \]
    6. Taylor expanded in i around 0 67.8%

      \[\leadsto 100 \cdot \color{blue}{\left(n + \left(n \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right) + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-out68.0%

        \[\leadsto 100 \cdot \left(n + \color{blue}{n \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
      2. unpow268.0%

        \[\leadsto 100 \cdot \left(n + n \cdot \left(\color{blue}{\left(i \cdot i\right)} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      3. associate--l+68.0%

        \[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)} + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      4. associate-*r/68.0%

        \[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{{n}^{2}}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      5. metadata-eval68.0%

        \[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{\color{blue}{0.3333333333333333}}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      6. unpow268.0%

        \[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{\color{blue}{n \cdot n}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      7. associate-*r/68.0%

        \[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      8. metadata-eval68.0%

        \[\leadsto 100 \cdot \left(n + n \cdot \left(\left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{\color{blue}{0.5}}{n}\right)\right) + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      9. associate-*l*68.0%

        \[\leadsto 100 \cdot \left(n + n \cdot \left(\color{blue}{i \cdot \left(i \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right)} + i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      10. associate-*r/68.0%

        \[\leadsto 100 \cdot \left(n + n \cdot \left(i \cdot \left(i \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right) + i \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)\right) \]
      11. metadata-eval68.0%

        \[\leadsto 100 \cdot \left(n + n \cdot \left(i \cdot \left(i \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right) + i \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right)\right) \]
    8. Simplified68.0%

      \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(i \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right) + \left(0.5 - \frac{0.5}{n}\right)\right)\right)\right)} \]
    9. Taylor expanded in n around inf 68.0%

      \[\leadsto 100 \cdot \left(n + n \cdot \color{blue}{\left(\left(0.5 + 0.16666666666666666 \cdot i\right) \cdot i\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.85 \cdot 10^{-179}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{elif}\;n \leq 7 \cdot 10^{-215}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 1.2 \cdot 10^{-25}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left(n + n \cdot \left(i \cdot \left(0.5 + i \cdot 0.16666666666666666\right)\right)\right)\\ \end{array} \]

Alternative 8: 67.2% accurate, 6.6× speedup?

\[\begin{array}{l} t_0 := 100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{if}\;n \leq -8.6 \cdot 10^{-179}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;n \leq 6.6 \cdot 10^{-215}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 2.4 \cdot 10^{-25}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if n < -8.60000000000000052e-179 or 6.5999999999999996e-215 < n < 2.40000000000000009e-25

    1. Initial program 28.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 28.9%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative28.9%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*28.9%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def68.4%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified68.4%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 53.5%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative53.5%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified53.5%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]

    if -8.60000000000000052e-179 < n < 6.5999999999999996e-215

    1. Initial program 73.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/73.2%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. sub-neg73.2%

        \[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}} \]
      3. distribute-lft-in73.2%

        \[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}} \]
      4. fma-def73.2%

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}} \]
    4. Taylor expanded in n around inf 50.1%

      \[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}} \]
    5. Taylor expanded in i around 0 85.7%

      \[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}} \]

    if 2.40000000000000009e-25 < n

    1. Initial program 19.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 46.3%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative46.3%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*46.3%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def93.5%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified93.5%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Step-by-step derivation
      1. associate-*l/93.5%

        \[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}} \]
    6. Applied egg-rr93.5%

      \[\leadsto \color{blue}{\frac{n \cdot 100}{\frac{i}{\mathsf{expm1}\left(i\right)}}} \]
    7. Taylor expanded in i around 0 67.8%

      \[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + 100 \cdot n\right)} \]
    8. Step-by-step derivation
      1. *-commutative67.8%

        \[\leadsto 50 \cdot \left(n \cdot i\right) + \left(16.666666666666668 \cdot \left(n \cdot {i}^{2}\right) + \color{blue}{n \cdot 100}\right) \]
      2. associate-+r+67.8%

        \[\leadsto \color{blue}{\left(50 \cdot \left(n \cdot i\right) + 16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)\right) + n \cdot 100} \]
    9. Simplified68.0%

      \[\leadsto \color{blue}{n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -8.6 \cdot 10^{-179}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{elif}\;n \leq 6.6 \cdot 10^{-215}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 2.4 \cdot 10^{-25}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 + i \cdot \left(i \cdot 16.666666666666668 + 50\right)\right)\\ \end{array} \]

Alternative 9: 65.9% accurate, 7.5× speedup?

\[\begin{array}{l} t_0 := 100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{if}\;n \leq -1.6 \cdot 10^{-177}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;n \leq 2.4 \cdot 10^{-214}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 6.1 \cdot 10^{-27}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left(n \cdot \left(1 + i \cdot 0.5\right)\right)\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if n < -1.5999999999999999e-177 or 2.4000000000000002e-214 < n < 6.0999999999999999e-27

    1. Initial program 28.9%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in n around inf 28.9%

      \[\leadsto \color{blue}{100 \cdot \frac{n \cdot \left(e^{i} - 1\right)}{i}} \]
    3. Step-by-step derivation
      1. *-commutative28.9%

        \[\leadsto \color{blue}{\frac{n \cdot \left(e^{i} - 1\right)}{i} \cdot 100} \]
      2. associate-/l*28.9%

        \[\leadsto \color{blue}{\frac{n}{\frac{i}{e^{i} - 1}}} \cdot 100 \]
      3. expm1-def68.4%

        \[\leadsto \frac{n}{\frac{i}{\color{blue}{\mathsf{expm1}\left(i\right)}}} \cdot 100 \]
    4. Simplified68.4%

      \[\leadsto \color{blue}{\frac{n}{\frac{i}{\mathsf{expm1}\left(i\right)}} \cdot 100} \]
    5. Taylor expanded in i around 0 53.5%

      \[\leadsto \frac{n}{\color{blue}{1 + -0.5 \cdot i}} \cdot 100 \]
    6. Step-by-step derivation
      1. *-commutative53.5%

        \[\leadsto \frac{n}{1 + \color{blue}{i \cdot -0.5}} \cdot 100 \]
    7. Simplified53.5%

      \[\leadsto \frac{n}{\color{blue}{1 + i \cdot -0.5}} \cdot 100 \]

    if -1.5999999999999999e-177 < n < 2.4000000000000002e-214

    1. Initial program 73.2%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/73.2%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. sub-neg73.2%

        \[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}} \]
      3. distribute-lft-in73.2%

        \[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}} \]
      4. fma-def73.2%

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}} \]
    4. Taylor expanded in n around inf 50.1%

      \[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}} \]
    5. Taylor expanded in i around 0 85.7%

      \[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}} \]

    if 6.0999999999999999e-27 < n

    1. Initial program 19.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 65.8%

      \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*65.8%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
      2. *-commutative65.8%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
      3. associate-*r/65.8%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
      4. metadata-eval65.8%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
    4. Simplified65.8%

      \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]
    5. Taylor expanded in n around inf 65.9%

      \[\leadsto 100 \cdot \color{blue}{\left(\left(1 + 0.5 \cdot i\right) \cdot n\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.6 \cdot 10^{-177}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{elif}\;n \leq 2.4 \cdot 10^{-214}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{elif}\;n \leq 6.1 \cdot 10^{-27}:\\ \;\;\;\;100 \cdot \frac{n}{1 + i \cdot -0.5}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left(n \cdot \left(1 + i \cdot 0.5\right)\right)\\ \end{array} \]

Alternative 10: 63.7% accurate, 10.2× speedup?

\[\begin{array}{l} \mathbf{if}\;n \leq -6800000 \lor \neg \left(n \leq 8.8 \cdot 10^{-10}\right):\\ \;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if n < -6.8e6 or 8.7999999999999996e-10 < n

    1. Initial program 27.5%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/28.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*28.0%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative28.0%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/28.0%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg28.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in28.0%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def28.0%

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

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

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

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

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. distribute-lft-out59.6%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
      2. associate-*r/59.6%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      3. metadata-eval59.6%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      4. unpow259.6%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \color{blue}{\left(i \cdot i\right)} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      5. associate--l+59.6%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)}\right)\right) \]
      6. associate-*r/59.6%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{{n}^{2}}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      7. metadata-eval59.6%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{\color{blue}{0.3333333333333333}}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      8. unpow259.6%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{\color{blue}{n \cdot n}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      9. associate-*r/59.6%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)\right)\right) \]
      10. metadata-eval59.6%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{\color{blue}{0.5}}{n}\right)\right)\right)\right) \]
    6. Simplified59.6%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right)\right)} \]
    7. Taylor expanded in n around inf 59.6%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. distribute-lft-in59.6%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)}\right) \]
      2. associate-*r*59.6%

        \[\leadsto n \cdot \left(100 + \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      3. metadata-eval59.6%

        \[\leadsto n \cdot \left(100 + \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      4. unpow259.6%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      5. associate-*r*59.6%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{\left(100 \cdot 0.5\right) \cdot i}\right)\right) \]
      6. metadata-eval59.6%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{50} \cdot i\right)\right) \]
    9. Simplified59.6%

      \[\leadsto \color{blue}{n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + 50 \cdot i\right)\right)} \]
    10. Taylor expanded in i around 0 56.9%

      \[\leadsto n \cdot \left(100 + \color{blue}{50 \cdot i}\right) \]
    11. Step-by-step derivation
      1. *-commutative56.9%

        \[\leadsto n \cdot \left(100 + \color{blue}{i \cdot 50}\right) \]
    12. Simplified56.9%

      \[\leadsto n \cdot \left(100 + \color{blue}{i \cdot 50}\right) \]

    if -6.8e6 < n < 8.7999999999999996e-10

    1. Initial program 38.3%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 54.4%

      \[\leadsto 100 \cdot \frac{\color{blue}{i}}{\frac{i}{n}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -6800000 \lor \neg \left(n \leq 8.8 \cdot 10^{-10}\right):\\ \;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \end{array} \]

Alternative 11: 61.9% accurate, 10.2× speedup?

\[\begin{array}{l} \mathbf{if}\;i \leq -10000000:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 4.5 \cdot 10^{+31}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if i < -1e7

    1. Initial program 54.5%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 22.9%

      \[\leadsto 100 \cdot \frac{\color{blue}{i}}{\frac{i}{n}} \]

    if -1e7 < i < 4.4999999999999996e31

    1. Initial program 12.5%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 76.0%

      \[\leadsto \color{blue}{100 \cdot n} \]
    3. Step-by-step derivation
      1. *-commutative76.0%

        \[\leadsto \color{blue}{n \cdot 100} \]
    4. Simplified76.0%

      \[\leadsto \color{blue}{n \cdot 100} \]

    if 4.4999999999999996e31 < i

    1. Initial program 52.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/53.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*53.0%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative53.0%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/53.0%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg53.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in53.0%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def53.0%

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

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

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

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

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. distribute-lft-out32.4%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
      2. associate-*r/32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      3. metadata-eval32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      4. unpow232.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \color{blue}{\left(i \cdot i\right)} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      5. associate--l+32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)}\right)\right) \]
      6. associate-*r/32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{{n}^{2}}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      7. metadata-eval32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{\color{blue}{0.3333333333333333}}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      8. unpow232.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{\color{blue}{n \cdot n}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      9. associate-*r/32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)\right)\right) \]
      10. metadata-eval32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{\color{blue}{0.5}}{n}\right)\right)\right)\right) \]
    6. Simplified32.4%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right)\right)} \]
    7. Taylor expanded in n around inf 32.7%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. distribute-lft-in32.7%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)}\right) \]
      2. associate-*r*32.7%

        \[\leadsto n \cdot \left(100 + \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      3. metadata-eval32.7%

        \[\leadsto n \cdot \left(100 + \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      4. unpow232.7%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      5. associate-*r*32.7%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{\left(100 \cdot 0.5\right) \cdot i}\right)\right) \]
      6. metadata-eval32.7%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{50} \cdot i\right)\right) \]
    9. Simplified32.7%

      \[\leadsto \color{blue}{n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + 50 \cdot i\right)\right)} \]
    10. Taylor expanded in i around inf 32.7%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)} \]
    11. Step-by-step derivation
      1. unpow232.7%

        \[\leadsto 16.666666666666668 \cdot \left(n \cdot \color{blue}{\left(i \cdot i\right)}\right) \]
    12. Simplified32.7%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification53.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -10000000:\\ \;\;\;\;100 \cdot \frac{i}{\frac{i}{n}}\\ \mathbf{elif}\;i \leq 4.5 \cdot 10^{+31}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \]

Alternative 12: 61.2% accurate, 10.3× speedup?

\[\begin{array}{l} \mathbf{if}\;i \leq -1.06 \cdot 10^{-10}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left(n + n \cdot \left(i \cdot 0.5\right)\right)\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if i < -1.06e-10

    1. Initial program 56.5%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/56.5%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. sub-neg56.5%

        \[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}} \]
      3. distribute-lft-in56.5%

        \[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}} \]
      4. fma-def56.5%

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}} \]
    4. Taylor expanded in n around inf 73.0%

      \[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}} \]
    5. Taylor expanded in i around 0 32.7%

      \[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}} \]

    if -1.06e-10 < i

    1. Initial program 23.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 62.5%

      \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*62.6%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
      2. *-commutative62.6%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
      3. associate-*r/62.6%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
      4. metadata-eval62.6%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
    4. Simplified62.6%

      \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]
    5. Taylor expanded in n around inf 63.0%

      \[\leadsto 100 \cdot \left(n + \color{blue}{0.5 \cdot \left(n \cdot i\right)}\right) \]
    6. Step-by-step derivation
      1. *-commutative63.0%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot 0.5}\right) \]
      2. associate-*r*63.0%

        \[\leadsto 100 \cdot \left(n + \color{blue}{n \cdot \left(i \cdot 0.5\right)}\right) \]
    7. Simplified63.0%

      \[\leadsto 100 \cdot \left(n + \color{blue}{n \cdot \left(i \cdot 0.5\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.06 \cdot 10^{-10}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;100 \cdot \left(n + n \cdot \left(i \cdot 0.5\right)\right)\\ \end{array} \]

Alternative 13: 58.1% accurate, 12.6× speedup?

\[\begin{array}{l} \mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if i < 4.4999999999999996e31

    1. Initial program 25.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 54.9%

      \[\leadsto \color{blue}{100 \cdot n} \]
    3. Step-by-step derivation
      1. *-commutative54.9%

        \[\leadsto \color{blue}{n \cdot 100} \]
    4. Simplified54.9%

      \[\leadsto \color{blue}{n \cdot 100} \]

    if 4.4999999999999996e31 < i

    1. Initial program 52.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/53.0%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*53.0%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative53.0%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/53.0%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg53.0%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in53.0%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def53.0%

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

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

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

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

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. distribute-lft-out32.4%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
      2. associate-*r/32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      3. metadata-eval32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      4. unpow232.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \color{blue}{\left(i \cdot i\right)} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      5. associate--l+32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)}\right)\right) \]
      6. associate-*r/32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{{n}^{2}}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      7. metadata-eval32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{\color{blue}{0.3333333333333333}}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      8. unpow232.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{\color{blue}{n \cdot n}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      9. associate-*r/32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)\right)\right) \]
      10. metadata-eval32.4%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{\color{blue}{0.5}}{n}\right)\right)\right)\right) \]
    6. Simplified32.4%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right)\right)} \]
    7. Taylor expanded in n around inf 32.7%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. distribute-lft-in32.7%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)}\right) \]
      2. associate-*r*32.7%

        \[\leadsto n \cdot \left(100 + \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      3. metadata-eval32.7%

        \[\leadsto n \cdot \left(100 + \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      4. unpow232.7%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      5. associate-*r*32.7%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{\left(100 \cdot 0.5\right) \cdot i}\right)\right) \]
      6. metadata-eval32.7%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{50} \cdot i\right)\right) \]
    9. Simplified32.7%

      \[\leadsto \color{blue}{n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + 50 \cdot i\right)\right)} \]
    10. Taylor expanded in i around inf 32.7%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot {i}^{2}\right)} \]
    11. Step-by-step derivation
      1. unpow232.7%

        \[\leadsto 16.666666666666668 \cdot \left(n \cdot \color{blue}{\left(i \cdot i\right)}\right) \]
    12. Simplified32.7%

      \[\leadsto \color{blue}{16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;16.666666666666668 \cdot \left(n \cdot \left(i \cdot i\right)\right)\\ \end{array} \]

Alternative 14: 61.2% accurate, 12.6× speedup?

\[\begin{array}{l} \mathbf{if}\;i \leq -1.06 \cdot 10^{-10}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if i < -1.06e-10

    1. Initial program 56.5%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-*r/56.5%

        \[\leadsto \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{\frac{i}{n}}} \]
      2. sub-neg56.5%

        \[\leadsto \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{\frac{i}{n}} \]
      3. distribute-lft-in56.5%

        \[\leadsto \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{\frac{i}{n}} \]
      4. fma-def56.5%

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

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(100, {\left(1 + \frac{i}{n}\right)}^{n}, -100\right)}{\frac{i}{n}}} \]
    4. Taylor expanded in n around inf 73.0%

      \[\leadsto \frac{\color{blue}{100 \cdot e^{i} - 100}}{\frac{i}{n}} \]
    5. Taylor expanded in i around 0 32.7%

      \[\leadsto \frac{\color{blue}{100} - 100}{\frac{i}{n}} \]

    if -1.06e-10 < i

    1. Initial program 23.4%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Step-by-step derivation
      1. associate-/r/23.9%

        \[\leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right)} \]
      2. associate-*r*23.9%

        \[\leadsto \color{blue}{\left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right) \cdot n} \]
      3. *-commutative23.9%

        \[\leadsto \color{blue}{n \cdot \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i}\right)} \]
      4. associate-*r/23.9%

        \[\leadsto n \cdot \color{blue}{\frac{100 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i}} \]
      5. sub-neg23.9%

        \[\leadsto n \cdot \frac{100 \cdot \color{blue}{\left({\left(1 + \frac{i}{n}\right)}^{n} + \left(-1\right)\right)}}{i} \]
      6. distribute-lft-in23.9%

        \[\leadsto n \cdot \frac{\color{blue}{100 \cdot {\left(1 + \frac{i}{n}\right)}^{n} + 100 \cdot \left(-1\right)}}{i} \]
      7. fma-def23.9%

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

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

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

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

      \[\leadsto n \cdot \color{blue}{\left(100 + \left(100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) + 100 \cdot \left({i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right)} \]
    5. Step-by-step derivation
      1. distribute-lft-out59.3%

        \[\leadsto n \cdot \left(100 + \color{blue}{100 \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)}\right) \]
      2. associate-*r/59.3%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      3. metadata-eval59.3%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right) + {i}^{2} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      4. unpow259.3%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \color{blue}{\left(i \cdot i\right)} \cdot \left(\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + 0.16666666666666666\right) - 0.5 \cdot \frac{1}{n}\right)\right)\right) \]
      5. associate--l+59.3%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \color{blue}{\left(0.3333333333333333 \cdot \frac{1}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)}\right)\right) \]
      6. associate-*r/59.3%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\color{blue}{\frac{0.3333333333333333 \cdot 1}{{n}^{2}}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      7. metadata-eval59.3%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{\color{blue}{0.3333333333333333}}{{n}^{2}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      8. unpow259.3%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{\color{blue}{n \cdot n}} + \left(0.16666666666666666 - 0.5 \cdot \frac{1}{n}\right)\right)\right)\right) \]
      9. associate-*r/59.3%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right)\right)\right) \]
      10. metadata-eval59.3%

        \[\leadsto n \cdot \left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{\color{blue}{0.5}}{n}\right)\right)\right)\right) \]
    6. Simplified59.3%

      \[\leadsto n \cdot \color{blue}{\left(100 + 100 \cdot \left(i \cdot \left(0.5 - \frac{0.5}{n}\right) + \left(i \cdot i\right) \cdot \left(\frac{0.3333333333333333}{n \cdot n} + \left(0.16666666666666666 - \frac{0.5}{n}\right)\right)\right)\right)} \]
    7. Taylor expanded in n around inf 65.1%

      \[\leadsto \color{blue}{n \cdot \left(100 + 100 \cdot \left(0.16666666666666666 \cdot {i}^{2} + 0.5 \cdot i\right)\right)} \]
    8. Step-by-step derivation
      1. distribute-lft-in65.1%

        \[\leadsto n \cdot \left(100 + \color{blue}{\left(100 \cdot \left(0.16666666666666666 \cdot {i}^{2}\right) + 100 \cdot \left(0.5 \cdot i\right)\right)}\right) \]
      2. associate-*r*65.1%

        \[\leadsto n \cdot \left(100 + \left(\color{blue}{\left(100 \cdot 0.16666666666666666\right) \cdot {i}^{2}} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      3. metadata-eval65.1%

        \[\leadsto n \cdot \left(100 + \left(\color{blue}{16.666666666666668} \cdot {i}^{2} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      4. unpow265.1%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \color{blue}{\left(i \cdot i\right)} + 100 \cdot \left(0.5 \cdot i\right)\right)\right) \]
      5. associate-*r*65.1%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{\left(100 \cdot 0.5\right) \cdot i}\right)\right) \]
      6. metadata-eval65.1%

        \[\leadsto n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + \color{blue}{50} \cdot i\right)\right) \]
    9. Simplified65.1%

      \[\leadsto \color{blue}{n \cdot \left(100 + \left(16.666666666666668 \cdot \left(i \cdot i\right) + 50 \cdot i\right)\right)} \]
    10. Taylor expanded in i around 0 63.0%

      \[\leadsto n \cdot \left(100 + \color{blue}{50 \cdot i}\right) \]
    11. Step-by-step derivation
      1. *-commutative63.0%

        \[\leadsto n \cdot \left(100 + \color{blue}{i \cdot 50}\right) \]
    12. Simplified63.0%

      \[\leadsto n \cdot \left(100 + \color{blue}{i \cdot 50}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.06 \cdot 10^{-10}:\\ \;\;\;\;\frac{0}{\frac{i}{n}}\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(100 + i \cdot 50\right)\\ \end{array} \]

Alternative 15: 55.7% accurate, 16.1× speedup?

\[\begin{array}{l} \mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;50 \cdot \left(i \cdot n\right)\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if i < 4.4999999999999996e31

    1. Initial program 25.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 54.9%

      \[\leadsto \color{blue}{100 \cdot n} \]
    3. Step-by-step derivation
      1. *-commutative54.9%

        \[\leadsto \color{blue}{n \cdot 100} \]
    4. Simplified54.9%

      \[\leadsto \color{blue}{n \cdot 100} \]

    if 4.4999999999999996e31 < i

    1. Initial program 52.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 26.4%

      \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*26.4%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
      2. *-commutative26.4%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
      3. associate-*r/26.4%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
      4. metadata-eval26.4%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
    4. Simplified26.4%

      \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]
    5. Taylor expanded in n around inf 26.8%

      \[\leadsto 100 \cdot \color{blue}{\left(\left(1 + 0.5 \cdot i\right) \cdot n\right)} \]
    6. Taylor expanded in i around inf 26.8%

      \[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;50 \cdot \left(i \cdot n\right)\\ \end{array} \]

Alternative 16: 55.7% accurate, 16.1× speedup?

\[\begin{array}{l} \mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(i \cdot 50\right)\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if i < 4.4999999999999996e31

    1. Initial program 25.0%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 54.9%

      \[\leadsto \color{blue}{100 \cdot n} \]
    3. Step-by-step derivation
      1. *-commutative54.9%

        \[\leadsto \color{blue}{n \cdot 100} \]
    4. Simplified54.9%

      \[\leadsto \color{blue}{n \cdot 100} \]

    if 4.4999999999999996e31 < i

    1. Initial program 52.7%

      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
    2. Taylor expanded in i around 0 26.4%

      \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
    3. Step-by-step derivation
      1. associate-*r*26.4%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
      2. *-commutative26.4%

        \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
      3. associate-*r/26.4%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
      4. metadata-eval26.4%

        \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
    4. Simplified26.4%

      \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]
    5. Taylor expanded in n around inf 26.8%

      \[\leadsto 100 \cdot \color{blue}{\left(\left(1 + 0.5 \cdot i\right) \cdot n\right)} \]
    6. Taylor expanded in i around inf 26.8%

      \[\leadsto \color{blue}{50 \cdot \left(n \cdot i\right)} \]
    7. Step-by-step derivation
      1. *-commutative26.8%

        \[\leadsto \color{blue}{\left(n \cdot i\right) \cdot 50} \]
      2. associate-*l*26.8%

        \[\leadsto \color{blue}{n \cdot \left(i \cdot 50\right)} \]
    8. Simplified26.8%

      \[\leadsto \color{blue}{n \cdot \left(i \cdot 50\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 4.5 \cdot 10^{+31}:\\ \;\;\;\;n \cdot 100\\ \mathbf{else}:\\ \;\;\;\;n \cdot \left(i \cdot 50\right)\\ \end{array} \]

Alternative 17: 2.8% accurate, 38.0× speedup?

\[i \cdot -50 \]
Derivation
  1. Initial program 31.6%

    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
  2. Taylor expanded in i around 0 48.1%

    \[\leadsto 100 \cdot \color{blue}{\left(n + n \cdot \left(i \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right)\right)} \]
  3. Step-by-step derivation
    1. associate-*r*48.2%

      \[\leadsto 100 \cdot \left(n + \color{blue}{\left(n \cdot i\right) \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)}\right) \]
    2. *-commutative48.2%

      \[\leadsto 100 \cdot \left(n + \color{blue}{\left(i \cdot n\right)} \cdot \left(0.5 - 0.5 \cdot \frac{1}{n}\right)\right) \]
    3. associate-*r/48.2%

      \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \color{blue}{\frac{0.5 \cdot 1}{n}}\right)\right) \]
    4. metadata-eval48.2%

      \[\leadsto 100 \cdot \left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{\color{blue}{0.5}}{n}\right)\right) \]
  4. Simplified48.2%

    \[\leadsto 100 \cdot \color{blue}{\left(n + \left(i \cdot n\right) \cdot \left(0.5 - \frac{0.5}{n}\right)\right)} \]
  5. Taylor expanded in n around 0 2.6%

    \[\leadsto \color{blue}{-50 \cdot i} \]
  6. Step-by-step derivation
    1. *-commutative2.6%

      \[\leadsto \color{blue}{i \cdot -50} \]
  7. Simplified2.6%

    \[\leadsto \color{blue}{i \cdot -50} \]
  8. Final simplification2.6%

    \[\leadsto i \cdot -50 \]

Alternative 18: 50.5% accurate, 38.0× speedup?

\[n \cdot 100 \]
Derivation
  1. Initial program 31.6%

    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \]
  2. Taylor expanded in i around 0 42.9%

    \[\leadsto \color{blue}{100 \cdot n} \]
  3. Step-by-step derivation
    1. *-commutative42.9%

      \[\leadsto \color{blue}{n \cdot 100} \]
  4. Simplified42.9%

    \[\leadsto \color{blue}{n \cdot 100} \]
  5. Final simplification42.9%

    \[\leadsto n \cdot 100 \]

Developer target: 33.2% accurate, 0.5× speedup?

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

Reproduce

?
herbie shell --seed 2023167 
(FPCore (i n)
  :name "Compound Interest"
  :precision binary64

  :herbie-target
  (* 100.0 (/ (- (exp (* n (if (== (+ 1.0 (/ i n)) 1.0) (/ i n) (/ (* (/ i n) (log (+ 1.0 (/ i n)))) (- (+ (/ i n) 1.0) 1.0))))) 1.0) (/ i n)))

  (* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))