Average Error: 40.7 → 0.4
Time: 11.1s
Precision: binary64
\[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.3445133628746207 \cdot 10^{-4}:\\ \;\;\;\;\sqrt{\frac{\frac{\left(-1 \cdot 1\right) + {\left(e^{2}\right)}^{\left(2 \cdot x\right)}}{e^{2 \cdot x} + 1}}{e^{x} - 1}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x \cdot \left(1 + 0.5 \cdot x\right) + 2}\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -1.3445133628746207e-4

    1. Initial program 0.0

      \[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
    2. Using strategy rm
    3. Applied flip--0.0

      \[\leadsto \sqrt{\frac{\color{blue}{\frac{e^{2 \cdot x} \cdot e^{2 \cdot x} - 1 \cdot 1}{e^{2 \cdot x} + 1}}}{e^{x} - 1}}\]
    4. Simplified0.0

      \[\leadsto \sqrt{\frac{\frac{\color{blue}{\left(-1 \cdot 1\right) + {\left(e^{2}\right)}^{\left(2 \cdot x\right)}}}{e^{2 \cdot x} + 1}}{e^{x} - 1}}\]

    if -1.3445133628746207e-4 < x

    1. Initial program 61.6

      \[\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\]
    2. Taylor expanded around 0 0.5

      \[\leadsto \sqrt{\color{blue}{0.5 \cdot {x}^{2} + \left(1 \cdot x + 2\right)}}\]
    3. Simplified0.5

      \[\leadsto \sqrt{\color{blue}{x \cdot \left(1 + 0.5 \cdot x\right) + 2}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.3445133628746207 \cdot 10^{-4}:\\ \;\;\;\;\sqrt{\frac{\frac{\left(-1 \cdot 1\right) + {\left(e^{2}\right)}^{\left(2 \cdot x\right)}}{e^{2 \cdot x} + 1}}{e^{x} - 1}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x \cdot \left(1 + 0.5 \cdot x\right) + 2}\\ \end{array}\]

Reproduce

herbie shell --seed 2020163 
(FPCore (x)
  :name "sqrtexp (problem 3.4.4)"
  :precision binary64
  (sqrt (/ (- (exp (* 2.0 x)) 1.0) (- (exp x) 1.0))))