Average Error: 12.3 → 0.0
Time: 10.2s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot \left(-z\right) + x \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot \left(-z\right) + x \cdot y
double f(double x, double y, double z) {
        double r27563178 = x;
        double r27563179 = y;
        double r27563180 = r27563178 * r27563179;
        double r27563181 = r27563179 * r27563179;
        double r27563182 = r27563180 - r27563181;
        double r27563183 = r27563182 + r27563181;
        double r27563184 = z;
        double r27563185 = r27563179 * r27563184;
        double r27563186 = r27563183 - r27563185;
        return r27563186;
}

double f(double x, double y, double z) {
        double r27563187 = y;
        double r27563188 = z;
        double r27563189 = -r27563188;
        double r27563190 = r27563187 * r27563189;
        double r27563191 = x;
        double r27563192 = r27563191 * r27563187;
        double r27563193 = r27563190 + r27563192;
        return r27563193;
}

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.3
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 12.3

    \[\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-rgt-in0.0

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

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

Reproduce

herbie shell --seed 2019164 
(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)))