Average Error: 13.4 → 0.0
Time: 5.6s
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 r1002121 = x;
        double r1002122 = y;
        double r1002123 = r1002121 * r1002122;
        double r1002124 = r1002122 * r1002122;
        double r1002125 = r1002123 - r1002124;
        double r1002126 = r1002125 + r1002124;
        double r1002127 = z;
        double r1002128 = r1002122 * r1002127;
        double r1002129 = r1002126 - r1002128;
        return r1002129;
}

double f(double x, double y, double z) {
        double r1002130 = z;
        double r1002131 = y;
        double r1002132 = r1002130 * r1002131;
        double r1002133 = -r1002132;
        double r1002134 = x;
        double r1002135 = r1002131 * r1002134;
        double r1002136 = r1002133 + r1002135;
        return r1002136;
}

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

Derivation

  1. Initial program 13.4

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