\[\frac{e^{x} - 1}{x}\]
Test:
Kahan's exp quotient
Bits:
128 bits
Bits error versus x
Time: 45.7 s
Input Error: 17.9
Output Error: 1.0
Log:
Profile: 🕒
\(\begin{cases} \frac{\left(\sqrt{e^{x}} + 1\right) \cdot \left(\sqrt{e^{x}} - 1\right)}{x} & \text{when } x \le -0.31132668f0 \\ \sqrt{e^{x}} \cdot \frac{{\left(e^{\frac{1}{24}}\right)}^{\left(x \cdot x\right)}}{{\left(e^{\frac{1}{2880}}\right)}^{\left({x}^{4}\right)}} & \text{otherwise} \end{cases}\)

    if x < -0.31132668f0

    1. Started with
      \[\frac{e^{x} - 1}{x}\]
      0.0
    2. Using strategy rm
      0.0
    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.0
    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.0

    if -0.31132668f0 < x

    1. Started with
      \[\frac{e^{x} - 1}{x}\]
      26.3
    2. Using strategy rm
      26.3
    3. Applied add-exp-log to get
      \[\color{red}{\frac{e^{x} - 1}{x}} \leadsto \color{blue}{e^{\log \left(\frac{e^{x} - 1}{x}\right)}}\]
      26.3
    4. Applied taylor to get
      \[e^{\log \left(\frac{e^{x} - 1}{x}\right)} \leadsto e^{\left(\frac{1}{24} \cdot {x}^2 + \frac{1}{2} \cdot x\right) - \frac{1}{2880} \cdot {x}^{4}}\]
      0.0
    5. Taylor expanded around 0 to get
      \[e^{\color{red}{\left(\frac{1}{24} \cdot {x}^2 + \frac{1}{2} \cdot x\right) - \frac{1}{2880} \cdot {x}^{4}}} \leadsto e^{\color{blue}{\left(\frac{1}{24} \cdot {x}^2 + \frac{1}{2} \cdot x\right) - \frac{1}{2880} \cdot {x}^{4}}}\]
      0.0
    6. Applied simplify to get
      \[e^{\left(\frac{1}{24} \cdot {x}^2 + \frac{1}{2} \cdot x\right) - \frac{1}{2880} \cdot {x}^{4}} \leadsto \frac{{\left(e^{\frac{1}{24}}\right)}^{\left(x \cdot x\right)}}{\frac{{\left(e^{\frac{1}{2880}}\right)}^{\left({x}^{4}\right)}}{e^{x \cdot \frac{1}{2}}}}\]
      1.5

    7. Applied final simplification
    8. Applied simplify to get
      \[\color{red}{\frac{{\left(e^{\frac{1}{24}}\right)}^{\left(x \cdot x\right)}}{\frac{{\left(e^{\frac{1}{2880}}\right)}^{\left({x}^{4}\right)}}{e^{x \cdot \frac{1}{2}}}}} \leadsto \color{blue}{\sqrt{e^{x}} \cdot \frac{{\left(e^{\frac{1}{24}}\right)}^{\left(x \cdot x\right)}}{{\left(e^{\frac{1}{2880}}\right)}^{\left({x}^{4}\right)}}}\]
      1.5

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