Alternative 1 | |
---|---|
Error | 0.0 |
Cost | 19392 |
\[\log \left(\frac{e^{\sqrt{x}}}{x}\right)
\]
(FPCore (x) :precision binary64 (- (sqrt x) (log x)))
(FPCore (x) :precision binary64 (log (* (/ 1.0 x) (exp (sqrt x)))))
double code(double x) { return sqrt(x) - log(x); }
double code(double x) { return log(((1.0 / x) * exp(sqrt(x)))); }
real(8) function code(x) real(8), intent (in) :: x code = sqrt(x) - log(x) end function
real(8) function code(x) real(8), intent (in) :: x code = log(((1.0d0 / x) * exp(sqrt(x)))) end function
public static double code(double x) { return Math.sqrt(x) - Math.log(x); }
public static double code(double x) { return Math.log(((1.0 / x) * Math.exp(Math.sqrt(x)))); }
def code(x): return math.sqrt(x) - math.log(x)
def code(x): return math.log(((1.0 / x) * math.exp(math.sqrt(x))))
function code(x) return Float64(sqrt(x) - log(x)) end
function code(x) return log(Float64(Float64(1.0 / x) * exp(sqrt(x)))) end
function tmp = code(x) tmp = sqrt(x) - log(x); end
function tmp = code(x) tmp = log(((1.0 / x) * exp(sqrt(x)))); end
code[x_] := N[(N[Sqrt[x], $MachinePrecision] - N[Log[x], $MachinePrecision]), $MachinePrecision]
code[x_] := N[Log[N[(N[(1.0 / x), $MachinePrecision] * N[Exp[N[Sqrt[x], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sqrt{x} - \log x
\log \left(\frac{1}{x} \cdot e^{\sqrt{x}}\right)
Results
Initial program 0.0
Applied egg-rr0.0
Applied egg-rr0.0
Final simplification0.0
Alternative 1 | |
---|---|
Error | 0.0 |
Cost | 19392 |
Alternative 2 | |
---|---|
Error | 0.0 |
Cost | 12992 |
Alternative 3 | |
---|---|
Error | 2.8 |
Cost | 6528 |
herbie shell --seed 1
(FPCore (x)
:name "sqrt(x) - log(x)"
:precision binary64
:pre (and (<= 0.0 x) (<= x 1000.0))
(- (sqrt x) (log x)))