\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)\frac{0.5}{e^{im}} \cdot \sin re + e^{im} \cdot \left(0.5 \cdot \sin re\right)(FPCore (re im) :precision binary64 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
(FPCore (re im) :precision binary64 (+ (* (/ 0.5 (exp im)) (sin re)) (* (exp im) (* 0.5 (sin re)))))
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 / exp(im)) * sin(re)) + (exp(im) * (0.5 * sin(re)));
}



Bits error versus re



Bits error versus im
Results
Initial program 0.1
Simplified0.1
rmApplied distribute-rgt-in_binary640.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2021173
(FPCore (re im)
:name "math.sin on complex, real part"
:precision binary64
(* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))