\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{\mathsf{fma}\left(\left({x}^{5}\right), \frac{1}{60}, \left(\mathsf{fma}\left(\frac{1}{3}, \left(x \cdot x\right), 2\right) \cdot x\right)\right)}{2} \cdot \sin y i\right))double f(double x, double y) {
double r5040151 = x;
double r5040152 = exp(r5040151);
double r5040153 = -r5040151;
double r5040154 = exp(r5040153);
double r5040155 = r5040152 + r5040154;
double r5040156 = 2.0;
double r5040157 = r5040155 / r5040156;
double r5040158 = y;
double r5040159 = cos(r5040158);
double r5040160 = r5040157 * r5040159;
double r5040161 = r5040152 - r5040154;
double r5040162 = r5040161 / r5040156;
double r5040163 = sin(r5040158);
double r5040164 = r5040162 * r5040163;
double r5040165 = /* ERROR: no complex support in C */;
double r5040166 = /* ERROR: no complex support in C */;
return r5040166;
}
double f(double x, double y) {
double r5040167 = x;
double r5040168 = exp(r5040167);
double r5040169 = -r5040167;
double r5040170 = exp(r5040169);
double r5040171 = r5040168 + r5040170;
double r5040172 = 2.0;
double r5040173 = r5040171 / r5040172;
double r5040174 = y;
double r5040175 = cos(r5040174);
double r5040176 = r5040173 * r5040175;
double r5040177 = 5.0;
double r5040178 = pow(r5040167, r5040177);
double r5040179 = 0.016666666666666666;
double r5040180 = 0.3333333333333333;
double r5040181 = r5040167 * r5040167;
double r5040182 = fma(r5040180, r5040181, r5040172);
double r5040183 = r5040182 * r5040167;
double r5040184 = fma(r5040178, r5040179, r5040183);
double r5040185 = r5040184 / r5040172;
double r5040186 = sin(r5040174);
double r5040187 = r5040185 * r5040186;
double r5040188 = /* ERROR: no complex support in C */;
double r5040189 = /* ERROR: no complex support in C */;
return r5040189;
}



Bits error versus x



Bits error versus y
Initial program 43.7
Taylor expanded around 0 0.8
Simplified0.8
rmApplied add-sqr-sqrt1.6
Applied *-un-lft-identity1.6
Applied times-frac1.4
Applied associate-*l*1.4
rmApplied pow11.4
Applied pow11.4
Applied pow-prod-down1.4
Applied pow11.4
Applied pow-prod-down1.4
Simplified0.9
rmApplied associate-/r/0.8
Final simplification0.8
herbie shell --seed 2019121 +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)))))