Average Error: 0.8 → 0.3
Time: 1.6s
Precision: binary64
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10} \]
\[-{\left(\frac{\log 0.1}{\tan^{-1}_* \frac{im}{re}}\right)}^{-1} \]
(FPCore (re im) :precision binary64 (/ (atan2 im re) (log 10.0)))
(FPCore (re im) :precision binary64 (- (pow (/ (log 0.1) (atan2 im re)) -1.0)))
double code(double re, double im) {
	return atan2(im, re) / log(10.0);
}
double code(double re, double im) {
	return -pow((log(0.1) / atan2(im, re)), -1.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 = -((log(0.1d0) / atan2(im, re)) ** (-1.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.pow((Math.log(0.1) / Math.atan2(im, re)), -1.0);
}
def code(re, im):
	return math.atan2(im, re) / math.log(10.0)
def code(re, im):
	return -math.pow((math.log(0.1) / math.atan2(im, re)), -1.0)
function code(re, im)
	return Float64(atan(im, re) / log(10.0))
end
function code(re, im)
	return Float64(-(Float64(log(0.1) / atan(im, re)) ^ -1.0))
end
function tmp = code(re, im)
	tmp = atan2(im, re) / log(10.0);
end
function tmp = code(re, im)
	tmp = -((log(0.1) / atan2(im, re)) ^ -1.0);
end
code[re_, im_] := N[(N[ArcTan[im / re], $MachinePrecision] / N[Log[10.0], $MachinePrecision]), $MachinePrecision]
code[re_, im_] := (-N[Power[N[(N[Log[0.1], $MachinePrecision] / N[ArcTan[im / re], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision])
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
-{\left(\frac{\log 0.1}{\tan^{-1}_* \frac{im}{re}}\right)}^{-1}

Error

Bits error versus re

Bits error versus im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.8

    \[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10} \]
  2. Applied egg-rr0.1

    \[\leadsto \color{blue}{-\frac{\tan^{-1}_* \frac{im}{re}}{\log 0.1}} \]
  3. Applied egg-rr0.3

    \[\leadsto -\color{blue}{{\left(\frac{\log 0.1}{\tan^{-1}_* \frac{im}{re}}\right)}^{-1}} \]
  4. Final simplification0.3

    \[\leadsto -{\left(\frac{\log 0.1}{\tan^{-1}_* \frac{im}{re}}\right)}^{-1} \]

Reproduce

herbie shell --seed 2022170 
(FPCore (re im)
  :name "math.log10 on complex, imaginary part"
  :precision binary64
  (/ (atan2 im re) (log 10.0)))