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(\left(\sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot \left(\left(\left(\sqrt[3]{\sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}} \cdot \sqrt[3]{\sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}}\right) \cdot \sqrt[3]{\sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}}\right) \cdot y.im\right) + \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 r16239 = x_re;
double r16240 = r16239 * r16239;
double r16241 = x_im;
double r16242 = r16241 * r16241;
double r16243 = r16240 + r16242;
double r16244 = sqrt(r16243);
double r16245 = log(r16244);
double r16246 = y_re;
double r16247 = r16245 * r16246;
double r16248 = atan2(r16241, r16239);
double r16249 = y_im;
double r16250 = r16248 * r16249;
double r16251 = r16247 - r16250;
double r16252 = exp(r16251);
double r16253 = r16245 * r16249;
double r16254 = r16248 * r16246;
double r16255 = r16253 + r16254;
double r16256 = sin(r16255);
double r16257 = r16252 * r16256;
return r16257;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r16258 = 1.0;
double r16259 = x_re;
double r16260 = x_im;
double r16261 = hypot(r16259, r16260);
double r16262 = r16258 * r16261;
double r16263 = log(r16262);
double r16264 = y_re;
double r16265 = r16263 * r16264;
double r16266 = atan2(r16260, r16259);
double r16267 = y_im;
double r16268 = r16266 * r16267;
double r16269 = r16265 - r16268;
double r16270 = exp(r16269);
double r16271 = log(r16261);
double r16272 = cbrt(r16271);
double r16273 = r16272 * r16272;
double r16274 = cbrt(r16272);
double r16275 = r16274 * r16274;
double r16276 = r16275 * r16274;
double r16277 = r16276 * r16267;
double r16278 = r16273 * r16277;
double r16279 = r16266 * r16264;
double r16280 = r16278 + r16279;
double r16281 = sin(r16280);
double r16282 = r16270 * r16281;
return r16282;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 33.4
rmApplied hypot-def19.1
rmApplied *-un-lft-identity19.1
Applied sqrt-prod19.1
Simplified19.1
Simplified3.4
rmApplied add-cube-cbrt3.6
Applied associate-*l*3.6
rmApplied add-cube-cbrt3.7
Final simplification3.7
herbie shell --seed 2019344 +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)))))