Average Error: 13.3 → 0.0
Time: 2.1s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot \left(x - z\right)\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r597367 = x;
        double r597368 = y;
        double r597369 = r597367 * r597368;
        double r597370 = r597368 * r597368;
        double r597371 = r597369 - r597370;
        double r597372 = r597371 + r597370;
        double r597373 = z;
        double r597374 = r597368 * r597373;
        double r597375 = r597372 - r597374;
        return r597375;
}

double f(double x, double y, double z) {
        double r597376 = y;
        double r597377 = x;
        double r597378 = z;
        double r597379 = r597377 - r597378;
        double r597380 = r597376 * r597379;
        return r597380;
}

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

Derivation

  1. Initial program 13.3

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

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

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, D"
  :precision binary64

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

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