Average Error: 0.0 → 0.5
Time: 1.2s
Precision: binary64
\[\frac{2}{e^{x} + e^{-x}}\]
\[\sqrt{2} \cdot \frac{\sqrt{2}}{e^{x} + e^{-x}}\]

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[\frac{2}{e^{x} + e^{-x}}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.0

    \[\leadsto \frac{2}{\color{blue}{1 \cdot \left(e^{x} + e^{-x}\right)}}\]
  4. Applied add-sqr-sqrt0.5

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

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

    \[\leadsto \color{blue}{\sqrt{2}} \cdot \frac{\sqrt{2}}{e^{x} + e^{-x}}\]
  7. Final simplification0.5

    \[\leadsto \sqrt{2} \cdot \frac{\sqrt{2}}{e^{x} + e^{-x}}\]

Reproduce

herbie shell --seed 2020179 
(FPCore (x)
  :name "Hyperbolic secant"
  :precision binary64
  (/ 2.0 (+ (exp x) (exp (neg x)))))