Average Error: 0.0 → 0.0
Time: 8.8s
Precision: 64
\[2 \cdot \left(x \cdot x + x \cdot y\right)\]
\[\left(2 \cdot x\right) \cdot \left(y + x\right)\]
2 \cdot \left(x \cdot x + x \cdot y\right)
\left(2 \cdot x\right) \cdot \left(y + x\right)
double f(double x, double y) {
        double r22398637 = 2.0;
        double r22398638 = x;
        double r22398639 = r22398638 * r22398638;
        double r22398640 = y;
        double r22398641 = r22398638 * r22398640;
        double r22398642 = r22398639 + r22398641;
        double r22398643 = r22398637 * r22398642;
        return r22398643;
}

double f(double x, double y) {
        double r22398644 = 2.0;
        double r22398645 = x;
        double r22398646 = r22398644 * r22398645;
        double r22398647 = y;
        double r22398648 = r22398647 + r22398645;
        double r22398649 = r22398646 * r22398648;
        return r22398649;
}

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

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

Reproduce

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