Average Error: 0.0 → 0.0
Time: 6.0s
Precision: 64
\[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(2.0 \cdot x\right) \cdot \left(y + x\right)\]
2.0 \cdot \left(x \cdot x + x \cdot y\right)
\left(2.0 \cdot x\right) \cdot \left(y + x\right)
double f(double x, double y) {
        double r20690473 = 2.0;
        double r20690474 = x;
        double r20690475 = r20690474 * r20690474;
        double r20690476 = y;
        double r20690477 = r20690474 * r20690476;
        double r20690478 = r20690475 + r20690477;
        double r20690479 = r20690473 * r20690478;
        return r20690479;
}

double f(double x, double y) {
        double r20690480 = 2.0;
        double r20690481 = x;
        double r20690482 = r20690480 * r20690481;
        double r20690483 = y;
        double r20690484 = r20690483 + r20690481;
        double r20690485 = r20690482 * r20690484;
        return r20690485;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[\left(x \cdot 2.0\right) \cdot \left(x + y\right)\]

Derivation

  1. Initial program 0.0

    \[2.0 \cdot \left(x \cdot x + x \cdot y\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\left(x + y\right) \cdot \left(2.0 \cdot x\right)}\]
  3. Final simplification0.0

    \[\leadsto \left(2.0 \cdot x\right) \cdot \left(y + x\right)\]

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y)
  :name "Linear.Matrix:fromQuaternion from linear-1.19.1.3, B"

  :herbie-target
  (* (* x 2.0) (+ x y))

  (* 2.0 (+ (* x x) (* x y))))