Average Error: 0.3 → 0
Time: 857.0ms
Precision: 64
\[d \cdot 10 + d \cdot 20\]
\[d \cdot 30\]
d \cdot 10 + d \cdot 20
d \cdot 30
double f(double d) {
        double r31097587 = d;
        double r31097588 = 10.0;
        double r31097589 = r31097587 * r31097588;
        double r31097590 = 20.0;
        double r31097591 = r31097587 * r31097590;
        double r31097592 = r31097589 + r31097591;
        return r31097592;
}

double f(double d) {
        double r31097593 = d;
        double r31097594 = 30.0;
        double r31097595 = r31097593 * r31097594;
        return r31097595;
}

Error

Bits error versus d

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0
Herbie0
\[d \cdot 30\]

Derivation

  1. Initial program 0.3

    \[d \cdot 10 + d \cdot 20\]
  2. Simplified0

    \[\leadsto \color{blue}{d \cdot 30}\]
  3. Final simplification0

    \[\leadsto d \cdot 30\]

Reproduce

herbie shell --seed 2019121 +o rules:numerics
(FPCore (d)
  :name "FastMath test1"

  :herbie-target
  (* d 30)

  (+ (* d 10) (* d 20)))