\[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: 9.7 s
Input Error: 61.8
Output Error: 0.2
Log:
Profile: 🕒
\(\frac{100 \cdot n}{\frac{1}{i}} \cdot (i * \frac{1}{6} + \frac{1}{2})_* + \frac{100 \cdot n}{1}\)
  1. Started with
    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
    61.8
  2. Applied taylor to get
    \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{\frac{1}{2} \cdot {i}^2 + \left(i + \frac{1}{6} \cdot {i}^{3}\right)}{\frac{i}{n}}\]
    19.7
  3. Taylor expanded around 0 to get
    \[100 \cdot \frac{\color{red}{\frac{1}{2} \cdot {i}^2 + \left(i + \frac{1}{6} \cdot {i}^{3}\right)}}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{\frac{1}{2} \cdot {i}^2 + \left(i + \frac{1}{6} \cdot {i}^{3}\right)}}{\frac{i}{n}}\]
    19.7
  4. Applied simplify to get
    \[\color{red}{100 \cdot \frac{\frac{1}{2} \cdot {i}^2 + \left(i + \frac{1}{6} \cdot {i}^{3}\right)}{\frac{i}{n}}} \leadsto \color{blue}{\frac{n \cdot 100}{i} \cdot (\left(i \cdot i\right) * \left((i * \frac{1}{6} + \frac{1}{2})_*\right) + i)_*}\]
    20.0
  5. Using strategy rm
    20.0
  6. Applied fma-udef to get
    \[\frac{n \cdot 100}{i} \cdot \color{red}{(\left(i \cdot i\right) * \left((i * \frac{1}{6} + \frac{1}{2})_*\right) + i)_*} \leadsto \frac{n \cdot 100}{i} \cdot \color{blue}{\left(\left(i \cdot i\right) \cdot (i * \frac{1}{6} + \frac{1}{2})_* + i\right)}\]
    20.0
  7. Applied distribute-lft-in to get
    \[\color{red}{\frac{n \cdot 100}{i} \cdot \left(\left(i \cdot i\right) \cdot (i * \frac{1}{6} + \frac{1}{2})_* + i\right)} \leadsto \color{blue}{\frac{n \cdot 100}{i} \cdot \left(\left(i \cdot i\right) \cdot (i * \frac{1}{6} + \frac{1}{2})_*\right) + \frac{n \cdot 100}{i} \cdot i}\]
    20.3
  8. Applied simplify to get
    \[\color{red}{\frac{n \cdot 100}{i} \cdot \left(\left(i \cdot i\right) \cdot (i * \frac{1}{6} + \frac{1}{2})_*\right)} + \frac{n \cdot 100}{i} \cdot i \leadsto \color{blue}{\frac{100 \cdot n}{\frac{1}{i}} \cdot (i * \frac{1}{6} + \frac{1}{2})_*} + \frac{n \cdot 100}{i} \cdot i\]
    10.4
  9. Applied simplify to get
    \[\frac{100 \cdot n}{\frac{1}{i}} \cdot (i * \frac{1}{6} + \frac{1}{2})_* + \color{red}{\frac{n \cdot 100}{i} \cdot i} \leadsto \frac{100 \cdot n}{\frac{1}{i}} \cdot (i * \frac{1}{6} + \frac{1}{2})_* + \color{blue}{\frac{100 \cdot n}{1}}\]
    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))))