Average Error: 0.0 → 0.0
Time: 7.6s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x \cdot 2\right) \cdot \left(x - y\right)\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(x \cdot 2\right) \cdot \left(x - y\right)
double f(double x, double y) {
        double r675531 = 2.0;
        double r675532 = x;
        double r675533 = r675532 * r675532;
        double r675534 = y;
        double r675535 = r675532 * r675534;
        double r675536 = r675533 - r675535;
        double r675537 = r675531 * r675536;
        return r675537;
}

double f(double x, double y) {
        double r675538 = x;
        double r675539 = 2.0;
        double r675540 = r675538 * r675539;
        double r675541 = y;
        double r675542 = r675538 - r675541;
        double r675543 = r675540 * r675542;
        return r675543;
}

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\right) \cdot \left(x - y\right)\]

Derivation

  1. Initial program 0.0

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

    \[\leadsto \color{blue}{\left(x \cdot \left(x - y\right)\right) \cdot 2}\]
  3. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{2 \cdot {x}^{2} - 2 \cdot \left(x \cdot y\right)}\]
  4. Simplified0.0

    \[\leadsto \color{blue}{\left(x \cdot 2\right) \cdot \left(x - y\right)}\]
  5. Final simplification0.0

    \[\leadsto \left(x \cdot 2\right) \cdot \left(x - y\right)\]

Reproduce

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

  :herbie-target
  (* (* x 2) (- x y))

  (* 2 (- (* x x) (* x y))))