\[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: 19.3 s
Input Error: 23.4
Output Error: 1.9
Log:
Profile: 🕒
\(\begin{cases} 100 \cdot \frac{\frac{(e^{\log_* (1 + \frac{i}{n}) \cdot \left(n + \left(n + n\right)\right)} - 1)^*}{{\left(e^{\log_* (1 + \frac{i}{n}) \cdot n}\right)}^2 + \left({1}^2 + e^{\log_* (1 + \frac{i}{n}) \cdot n} \cdot 1\right)}}{\frac{i}{n}} & \text{when } i \le -1.2413777f-14 \\ (100 * \left((\left(i \cdot i\right) * \left(n \cdot \frac{1}{6}\right) + n)_*\right) + \left(\left(100 \cdot i\right) \cdot \left(n \cdot \frac{1}{2}\right)\right))_* & \text{when } i \le 4.73221f-17 \\ 100 \cdot \frac{{\left(\sqrt[3]{(e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^*}\right)}^3}{\frac{i}{n}} & \text{otherwise} \end{cases}\)

    if i < -1.2413777f-14

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      14.8
    2. Using strategy rm
      14.8
    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}}\]
      14.8
    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}}\]
      14.8
    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
    6. Using strategy rm
      7.3
    7. Applied flip3-- to get
      \[100 \cdot \frac{\color{red}{e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1}}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{\frac{{\left(e^{\log_* (1 + \frac{i}{n}) \cdot n}\right)}^{3} - {1}^{3}}{{\left(e^{\log_* (1 + \frac{i}{n}) \cdot n}\right)}^2 + \left({1}^2 + e^{\log_* (1 + \frac{i}{n}) \cdot n} \cdot 1\right)}}}{\frac{i}{n}}\]
      7.3
    8. Applied simplify to get
      \[100 \cdot \frac{\frac{\color{red}{{\left(e^{\log_* (1 + \frac{i}{n}) \cdot n}\right)}^{3} - {1}^{3}}}{{\left(e^{\log_* (1 + \frac{i}{n}) \cdot n}\right)}^2 + \left({1}^2 + e^{\log_* (1 + \frac{i}{n}) \cdot n} \cdot 1\right)}}{\frac{i}{n}} \leadsto 100 \cdot \frac{\frac{\color{blue}{(e^{\log_* (1 + \frac{i}{n}) \cdot \left(n + \left(n + n\right)\right)} - 1)^*}}{{\left(e^{\log_* (1 + \frac{i}{n}) \cdot n}\right)}^2 + \left({1}^2 + e^{\log_* (1 + \frac{i}{n}) \cdot n} \cdot 1\right)}}{\frac{i}{n}}\]
      0.5

    if -1.2413777f-14 < i < 4.73221f-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}{e^{\log \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}}}{\frac{i}{n}}\]
      29.7
    4. Applied taylor to get
      \[100 \cdot \frac{e^{\log \left({\left(1 + \frac{i}{n}\right)}^{n} - 1\right)}}{\frac{i}{n}} \leadsto 100 \cdot \left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right)\]
      0.0
    5. Taylor expanded around 0 to get
      \[100 \cdot \color{red}{\left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right)} \leadsto 100 \cdot \color{blue}{\left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right)}\]
      0.0
    6. Applied simplify to get
      \[100 \cdot \left(n + \left(\frac{1}{6} \cdot \left(n \cdot {i}^2\right) + \frac{1}{2} \cdot \left(n \cdot i\right)\right)\right) \leadsto (100 * \left((\left(i \cdot i\right) * \left(n \cdot \frac{1}{6}\right) + n)_*\right) + \left(\left(100 \cdot i\right) \cdot \left(n \cdot \frac{1}{2}\right)\right))_*\]
      0.0

    7. Applied final simplification

    if 4.73221f-17 < i

    1. Started with
      \[100 \cdot \frac{{\left(1 + \frac{i}{n}\right)}^{n} - 1}{\frac{i}{n}}\]
      24.2
    2. Using strategy rm
      24.2
    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}}\]
      24.3
    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}}\]
      24.3
    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}}\]
      20.5
    6. Using strategy rm
      20.5
    7. Applied add-cube-cbrt to get
      \[100 \cdot \frac{\color{red}{e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1}}{\frac{i}{n}} \leadsto 100 \cdot \frac{\color{blue}{{\left(\sqrt[3]{e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1}\right)}^3}}{\frac{i}{n}}\]
      20.6
    8. Applied simplify to get
      \[100 \cdot \frac{{\color{red}{\left(\sqrt[3]{e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1}\right)}}^3}{\frac{i}{n}} \leadsto 100 \cdot \frac{{\color{blue}{\left(\sqrt[3]{(e^{\log_* (1 + \frac{i}{n}) \cdot n} - 1)^*}\right)}}^3}{\frac{i}{n}}\]
      8.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))))