\[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: 7.5 s
Input Error: 62.0
Output Error: 11.4
Log:
Profile: 🕒
\(\left(\left((i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot 100\right) \cdot \frac{1}{i}\right) \cdot n\)
  1. Started with
    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
    62.0
  2. Applied taylor to get
    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{\left(\frac{1}{2} \cdot {i}^2 + \left(1 + i\right)\right) - 1}{\frac{i}{n}}\]
    47.4
  3. Taylor expanded around 0 to get
    \[100 \cdot \frac{\color{red}{\left(\frac{1}{2} \cdot {i}^2 + \left(1 + i\right)\right)} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{\left(\frac{1}{2} \cdot {i}^2 + \left(1 + i\right)\right)} - 1}{\frac{i}{n}}\]
    47.4
  4. Applied simplify to get
    \[\color{red}{100 \cdot \frac{\left(\frac{1}{2} \cdot {i}^2 + \left(1 + i\right)\right) - 1}{\frac{i}{n}}} \leadsto \color{blue}{(i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \frac{100}{\frac{i}{n}}}\]
    21.9
  5. Using strategy rm
    21.9
  6. Applied associate-/r/ to get
    \[(i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \color{red}{\frac{100}{\frac{i}{n}}} \leadsto (i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \color{blue}{\left(\frac{100}{i} \cdot n\right)}\]
    21.7
  7. Applied associate-*r* to get
    \[\color{red}{(i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \left(\frac{100}{i} \cdot n\right)} \leadsto \color{blue}{\left((i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \frac{100}{i}\right) \cdot n}\]
    11.5
  8. Using strategy rm
    11.5
  9. Applied div-inv to get
    \[\left((i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \color{red}{\frac{100}{i}}\right) \cdot n \leadsto \left((i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \color{blue}{\left(100 \cdot \frac{1}{i}\right)}\right) \cdot n\]
    11.6
  10. Applied associate-*r* to get
    \[\color{red}{\left((i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \left(100 \cdot \frac{1}{i}\right)\right)} \cdot n \leadsto \color{blue}{\left(\left((i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot 100\right) \cdot \frac{1}{i}\right)} \cdot n\]
    11.4

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