\[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
Test:
Compound Interest
Bits:
128 bits
Bits error versus i
Bits error versus n
Time: 24.1 s
Input Error: 51.9
Output Error: 3.0
Log:
Profile: 🕒
\(\begin{cases} \frac{n \cdot 100}{i} \cdot (e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^* & \text{when } i \le -4.487857240777079 \cdot 10^{-131} \\ (100 * \left((\left(i \cdot i\right) * \left(n \cdot \frac{1}{6}\right) + n)_*\right) + \left(\left(100 \cdot i\right) \cdot \left(n \cdot \frac{1}{2}\right)\right))_* & \text{when } i \le 2.8291641631335695 \cdot 10^{-146} \\ \frac{n \cdot 100}{i} \cdot (e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^* & \text{when } i \le 1.640824326731122 \cdot 10^{+126} \\ \frac{(e^{\frac{\log n - \log i}{n}} - 1)^*}{\frac{\frac{i}{100}}{n}} & \text{otherwise} \end{cases}\)

    if i < -4.487857240777079e-131 or 2.8291641631335695e-146 < i < 1.640824326731122e+126

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      42.4
    2. Using strategy rm
      42.4
    3. Applied add-exp-log to get
      \[100 \cdot \frac{{\color{red}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{{\color{blue}{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}}^{n} - 1}{\frac{i}{n}}\]
      42.4
    4. Applied pow-exp to get
      \[100 \cdot \frac{\color{red}{{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}^{n}} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}}\]
      42.4
    5. Applied expm1-def to get
      \[100 \cdot \frac{\color{red}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n} - 1}}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{(e^{\log \left(1 + \frac{i}{n}\right) \cdot n} - 1)^*}}{\frac{i}{n}}\]
      34.8
    6. Applied taylor to get
      \[100 \cdot \frac{(e^{\log \left(1 + \frac{i}{n}\right) \cdot n} - 1)^*}{\frac{i}{n}} \leadsto 100 \cdot \frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i}\]
      36.1
    7. Taylor expanded around 0 to get
      \[100 \cdot \color{red}{\frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i}} \leadsto 100 \cdot \color{blue}{\frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i}}\]
      36.1
    8. Applied simplify to get
      \[100 \cdot \frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i} \leadsto \frac{n \cdot 100}{i} \cdot (e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^*\]
      5.7

    9. Applied final simplification

    if -4.487857240777079e-131 < i < 2.8291641631335695e-146

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      61.6
    2. Using strategy rm
      61.6
    3. Applied div-sub to get
      \[100 \cdot \color{red}{\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \leadsto 100 \cdot \color{blue}{\left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \frac{1}{\frac{i}{n}}\right)}\]
      61.6
    4. Applied simplify to get
      \[100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \color{red}{\frac{1}{\frac{i}{n}}}\right) \leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \color{blue}{\frac{n}{i}}\right)\]
      61.7
    5. Applied taylor to get
      \[100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \frac{n}{i}\right) \leadsto 100 \cdot \left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right)\]
      0.0
    6. Taylor expanded around 0 to get
      \[100 \cdot \color{red}{\left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right)} \leadsto 100 \cdot \color{blue}{\left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right)}\]
      0.0
    7. Applied simplify to get
      \[100 \cdot \left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right) \leadsto (100 * \left((\left(i \cdot i\right) * \left(n \cdot \frac{1}{6}\right) + n)_*\right) + \left(\left(100 \cdot i\right) \cdot \left(n \cdot \frac{1}{2}\right)\right))_*\]
      0.0

    8. Applied final simplification

    if 1.640824326731122e+126 < i

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      62.2
    2. Applied taylor to get
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{e^{\frac{\log n - \log i}{n}} - 1}{\frac{i}{n}}\]
      28.9
    3. Taylor expanded around inf to get
      \[100 \cdot \frac{\color{red}{e^{\frac{\log n - \log i}{n}} - 1}}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{e^{\frac{\log n - \log i}{n}} - 1}}{\frac{i}{n}}\]
      28.9
    4. Applied simplify to get
      \[\color{red}{100 \cdot \frac{e^{\frac{\log n - \log i}{n}} - 1}{\frac{i}{n}}} \leadsto \color{blue}{\frac{(e^{\frac{\log n - \log i}{n}} - 1)^*}{\frac{\frac{i}{100}}{n}}}\]
      1.1

  1. Removed slow pow expressions

Original test:


(lambda ((i default) (n default))
  #:name "Compound Interest"
  (* 100 (/ (- (pow (+ 1 (/ i n)) n) 1) (/ i n)))
  #:target
  (* 100 (/ (- (exp (* n (if (= (+ 1 (/ i n)) 1) (/ i n) (/ (* (/ i n) (log (+ 1 (/ i n)))) (- (+ (/ i n) 1) 1))))) 1) (/ i n))))