(FPCore (x t) :precision binary64 (/ (erf (/ x t)) x))
double code(double x, double t) { return erf((x / t)) / x; }
def code(x, t): return math.erf((x / t)) / x
function tmp = code(x, t) tmp = erf((x / t)) / x; end
code[x_, t_] := N[(N[Erf[N[(x / t), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l} \\ \frac{\mathsf{erf}\left(\left(\frac{x}{t}\right)\right)}{x} \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (x t) :precision binary64 (/ (erf (/ x t)) x))
double code(double x, double t) { return erf((x / t)) / x; }
def code(x, t): return math.erf((x / t)) / x
function tmp = code(x, t) tmp = erf((x / t)) / x; end
code[x_, t_] := N[(N[Erf[N[(x / t), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l} \\ \frac{\mathsf{erf}\left(\left(\frac{x}{t}\right)\right)}{x} \end{array}
(FPCore (x t) :precision binary64 (/ (erf (/ x t)) x))
double code(double x, double t) { return erf((x / t)) / x; }
def code(x, t): return math.erf((x / t)) / x
function tmp = code(x, t) tmp = erf((x / t)) / x; end
code[x_, t_] := N[(N[Erf[N[(x / t), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l} \\ \frac{\mathsf{erf}\left(\left(\frac{x}{t}\right)\right)}{x} \end{array}
Initial program 99.8%
herbie shell --seed 1
(FPCore (x t)
:name "erf(x / t) / x"
:precision binary64
:pre (and (and (<= 1e-10 x) (<= x 10000000000.0)) (and (<= 1e-6 t) (<= t 1.0)))
(/ (erf (/ x t)) x))