Average Error: 12.7 → 0.0
Time: 21.1s
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 r356299 = x;
        double r356300 = y;
        double r356301 = r356299 * r356300;
        double r356302 = r356300 * r356300;
        double r356303 = r356301 - r356302;
        double r356304 = r356303 + r356302;
        double r356305 = z;
        double r356306 = r356300 * r356305;
        double r356307 = r356304 - r356306;
        return r356307;
}

double f(double x, double y, double z) {
        double r356308 = x;
        double r356309 = z;
        double r356310 = r356308 - r356309;
        double r356311 = y;
        double r356312 = r356310 * r356311;
        return r356312;
}

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

Original12.7
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 12.7

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