Average Error: 43.7 → 0.9
Time: 39.3s
Precision: 64
Internal Precision: 1344
\[\Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\]
\[\Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{(\frac{1}{60} \cdot \left({x}^{5}\right) + \left((\frac{1}{3} \cdot \left(x \cdot x\right) + 2)_* \cdot x\right))_*}{2} \cdot \sin y i\right))\]

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 43.7

    \[\Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{e^{x} - e^{-x}}{2} \cdot \sin y i\right))\]
  2. Taylor expanded around 0 0.9

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

    \[\leadsto \Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{\color{blue}{(\frac{1}{60} \cdot \left({x}^{5}\right) + \left((\frac{1}{3} \cdot \left(x \cdot x\right) + 2)_* \cdot x\right))_*}}{2} \cdot \sin y i\right))\]
  4. Final simplification0.9

    \[\leadsto \Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{(\frac{1}{60} \cdot \left({x}^{5}\right) + \left((\frac{1}{3} \cdot \left(x \cdot x\right) + 2)_* \cdot x\right))_*}{2} \cdot \sin y i\right))\]

Reproduce

herbie shell --seed 2019050 +o rules:numerics
(FPCore (x y)
  :name "Euler formula imaginary part (p55)"
  (im (complex (* (/ (+ (exp x) (exp (- x))) 2) (cos y)) (* (/ (- (exp x) (exp (- x))) 2) (sin y)))))