Average Error: 0.0 → 0.1
Time: 5.1s
Precision: 64
\[\Re(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\]
\[\sqrt{\frac{\sqrt[3]{{\left(e^{-1 \cdot x} + e^{x}\right)}^{3}}}{2}} \cdot \left(\sqrt{\frac{\sqrt[3]{{\left(e^{-1 \cdot x} + e^{x}\right)}^{3}}}{2}} \cdot \cos y\right)\]

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.0

    \[\Re(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\frac{e^{x} + e^{-x}}{2} \cdot \cos y}\]
  3. Using strategy rm
  4. Applied add-cbrt-cube0.1

    \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(e^{x} + e^{-x}\right) \cdot \left(e^{x} + e^{-x}\right)\right) \cdot \left(e^{x} + e^{-x}\right)}}}{2} \cdot \cos y\]
  5. Simplified0.1

    \[\leadsto \frac{\sqrt[3]{\color{blue}{{\left(e^{-1 \cdot x} + e^{x}\right)}^{3}}}}{2} \cdot \cos y\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt0.1

    \[\leadsto \color{blue}{\left(\sqrt{\frac{\sqrt[3]{{\left(e^{-1 \cdot x} + e^{x}\right)}^{3}}}{2}} \cdot \sqrt{\frac{\sqrt[3]{{\left(e^{-1 \cdot x} + e^{x}\right)}^{3}}}{2}}\right)} \cdot \cos y\]
  8. Applied associate-*l*0.1

    \[\leadsto \color{blue}{\sqrt{\frac{\sqrt[3]{{\left(e^{-1 \cdot x} + e^{x}\right)}^{3}}}{2}} \cdot \left(\sqrt{\frac{\sqrt[3]{{\left(e^{-1 \cdot x} + e^{x}\right)}^{3}}}{2}} \cdot \cos y\right)}\]
  9. Final simplification0.1

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

Reproduce

herbie shell --seed 2020078 
(FPCore (x y)
  :name "Euler formula real part (p55)"
  :precision binary64
  (re (complex (* (/ (+ (exp x) (exp (- x))) 2) (cos y)) (* (/ (- (exp x) (exp (- x))) 2) (sin y)))))