Average Error: 17.4 → 0.0
Time: 8.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(-z \cdot y\right) + y \cdot x\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(-z \cdot y\right) + y \cdot x
double f(double x, double y, double z) {
        double r406059 = x;
        double r406060 = y;
        double r406061 = r406059 * r406060;
        double r406062 = z;
        double r406063 = r406060 * r406062;
        double r406064 = r406061 - r406063;
        double r406065 = r406060 * r406060;
        double r406066 = r406064 - r406065;
        double r406067 = r406066 + r406065;
        return r406067;
}

double f(double x, double y, double z) {
        double r406068 = z;
        double r406069 = y;
        double r406070 = r406068 * r406069;
        double r406071 = -r406070;
        double r406072 = x;
        double r406073 = r406069 * r406072;
        double r406074 = r406071 + r406073;
        return r406074;
}

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

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

Derivation

  1. Initial program 17.4

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  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, B"

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

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