2 \cdot \left(\left(1 \cdot \frac{1}{9} + \frac{1}{9} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)2 \cdot \left(1 \cdot \frac{1}{9} + \left(1 \cdot \frac{1}{9} + \frac{1}{9} \cdot \frac{1}{9}\right)\right)(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 (* 2.0 (+ (* 1.0 (/ 1.0 9.0)) (+ (* 1.0 (/ 1.0 9.0)) (* (/ 1.0 9.0) (/ 1.0 9.0))))))
double code() {
return ((double) (2.0 * ((double) (((double) (((double) (1.0 * (1.0 / 9.0))) + ((double) ((1.0 / 9.0) * (1.0 / 9.0))))) + ((double) ((1.0 / 9.0) * 1.0))))));
}
double code() {
return ((double) (2.0 * ((double) (((double) (1.0 * (1.0 / 9.0))) + ((double) (((double) (1.0 * (1.0 / 9.0))) + ((double) ((1.0 / 9.0) * (1.0 / 9.0)))))))));
}
Results
| Original | 0 |
|---|---|
| Target | 0 |
| Herbie | 0 |
Initial program 0
Final simplification0
herbie shell --seed 2020210
(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))))