e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)e^{\log \left(1 \cdot \mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(1 \cdot \mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)double f(double x_re, double x_im, double y_re, double y_im) {
double r15186 = x_re;
double r15187 = r15186 * r15186;
double r15188 = x_im;
double r15189 = r15188 * r15188;
double r15190 = r15187 + r15189;
double r15191 = sqrt(r15190);
double r15192 = log(r15191);
double r15193 = y_re;
double r15194 = r15192 * r15193;
double r15195 = atan2(r15188, r15186);
double r15196 = y_im;
double r15197 = r15195 * r15196;
double r15198 = r15194 - r15197;
double r15199 = exp(r15198);
double r15200 = r15192 * r15196;
double r15201 = r15195 * r15193;
double r15202 = r15200 + r15201;
double r15203 = sin(r15202);
double r15204 = r15199 * r15203;
return r15204;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r15205 = 1.0;
double r15206 = x_re;
double r15207 = x_im;
double r15208 = hypot(r15206, r15207);
double r15209 = r15205 * r15208;
double r15210 = log(r15209);
double r15211 = y_re;
double r15212 = r15210 * r15211;
double r15213 = atan2(r15207, r15206);
double r15214 = y_im;
double r15215 = r15213 * r15214;
double r15216 = r15212 - r15215;
double r15217 = exp(r15216);
double r15218 = r15210 * r15214;
double r15219 = r15213 * r15211;
double r15220 = r15218 + r15219;
double r15221 = sin(r15220);
double r15222 = r15217 * r15221;
return r15222;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 33.5
rmApplied *-un-lft-identity33.5
Applied sqrt-prod33.5
Simplified33.5
Simplified19.3
rmApplied *-un-lft-identity19.3
Applied sqrt-prod19.3
Simplified19.3
Simplified3.6
Final simplification3.6
herbie shell --seed 2020018 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))