Average Error: 17.4 → 0.0
Time: 12.8s
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 r18069097 = x;
        double r18069098 = y;
        double r18069099 = r18069097 * r18069098;
        double r18069100 = r18069098 * r18069098;
        double r18069101 = r18069099 + r18069100;
        double r18069102 = z;
        double r18069103 = r18069098 * r18069102;
        double r18069104 = r18069101 - r18069103;
        double r18069105 = r18069104 - r18069100;
        return r18069105;
}

double f(double x, double y, double z) {
        double r18069106 = x;
        double r18069107 = z;
        double r18069108 = r18069106 - r18069107;
        double r18069109 = y;
        double r18069110 = r18069108 * r18069109;
        return r18069110;
}

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