\[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.6 s
Input Error: 51.5
Output Error: 1.6
Log:
Profile: 🕒
\(\begin{cases} \frac{n \cdot 100}{i} \cdot (e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^* & \text{when } i \le -9.087224170415142 \cdot 10^{-132} \\ \left((i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \frac{100}{i}\right) \cdot n & \text{when } i \le 7.872073041510645 \cdot 10^{-51} \\ \frac{n \cdot 100}{i} \cdot (e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^* & \text{when } i \le 18073.65682704277 \\ \frac{n \cdot 100}{i} \cdot (e^{\left(\left(-\log n\right) - \left(-\log i\right)\right) \cdot n} - 1)^* & \text{otherwise} \end{cases}\)

    if i < -9.087224170415142e-132

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      37.0
    2. Using strategy rm
      37.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}}\]
      37.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}}\]
      37.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}}\]
      30.0
    6. Applied taylor to get
      \[100 \cdot \frac{(e^{\log \left(1 + \frac{i}{n}\right) \cdot n} - 1)^*}{\frac{i}{n}} \leadsto 100 \cdot \frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i}\]
      31.2
    7. Taylor expanded around 0 to get
      \[100 \cdot \color{red}{\frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i}} \leadsto 100 \cdot \color{blue}{\frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i}}\]
      31.2
    8. Applied simplify to get
      \[100 \cdot \frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i} \leadsto \frac{n \cdot 100}{i} \cdot (e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^*\]
      3.3

    9. Applied final simplification

    if -9.087224170415142e-132 < i < 7.872073041510645e-51

    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}}\]
      61.3
    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.3
    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}{(i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \frac{100}{\frac{i}{n}}}\]
      18.9
    5. Using strategy rm
      18.9
    6. Applied associate-/r/ to get
      \[(i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \color{red}{\frac{100}{\frac{i}{n}}} \leadsto (i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \color{blue}{\left(\frac{100}{i} \cdot n\right)}\]
      19.2
    7. Applied associate-*r* to get
      \[\color{red}{(i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \left(\frac{100}{i} \cdot n\right)} \leadsto \color{blue}{\left((i * \left(\frac{1}{2} \cdot i\right) + i)_* \cdot \frac{100}{i}\right) \cdot n}\]
      0.6

    if 7.872073041510645e-51 < i < 18073.65682704277

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      51.1
    2. Using strategy rm
      51.1
    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}}\]
      51.1
    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}}\]
      51.1
    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}}\]
      38.8
    6. Applied taylor to get
      \[100 \cdot \frac{(e^{\log \left(1 + \frac{i}{n}\right) \cdot n} - 1)^*}{\frac{i}{n}} \leadsto 100 \cdot \frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i}\]
      39.8
    7. Taylor expanded around 0 to get
      \[100 \cdot \color{red}{\frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i}} \leadsto 100 \cdot \color{blue}{\frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i}}\]
      39.8
    8. Applied simplify to get
      \[100 \cdot \frac{n \cdot (e^{\log \left(\frac{i}{n} + 1\right) \cdot n} - 1)^*}{i} \leadsto \frac{n \cdot 100}{i} \cdot (e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^*\]
      3.9

    9. Applied final simplification

    if 18073.65682704277 < i

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      52.2
    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}}\]
      39.2
    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}}\]
      39.2
    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}}}\]
      39.8
    5. Applied taylor to get
      \[\frac{(e^{\frac{\log n - \log i}{n}} - 1)^*}{\frac{\frac{i}{100}}{n}} \leadsto 100 \cdot \frac{n \cdot (e^{n \cdot \left(\log \left(\frac{1}{n}\right) - \log \left(\frac{1}{i}\right)\right)} - 1)^*}{i}\]
      0.4
    6. Taylor expanded around inf to get
      \[\color{red}{100 \cdot \frac{n \cdot (e^{n \cdot \left(\log \left(\frac{1}{n}\right) - \log \left(\frac{1}{i}\right)\right)} - 1)^*}{i}} \leadsto \color{blue}{100 \cdot \frac{n \cdot (e^{n \cdot \left(\log \left(\frac{1}{n}\right) - \log \left(\frac{1}{i}\right)\right)} - 1)^*}{i}}\]
      0.4
    7. Applied simplify to get
      \[100 \cdot \frac{n \cdot (e^{n \cdot \left(\log \left(\frac{1}{n}\right) - \log \left(\frac{1}{i}\right)\right)} - 1)^*}{i} \leadsto \frac{n \cdot 100}{i} \cdot (e^{\left(\left(-\log n\right) - \left(-\log i\right)\right) \cdot n} - 1)^*\]
      0.3

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