Average Error: 17.7 → 0.0
Time: 2.0s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[y \cdot \left(x - z\right)\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r411212 = x;
        double r411213 = y;
        double r411214 = r411212 * r411213;
        double r411215 = r411213 * r411213;
        double r411216 = r411214 + r411215;
        double r411217 = z;
        double r411218 = r411213 * r411217;
        double r411219 = r411216 - r411218;
        double r411220 = r411219 - r411215;
        return r411220;
}

double f(double x, double y, double z) {
        double r411221 = y;
        double r411222 = x;
        double r411223 = z;
        double r411224 = r411222 - r411223;
        double r411225 = r411221 * r411224;
        return r411225;
}

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

Derivation

  1. Initial program 17.7

    \[\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. Final simplification0.0

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

Reproduce

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