(FPCore (x) :precision binary64 (log (exp x)))
double code(double x) { return log(exp(x)); }
real(8) function code(x) real(8), intent (in) :: x code = log(exp(x)) end function
public static double code(double x) { return Math.log(Math.exp(x)); }
def code(x): return math.log(math.exp(x))
function code(x) return log(exp(x)) end
function tmp = code(x) tmp = log(exp(x)); end
code[x_] := N[Log[N[Exp[x], $MachinePrecision]], $MachinePrecision]
\begin{array}{l} \\ \log \left(e^{x}\right) \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore (x) :precision binary64 (log (exp x)))
double code(double x) { return log(exp(x)); }
real(8) function code(x) real(8), intent (in) :: x code = log(exp(x)) end function
public static double code(double x) { return Math.log(Math.exp(x)); }
def code(x): return math.log(math.exp(x))
function code(x) return log(exp(x)) end
function tmp = code(x) tmp = log(exp(x)); end
code[x_] := N[Log[N[Exp[x], $MachinePrecision]], $MachinePrecision]
\begin{array}{l} \\ \log \left(e^{x}\right) \end{array}
(FPCore (x) :precision binary64 x)
double code(double x) { return x; }
real(8) function code(x) real(8), intent (in) :: x code = x end function
public static double code(double x) { return x; }
def code(x): return x
function code(x) return x end
function tmp = code(x) tmp = x; end
code[x_] := x
\begin{array}{l} \\ x \end{array}
Initial program 9.1%
lift-log.f64
N/A
lift-exp.f64
N/A
rem-log-exp
100.0
Applied rewrites100.0%
herbie shell --seed 1
(FPCore (x)
:name "log(exp(x))"
:precision binary64
:pre (and (<= -1.79e+308 x) (<= x 1.79e+308))
(log (exp x)))