(FPCore () :precision binary64 (+ (+ 0.1 0.2) 0.3))
(FPCore () :precision binary64 0.6)
double code() { return (0.1 + 0.2) + 0.3; }
double code() { return 0.6; }
real(8) function code() code = (0.1d0 + 0.2d0) + 0.3d0 end function
real(8) function code() code = 0.6d0 end function
public static double code() { return (0.1 + 0.2) + 0.3; }
public static double code() { return 0.6; }
def code(): return (0.1 + 0.2) + 0.3
def code(): return 0.6
function code() return Float64(Float64(0.1 + 0.2) + 0.3) end
function code() return 0.6 end
function tmp = code() tmp = (0.1 + 0.2) + 0.3; end
function tmp = code() tmp = 0.6; end
code[] := N[(N[(0.1 + 0.2), $MachinePrecision] + 0.3), $MachinePrecision]
code[] := 0.6
\left(0.1 + 0.2\right) + 0.3
0.6
Results
Initial program 1.0
Simplified0
[Start]1.0 | \[ \left(0.1 + 0.2\right) + 0.3
\] |
---|---|
metadata-eval [=>]1.0 | \[ \color{blue}{0.30000000000000004} + 0.3
\] |
metadata-eval [=>]0 | \[ \color{blue}{0.6}
\] |
Final simplification0
herbie shell --seed 1
(FPCore ()
:name "0.1+0.2+0.3"
:precision binary64
(+ (+ 0.1 0.2) 0.3))