\[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: 24.9 s
Input Error: 51.7
Output Error: 10.5
Log:
Profile: 🕒
\(\begin{cases} 100 \cdot \frac{\frac{{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}^2 - {1}^2}{{\left(1 + \frac{i}{n}\right)}^{n} + 1}}{\frac{i}{n}} & \text{when } i \le -2768.3130698710897 \\ \left(\left(i \cdot \frac{1}{2}\right) \cdot n + \left(\left(i \cdot i\right) \cdot \left(n \cdot \frac{1}{6}\right) + n\right)\right) \cdot 100 & \text{when } i \le 1.001552520707554 \cdot 10^{-05} \\ 100 \cdot \frac{\frac{{\left({\left(1 + \frac{i}{n}\right)}^{n}\right)}^2 - {1}^2}{{\left(1 + \frac{i}{n}\right)}^{n} + 1}}{\frac{i}{n}} & \text{when } i \le 9.613916160983725 \cdot 10^{+206} \\ \frac{\frac{-100}{i}}{\frac{i}{n}} \cdot \left(i \cdot \frac{1}{2} + 1\right) & \text{otherwise} \end{cases}\)

    if i < -2768.3130698710897

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      27.8
    2. Using strategy rm
      27.8
    3. Applied flip-- 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)}^2 - {1}^2}{{\left(1 + \frac{i}{n}\right)}^{n} + 1}}}{\frac{i}{n}}\]
      27.8

    if -2768.3130698710897 < i < 1.001552520707554e-05

    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
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\color{red}{\frac{i}{n}}} \leadsto 100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\color{blue}{e^{\log \left(\frac{i}{n}\right)}}}\]
      61.9
    4. Applied add-exp-log to get
      \[100 \cdot \frac{\color{red}{{\left(1 + \frac{i}{n}\right)}^{n} - 1}}{e^{\log \left(\frac{i}{n}\right)}} \leadsto 100 \cdot \frac{\color{blue}{e^{\log \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}}}{e^{\log \left(\frac{i}{n}\right)}}\]
      61.9
    5. Applied div-exp to get
      \[100 \cdot \color{red}{\frac{e^{\log \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}}{e^{\log \left(\frac{i}{n}\right)}}} \leadsto 100 \cdot \color{blue}{e^{\log \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) - \log \left(\frac{i}{n}\right)}}\]
      61.9
    6. Applied taylor to get
      \[100 \cdot e^{\log \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right) - \log \left(\frac{i}{n}\right)} \leadsto 100 \cdot \left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right)\]
      0.0
    7. Taylor expanded around 0 to get
      \[100 \cdot \color{red}{\left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right)} \leadsto 100 \cdot \color{blue}{\left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right)}\]
      0.0
    8. Applied simplify to get
      \[100 \cdot \left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right) \leadsto \left(\left(i \cdot \frac{1}{2}\right) \cdot n + \left(\left(i \cdot i\right) \cdot \left(n \cdot \frac{1}{6}\right) + n\right)\right) \cdot 100\]
      0.0

    9. Applied final simplification

    if 1.001552520707554e-05 < i < 9.613916160983725e+206

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      32.2
    2. Using strategy rm
      32.2
    3. Applied flip-- 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)}^2 - {1}^2}{{\left(1 + \frac{i}{n}\right)}^{n} + 1}}}{\frac{i}{n}}\]
      32.2

    if 9.613916160983725e+206 < i

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      48.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}}\]
      63.2
    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}}\]
      63.2
    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}}}\]
      39.7
    5. Using strategy rm
      39.7
    6. Applied add-cube-cbrt to get
      \[\left(\frac{1}{2} \cdot i + 1\right) \cdot \frac{i \cdot 100}{\color{red}{\frac{i}{n}}} \leadsto \left(\frac{1}{2} \cdot i + 1\right) \cdot \frac{i \cdot 100}{\color{blue}{{\left(\sqrt[3]{\frac{i}{n}}\right)}^3}}\]
      39.7
    7. Applied add-cube-cbrt to get
      \[\left(\frac{1}{2} \cdot i + 1\right) \cdot \frac{\color{red}{i \cdot 100}}{{\left(\sqrt[3]{\frac{i}{n}}\right)}^3} \leadsto \left(\frac{1}{2} \cdot i + 1\right) \cdot \frac{\color{blue}{{\left(\sqrt[3]{i \cdot 100}\right)}^3}}{{\left(\sqrt[3]{\frac{i}{n}}\right)}^3}\]
      39.7
    8. Applied cube-undiv to get
      \[\left(\frac{1}{2} \cdot i + 1\right) \cdot \color{red}{\frac{{\left(\sqrt[3]{i \cdot 100}\right)}^3}{{\left(\sqrt[3]{\frac{i}{n}}\right)}^3}} \leadsto \left(\frac{1}{2} \cdot i + 1\right) \cdot \color{blue}{{\left(\frac{\sqrt[3]{i \cdot 100}}{\sqrt[3]{\frac{i}{n}}}\right)}^3}\]
      39.7
    9. Applied taylor to get
      \[\left(\frac{1}{2} \cdot i + 1\right) \cdot {\left(\frac{\sqrt[3]{i \cdot 100}}{\sqrt[3]{\frac{i}{n}}}\right)}^3 \leadsto \left(\frac{1}{2} \cdot i + 1\right) \cdot {\left(\frac{\sqrt[3]{\frac{-100}{i}}}{\sqrt[3]{\frac{i}{n}}}\right)}^3\]
      27.7
    10. Taylor expanded around -inf to get
      \[\left(\frac{1}{2} \cdot i + 1\right) \cdot {\left(\frac{\color{red}{\sqrt[3]{\frac{-100}{i}}}}{\sqrt[3]{\frac{i}{n}}}\right)}^3 \leadsto \left(\frac{1}{2} \cdot i + 1\right) \cdot {\left(\frac{\color{blue}{\sqrt[3]{\frac{-100}{i}}}}{\sqrt[3]{\frac{i}{n}}}\right)}^3\]
      27.7
    11. Applied simplify to get
      \[\left(\frac{1}{2} \cdot i + 1\right) \cdot {\left(\frac{\sqrt[3]{\frac{-100}{i}}}{\sqrt[3]{\frac{i}{n}}}\right)}^3 \leadsto \frac{\frac{-100}{i}}{\frac{i}{n}} \cdot \left(i \cdot \frac{1}{2} + 1\right)\]
      27.5

    12. Applied final simplification

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