Average Error: 17.4 → 0.0
Time: 22.0s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r317371 = x;
        double r317372 = y;
        double r317373 = r317371 * r317372;
        double r317374 = z;
        double r317375 = r317372 * r317374;
        double r317376 = r317373 - r317375;
        double r317377 = r317372 * r317372;
        double r317378 = r317376 - r317377;
        double r317379 = r317378 + r317377;
        return r317379;
}

double f(double x, double y, double z) {
        double r317380 = x;
        double r317381 = z;
        double r317382 = r317380 - r317381;
        double r317383 = y;
        double r317384 = r317382 * r317383;
        return r317384;
}

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

Derivation

  1. Initial program 17.4

    \[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
  2. Simplified0.0

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

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

Reproduce

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

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

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