Average Error: 17.5 → 0.0
Time: 12.3s
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 r22257375 = x;
        double r22257376 = y;
        double r22257377 = r22257375 * r22257376;
        double r22257378 = z;
        double r22257379 = r22257376 * r22257378;
        double r22257380 = r22257377 - r22257379;
        double r22257381 = r22257376 * r22257376;
        double r22257382 = r22257380 - r22257381;
        double r22257383 = r22257382 + r22257381;
        return r22257383;
}

double f(double x, double y, double z) {
        double r22257384 = x;
        double r22257385 = z;
        double r22257386 = r22257384 - r22257385;
        double r22257387 = y;
        double r22257388 = r22257386 * r22257387;
        return r22257388;
}

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

Derivation

  1. Initial program 17.5

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

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

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

Reproduce

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

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

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