(FPCore (re im) :precision binary64 (/ (atan2 im re) (log 10.0)))
(FPCore (re im) :precision binary64 (/ (* (atan2 im re) (pow (log 10.0) 3.0)) (pow (log 10.0) 4.0)))
double code(double re, double im) {
return atan2(im, re) / log(10.0);
}
double code(double re, double im) {
return (atan2(im, re) * pow(log(10.0), 3.0)) / pow(log(10.0), 4.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
code = (atan2(im, re) * (log(10.0d0) ** 3.0d0)) / (log(10.0d0) ** 4.0d0)
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.atan2(im, re) * Math.pow(Math.log(10.0), 3.0)) / Math.pow(Math.log(10.0), 4.0);
}
def code(re, im): return math.atan2(im, re) / math.log(10.0)
def code(re, im): return (math.atan2(im, re) * math.pow(math.log(10.0), 3.0)) / math.pow(math.log(10.0), 4.0)
function code(re, im) return Float64(atan(im, re) / log(10.0)) end
function code(re, im) return Float64(Float64(atan(im, re) * (log(10.0) ^ 3.0)) / (log(10.0) ^ 4.0)) end
function tmp = code(re, im) tmp = atan2(im, re) / log(10.0); end
function tmp = code(re, im) tmp = (atan2(im, re) * (log(10.0) ^ 3.0)) / (log(10.0) ^ 4.0); end
code[re_, im_] := N[(N[ArcTan[im / re], $MachinePrecision] / N[Log[10.0], $MachinePrecision]), $MachinePrecision]
code[re_, im_] := N[(N[(N[ArcTan[im / re], $MachinePrecision] * N[Power[N[Log[10.0], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[N[Log[10.0], $MachinePrecision], 4.0], $MachinePrecision]), $MachinePrecision]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\frac{\tan^{-1}_* \frac{im}{re} \cdot {\log 10}^{3}}{{\log 10}^{4}}
Results
Initial program 98.7%
Applied egg-rr99.9%
herbie shell --seed 2023151
(FPCore (re im)
:name "math.log10 on complex, imaginary part"
:precision binary64
(/ (atan2 im re) (log 10.0)))