Average Error: 13.0 → 0.0
Time: 5.9s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[\left(-z \cdot y\right) + y \cdot x\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
\left(-z \cdot y\right) + y \cdot x
double f(double x, double y, double z) {
        double r246950 = x;
        double r246951 = y;
        double r246952 = r246950 * r246951;
        double r246953 = r246951 * r246951;
        double r246954 = r246952 - r246953;
        double r246955 = r246954 + r246953;
        double r246956 = z;
        double r246957 = r246951 * r246956;
        double r246958 = r246955 - r246957;
        return r246958;
}

double f(double x, double y, double z) {
        double r246959 = z;
        double r246960 = y;
        double r246961 = r246959 * r246960;
        double r246962 = -r246961;
        double r246963 = x;
        double r246964 = r246960 * r246963;
        double r246965 = r246962 + r246964;
        return r246965;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original13.0
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 13.0

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

    \[\leadsto \color{blue}{y \cdot \left(x - z\right)}\]
  3. Using strategy rm
  4. Applied sub-neg0.0

    \[\leadsto y \cdot \color{blue}{\left(x + \left(-z\right)\right)}\]
  5. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{y \cdot x + y \cdot \left(-z\right)}\]
  6. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019196 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, D"

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

  (- (+ (- (* x y) (* y y)) (* y y)) (* y z)))