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

    if x < -0.0003019673949516488

    1. Started with
      \[\frac{e^{x} - 1}{x}\]
      0.0
    2. Using strategy rm
      0.0
    3. Applied clear-num to get
      \[\color{red}{\frac{e^{x} - 1}{x}} \leadsto \color{blue}{\frac{1}{\frac{x}{e^{x} - 1}}}\]
      0.0

    if -0.0003019673949516488 < x

    1. Started with
      \[\frac{e^{x} - 1}{x}\]
      61.3
    2. Using strategy rm
      61.3
    3. Applied clear-num to get
      \[\color{red}{\frac{e^{x} - 1}{x}} \leadsto \color{blue}{\frac{1}{\frac{x}{e^{x} - 1}}}\]
      61.3
    4. Applied taylor to get
      \[\frac{1}{\frac{x}{e^{x} - 1}} \leadsto \frac{1}{\left(\frac{1}{12} \cdot {x}^2 + 1\right) - \frac{1}{2} \cdot x}\]
      0.3
    5. Taylor expanded around 0 to get
      \[\frac{1}{\color{red}{\left(\frac{1}{12} \cdot {x}^2 + 1\right) - \frac{1}{2} \cdot x}} \leadsto \frac{1}{\color{blue}{\left(\frac{1}{12} \cdot {x}^2 + 1\right) - \frac{1}{2} \cdot x}}\]
      0.3
    6. Applied simplify to get
      \[\frac{1}{\left(\frac{1}{12} \cdot {x}^2 + 1\right) - \frac{1}{2} \cdot x} \leadsto \frac{1}{\left(x \cdot x\right) \cdot \frac{1}{12} + \left(1 - x \cdot \frac{1}{2}\right)}\]
      0.3

    7. Applied final simplification

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