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(\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 r16224 = x_re;
double r16225 = r16224 * r16224;
double r16226 = x_im;
double r16227 = r16226 * r16226;
double r16228 = r16225 + r16227;
double r16229 = sqrt(r16228);
double r16230 = log(r16229);
double r16231 = y_re;
double r16232 = r16230 * r16231;
double r16233 = atan2(r16226, r16224);
double r16234 = y_im;
double r16235 = r16233 * r16234;
double r16236 = r16232 - r16235;
double r16237 = exp(r16236);
double r16238 = r16230 * r16234;
double r16239 = r16233 * r16231;
double r16240 = r16238 + r16239;
double r16241 = sin(r16240);
double r16242 = r16237 * r16241;
return r16242;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r16243 = 1.0;
double r16244 = x_re;
double r16245 = x_im;
double r16246 = hypot(r16244, r16245);
double r16247 = r16243 * r16246;
double r16248 = log(r16247);
double r16249 = y_re;
double r16250 = r16248 * r16249;
double r16251 = atan2(r16245, r16244);
double r16252 = y_im;
double r16253 = r16251 * r16252;
double r16254 = r16250 - r16253;
double r16255 = exp(r16254);
double r16256 = log(r16246);
double r16257 = r16256 * r16252;
double r16258 = r16251 * r16249;
double r16259 = r16257 + r16258;
double r16260 = sin(r16259);
double r16261 = r16255 * r16260;
return r16261;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 33.2
rmApplied hypot-def19.4
rmApplied *-un-lft-identity19.4
Applied sqrt-prod19.4
Simplified19.4
Simplified3.6
Final simplification3.6
herbie shell --seed 2020024 +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)))))