(FPCore () :precision binary64 (/ 1.0 (- 1.0 (- 1.0 (exp (- 1000.0))))))
double code() { return 1.0 / (1.0 - (1.0 - exp(-1000.0))); }
real(8) function code() code = 1.0d0 / (1.0d0 - (1.0d0 - exp(-1000.0d0))) end function
public static double code() { return 1.0 / (1.0 - (1.0 - Math.exp(-1000.0))); }
def code(): return 1.0 / (1.0 - (1.0 - math.exp(-1000.0)))
function code() return Float64(1.0 / Float64(1.0 - Float64(1.0 - exp(Float64(-1000.0))))) end
function tmp = code() tmp = 1.0 / (1.0 - (1.0 - exp(-1000.0))); end
code[] := N[(1.0 / N[(1.0 - N[(1.0 - N[Exp[(-1000.0)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \frac{1}{1 - \left(1 - e^{-1000}\right)} \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore () :precision binary64 (/ 1.0 (- 1.0 (- 1.0 (exp (- 1000.0))))))
double code() { return 1.0 / (1.0 - (1.0 - exp(-1000.0))); }
real(8) function code() code = 1.0d0 / (1.0d0 - (1.0d0 - exp(-1000.0d0))) end function
public static double code() { return 1.0 / (1.0 - (1.0 - Math.exp(-1000.0))); }
def code(): return 1.0 / (1.0 - (1.0 - math.exp(-1000.0)))
function code() return Float64(1.0 / Float64(1.0 - Float64(1.0 - exp(Float64(-1000.0))))) end
function tmp = code() tmp = 1.0 / (1.0 - (1.0 - exp(-1000.0))); end
code[] := N[(1.0 / N[(1.0 - N[(1.0 - N[Exp[(-1000.0)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \frac{1}{1 - \left(1 - e^{-1000}\right)} \end{array}
(FPCore () :precision binary64 (exp 1000.0))
double code() { return exp(1000.0); }
real(8) function code() code = exp(1000.0d0) end function
public static double code() { return Math.exp(1000.0); }
def code(): return math.exp(1000.0)
function code() return exp(1000.0) end
function tmp = code() tmp = exp(1000.0); end
code[] := N[Exp[1000.0], $MachinePrecision]
\begin{array}{l} \\ e^{1000} \end{array}
Initial program 100.0%
lift--.f64
N/A
lift--.f64
N/A
associate--r-
N/A
metadata-eval
N/A
+-lft-identity
100.0
lower-/.f64
N/A
lift-exp.f64
N/A
rec-exp
N/A
lift-neg.f64
N/A
metadata-eval
N/A
metadata-eval
N/A
metadata-eval
N/A
metadata-eval
N/A
metadata-eval
N/A
lift-neg.f64
N/A
rem-log-exp
N/A
lift-exp.f64
N/A
log-div
N/A
lower-/.f64
N/A
+-lft-identity
N/A
metadata-eval
N/A
associate--r-
N/A
lift--.f64
N/A
lift--.f64
N/A
Applied rewrites100.0%
herbie shell --seed 1
(FPCore ()
:name "log(1-(1-exp(-1000)))"
:precision binary64
(/ 1.0 (- 1.0 (- 1.0 (exp (- 1000.0))))))