Average Error: 0.0 → 0.0
Time: 2.7s
Precision: binary64
\[\frac{2}{e^{x} + e^{-x}}\]
\[\frac{\sqrt{2}}{\sqrt{e^{x} + e^{-x}}} \cdot \frac{\sqrt{2}}{\sqrt{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 add-sqr-sqrt0.8

    \[\leadsto \frac{2}{\color{blue}{\sqrt{e^{x} + e^{-x}} \cdot \sqrt{e^{x} + e^{-x}}}}\]
  4. Applied add-sqr-sqrt0.0

    \[\leadsto \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{\sqrt{e^{x} + e^{-x}} \cdot \sqrt{e^{x} + e^{-x}}}\]
  5. Applied times-frac0.0

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

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

Reproduce

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