Average Error: 17.4 → 0.0
Time: 9.5s
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 r311324 = x;
        double r311325 = y;
        double r311326 = r311324 * r311325;
        double r311327 = z;
        double r311328 = r311325 * r311327;
        double r311329 = r311326 - r311328;
        double r311330 = r311325 * r311325;
        double r311331 = r311329 - r311330;
        double r311332 = r311331 + r311330;
        return r311332;
}

double f(double x, double y, double z) {
        double r311333 = x;
        double r311334 = z;
        double r311335 = r311333 - r311334;
        double r311336 = y;
        double r311337 = r311335 * r311336;
        return r311337;
}

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}{y \cdot \left(x - z\right)}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019174 +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)))