\[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: 18.1 s
Input Error: 23.4
Output Error: 2.4
Log:
Profile: 🕒
\(\begin{cases} 100 \cdot \frac{(e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^*}{\frac{i}{n}} & \text{when } i \le -2.3355523f-31 \\ \frac{(\frac{1}{2} * \left(i \cdot i\right) + \left((\frac{1}{6} * \left({i}^3\right) + i)_*\right))_*}{\frac{1}{n}} \cdot \frac{100}{i} & \text{when } i \le 7.9128556f-20 \\ 100 \cdot \frac{(e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^*}{\frac{i}{n}} & \text{when } i \le 10.704295f0 \\ \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 < -2.3355523f-31 or 7.9128556f-20 < i < 10.704295f0

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      20.7
    2. Using strategy rm
      20.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}}\]
      20.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}}\]
      20.7
    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}}\]
      16.8
    6. Using strategy rm
      16.8
    7. Applied log1p-expm1-u 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 + (e^{\log \left(1 + \frac{i}{n}\right)} - 1)^*)} \cdot n} - 1)^*}{\frac{i}{n}}\]
      16.8
    8. Applied simplify to get
      \[100 \cdot \frac{(e^{\log_* (1 + \color{red}{(e^{\log \left(1 + \frac{i}{n}\right)} - 1)^*}) \cdot n} - 1)^*}{\frac{i}{n}} \leadsto 100 \cdot \frac{(e^{\log_* (1 + \color{blue}{\frac{i}{n}}) \cdot n} - 1)^*}{\frac{i}{n}}\]
      2.1

    if -2.3355523f-31 < i < 7.9128556f-20

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      29.6
    2. Using strategy rm
      29.6
    3. Applied div-inv 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}{i \cdot \frac{1}{n}}}\]
      29.6
    4. Applied *-un-lft-identity to get
      \[100 \cdot \frac{\color{red}{{\left(1 + \frac{i}{n}\right)}^{n} - 1}}{i \cdot \frac{1}{n}} \leadsto 100 \cdot \frac{\color{blue}{1 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}}{i \cdot \frac{1}{n}}\]
      29.6
    5. Applied times-frac to get
      \[100 \cdot \color{red}{\frac{1 \cdot \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}{i \cdot \frac{1}{n}}} \leadsto 100 \cdot \color{blue}{\left(\frac{1}{i} \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{1}{n}}\right)}\]
      29.9
    6. Applied taylor to get
      \[100 \cdot \left(\frac{1}{i} \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{1}{n}}\right) \leadsto 100 \cdot \left(\frac{1}{i} \cdot \frac{\frac{1}{2} \cdot {i}^2 + \left(i + \frac{1}{6} \cdot {i}^{3}\right)}{\frac{1}{n}}\right)\]
      0.6
    7. Taylor expanded around 0 to get
      \[100 \cdot \left(\frac{1}{i} \cdot \frac{\color{red}{\frac{1}{2} \cdot {i}^2 + \left(i + \frac{1}{6} \cdot {i}^{3}\right)}}{\frac{1}{n}}\right) \leadsto 100 \cdot \left(\frac{1}{i} \cdot \frac{\color{blue}{\frac{1}{2} \cdot {i}^2 + \left(i + \frac{1}{6} \cdot {i}^{3}\right)}}{\frac{1}{n}}\right)\]
      0.6
    8. Applied simplify to get
      \[100 \cdot \left(\frac{1}{i} \cdot \frac{\frac{1}{2} \cdot {i}^2 + \left(i + \frac{1}{6} \cdot {i}^{3}\right)}{\frac{1}{n}}\right) \leadsto \frac{(\frac{1}{2} * \left(i \cdot i\right) + \left((\frac{1}{6} * \left({i}^3\right) + i)_*\right))_*}{\frac{1}{n}} \cdot \frac{100}{i}\]
      3.8

    9. Applied final simplification

    if 10.704295f0 < i

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

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