\[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: 12.8 s
Input Error: 23.1
Output Error: 2.4
Log:
Profile: 🕒
\(\begin{cases} \frac{(e^{n \cdot \log_* (1 + \frac{i}{n})} - 1)^*}{\frac{\frac{i}{n}}{100}} & \text{when } i \le -1.9342776f-16 \\ 100 \cdot \frac{n \cdot (\left({i}^2\right) * \left((i * \frac{1}{6} + \frac{1}{2})_*\right) + i)_*}{i} & \text{when } i \le 2.6108882f-21 \\ \frac{(e^{n \cdot \log_* (1 + \frac{i}{n})} - 1)^*}{\frac{\frac{i}{n}}{100}} & \text{otherwise} \end{cases}\)

    if i < -1.9342776f-16 or 2.6108882f-21 < i

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      19.0
    2. Using strategy rm
      19.0
    3. Applied add-exp-log to get
      \[100 \cdot \frac{{\color{red}{\left(1 + \frac{i}{n}\right)}}^{n} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{{\color{blue}{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}}^{n} - 1}{\frac{i}{n}}\]
      19.1
    4. Applied pow-exp to get
      \[100 \cdot \frac{\color{red}{{\left(e^{\log \left(1 + \frac{i}{n}\right)}\right)}^{n}} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{e^{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}}\]
      19.1
    5. Applied simplify to get
      \[100 \cdot \frac{e^{\color{red}{\log \left(1 + \frac{i}{n}\right) \cdot n}} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{e^{\color{blue}{\log_* (1 + \frac{i}{n}) \cdot n}} - 1}{\frac{i}{n}}\]
      13.7
    6. Applied taylor to get
      \[100 \cdot \frac{e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{e^{n \cdot \log_* (1 + \frac{i}{n})} - 1}{\frac{i}{n}}\]
      13.7
    7. Taylor expanded around 0 to get
      \[100 \cdot \frac{e^{\color{red}{n \cdot \log_* (1 + \frac{i}{n})}} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{e^{\color{blue}{n \cdot \log_* (1 + \frac{i}{n})}} - 1}{\frac{i}{n}}\]
      13.7
    8. Applied simplify to get
      \[100 \cdot \frac{e^{n \cdot \log_* (1 + \frac{i}{n})} - 1}{\frac{i}{n}} \leadsto \frac{(e^{n \cdot \log_* (1 + \frac{i}{n})} - 1)^*}{\frac{\frac{i}{n}}{100}}\]
      4.0

    9. Applied final simplification

    if -1.9342776f-16 < i < 2.6108882f-21

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      29.6
    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}}\]
      8.3
    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}}\]
      8.3
    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)_*}\]
      10.5
    5. Applied taylor to get
      \[\frac{n \cdot 100}{i} \cdot (\left(i \cdot i\right) * \left((i * \frac{1}{6} + \frac{1}{2})_*\right) + i)_* \leadsto 100 \cdot \frac{n \cdot (\left({i}^2\right) * \left((i * \frac{1}{6} + \frac{1}{2})_*\right) + i)_*}{i}\]
      0
    6. Taylor expanded around 0 to get
      \[\color{red}{100 \cdot \frac{n \cdot (\left({i}^2\right) * \left((i * \frac{1}{6} + \frac{1}{2})_*\right) + i)_*}{i}} \leadsto \color{blue}{100 \cdot \frac{n \cdot (\left({i}^2\right) * \left((i * \frac{1}{6} + \frac{1}{2})_*\right) + i)_*}{i}}\]
      0

  1. Removed slow pow expressions

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