(FPCore (re im) :precision binary64 (/ (atan2 im re) (log 10.0)))
(FPCore (re im) :precision binary64 (let* ((t_0 (pow (log 10.0) 0.25))) (- 0.0 (/ (/ (/ (atan2 im re) (sqrt (log 10.0))) t_0) (- 0.0 t_0)))))
double code(double re, double im) {
return atan2(im, re) / log(10.0);
}
double code(double re, double im) {
double t_0 = pow(log(10.0), 0.25);
return 0.0 - (((atan2(im, re) / sqrt(log(10.0))) / t_0) / (0.0 - t_0));
}
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
real(8) :: t_0
t_0 = log(10.0d0) ** 0.25d0
code = 0.0d0 - (((atan2(im, re) / sqrt(log(10.0d0))) / t_0) / (0.0d0 - t_0))
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) {
double t_0 = Math.pow(Math.log(10.0), 0.25);
return 0.0 - (((Math.atan2(im, re) / Math.sqrt(Math.log(10.0))) / t_0) / (0.0 - t_0));
}
def code(re, im): return math.atan2(im, re) / math.log(10.0)
def code(re, im): t_0 = math.pow(math.log(10.0), 0.25) return 0.0 - (((math.atan2(im, re) / math.sqrt(math.log(10.0))) / t_0) / (0.0 - t_0))
function code(re, im) return Float64(atan(im, re) / log(10.0)) end
function code(re, im) t_0 = log(10.0) ^ 0.25 return Float64(0.0 - Float64(Float64(Float64(atan(im, re) / sqrt(log(10.0))) / t_0) / Float64(0.0 - t_0))) end
function tmp = code(re, im) tmp = atan2(im, re) / log(10.0); end
function tmp = code(re, im) t_0 = log(10.0) ^ 0.25; tmp = 0.0 - (((atan2(im, re) / sqrt(log(10.0))) / t_0) / (0.0 - t_0)); end
code[re_, im_] := N[(N[ArcTan[im / re], $MachinePrecision] / N[Log[10.0], $MachinePrecision]), $MachinePrecision]
code[re_, im_] := Block[{t$95$0 = N[Power[N[Log[10.0], $MachinePrecision], 0.25], $MachinePrecision]}, N[(0.0 - N[(N[(N[(N[ArcTan[im / re], $MachinePrecision] / N[Sqrt[N[Log[10.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(0.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\begin{array}{l}
t_0 := {\log 10}^{0.25}\\
0 - \frac{\frac{\frac{\tan^{-1}_* \frac{im}{re}}{\sqrt{\log 10}}}{t_0}}{0 - t_0}
\end{array}



Bits error versus re



Bits error versus im
Results
Initial program 0.9
Applied egg-rr1.6
Applied egg-rr0.9
Taylor expanded in im around 0 0.8
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022155
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
:precision binary64
(/ (atan2 im re) (log 10.0)))