\[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: 33.6 s
Input Error: 29.7
Output Error: 0.2
Log:
Profile: 🕒
\(\left(n \cdot i\right) \cdot \left(\frac{50}{3} \cdot i + 50\right) + 100 \cdot n\)
  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 associate-/r/ 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} - 1}{i} \cdot n\right)}\]
    29.9
  4. Applied taylor to get
    \[100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{i} \cdot n\right) \leadsto 100 \cdot n + \left(\frac{50}{3} \cdot \left(n \cdot {i}^2\right) + 50 \cdot \left(n \cdot i\right)\right)\]
    2.4
  5. Taylor expanded around 0 to get
    \[\color{red}{100 \cdot n + \left(\frac{50}{3} \cdot \left(n \cdot {i}^2\right) + 50 \cdot \left(n \cdot i\right)\right)} \leadsto \color{blue}{100 \cdot n + \left(\frac{50}{3} \cdot \left(n \cdot {i}^2\right) + 50 \cdot \left(n \cdot i\right)\right)}\]
    2.4
  6. Applied simplify to get
    \[100 \cdot n + \left(\frac{50}{3} \cdot \left(n \cdot {i}^2\right) + 50 \cdot \left(n \cdot i\right)\right) \leadsto 50 \cdot \left(n \cdot i\right) + \left(n \cdot 100 + \left(i \cdot i\right) \cdot \left(\frac{50}{3} \cdot n\right)\right)\]
    2.4

  7. Applied final simplification
  8. Applied simplify to get
    \[\color{red}{50 \cdot \left(n \cdot i\right) + \left(n \cdot 100 + \left(i \cdot i\right) \cdot \left(\frac{50}{3} \cdot n\right)\right)} \leadsto \color{blue}{\left(n \cdot i\right) \cdot \left(\frac{50}{3} \cdot i + 50\right) + 100 \cdot n}\]
    0.2

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