Average Error: 18.0 → 0.0
Time: 18.4s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot \left(-z\right) + x \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot \left(-z\right) + x \cdot y
double f(double x, double y, double z) {
        double r20323301 = x;
        double r20323302 = y;
        double r20323303 = r20323301 * r20323302;
        double r20323304 = z;
        double r20323305 = r20323302 * r20323304;
        double r20323306 = r20323303 - r20323305;
        double r20323307 = r20323302 * r20323302;
        double r20323308 = r20323306 - r20323307;
        double r20323309 = r20323308 + r20323307;
        return r20323309;
}

double f(double x, double y, double z) {
        double r20323310 = y;
        double r20323311 = z;
        double r20323312 = -r20323311;
        double r20323313 = r20323310 * r20323312;
        double r20323314 = x;
        double r20323315 = r20323314 * r20323310;
        double r20323316 = r20323313 + r20323315;
        return r20323316;
}

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

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

Derivation

  1. Initial program 18.0

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  2. Using strategy rm
  3. Applied sub-neg18.0

    \[\leadsto \left(\color{blue}{\left(x \cdot y + \left(-y \cdot z\right)\right)} - y \cdot y\right) + y \cdot y\]
  4. Applied associate--l+18.0

    \[\leadsto \color{blue}{\left(x \cdot y + \left(\left(-y \cdot z\right) - y \cdot y\right)\right)} + y \cdot y\]
  5. Applied associate-+l+13.2

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

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(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)))