Average Error: 12.8 → 0.0
Time: 12.5s
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 r31962 = x;
        double r31963 = y;
        double r31964 = r31962 * r31963;
        double r31965 = r31963 * r31963;
        double r31966 = r31964 - r31965;
        double r31967 = r31966 + r31965;
        double r31968 = z;
        double r31969 = r31963 * r31968;
        double r31970 = r31967 - r31969;
        return r31970;
}

double f(double x, double y, double z) {
        double r31971 = x;
        double r31972 = z;
        double r31973 = r31971 - r31972;
        double r31974 = y;
        double r31975 = r31973 * r31974;
        return r31975;
}

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

Derivation

  1. Initial program 12.8

    \[\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 2019315 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, D"
  :precision binary64

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

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