(FPCore () :precision binary64 (- (+ 100.0 1.0) 100.0))
double code() { return (100.0 + 1.0) - 100.0; }
real(8) function code() code = (100.0d0 + 1.0d0) - 100.0d0 end function
public static double code() { return (100.0 + 1.0) - 100.0; }
def code(): return (100.0 + 1.0) - 100.0
function code() return Float64(Float64(100.0 + 1.0) - 100.0) end
function tmp = code() tmp = (100.0 + 1.0) - 100.0; end
code[] := N[(N[(100.0 + 1.0), $MachinePrecision] - 100.0), $MachinePrecision]
\begin{array}{l} \\ \left(100 + 1\right) - 100 \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore () :precision binary64 (- (+ 100.0 1.0) 100.0))
double code() { return (100.0 + 1.0) - 100.0; }
real(8) function code() code = (100.0d0 + 1.0d0) - 100.0d0 end function
public static double code() { return (100.0 + 1.0) - 100.0; }
def code(): return (100.0 + 1.0) - 100.0
function code() return Float64(Float64(100.0 + 1.0) - 100.0) end
function tmp = code() tmp = (100.0 + 1.0) - 100.0; end
code[] := N[(N[(100.0 + 1.0), $MachinePrecision] - 100.0), $MachinePrecision]
\begin{array}{l} \\ \left(100 + 1\right) - 100 \end{array}
(FPCore () :precision binary64 1.0)
double code() { return 1.0; }
real(8) function code() code = 1.0d0 end function
public static double code() { return 1.0; }
def code(): return 1.0
function code() return 1.0 end
function tmp = code() tmp = 1.0; end
code[] := 1.0
\begin{array}{l} \\ 1 \end{array}
Initial program 100.0%
lift--.f64
N/A
lift-+.f64
N/A
metadata-eval
N/A
metadata-eval
100.0
Applied rewrites100.0%
herbie shell --seed 1
(FPCore ()
:name "(1e2 + 1) - 1e2"
:precision binary64
(- (+ 100.0 1.0) 100.0))