\[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: 29.1 s
Input Error: 53.7
Output Error: 2.2
Log:
Profile: 🕒
\(\begin{cases} 100 \cdot \frac{e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1}{\frac{i}{n}} & \text{when } i \le -8.61646249982272 \cdot 10^{-12} \\ \frac{100 \cdot n}{\frac{1}{i}} \cdot (i * \frac{1}{6} + \frac{1}{2})_* + \frac{100 \cdot n}{1} & \text{when } i \le 8.584780819621077 \\ 100 \cdot \frac{(e^{\log \left(1 + \frac{i}{n}\right) \cdot n} - 1)^*}{\frac{i}{n}} & \text{when } i \le 1.5757889061495052 \cdot 10^{+162} \\ \frac{(e^{\frac{\log n - \log i}{n}} - 1)^*}{\frac{\frac{i}{100}}{n}} & \text{otherwise} \end{cases}\)

    if i < -8.61646249982272e-12

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

    if -8.61646249982272e-12 < i < 8.584780819621077

    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.6
    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.6
    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.6
    5. Using strategy rm
      15.6
    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.6
    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}\]
      16.0
    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.6
    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 8.584780819621077 < i < 1.5757889061495052e+162

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

    if 1.5757889061495052e+162 < i

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      62.3
    2. Applied taylor to get
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}} \leadsto 100 \cdot \frac{e^{\frac{\log n - \log i}{n}} - 1}{\frac{i}{n}}\]
      30.0
    3. Taylor expanded around inf to get
      \[100 \cdot \frac{\color{red}{e^{\frac{\log n - \log i}{n}} - 1}}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{e^{\frac{\log n - \log i}{n}} - 1}}{\frac{i}{n}}\]
      30.0
    4. Applied simplify to get
      \[\color{red}{100 \cdot \frac{e^{\frac{\log n - \log i}{n}} - 1}{\frac{i}{n}}} \leadsto \color{blue}{\frac{(e^{\frac{\log n - \log i}{n}} - 1)^*}{\frac{\frac{i}{100}}{n}}}\]
      1.4

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