Average Error: 18.0 → 0.0
Time: 40.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r27955796 = x;
        double r27955797 = y;
        double r27955798 = r27955796 * r27955797;
        double r27955799 = z;
        double r27955800 = r27955797 * r27955799;
        double r27955801 = r27955798 - r27955800;
        double r27955802 = r27955797 * r27955797;
        double r27955803 = r27955801 - r27955802;
        double r27955804 = r27955803 + r27955802;
        return r27955804;
}

double f(double x, double y, double z) {
        double r27955805 = x;
        double r27955806 = z;
        double r27955807 = r27955805 - r27955806;
        double r27955808 = y;
        double r27955809 = r27955807 * r27955808;
        return r27955809;
}

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

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

Derivation

  1. Initial program 18.0

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

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

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