Average Error: 17.9 → 0.0
Time: 1.3s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[y \cdot x + y \cdot \left(-z\right)\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
y \cdot x + y \cdot \left(-z\right)
double f(double x, double y, double z) {
        double r508327 = x;
        double r508328 = y;
        double r508329 = r508327 * r508328;
        double r508330 = r508328 * r508328;
        double r508331 = r508329 + r508330;
        double r508332 = z;
        double r508333 = r508328 * r508332;
        double r508334 = r508331 - r508333;
        double r508335 = r508334 - r508330;
        return r508335;
}

double f(double x, double y, double z) {
        double r508336 = y;
        double r508337 = x;
        double r508338 = r508336 * r508337;
        double r508339 = z;
        double r508340 = -r508339;
        double r508341 = r508336 * r508340;
        double r508342 = r508338 + r508341;
        return r508342;
}

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

Derivation

  1. Initial program 17.9

    \[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\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. Final simplification0.0

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

Reproduce

herbie shell --seed 2020046 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, C"
  :precision binary64

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

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