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 r4063082 = 2.0;
        double r4063083 = 1.0;
        double r4063084 = 9.0;
        double r4063085 = r4063083 / r4063084;
        double r4063086 = r4063083 * r4063085;
        double r4063087 = r4063085 * r4063085;
        double r4063088 = r4063086 + r4063087;
        double r4063089 = r4063085 * r4063083;
        double r4063090 = r4063088 + r4063089;
        double r4063091 = r4063082 * r4063090;
        return r4063091;
}

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

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 
(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))))