Average Error: 0.3 → 0
Time: 691.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 r6836336 = d;
        double r6836337 = 10.0;
        double r6836338 = r6836336 * r6836337;
        double r6836339 = 20.0;
        double r6836340 = r6836336 * r6836339;
        double r6836341 = r6836338 + r6836340;
        return r6836341;
}

double f(double d) {
        double r6836342 = d;
        double r6836343 = 30.0;
        double r6836344 = r6836342 * r6836343;
        return r6836344;
}

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

  :herbie-target
  (* d 30)

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