\[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: 20.8 s
Input Error: 52.0
Output Error: 10.7
Log:
Profile: 🕒
\(\begin{cases} 100 \cdot \frac{\left(\sqrt{{\left(1 + \frac{i}{n}\right)}^{n}} + 1\right) \cdot \left(\sqrt{{\left(1 + \frac{i}{n}\right)}^{n}} - 1\right)}{\frac{i}{n}} & \text{when } i \le -0.09197678863246804 \\ \left(i \cdot 50 + 100\right) \cdot n & \text{when } i \le 18073.65682704277 \\ 100 \cdot \frac{\left(\sqrt{{\left(1 + \frac{i}{n}\right)}^{n}} + 1\right) \cdot \left(\sqrt{{\left(1 + \frac{i}{n}\right)}^{n}} - 1\right)}{\frac{i}{n}} & \text{when } i \le 1.4768914403135694 \cdot 10^{+243} \\ \left(\frac{1}{2} \cdot i + 1\right) \cdot {\left(\frac{\sqrt[3]{i \cdot 100}}{\sqrt[3]{\frac{i}{n}}}\right)}^3 & \text{otherwise} \end{cases}\)

    if i < -0.09197678863246804 or 18073.65682704277 < i < 1.4768914403135694e+243

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      29.1
    2. Using strategy rm
      29.1
    3. Applied add-sqr-sqrt 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(\sqrt{{\left(1 + \frac{i}{n}\right)}^{n}}\right)}^2} - 1}{\frac{i}{n}}\]
      29.1
    4. Applied difference-of-sqr-1 to get
      \[100 \cdot \frac{\color{red}{{\left(\sqrt{{\left(1 + \frac{i}{n}\right)}^{n}}\right)}^2 - 1}}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{\left(\sqrt{{\left(1 + \frac{i}{n}\right)}^{n}} + 1\right) \cdot \left(\sqrt{{\left(1 + \frac{i}{n}\right)}^{n}} - 1\right)}}{\frac{i}{n}}\]
      29.1

    if -0.09197678863246804 < i < 18073.65682704277

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      61.7
    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}}\]
      59.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}}\]
      59.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}}}\]
      13.7
    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.0
    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.0
    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.0

    if 1.4768914403135694e+243 < i

    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{\left(\frac{1}{2} \cdot {i}^2 + \left(1 + i\right)\right) - 1}{\frac{i}{n}}\]
      61.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}}\]
      61.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}}}\]
      48.4
    5. Using strategy rm
      48.4
    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}}\]
      48.6
    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}\]
      48.6
    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}\]
      48.6

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