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

Error

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-rr1.0

    \[\leadsto \color{blue}{{\left(\frac{\log 10}{\tan^{-1}_* \frac{im}{re}}\right)}^{-1}} \]
  3. Applied egg-rr0.3

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

    \[\leadsto {\color{blue}{\left(\frac{\log 0.1}{-\tan^{-1}_* \frac{im}{re}}\right)}}^{-1} \]
    Proof
    (/.f64 (log.f64 1/10) (neg.f64 (atan2.f64 im re))): 0 points increase in error, 0 points decrease in error
    (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (log.f64 1/10) 1)) (neg.f64 (atan2.f64 im re))): 0 points increase in error, 0 points decrease in error
    (Rewrite<= associate-*r/_binary64 (*.f64 (log.f64 1/10) (/.f64 1 (neg.f64 (atan2.f64 im re))))): 7 points increase in error, 6 points decrease in error
  5. Applied egg-rr0.3

    \[\leadsto \color{blue}{\frac{\frac{1}{\log 0.1}}{\frac{-1}{\tan^{-1}_* \frac{im}{re}}}} \]
  6. Final simplification0.3

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

Alternatives

Alternative 1
Error0.1
Cost13120
\[\frac{-\tan^{-1}_* \frac{im}{re}}{\log 0.1} \]
Alternative 2
Error0.8
Cost13056
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10} \]

Error

Reproduce

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