(FPCore (x y) :precision binary64 (log (/ x y)))
double code(double x, double y) { return log((x / y)); }
real(8) function code(x, y) real(8), intent (in) :: x real(8), intent (in) :: y code = log((x / y)) end function
public static double code(double x, double y) { return Math.log((x / y)); }
def code(x, y): return math.log((x / y))
function code(x, y) return log(Float64(x / y)) end
function tmp = code(x, y) tmp = log((x / y)); end
code[x_, y_] := N[Log[N[(x / y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l} \\ \log \left(\frac{x}{y}\right) \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (x y) :precision binary64 (log (/ x y)))
double code(double x, double y) { return log((x / y)); }
real(8) function code(x, y) real(8), intent (in) :: x real(8), intent (in) :: y code = log((x / y)) end function
public static double code(double x, double y) { return Math.log((x / y)); }
def code(x, y): return math.log((x / y))
function code(x, y) return log(Float64(x / y)) end
function tmp = code(x, y) tmp = log((x / y)); end
code[x_, y_] := N[Log[N[(x / y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l} \\ \log \left(\frac{x}{y}\right) \end{array}
(FPCore (x y) :precision binary64 (log (/ x y)))
double code(double x, double y) { return log((x / y)); }
real(8) function code(x, y) real(8), intent (in) :: x real(8), intent (in) :: y code = log((x / y)) end function
public static double code(double x, double y) { return Math.log((x / y)); }
def code(x, y): return math.log((x / y))
function code(x, y) return log(Float64(x / y)) end
function tmp = code(x, y) tmp = log((x / y)); end
code[x_, y_] := N[Log[N[(x / y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l} \\ \log \left(\frac{x}{y}\right) \end{array}
Initial program 100.0%
herbie shell --seed 1
(FPCore (x y)
:name "log(x/y)"
:precision binary64
:pre (and (and (<= -1000.0 x) (<= x 1000.0)) (and (<= -1000.0 y) (<= y 1000.0)))
(log (/ x y)))