(FPCore (x2 x1) :precision binary64 (* (atan (/ x2 x1)) (/ 180.0 3.14159265359)))
double code(double x2, double x1) { return atan((x2 / x1)) * (180.0 / 3.14159265359); }
real(8) function code(x2, x1) real(8), intent (in) :: x2 real(8), intent (in) :: x1 code = atan((x2 / x1)) * (180.0d0 / 3.14159265359d0) end function
public static double code(double x2, double x1) { return Math.atan((x2 / x1)) * (180.0 / 3.14159265359); }
def code(x2, x1): return math.atan((x2 / x1)) * (180.0 / 3.14159265359)
function code(x2, x1) return Float64(atan(Float64(x2 / x1)) * Float64(180.0 / 3.14159265359)) end
function tmp = code(x2, x1) tmp = atan((x2 / x1)) * (180.0 / 3.14159265359); end
code[x2_, x1_] := N[(N[ArcTan[N[(x2 / x1), $MachinePrecision]], $MachinePrecision] * N[(180.0 / 3.14159265359), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \tan^{-1} \left(\frac{x2}{x1}\right) \cdot \frac{180}{3.14159265359} \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (x2 x1) :precision binary64 (* (atan (/ x2 x1)) (/ 180.0 3.14159265359)))
double code(double x2, double x1) { return atan((x2 / x1)) * (180.0 / 3.14159265359); }
real(8) function code(x2, x1) real(8), intent (in) :: x2 real(8), intent (in) :: x1 code = atan((x2 / x1)) * (180.0d0 / 3.14159265359d0) end function
public static double code(double x2, double x1) { return Math.atan((x2 / x1)) * (180.0 / 3.14159265359); }
def code(x2, x1): return math.atan((x2 / x1)) * (180.0 / 3.14159265359)
function code(x2, x1) return Float64(atan(Float64(x2 / x1)) * Float64(180.0 / 3.14159265359)) end
function tmp = code(x2, x1) tmp = atan((x2 / x1)) * (180.0 / 3.14159265359); end
code[x2_, x1_] := N[(N[ArcTan[N[(x2 / x1), $MachinePrecision]], $MachinePrecision] * N[(180.0 / 3.14159265359), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \tan^{-1} \left(\frac{x2}{x1}\right) \cdot \frac{180}{3.14159265359} \end{array}
(FPCore (x2 x1) :precision binary64 (* (atan (/ x2 x1)) 57.29577951307855))
double code(double x2, double x1) { return atan((x2 / x1)) * 57.29577951307855; }
real(8) function code(x2, x1) real(8), intent (in) :: x2 real(8), intent (in) :: x1 code = atan((x2 / x1)) * 57.29577951307855d0 end function
public static double code(double x2, double x1) { return Math.atan((x2 / x1)) * 57.29577951307855; }
def code(x2, x1): return math.atan((x2 / x1)) * 57.29577951307855
function code(x2, x1) return Float64(atan(Float64(x2 / x1)) * 57.29577951307855) end
function tmp = code(x2, x1) tmp = atan((x2 / x1)) * 57.29577951307855; end
code[x2_, x1_] := N[(N[ArcTan[N[(x2 / x1), $MachinePrecision]], $MachinePrecision] * 57.29577951307855), $MachinePrecision]
\begin{array}{l} \\ \tan^{-1} \left(\frac{x2}{x1}\right) \cdot 57.29577951307855 \end{array}
Initial program 99.5%
lift-/.f64
N/A
metadata-eval
99.5
Applied rewrites99.5%
herbie shell --seed 1
(FPCore (x2 x1)
:name "atan(x2 / x1) * (180.0 / 3.14159265359)"
:precision binary64
:pre (and (and (<= 1.0 x2) (<= x2 100.0)) (and (<= 1.0 x1) (<= x1 100.0)))
(* (atan (/ x2 x1)) (/ 180.0 3.14159265359)))