e^{re} \cdot \cos im
\begin{array}{l}
t_0 := \sqrt{e^{re}}\\
t_0 \cdot \left(t_0 \cdot \cos im\right)
\end{array}
(FPCore (re im) :precision binary64 (* (exp re) (cos im)))
(FPCore (re im) :precision binary64 (let* ((t_0 (sqrt (exp re)))) (* t_0 (* t_0 (cos im)))))
double code(double re, double im) {
return exp(re) * cos(im);
}
double code(double re, double im) {
double t_0 = sqrt(exp(re));
return t_0 * (t_0 * cos(im));
}



Bits error versus re



Bits error versus im
Results
Initial program 0.0
Applied add-sqr-sqrt_binary640.0
Applied associate-*l*_binary640.0
Final simplification0.0
herbie shell --seed 2021357
(FPCore (re im)
:name "math.exp on complex, real part"
:precision binary64
(* (exp re) (cos im)))