Average Error: 0.2 → 0.0
Time: 7.6s
Precision: 64
\[\left(d1 \cdot 10 + d1 \cdot d2\right) + d1 \cdot 20\]
\[d1 \cdot d2 + 30 \cdot d1\]
\left(d1 \cdot 10 + d1 \cdot d2\right) + d1 \cdot 20
d1 \cdot d2 + 30 \cdot d1
double f(double d1, double d2) {
        double r56263995 = d1;
        double r56263996 = 10.0;
        double r56263997 = r56263995 * r56263996;
        double r56263998 = d2;
        double r56263999 = r56263995 * r56263998;
        double r56264000 = r56263997 + r56263999;
        double r56264001 = 20.0;
        double r56264002 = r56263995 * r56264001;
        double r56264003 = r56264000 + r56264002;
        return r56264003;
}

double f(double d1, double d2) {
        double r56264004 = d1;
        double r56264005 = d2;
        double r56264006 = r56264004 * r56264005;
        double r56264007 = 30.0;
        double r56264008 = r56264007 * r56264004;
        double r56264009 = r56264006 + r56264008;
        return r56264009;
}

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 + 30\right)}\]
  3. Using strategy rm
  4. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{d1 \cdot d2 + d1 \cdot 30}\]
  5. Final simplification0.0

    \[\leadsto d1 \cdot d2 + 30 \cdot d1\]

Reproduce

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

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

  (+ (+ (* d1 10) (* d1 d2)) (* d1 20)))