\[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: 22.7 s
Input Error: 22.5
Output Error: 0.3
Log:
Profile: 🕒
\(\begin{cases} 100 \cdot \frac{(e^{{\left(\sqrt[3]{\log_* (1 + \frac{i}{n})}\right)}^3 \cdot n} - 1)^*}{\frac{i}{n}} & \text{when } i \le -8.466995f-21 \\ (\left(50 \cdot n\right) * i + \left((\left(i \cdot i\right) * \left(\frac{50}{3} \cdot n\right) + \left(n \cdot 100\right))_*\right))_* & \text{when } i \le 0.15324226f0 \\ 0 & \text{otherwise} \end{cases}\)

    if i < -8.466995f-21

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      16.5
    2. Using strategy rm
      16.5
    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}}\]
      16.5
    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}}\]
      16.5
    5. Applied expm1-def to get
      \[100 \cdot \frac{\color{red}{e^{\log \left(1 + \frac{i}{n}\right) \cdot 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}}\]
      13.1
    6. Using strategy rm
      13.1
    7. Applied add-cube-cbrt 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}{{\left(\sqrt[3]{\log \left(1 + \frac{i}{n}\right)}\right)}^3} \cdot n} - 1)^*}{\frac{i}{n}}\]
      13.1
    8. Applied simplify to get
      \[100 \cdot \frac{(e^{{\color{red}{\left(\sqrt[3]{\log \left(1 + \frac{i}{n}\right)}\right)}}^3 \cdot n} - 1)^*}{\frac{i}{n}} \leadsto 100 \cdot \frac{(e^{{\color{blue}{\left(\sqrt[3]{\log_* (1 + \frac{i}{n})}\right)}}^3 \cdot n} - 1)^*}{\frac{i}{n}}\]
      1.1

    if -8.466995f-21 < i < 0.15324226f0

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      29.6
    2. Using strategy rm
      29.6
    3. Applied div-sub 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}}{\frac{i}{n}} - \frac{1}{\frac{i}{n}}\right)}\]
      29.7
    4. Applied simplify to get
      \[100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \color{red}{\frac{1}{\frac{i}{n}}}\right) \leadsto 100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \color{blue}{\frac{n}{i}}\right)\]
      29.7
    5. Applied taylor to get
      \[100 \cdot \left(\frac{{\left(1 + \frac{i}{n}\right)}^{n}}{\frac{i}{n}} - \frac{n}{i}\right) \leadsto 100 \cdot n + \left(\frac{50}{3} \cdot \left(n \cdot {i}^2\right) + 50 \cdot \left(n \cdot i\right)\right)\]
      0.0
    6. 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)}\]
      0.0
    7. 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 (\left(50 \cdot n\right) * i + \left((\left(i \cdot i\right) * \left(\frac{50}{3} \cdot n\right) + \left(n \cdot 100\right))_*\right))_*\]
      0.0

    8. Applied final simplification

    if 0.15324226f0 < i

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      19.1
    2. Applied taylor to get
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \leadsto 100 \cdot 0\]
      0
    3. Taylor expanded around 0 to get
      \[100 \cdot \color{red}{0} \leadsto 100 \cdot \color{blue}{0}\]
      0
    4. Applied simplify to get
      \[\color{red}{100 \cdot 0} \leadsto \color{blue}{0}\]
      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))))