Average Error: 43.4 → 0.7
Time: 1.2m
Precision: 64
\[\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 + \sin y \cdot \frac{{x}^{5} \cdot \frac{1}{60} + \left(2 + \log \left(e^{\left(x \cdot \frac{1}{3}\right) \cdot x}\right)\right) \cdot x}{2} i\right))\]

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 43.4

    \[\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.7

    \[\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.7

    \[\leadsto \Im(\left(\frac{e^{x} + e^{-x}}{2} \cdot \cos y + \frac{\color{blue}{x \cdot \left(x \cdot \left(\frac{1}{3} \cdot x\right) + 2\right) + {x}^{5} \cdot \frac{1}{60}}}{2} \cdot \sin y i\right))\]
  4. Using strategy rm
  5. Applied add-log-exp0.7

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

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

Reproduce

herbie shell --seed 2019100 
(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)))))