Average Error: 0.3 → 0
Time: 966.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 r6556947 = d;
        double r6556948 = 10.0;
        double r6556949 = r6556947 * r6556948;
        double r6556950 = 20.0;
        double r6556951 = r6556947 * r6556950;
        double r6556952 = r6556949 + r6556951;
        return r6556952;
}

double f(double d) {
        double r6556953 = d;
        double r6556954 = 30.0;
        double r6556955 = r6556953 * r6556954;
        return r6556955;
}

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 2019149 +o rules:numerics
(FPCore (d)
  :name "FastMath test1"

  :herbie-target
  (* d 30)

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