(FPCore (re im) :precision binary64 (/ (atan2 im re) (log 10.0)))
(FPCore (re im) :precision binary64 (* (sqrt (/ 1.0 (sqrt (log 10.0)))) (* (atan2 im re) (pow (sqrt (/ 1.0 (log 10.0))) 1.5))))
double code(double re, double im) {
return atan2(im, re) / log(10.0);
}
double code(double re, double im) {
return sqrt((1.0 / sqrt(log(10.0)))) * (atan2(im, re) * pow(sqrt((1.0 / log(10.0))), 1.5));
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = atan2(im, re) / log(10.0d0)
end function
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = sqrt((1.0d0 / sqrt(log(10.0d0)))) * (atan2(im, re) * (sqrt((1.0d0 / log(10.0d0))) ** 1.5d0))
end function
public static double code(double re, double im) {
return Math.atan2(im, re) / Math.log(10.0);
}
public static double code(double re, double im) {
return Math.sqrt((1.0 / Math.sqrt(Math.log(10.0)))) * (Math.atan2(im, re) * Math.pow(Math.sqrt((1.0 / Math.log(10.0))), 1.5));
}
def code(re, im): return math.atan2(im, re) / math.log(10.0)
def code(re, im): return math.sqrt((1.0 / math.sqrt(math.log(10.0)))) * (math.atan2(im, re) * math.pow(math.sqrt((1.0 / math.log(10.0))), 1.5))
function code(re, im) return Float64(atan(im, re) / log(10.0)) end
function code(re, im) return Float64(sqrt(Float64(1.0 / sqrt(log(10.0)))) * Float64(atan(im, re) * (sqrt(Float64(1.0 / log(10.0))) ^ 1.5))) end
function tmp = code(re, im) tmp = atan2(im, re) / log(10.0); end
function tmp = code(re, im) tmp = sqrt((1.0 / sqrt(log(10.0)))) * (atan2(im, re) * (sqrt((1.0 / log(10.0))) ^ 1.5)); end
code[re_, im_] := N[(N[ArcTan[im / re], $MachinePrecision] / N[Log[10.0], $MachinePrecision]), $MachinePrecision]
code[re_, im_] := N[(N[Sqrt[N[(1.0 / N[Sqrt[N[Log[10.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[ArcTan[im / re], $MachinePrecision] * N[Power[N[Sqrt[N[(1.0 / N[Log[10.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\sqrt{\frac{1}{\sqrt{\log 10}}} \cdot \left(\tan^{-1}_* \frac{im}{re} \cdot {\left(\sqrt{\frac{1}{\log 10}}\right)}^{1.5}\right)



Bits error versus re



Bits error versus im
Results
Initial program 0.9
Applied add-sqr-sqrt_binary640.9
Applied *-un-lft-identity_binary640.9
Applied times-frac_binary640.8
Taylor expanded in im around 0 0.8
Applied add-sqr-sqrt_binary640.8
Applied associate-*l*_binary640.8
Simplified0.1
Final simplification0.1
herbie shell --seed 2022131
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
:precision binary64
(/ (atan2 im re) (log 10.0)))