\[\frac{e^{x} - 1}{x}\]
Test:
Kahan's exp quotient
Bits:
128 bits
Bits error versus x
Time: 4.4 s
Input Error: 27.2
Output Error: 0.3
Log:
Profile: 🕒
\(\frac{\left(x \cdot x\right) \cdot \left({\left(x \cdot \frac{1}{6}\right)}^{1} + \frac{1}{2}\right) + x}{x}\)
  1. Started with
    \[\frac{e^{x} - 1}{x}\]
    27.2
  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.4
  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.4
  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.3
  5. Using strategy rm
    3.3
  6. Applied pow1 to get
    \[\frac{\left(x \cdot x\right) \cdot \left(\color{red}{x \cdot \frac{1}{6}} + \frac{1}{2}\right) + x}{x} \leadsto \frac{\left(x \cdot x\right) \cdot \left(\color{blue}{{\left(x \cdot \frac{1}{6}\right)}^{1}} + \frac{1}{2}\right) + x}{x}\]
    0.3

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