\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}{\mathsf{hypot}\left(\log base, 0.0\right)} \cdot \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)}double f(double re, double im, double base) {
double r44091 = re;
double r44092 = r44091 * r44091;
double r44093 = im;
double r44094 = r44093 * r44093;
double r44095 = r44092 + r44094;
double r44096 = sqrt(r44095);
double r44097 = log(r44096);
double r44098 = base;
double r44099 = log(r44098);
double r44100 = r44097 * r44099;
double r44101 = atan2(r44093, r44091);
double r44102 = 0.0;
double r44103 = r44101 * r44102;
double r44104 = r44100 + r44103;
double r44105 = r44099 * r44099;
double r44106 = r44102 * r44102;
double r44107 = r44105 + r44106;
double r44108 = r44104 / r44107;
return r44108;
}
double f(double re, double im, double base) {
double r44109 = 1.0;
double r44110 = base;
double r44111 = log(r44110);
double r44112 = 0.0;
double r44113 = hypot(r44111, r44112);
double r44114 = r44109 / r44113;
double r44115 = re;
double r44116 = im;
double r44117 = hypot(r44115, r44116);
double r44118 = log(r44117);
double r44119 = atan2(r44116, r44115);
double r44120 = r44119 * r44112;
double r44121 = fma(r44118, r44111, r44120);
double r44122 = r44121 / r44113;
double r44123 = r44114 * r44122;
return r44123;
}



Bits error versus re



Bits error versus im



Bits error versus base
Initial program 31.4
rmApplied hypot-def0.5
rmApplied add-sqr-sqrt0.5
Applied associate-/r*0.4
Simplified0.4
rmApplied *-un-lft-identity0.4
Applied sqrt-prod0.4
Applied *-un-lft-identity0.4
Applied times-frac0.5
Applied times-frac0.5
Simplified0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2019352 +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))))