\[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: 13.0 s
Input Error: 25.9
Output Error: 6.2
Log:
Profile: 🕒
\(\begin{cases} 100 \cdot \frac{{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}^{3} - {1}^{3}}{\frac{i}{n} \cdot \left({\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}^2 + \left({1}^2 + {\left(1 + \frac{i}{n}\right)}^{n} \cdot 1\right)\right)} & \text{when } i \le -0.024611041f0 \\ \left(i \cdot 50 + 100\right) \cdot n & \text{when } i \le 504.572f0 \\ \left(\frac{1}{2} \cdot i + 1\right) \cdot \log \left(e^{n \cdot 100}\right) & \text{otherwise} \end{cases}\)

    if i < -0.024611041f0

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      10.7
    2. Using strategy rm
      10.7
    3. Applied flip3-- to get
      \[100 \cdot \frac{\color{red}{{\left(1 + \frac{i}{n}\right)}^{n} - 1}}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{\frac{{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}^{3} - {1}^{3}}{{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}^2 + \left({1}^2 + {\left(1 + \frac{i}{n}\right)}^{n} \cdot 1\right)}}}{\frac{i}{n}}\]
      10.7
    4. Applied associate-/l/ to get
      \[100 \cdot \color{red}{\frac{\frac{{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}^{3} - {1}^{3}}{{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}^2 + \left({1}^2 + {\left(1 + \frac{i}{n}\right)}^{n} \cdot 1\right)}}{\frac{i}{n}}} \leadsto 100 \cdot \color{blue}{\frac{{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}^{3} - {1}^{3}}{\frac{i}{n} \cdot \left({\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}^2 + \left({1}^2 + {\left(1 + \frac{i}{n}\right)}^{n} \cdot 1\right)\right)}}\]
      10.7

    if -0.024611041f0 < i < 504.572f0

    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{\left(\frac{1}{2} \cdot {i}^2 + \left(1 + i\right)\right) - 1}{\frac{i}{n}}\]
      25.6
    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}}\]
      25.6
    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}{\left(\frac{1}{2} \cdot i + 1\right) \cdot \frac{i \cdot 100}{\frac{i}{n}}}\]
      5.4
    5. Applied taylor to get
      \[\left(\frac{1}{2} \cdot i + 1\right) \cdot \frac{i \cdot 100}{\frac{i}{n}} \leadsto 100 \cdot n + 50 \cdot \left(n \cdot i\right)\]
      0.1
    6. Taylor expanded around 0 to get
      \[\color{red}{100 \cdot n + 50 \cdot \left(n \cdot i\right)} \leadsto \color{blue}{100 \cdot n + 50 \cdot \left(n \cdot i\right)}\]
      0.1
    7. Applied simplify to get
      \[\color{red}{100 \cdot n + 50 \cdot \left(n \cdot i\right)} \leadsto \color{blue}{\left(i \cdot 50 + 100\right) \cdot n}\]
      0.1

    if 504.572f0 < i

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      30.2
    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}}\]
      19.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}}\]
      19.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}{\left(\frac{1}{2} \cdot i + 1\right) \cdot \frac{i \cdot 100}{\frac{i}{n}}}\]
      14.4
    5. Using strategy rm
      14.4
    6. Applied add-log-exp to get
      \[\left(\frac{1}{2} \cdot i + 1\right) \cdot \color{red}{\frac{i \cdot 100}{\frac{i}{n}}} \leadsto \left(\frac{1}{2} \cdot i + 1\right) \cdot \color{blue}{\log \left(e^{\frac{i \cdot 100}{\frac{i}{n}}}\right)}\]
      25.3
    7. Applied simplify to get
      \[\left(\frac{1}{2} \cdot i + 1\right) \cdot \log \color{red}{\left(e^{\frac{i \cdot 100}{\frac{i}{n}}}\right)} \leadsto \left(\frac{1}{2} \cdot i + 1\right) \cdot \log \color{blue}{\left(e^{n \cdot 100}\right)}\]
      24.7

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