\[\frac{e^{x} - 1}{x}\]
Test:
Kahan's exp quotient
Bits:
128 bits
Bits error versus x
Time: 7.6 s
Input Error: 43.3
Output Error: 2.9
Log:
Profile: 🕒
\(\begin{cases} \frac{\frac{{\left(e^{x}\right)}^3 - 1}{\left(e^{x} + 1\right) + e^{x + x}}}{x} & \text{when } x \le -8.61646249982272 \cdot 10^{-12} \\ \frac{\left(\frac{1}{2} + \frac{1}{6} \cdot x\right) \cdot {x}^2 + x}{x} & \text{otherwise} \end{cases}\)

    if x < -8.61646249982272e-12

    1. Started with
      \[\frac{e^{x} - 1}{x}\]
      0.5
    2. Using strategy rm
      0.5
    3. Applied flip3-- to get
      \[\frac{\color{red}{e^{x} - 1}}{x} \leadsto \frac{\color{blue}{\frac{{\left(e^{x}\right)}^{3} - {1}^{3}}{{\left(e^{x}\right)}^2 + \left({1}^2 + e^{x} \cdot 1\right)}}}{x}\]
      0.5
    4. Applied simplify to get
      \[\frac{\frac{\color{red}{{\left(e^{x}\right)}^{3} - {1}^{3}}}{{\left(e^{x}\right)}^2 + \left({1}^2 + e^{x} \cdot 1\right)}}{x} \leadsto \frac{\frac{\color{blue}{{\left(e^{x}\right)}^3 - 1}}{{\left(e^{x}\right)}^2 + \left({1}^2 + e^{x} \cdot 1\right)}}{x}\]
      0.5
    5. Applied simplify to get
      \[\frac{\frac{{\left(e^{x}\right)}^3 - 1}{\color{red}{{\left(e^{x}\right)}^2 + \left({1}^2 + e^{x} \cdot 1\right)}}}{x} \leadsto \frac{\frac{{\left(e^{x}\right)}^3 - 1}{\color{blue}{\left(e^{x} + 1\right) + e^{x} \cdot e^{x}}}}{x}\]
      0.5
    6. Applied simplify to get
      \[\frac{\frac{{\left(e^{x}\right)}^3 - 1}{\left(e^{x} + 1\right) + \color{red}{e^{x} \cdot e^{x}}}}{x} \leadsto \frac{\frac{{\left(e^{x}\right)}^3 - 1}{\left(e^{x} + 1\right) + \color{blue}{e^{x + x}}}}{x}\]
      0.5

    if -8.61646249982272e-12 < x

    1. Started with
      \[\frac{e^{x} - 1}{x}\]
      60.8
    2. Applied taylor to get
      \[\frac{e^{x} - 1}{x} \leadsto \frac{\frac{1}{2} \cdot {x}^2 + \left(\frac{1}{6} \cdot {x}^{3} + x\right)}{x}\]
      3.9
    3. Taylor expanded around 0 to get
      \[\frac{\color{red}{\frac{1}{2} \cdot {x}^2 + \left(\frac{1}{6} \cdot {x}^{3} + x\right)}}{x} \leadsto \frac{\color{blue}{\frac{1}{2} \cdot {x}^2 + \left(\frac{1}{6} \cdot {x}^{3} + x\right)}}{x}\]
      3.9
    4. Applied simplify to get
      \[\color{red}{\frac{\frac{1}{2} \cdot {x}^2 + \left(\frac{1}{6} \cdot {x}^{3} + x\right)}{x}} \leadsto \color{blue}{\frac{\left(x \cdot x\right) \cdot \left(x \cdot \frac{1}{6} + \frac{1}{2}\right) + x}{x}}\]
      3.9
    5. Applied simplify to get
      \[\frac{\color{red}{\left(x \cdot x\right) \cdot \left(x \cdot \frac{1}{6} + \frac{1}{2}\right) + x}}{x} \leadsto \frac{\color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot x\right) \cdot {x}^2 + x}}{x}\]
      3.9

  1. Removed slow pow expressions

Original test:


(lambda ((x default))
  #:name "Kahan's exp quotient"
  (/ (- (exp x) 1) x)
  #:target
  (if (and (< x 1) (> x -1)) (/ (- (exp x) 1) (log (exp x))) (/ (- (exp x) 1) x)))