\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{1}{\sqrt[3]{1} \cdot \sqrt[3]{1}}} \cdot \frac{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(\log base, 0.0\right)}}{\mathsf{hypot}\left(\log base, 0.0\right)}double f(double re, double im, double base) {
double r42733 = re;
double r42734 = r42733 * r42733;
double r42735 = im;
double r42736 = r42735 * r42735;
double r42737 = r42734 + r42736;
double r42738 = sqrt(r42737);
double r42739 = log(r42738);
double r42740 = base;
double r42741 = log(r42740);
double r42742 = r42739 * r42741;
double r42743 = atan2(r42735, r42733);
double r42744 = 0.0;
double r42745 = r42743 * r42744;
double r42746 = r42742 + r42745;
double r42747 = r42741 * r42741;
double r42748 = r42744 * r42744;
double r42749 = r42747 + r42748;
double r42750 = r42746 / r42749;
return r42750;
}
double f(double re, double im, double base) {
double r42751 = 1.0;
double r42752 = cbrt(r42751);
double r42753 = r42752 * r42752;
double r42754 = r42751 / r42753;
double r42755 = r42751 / r42754;
double r42756 = re;
double r42757 = im;
double r42758 = hypot(r42756, r42757);
double r42759 = log(r42758);
double r42760 = base;
double r42761 = log(r42760);
double r42762 = atan2(r42757, r42756);
double r42763 = 0.0;
double r42764 = r42762 * r42763;
double r42765 = fma(r42759, r42761, r42764);
double r42766 = hypot(r42761, r42763);
double r42767 = r42765 / r42766;
double r42768 = r42767 / r42766;
double r42769 = r42755 * r42768;
return r42769;
}



Bits error versus re



Bits error versus im



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