\left(0.5 \cdot \sin re\right) \cdot \left(e^{0.0 - im} + e^{im}\right)\left(0.5 \cdot \sin re\right) \cdot \mathsf{fma}\left(\sqrt{e^{0.0 - im}}, \sqrt{e^{0.0 - im}}, e^{im}\right)double code(double re, double im) {
return ((0.5 * sin(re)) * (exp((0.0 - im)) + exp(im)));
}
double code(double re, double im) {
return ((0.5 * sin(re)) * fma(sqrt(exp((0.0 - im))), sqrt(exp((0.0 - im))), exp(im)));
}



Bits error versus re



Bits error versus im
Results
Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied fma-def0.0
Final simplification0.0
herbie shell --seed 2020105 +o rules:numerics
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))