Average Error: 0.0 → 0.0
Time: 7.0s
Precision: 64
\[2.0 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(\left(x - y\right) \cdot 2.0\right) \cdot x\]
2.0 \cdot \left(x \cdot x - x \cdot y\right)
\left(\left(x - y\right) \cdot 2.0\right) \cdot x
double f(double x, double y) {
        double r22634069 = 2.0;
        double r22634070 = x;
        double r22634071 = r22634070 * r22634070;
        double r22634072 = y;
        double r22634073 = r22634070 * r22634072;
        double r22634074 = r22634071 - r22634073;
        double r22634075 = r22634069 * r22634074;
        return r22634075;
}

double f(double x, double y) {
        double r22634076 = x;
        double r22634077 = y;
        double r22634078 = r22634076 - r22634077;
        double r22634079 = 2.0;
        double r22634080 = r22634078 * r22634079;
        double r22634081 = r22634080 * r22634076;
        return r22634081;
}

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}{x \cdot \left(\left(x - y\right) \cdot 2.0\right)}\]
  3. Final simplification0.0

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

Reproduce

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

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

  (* 2.0 (- (* x x) (* x y))))