Average Error: 17.0 → 0.0
Time: 20.4s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r22608079 = x;
        double r22608080 = y;
        double r22608081 = r22608079 * r22608080;
        double r22608082 = r22608080 * r22608080;
        double r22608083 = r22608081 + r22608082;
        double r22608084 = z;
        double r22608085 = r22608080 * r22608084;
        double r22608086 = r22608083 - r22608085;
        double r22608087 = r22608086 - r22608082;
        return r22608087;
}

double f(double x, double y, double z) {
        double r22608088 = x;
        double r22608089 = z;
        double r22608090 = r22608088 - r22608089;
        double r22608091 = y;
        double r22608092 = r22608090 * r22608091;
        return r22608092;
}

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

Derivation

  1. Initial program 17.0

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

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

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