Average Error: 0.0 → 0.0
Time: 4.6s
Precision: 64
\[2 \cdot \left(x \cdot x - x \cdot y\right)\]
\[\left(x \cdot x - y \cdot x\right) \cdot 2\]
2 \cdot \left(x \cdot x - x \cdot y\right)
\left(x \cdot x - y \cdot x\right) \cdot 2
double f(double x, double y) {
        double r22413127 = 2.0;
        double r22413128 = x;
        double r22413129 = r22413128 * r22413128;
        double r22413130 = y;
        double r22413131 = r22413128 * r22413130;
        double r22413132 = r22413129 - r22413131;
        double r22413133 = r22413127 * r22413132;
        return r22413133;
}

double f(double x, double y) {
        double r22413134 = x;
        double r22413135 = r22413134 * r22413134;
        double r22413136 = y;
        double r22413137 = r22413136 * r22413134;
        double r22413138 = r22413135 - r22413137;
        double r22413139 = 2.0;
        double r22413140 = r22413138 * r22413139;
        return r22413140;
}

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. Final simplification0.0

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

Reproduce

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