\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\frac{1}{\frac{\mathsf{hypot}\left(\log base, 0.0\right)}{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, 0.0 \cdot \tan^{-1}_* \frac{im}{re}\right)}{\mathsf{hypot}\left(\log base, 0.0\right)}}}double f(double re, double im, double base) {
double r69385 = re;
double r69386 = r69385 * r69385;
double r69387 = im;
double r69388 = r69387 * r69387;
double r69389 = r69386 + r69388;
double r69390 = sqrt(r69389);
double r69391 = log(r69390);
double r69392 = base;
double r69393 = log(r69392);
double r69394 = r69391 * r69393;
double r69395 = atan2(r69387, r69385);
double r69396 = 0.0;
double r69397 = r69395 * r69396;
double r69398 = r69394 + r69397;
double r69399 = r69393 * r69393;
double r69400 = r69396 * r69396;
double r69401 = r69399 + r69400;
double r69402 = r69398 / r69401;
return r69402;
}
double f(double re, double im, double base) {
double r69403 = 1.0;
double r69404 = base;
double r69405 = log(r69404);
double r69406 = 0.0;
double r69407 = hypot(r69405, r69406);
double r69408 = re;
double r69409 = im;
double r69410 = hypot(r69408, r69409);
double r69411 = log(r69410);
double r69412 = atan2(r69409, r69408);
double r69413 = r69406 * r69412;
double r69414 = fma(r69411, r69405, r69413);
double r69415 = r69414 / r69407;
double r69416 = r69407 / r69415;
double r69417 = r69403 / r69416;
return r69417;
}



Bits error versus re



Bits error versus im



Bits error versus base
Initial program 32.1
Simplified0.5
rmApplied add-sqr-sqrt0.5
Applied associate-/r*0.4
Simplified0.4
rmApplied *-un-lft-identity0.4
Applied *-un-lft-identity0.4
Applied times-frac0.4
Applied associate-/l*0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2019174 +o rules:numerics
(FPCore (re im base)
:name "math.log/2 on complex, real part"
(/ (+ (* (log (sqrt (+ (* re re) (* im im)))) (log base)) (* (atan2 im re) 0.0)) (+ (* (log base) (log base)) (* 0.0 0.0))))