Average Error: 0.0 → 0.0
Time: 14.4s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[2 \cdot \left(x \cdot \left(x - y\right)\right)\]
2 \cdot \left(x \cdot x - x \cdot y\right)
2 \cdot \left(x \cdot \left(x - y\right)\right)
double f(double x, double y) {
        double r25755965 = 2.0;
        double r25755966 = x;
        double r25755967 = r25755966 * r25755966;
        double r25755968 = y;
        double r25755969 = r25755966 * r25755968;
        double r25755970 = r25755967 - r25755969;
        double r25755971 = r25755965 * r25755970;
        return r25755971;
}

double f(double x, double y) {
        double r25755972 = 2.0;
        double r25755973 = x;
        double r25755974 = y;
        double r25755975 = r25755973 - r25755974;
        double r25755976 = r25755973 * r25755975;
        double r25755977 = r25755972 * r25755976;
        return r25755977;
}

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

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

Reproduce

herbie shell --seed 2019200 +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))))