Average Error: 43.5 → 0.8
Time: 59.1s
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 + \sin y \cdot (x \cdot \left(\left(x \cdot \frac{1}{6}\right) \cdot x\right) + \left((\frac{1}{120} \cdot \left({x}^{5}\right) + x)_*\right))_* i\right))\]

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 43.5

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

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

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

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

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

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

Runtime

Time bar (total: 59.1s)Debug logProfile

herbie shell --seed 2018242 +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)))))