Average Error: 12.6 → 0.0
Time: 27.0s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot \left(x - z\right)\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r55286777 = x;
        double r55286778 = y;
        double r55286779 = r55286777 * r55286778;
        double r55286780 = r55286778 * r55286778;
        double r55286781 = r55286779 - r55286780;
        double r55286782 = r55286781 + r55286780;
        double r55286783 = z;
        double r55286784 = r55286778 * r55286783;
        double r55286785 = r55286782 - r55286784;
        return r55286785;
}

double f(double x, double y, double z) {
        double r55286786 = y;
        double r55286787 = x;
        double r55286788 = z;
        double r55286789 = r55286787 - r55286788;
        double r55286790 = r55286786 * r55286789;
        return r55286790;
}

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

Derivation

  1. Initial program 12.6

    \[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
  2. Simplified0.0

    \[\leadsto \color{blue}{y \cdot \left(x - z\right)}\]
  3. Final simplification0.0

    \[\leadsto y \cdot \left(x - z\right)\]

Reproduce

herbie shell --seed 2019173 +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)))