\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\begin{array}{l}
\mathbf{if}\;im \le -4.25682844850392472 \cdot 10^{142}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(-1 \cdot im\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\mathbf{elif}\;im \le -6.04174234951709435 \cdot 10^{-250}:\\
\;\;\;\;\frac{\left(2 \cdot \log \left(\sqrt[3]{{\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right)\right) \cdot 1}{\sqrt{\log 10}} + \frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt[3]{{\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right)\\
\mathbf{elif}\;im \le 1.2401950370154968 \cdot 10^{-260}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \left(-1 \cdot \left(\log \left(\frac{-1}{re}\right) \cdot \sqrt{\frac{1}{\log 10}}\right)\right)\\
\mathbf{elif}\;im \le 2.16201455188241352 \cdot 10^{107}:\\
\;\;\;\;\frac{\left(2 \cdot \log \left(\sqrt[3]{{\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right)\right) \cdot 1}{\sqrt{\log 10}} + \frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt[3]{{\left(\sqrt{re \cdot re + im \cdot im}\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right)\\
\mathbf{elif}\;im \le 7.0171177849554594 \cdot 10^{121}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({re}^{\left(\sqrt{\frac{1}{\log 10}}\right)}\right)\\
\mathbf{elif}\;im \le 4.36744780112662469 \cdot 10^{128}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(-1 \cdot re\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{\log 10}} \cdot \log \left({\left(\frac{1}{im}\right)}^{\left(-\sqrt{\frac{1}{\log 10}}\right)}\right)\\
\end{array}double f(double re, double im) {
double r47045 = re;
double r47046 = r47045 * r47045;
double r47047 = im;
double r47048 = r47047 * r47047;
double r47049 = r47046 + r47048;
double r47050 = sqrt(r47049);
double r47051 = log(r47050);
double r47052 = 10.0;
double r47053 = log(r47052);
double r47054 = r47051 / r47053;
return r47054;
}
double f(double re, double im) {
double r47055 = im;
double r47056 = -4.2568284485039247e+142;
bool r47057 = r47055 <= r47056;
double r47058 = 1.0;
double r47059 = 10.0;
double r47060 = log(r47059);
double r47061 = sqrt(r47060);
double r47062 = r47058 / r47061;
double r47063 = -1.0;
double r47064 = r47063 * r47055;
double r47065 = pow(r47064, r47062);
double r47066 = log(r47065);
double r47067 = r47062 * r47066;
double r47068 = -6.041742349517094e-250;
bool r47069 = r47055 <= r47068;
double r47070 = 2.0;
double r47071 = re;
double r47072 = r47071 * r47071;
double r47073 = r47055 * r47055;
double r47074 = r47072 + r47073;
double r47075 = sqrt(r47074);
double r47076 = pow(r47075, r47062);
double r47077 = cbrt(r47076);
double r47078 = log(r47077);
double r47079 = r47070 * r47078;
double r47080 = r47079 * r47058;
double r47081 = r47080 / r47061;
double r47082 = r47062 * r47078;
double r47083 = r47081 + r47082;
double r47084 = 1.2401950370154968e-260;
bool r47085 = r47055 <= r47084;
double r47086 = r47063 / r47071;
double r47087 = log(r47086);
double r47088 = r47058 / r47060;
double r47089 = sqrt(r47088);
double r47090 = r47087 * r47089;
double r47091 = r47063 * r47090;
double r47092 = r47062 * r47091;
double r47093 = 2.1620145518824135e+107;
bool r47094 = r47055 <= r47093;
double r47095 = 7.017117784955459e+121;
bool r47096 = r47055 <= r47095;
double r47097 = pow(r47071, r47089);
double r47098 = log(r47097);
double r47099 = r47062 * r47098;
double r47100 = 4.367447801126625e+128;
bool r47101 = r47055 <= r47100;
double r47102 = r47063 * r47071;
double r47103 = pow(r47102, r47062);
double r47104 = log(r47103);
double r47105 = r47062 * r47104;
double r47106 = r47058 / r47055;
double r47107 = -r47089;
double r47108 = pow(r47106, r47107);
double r47109 = log(r47108);
double r47110 = r47062 * r47109;
double r47111 = r47101 ? r47105 : r47110;
double r47112 = r47096 ? r47099 : r47111;
double r47113 = r47094 ? r47083 : r47112;
double r47114 = r47085 ? r47092 : r47113;
double r47115 = r47069 ? r47083 : r47114;
double r47116 = r47057 ? r47067 : r47115;
return r47116;
}



Bits error versus re



Bits error versus im
Results
if im < -4.2568284485039247e+142Initial program 60.9
rmApplied add-sqr-sqrt60.9
Applied pow160.9
Applied log-pow60.9
Applied times-frac60.9
rmApplied add-log-exp60.9
Simplified60.9
rmApplied +-commutative60.9
Taylor expanded around -inf 6.7
if -4.2568284485039247e+142 < im < -6.041742349517094e-250 or 1.2401950370154968e-260 < im < 2.1620145518824135e+107Initial program 20.6
rmApplied add-sqr-sqrt20.6
Applied pow120.6
Applied log-pow20.6
Applied times-frac20.5
rmApplied add-log-exp20.5
Simplified20.4
rmApplied add-cube-cbrt20.4
Applied log-prod20.4
Applied distribute-lft-in20.4
Simplified20.5
if -6.041742349517094e-250 < im < 1.2401950370154968e-260Initial program 34.0
rmApplied add-sqr-sqrt34.0
Applied pow134.0
Applied log-pow34.0
Applied times-frac33.9
Taylor expanded around -inf 32.5
if 2.1620145518824135e+107 < im < 7.017117784955459e+121Initial program 18.0
rmApplied add-sqr-sqrt18.0
Applied pow118.0
Applied log-pow18.0
Applied times-frac18.0
rmApplied add-log-exp18.0
Simplified17.8
rmApplied +-commutative17.8
Taylor expanded around 0 49.7
if 7.017117784955459e+121 < im < 4.367447801126625e+128Initial program 18.4
rmApplied add-sqr-sqrt18.4
Applied pow118.4
Applied log-pow18.4
Applied times-frac18.4
rmApplied add-log-exp18.4
Simplified18.1
Taylor expanded around -inf 48.1
if 4.367447801126625e+128 < im Initial program 57.4
rmApplied add-sqr-sqrt57.4
Applied pow157.4
Applied log-pow57.4
Applied times-frac57.3
rmApplied add-log-exp57.3
Simplified57.3
rmApplied +-commutative57.3
Taylor expanded around inf 7.3
Simplified7.2
Final simplification18.1
herbie shell --seed 2020047
(FPCore (re im)
:name "math.log10 on complex, real part"
:precision binary64
(/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))