Average Error: 0 → 0
Time: 639.0ms
Precision: binary64
Cost: 6528
\[\tan^{-1}_* \frac{im}{re}\]
\[\tan^{-1}_* \frac{im}{re}\]
\tan^{-1}_* \frac{im}{re}
\tan^{-1}_* \frac{im}{re}
(FPCore (re im) :precision binary64 (atan2 im re))
(FPCore (re im) :precision binary64 (atan2 im re))
double code(double re, double im) {
	return atan2(im, re);
}
double code(double re, double im) {
	return atan2(im, re);
}

Error

Bits error versus re

Bits error versus im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error52.5
Cost706
\[\begin{array}{l} \mathbf{if}\;im \leq -1.9774280438554357 \cdot 10^{-199}:\\ \;\;\;\;-1\\ \mathbf{elif}\;im \leq 3.7221819733455804 \cdot 10^{-141}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 2
Error55.0
Cost385
\[\begin{array}{l} \mathbf{if}\;re \leq 4.011616982378676 \cdot 10^{+82}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
Alternative 3
Error58.4
Cost64
\[1\]

Error

Derivation

  1. Initial program 0

    \[\tan^{-1}_* \frac{im}{re}\]
  2. Simplified0

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

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

Reproduce

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