\[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.2 s
Input Error: 51.1
Output Error: 4.0
Log:
Profile: 🕒
\(\begin{cases} 100 \cdot \frac{e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1}{\frac{i}{n}} & \text{when } i \le -8.598462733726525 \cdot 10^{-17} \\ \frac{100 \cdot n}{\frac{1}{i}} \cdot (i * \frac{1}{6} + \frac{1}{2})_* + \frac{100 \cdot n}{1} & \text{when } i \le 1.001552520707554 \cdot 10^{-05} \\ 100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} & \text{when } i \le 9.613916160983725 \cdot 10^{+206} \\ 0 & \text{otherwise} \end{cases}\)

    if i < -8.598462733726525e-17

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

    if -8.598462733726525e-17 < i < 1.001552520707554e-05

    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{\frac{1}{2} \cdot {i}^2 + \left(i + \frac{1}{6} \cdot {i}^{3}\right)}{\frac{i}{n}}\]
      14.0
    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}}\]
      14.0
    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)_*}\]
      15.1
    5. Using strategy rm
      15.1
    6. Applied fma-udef to get
      \[\frac{n \cdot 100}{i} \cdot \color{red}{(\left(i \cdot i\right) * \left((i * \frac{1}{6} + \frac{1}{2})_*\right) + i)_*} \leadsto \frac{n \cdot 100}{i} \cdot \color{blue}{\left(\left(i \cdot i\right) \cdot (i * \frac{1}{6} + \frac{1}{2})_* + i\right)}\]
      15.1
    7. Applied distribute-lft-in to get
      \[\color{red}{\frac{n \cdot 100}{i} \cdot \left(\left(i \cdot i\right) \cdot (i * \frac{1}{6} + \frac{1}{2})_* + i\right)} \leadsto \color{blue}{\frac{n \cdot 100}{i} \cdot \left(\left(i \cdot i\right) \cdot (i * \frac{1}{6} + \frac{1}{2})_*\right) + \frac{n \cdot 100}{i} \cdot i}\]
      15.5
    8. Applied simplify to get
      \[\color{red}{\frac{n \cdot 100}{i} \cdot \left(\left(i \cdot i\right) \cdot (i * \frac{1}{6} + \frac{1}{2})_*\right)} + \frac{n \cdot 100}{i} \cdot i \leadsto \color{blue}{\frac{100 \cdot n}{\frac{1}{i}} \cdot (i * \frac{1}{6} + \frac{1}{2})_*} + \frac{n \cdot 100}{i} \cdot i\]
      15.1
    9. Applied simplify to get
      \[\frac{100 \cdot n}{\frac{1}{i}} \cdot (i * \frac{1}{6} + \frac{1}{2})_* + \color{red}{\frac{n \cdot 100}{i} \cdot i} \leadsto \frac{100 \cdot n}{\frac{1}{i}} \cdot (i * \frac{1}{6} + \frac{1}{2})_* + \color{blue}{\frac{100 \cdot n}{1}}\]
      0.0

    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.3

    if 9.613916160983725e+206 < i

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