Average Error: 0 → 0
Time: 1.2s
Precision: 64
\[2 \cdot \left(\left(1 \cdot \frac{1}{9} + \frac{1}{9} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)\]
\[\frac{38}{81}\]
double f() {
        double r3355469 = 2.0;
        double r3355470 = 1.0;
        double r3355471 = 9.0;
        double r3355472 = r3355470 / r3355471;
        double r3355473 = r3355470 * r3355472;
        double r3355474 = r3355472 * r3355472;
        double r3355475 = r3355473 + r3355474;
        double r3355476 = r3355472 * r3355470;
        double r3355477 = r3355475 + r3355476;
        double r3355478 = r3355469 * r3355477;
        return r3355478;
}

double f() {
        double r3355479 = 0.4691358024691358;
        return r3355479;
}

2 \cdot \left(\left(1 \cdot \frac{1}{9} + \frac{1}{9} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)
\frac{38}{81}

Error

Target

Original0
Target0
Herbie0
\[\left(\left(\frac{1}{9} \cdot 1\right) \cdot 2 + 2 \cdot \left(\frac{1}{9} \cdot \frac{1}{9}\right)\right) + 2 \cdot \left(1 \cdot \frac{1}{9}\right)\]

Derivation

  1. Initial program 0

    \[2 \cdot \left(\left(1 \cdot \frac{1}{9} + \frac{1}{9} \cdot \frac{1}{9}\right) + \frac{1}{9} \cdot 1\right)\]
  2. Simplified0

    \[\leadsto \color{blue}{\frac{38}{81}}\]
  3. Final simplification0

    \[\leadsto \frac{38}{81}\]

Reproduce

herbie shell --seed 2019102 +o rules:numerics
(FPCore ()
  :name "Rectangular parallelepiped of dimension a×b×c"

  :herbie-target
  (+ (+ (* (* (/ 1 9) 1) 2) (* 2 (* (/ 1 9) (/ 1 9)))) (* 2 (* 1 (/ 1 9))))

  (* 2 (+ (+ (* 1 (/ 1 9)) (* (/ 1 9) (/ 1 9))) (* (/ 1 9) 1))))