\[\frac{e^{x} - 1}{x}\]
Test:
Kahan's exp quotient
Bits:
128 bits
Bits error versus x
Time: 11.6 s
Input Error: 19.1
Output Error: 0.1
Log:
Profile: 🕒
\(\begin{cases} \frac{\left(\sqrt{e^{x}} + 1\right) \cdot \left(\sqrt{e^{x}} - 1\right)}{x} & \text{when } x \le -0.020851452f0 \\ \frac{1}{6} \cdot {x}^2 + \left(1 + \frac{1}{2} \cdot x\right) & \text{otherwise} \end{cases}\)

    if x < -0.020851452f0

    1. Started with
      \[\frac{e^{x} - 1}{x}\]
      0.1
    2. Using strategy rm
      0.1
    3. Applied add-sqr-sqrt to get
      \[\frac{\color{red}{e^{x}} - 1}{x} \leadsto \frac{\color{blue}{{\left(\sqrt{e^{x}}\right)}^2} - 1}{x}\]
      0.1
    4. Applied difference-of-sqr-1 to get
      \[\frac{\color{red}{{\left(\sqrt{e^{x}}\right)}^2 - 1}}{x} \leadsto \frac{\color{blue}{\left(\sqrt{e^{x}} + 1\right) \cdot \left(\sqrt{e^{x}} - 1\right)}}{x}\]
      0.1

    if -0.020851452f0 < x

    1. Started with
      \[\frac{e^{x} - 1}{x}\]
      27.2
    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.2
    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.2

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