
(FPCore (x) :precision binary64 (* x (log x)))
double code(double x) {
return x * log(x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = x * log(x)
end function
public static double code(double x) {
return x * Math.log(x);
}
def code(x): return x * math.log(x)
function code(x) return Float64(x * log(x)) end
function tmp = code(x) tmp = x * log(x); end
code[x_] := N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \log x
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (* x (log x)))
double code(double x) {
return x * log(x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = x * log(x)
end function
public static double code(double x) {
return x * Math.log(x);
}
def code(x): return x * math.log(x)
function code(x) return Float64(x * log(x)) end
function tmp = code(x) tmp = x * log(x); end
code[x_] := N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \log x
\end{array}
(FPCore (x) :precision binary64 (* (log x) x))
double code(double x) {
return log(x) * x;
}
real(8) function code(x)
real(8), intent (in) :: x
code = log(x) * x
end function
public static double code(double x) {
return Math.log(x) * x;
}
def code(x): return math.log(x) * x
function code(x) return Float64(log(x) * x) end
function tmp = code(x) tmp = log(x) * x; end
code[x_] := N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\log x \cdot x
\end{array}
Initial program 99.6%
Final simplification99.6%
herbie shell --seed 2024295
(FPCore (x)
:name "Statistics.Distribution.Binomial:directEntropy from math-functions-0.1.5.2"
:precision binary64
(* x (log x)))