Average Error: 0 → 0
Time: 1.7s
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 r6936382 = 2.0;
        double r6936383 = 1.0;
        double r6936384 = 9.0;
        double r6936385 = r6936383 / r6936384;
        double r6936386 = r6936383 * r6936385;
        double r6936387 = r6936385 * r6936385;
        double r6936388 = r6936386 + r6936387;
        double r6936389 = r6936385 * r6936383;
        double r6936390 = r6936388 + r6936389;
        double r6936391 = r6936382 * r6936390;
        return r6936391;
}

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

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