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

    if x < -5.084423344895139e-11

    1. Started with
      \[\frac{e^{x} - 1}{x}\]
      0.6

    if -5.084423344895139e-11 < x

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

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