\[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: 11.3 s
Input Error: 29.7
Output Error: 2.5
Log:
Profile: 🕒
\(\left(\left(i \cdot \frac{1}{2}\right) \cdot n + \left(\left(i \cdot i\right) \cdot \left(n \cdot \frac{1}{6}\right) + n\right)\right) \cdot 100\)
  1. Started with
    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
    29.7
  2. Using strategy rm
    29.7
  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)}\]
    29.5
  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)\]
    29.5
  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)\]
    2.5
  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)}\]
    2.5
  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 \left(\left(i \cdot \frac{1}{2}\right) \cdot n + \left(\left(i \cdot i\right) \cdot \left(n \cdot \frac{1}{6}\right) + n\right)\right) \cdot 100\]
    2.5

  8. Applied final simplification

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))))