Average Error: 0.2 → 0.0
Time: 8.8s
Precision: 64
\[\left(d1 \cdot 10 + d1 \cdot d2\right) + d1 \cdot 20\]
\[\left(\left(d2 + 10\right) + 20\right) \cdot d1\]
\left(d1 \cdot 10 + d1 \cdot d2\right) + d1 \cdot 20
\left(\left(d2 + 10\right) + 20\right) \cdot d1
double f(double d1, double d2) {
        double r168531 = d1;
        double r168532 = 10.0;
        double r168533 = r168531 * r168532;
        double r168534 = d2;
        double r168535 = r168531 * r168534;
        double r168536 = r168533 + r168535;
        double r168537 = 20.0;
        double r168538 = r168531 * r168537;
        double r168539 = r168536 + r168538;
        return r168539;
}

double f(double d1, double d2) {
        double r168540 = d2;
        double r168541 = 10.0;
        double r168542 = r168540 + r168541;
        double r168543 = 20.0;
        double r168544 = r168542 + r168543;
        double r168545 = d1;
        double r168546 = r168544 * r168545;
        return r168546;
}

Error

Bits error versus d1

Bits error versus d2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.2
Target0.0
Herbie0.0
\[d1 \cdot \left(30 + d2\right)\]

Derivation

  1. Initial program 0.2

    \[\left(d1 \cdot 10 + d1 \cdot d2\right) + d1 \cdot 20\]
  2. Simplified0.0

    \[\leadsto \color{blue}{d1 \cdot \left(d2 + \left(10 + 20\right)\right)}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.0

    \[\leadsto \color{blue}{\left(1 \cdot d1\right)} \cdot \left(d2 + \left(10 + 20\right)\right)\]
  5. Applied associate-*l*0.0

    \[\leadsto \color{blue}{1 \cdot \left(d1 \cdot \left(d2 + \left(10 + 20\right)\right)\right)}\]
  6. Simplified0.0

    \[\leadsto 1 \cdot \color{blue}{\left(\left(\left(d2 + 10\right) + 20\right) \cdot d1\right)}\]
  7. Final simplification0.0

    \[\leadsto \left(\left(d2 + 10\right) + 20\right) \cdot d1\]

Reproduce

herbie shell --seed 2019196 
(FPCore (d1 d2)
  :name "FastMath test2"

  :herbie-target
  (* d1 (+ 30.0 d2))

  (+ (+ (* d1 10.0) (* d1 d2)) (* d1 20.0)))