\[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: 32.6 s
Input Error: 61.7
Output Error: 0.1
Log:
Profile: 🕒
\(\left(100 \cdot n\right) \cdot {\left(e^{i}\right)}^{\left(\frac{1}{24} \cdot i + \frac{1}{2}\right)}\)
  1. Started with
    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
    61.7
  2. Using strategy rm
    61.7
  3. Applied add-exp-log to get
    \[\color{red}{100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}} \leadsto \color{blue}{e^{\log \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\right)}}\]
    61.8
  4. Applied taylor to get
    \[e^{\log \left(100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\right)} \leadsto e^{\frac{1}{24} \cdot {i}^2 + \left(\log n + \left(\log 100 + \frac{1}{2} \cdot i\right)\right)}\]
    34.8
  5. Taylor expanded around 0 to get
    \[e^{\color{red}{\frac{1}{24} \cdot {i}^2 + \left(\log n + \left(\log 100 + \frac{1}{2} \cdot i\right)\right)}} \leadsto e^{\color{blue}{\frac{1}{24} \cdot {i}^2 + \left(\log n + \left(\log 100 + \frac{1}{2} \cdot i\right)\right)}}\]
    34.8
  6. Applied simplify to get
    \[e^{\frac{1}{24} \cdot {i}^2 + \left(\log n + \left(\log 100 + \frac{1}{2} \cdot i\right)\right)} \leadsto e^{\left(\log n + \left(i \cdot i\right) \cdot \frac{1}{24}\right) + \left(\frac{1}{2} \cdot i + \log 100\right)}\]
    34.8

  7. Applied final simplification
  8. Applied simplify to get
    \[\color{red}{e^{\left(\log n + \left(i \cdot i\right) \cdot \frac{1}{24}\right) + \left(\frac{1}{2} \cdot i + \log 100\right)}} \leadsto \color{blue}{\left(100 \cdot n\right) \cdot {\left(e^{i}\right)}^{\left(\frac{1}{24} \cdot i + \frac{1}{2}\right)}}\]
    0.1

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