
(FPCore () :precision binary64 (* 2.0 (+ (+ (* 1.0 (/ 1.0 9.0)) (* (/ 1.0 9.0) (/ 1.0 9.0))) (* (/ 1.0 9.0) 1.0))))
(FPCore () :precision binary64 0.4691358024691358)
double code() {
return 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0));
}
double code() {
return 0.4691358024691358;
}
real(8) function code()
code = 2.0d0 * (((1.0d0 * (1.0d0 / 9.0d0)) + ((1.0d0 / 9.0d0) * (1.0d0 / 9.0d0))) + ((1.0d0 / 9.0d0) * 1.0d0))
end function
real(8) function code()
code = 0.4691358024691358d0
end function
public static double code() {
return 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0));
}
public static double code() {
return 0.4691358024691358;
}
def code(): return 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0))
def code(): return 0.4691358024691358
function code() return Float64(2.0 * Float64(Float64(Float64(1.0 * Float64(1.0 / 9.0)) + Float64(Float64(1.0 / 9.0) * Float64(1.0 / 9.0))) + Float64(Float64(1.0 / 9.0) * 1.0))) end
function code() return 0.4691358024691358 end
function tmp = code() tmp = 2.0 * (((1.0 * (1.0 / 9.0)) + ((1.0 / 9.0) * (1.0 / 9.0))) + ((1.0 / 9.0) * 1.0)); end
function tmp = code() tmp = 0.4691358024691358; end
code[] := N[(2.0 * N[(N[(N[(1.0 * N[(1.0 / 9.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 9.0), $MachinePrecision] * N[(1.0 / 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / 9.0), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[] := 0.4691358024691358
2 \cdot \left(\left(1 \cdot \frac{1}{9} + \frac{1}{9} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)
0.4691358024691358
Herbie found 1 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Results
| Original | 100.0% |
|---|---|
| Target | 100.0% |
| Herbie | 100.0% |
Initial program 100.0%
Simplified100.0%
[Start]100.0% | \[ 2 \cdot \left(\left(1 \cdot \frac{1}{9} + \frac{1}{9} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)
\] |
|---|---|
metadata-eval [=>]100.0% | \[ 2 \cdot \left(\left(1 \cdot \color{blue}{0.1111111111111111} + \frac{1}{9} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)
\] |
metadata-eval [=>]100.0% | \[ 2 \cdot \left(\left(\color{blue}{0.1111111111111111} + \frac{1}{9} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)
\] |
metadata-eval [=>]100.0% | \[ 2 \cdot \left(\left(0.1111111111111111 + \color{blue}{0.1111111111111111} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)
\] |
metadata-eval [=>]100.0% | \[ 2 \cdot \left(\left(0.1111111111111111 + 0.1111111111111111 \cdot \color{blue}{0.1111111111111111}\right) + \frac{1}{9} \cdot 1\right)
\] |
metadata-eval [=>]100.0% | \[ 2 \cdot \left(\left(0.1111111111111111 + \color{blue}{0.012345679012345678}\right) + \frac{1}{9} \cdot 1\right)
\] |
metadata-eval [=>]100.0% | \[ 2 \cdot \left(\color{blue}{0.12345679012345678} + \frac{1}{9} \cdot 1\right)
\] |
metadata-eval [=>]100.0% | \[ 2 \cdot \left(0.12345679012345678 + \color{blue}{0.1111111111111111} \cdot 1\right)
\] |
metadata-eval [=>]100.0% | \[ 2 \cdot \left(0.12345679012345678 + \color{blue}{0.1111111111111111}\right)
\] |
metadata-eval [=>]100.0% | \[ 2 \cdot \color{blue}{0.2345679012345679}
\] |
metadata-eval [=>]100.0% | \[ \color{blue}{0.4691358024691358}
\] |
Final simplification100.0%
herbie shell --seed 2023178
(FPCore ()
:name "Rectangular parallelepiped of dimension a×b×c"
:precision binary64
:herbie-target
(+ (+ (* (* (/ 1.0 9.0) 1.0) 2.0) (* 2.0 (* (/ 1.0 9.0) (/ 1.0 9.0)))) (* 2.0 (* 1.0 (/ 1.0 9.0))))
(* 2.0 (+ (+ (* 1.0 (/ 1.0 9.0)) (* (/ 1.0 9.0) (/ 1.0 9.0))) (* (/ 1.0 9.0) 1.0))))