
(FPCore (x y) :precision binary64 (exp (* (* x y) y)))
double code(double x, double y) {
return exp(((x * y) * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = exp(((x * y) * y))
end function
public static double code(double x, double y) {
return Math.exp(((x * y) * y));
}
def code(x, y): return math.exp(((x * y) * y))
function code(x, y) return exp(Float64(Float64(x * y) * y)) end
function tmp = code(x, y) tmp = exp(((x * y) * y)); end
code[x_, y_] := N[Exp[N[(N[(x * y), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(x \cdot y\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 3 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (exp (* (* x y) y)))
double code(double x, double y) {
return exp(((x * y) * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = exp(((x * y) * y))
end function
public static double code(double x, double y) {
return Math.exp(((x * y) * y));
}
def code(x, y): return math.exp(((x * y) * y))
function code(x, y) return exp(Float64(Float64(x * y) * y)) end
function tmp = code(x, y) tmp = exp(((x * y) * y)); end
code[x_, y_] := N[Exp[N[(N[(x * y), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(x \cdot y\right) \cdot y}
\end{array}
NOTE: y should be positive before calling this function (FPCore (x y) :precision binary64 (exp (* (* x y) y)))
y = abs(y);
double code(double x, double y) {
return exp(((x * y) * y));
}
NOTE: y should be positive before calling this function
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = exp(((x * y) * y))
end function
y = Math.abs(y);
public static double code(double x, double y) {
return Math.exp(((x * y) * y));
}
y = abs(y) def code(x, y): return math.exp(((x * y) * y))
y = abs(y) function code(x, y) return exp(Float64(Float64(x * y) * y)) end
y = abs(y) function tmp = code(x, y) tmp = exp(((x * y) * y)); end
NOTE: y should be positive before calling this function code[x_, y_] := N[Exp[N[(N[(x * y), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
e^{\left(x \cdot y\right) \cdot y}
\end{array}
Initial program 100.0%
NOTE: y should be positive before calling this function (FPCore (x y) :precision binary64 (pow (exp (* x y)) y))
y = abs(y);
double code(double x, double y) {
return pow(exp((x * y)), y);
}
NOTE: y should be positive before calling this function
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = exp((x * y)) ** y
end function
y = Math.abs(y);
public static double code(double x, double y) {
return Math.pow(Math.exp((x * y)), y);
}
y = abs(y) def code(x, y): return math.pow(math.exp((x * y)), y)
y = abs(y) function code(x, y) return exp(Float64(x * y)) ^ y end
y = abs(y) function tmp = code(x, y) tmp = exp((x * y)) ^ y; end
NOTE: y should be positive before calling this function code[x_, y_] := N[Power[N[Exp[N[(x * y), $MachinePrecision]], $MachinePrecision], y], $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
{\left(e^{x \cdot y}\right)}^{y}
\end{array}
Initial program 89.3%
NOTE: y should be positive before calling this function (FPCore (x y) :precision binary64 (pow (pow (exp y) x) y))
y = abs(y);
double code(double x, double y) {
return pow(pow(exp(y), x), y);
}
NOTE: y should be positive before calling this function
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (exp(y) ** x) ** y
end function
y = Math.abs(y);
public static double code(double x, double y) {
return Math.pow(Math.pow(Math.exp(y), x), y);
}
y = abs(y) def code(x, y): return math.pow(math.pow(math.exp(y), x), y)
y = abs(y) function code(x, y) return (exp(y) ^ x) ^ y end
y = abs(y) function tmp = code(x, y) tmp = (exp(y) ^ x) ^ y; end
NOTE: y should be positive before calling this function code[x_, y_] := N[Power[N[Power[N[Exp[y], $MachinePrecision], x], $MachinePrecision], y], $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
{\left({\left(e^{y}\right)}^{x}\right)}^{y}
\end{array}
Initial program 92.0%
herbie shell --seed 2023276
(FPCore (x y)
:name "Data.Random.Distribution.Normal:normalF from random-fu-0.2.6.2"
:precision binary64
(exp (* (* x y) y)))