Average Error: 12.7 → 0.0
Time: 10.2s
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 r305874 = x;
        double r305875 = y;
        double r305876 = r305874 * r305875;
        double r305877 = r305875 * r305875;
        double r305878 = r305876 - r305877;
        double r305879 = r305878 + r305877;
        double r305880 = z;
        double r305881 = r305875 * r305880;
        double r305882 = r305879 - r305881;
        return r305882;
}

double f(double x, double y, double z) {
        double r305883 = z;
        double r305884 = y;
        double r305885 = r305883 * r305884;
        double r305886 = -r305885;
        double r305887 = x;
        double r305888 = r305884 * r305887;
        double r305889 = r305886 + r305888;
        return r305889;
}

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

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

Derivation

  1. Initial program 12.7

    \[\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 2019195 
(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)))