Average Error: 17.7 → 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 \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 r490369 = x;
        double r490370 = y;
        double r490371 = r490369 * r490370;
        double r490372 = r490370 * r490370;
        double r490373 = r490371 + r490372;
        double r490374 = z;
        double r490375 = r490370 * r490374;
        double r490376 = r490373 - r490375;
        double r490377 = r490376 - r490372;
        return r490377;
}

double f(double x, double y, double z) {
        double r490378 = y;
        double r490379 = x;
        double r490380 = z;
        double r490381 = r490379 - r490380;
        double r490382 = r490378 * r490381;
        return r490382;
}

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 2019353 
(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)))