\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\sin re \cdot \mathsf{fma}\left(0.5, e^{im}, \sqrt{0.5} \cdot \frac{\sqrt{0.5}}{e^{im}}\right)
(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
(FPCore (re im) :precision binary64 (* (sin re) (fma 0.5 (exp im) (* (sqrt 0.5) (/ (sqrt 0.5) (exp im))))))
double code(double re, double im) {
return (0.5 * sin(re)) * (exp(0.0 - im) + exp(im));
}
double code(double re, double im) {
return sin(re) * fma(0.5, exp(im), (sqrt(0.5) * (sqrt(0.5) / exp(im))));
}



Bits error versus re



Bits error versus im
Initial program 0.0
Simplified0.0
Applied *-un-lft-identity_binary640.0
Applied add-sqr-sqrt_binary640.0
Applied times-frac_binary640.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021215
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))