Average Error: 17.2 → 0.0
Time: 8.8s
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 r8582999 = x;
        double r8583000 = y;
        double r8583001 = r8582999 * r8583000;
        double r8583002 = z;
        double r8583003 = r8583000 * r8583002;
        double r8583004 = r8583001 - r8583003;
        double r8583005 = r8583000 * r8583000;
        double r8583006 = r8583004 - r8583005;
        double r8583007 = r8583006 + r8583005;
        return r8583007;
}

double f(double x, double y, double z) {
        double r8583008 = x;
        double r8583009 = z;
        double r8583010 = r8583008 - r8583009;
        double r8583011 = y;
        double r8583012 = r8583010 * r8583011;
        return r8583012;
}

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

Derivation

  1. Initial program 17.2

    \[\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 2019156 +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)))