(FPCore (k p) :precision binary64 (sqrt (/ k p)))
double code(double k, double p) { return sqrt((k / p)); }
real(8) function code(k, p) real(8), intent (in) :: k real(8), intent (in) :: p code = sqrt((k / p)) end function
public static double code(double k, double p) { return Math.sqrt((k / p)); }
def code(k, p): return math.sqrt((k / p))
function code(k, p) return sqrt(Float64(k / p)) end
function tmp = code(k, p) tmp = sqrt((k / p)); end
code[k_, p_] := N[Sqrt[N[(k / p), $MachinePrecision]], $MachinePrecision]
\begin{array}{l} \\ \sqrt{\frac{k}{p}} \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (k p) :precision binary64 (sqrt (/ k p)))
double code(double k, double p) { return sqrt((k / p)); }
real(8) function code(k, p) real(8), intent (in) :: k real(8), intent (in) :: p code = sqrt((k / p)) end function
public static double code(double k, double p) { return Math.sqrt((k / p)); }
def code(k, p): return math.sqrt((k / p))
function code(k, p) return sqrt(Float64(k / p)) end
function tmp = code(k, p) tmp = sqrt((k / p)); end
code[k_, p_] := N[Sqrt[N[(k / p), $MachinePrecision]], $MachinePrecision]
\begin{array}{l} \\ \sqrt{\frac{k}{p}} \end{array}
(FPCore (k p) :precision binary64 (sqrt (/ k p)))
double code(double k, double p) { return sqrt((k / p)); }
real(8) function code(k, p) real(8), intent (in) :: k real(8), intent (in) :: p code = sqrt((k / p)) end function
public static double code(double k, double p) { return Math.sqrt((k / p)); }
def code(k, p): return math.sqrt((k / p))
function code(k, p) return sqrt(Float64(k / p)) end
function tmp = code(k, p) tmp = sqrt((k / p)); end
code[k_, p_] := N[Sqrt[N[(k / p), $MachinePrecision]], $MachinePrecision]
\begin{array}{l} \\ \sqrt{\frac{k}{p}} \end{array}
Initial program 99.8%
herbie shell --seed 1
(FPCore (k p)
:name "sqrt(k / p)"
:precision binary64
:pre (and (and (<= 1.0 k) (<= k 1000000.0)) (and (<= 0.9 p) (<= p 1.1)))
(sqrt (/ k p)))