Average Error: 13.1 → 0.0
Time: 15.7s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r21233069 = x;
        double r21233070 = y;
        double r21233071 = r21233069 * r21233070;
        double r21233072 = r21233070 * r21233070;
        double r21233073 = r21233071 - r21233072;
        double r21233074 = r21233073 + r21233072;
        double r21233075 = z;
        double r21233076 = r21233070 * r21233075;
        double r21233077 = r21233074 - r21233076;
        return r21233077;
}

double f(double x, double y, double z) {
        double r21233078 = x;
        double r21233079 = z;
        double r21233080 = r21233078 - r21233079;
        double r21233081 = y;
        double r21233082 = r21233080 * r21233081;
        return r21233082;
}

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

Derivation

  1. Initial program 13.1

    \[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
  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 2019168 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, D"

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

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