Average Error: 17.4 → 0.0
Time: 5.8s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot \left(x - z\right)\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r444945 = x;
        double r444946 = y;
        double r444947 = r444945 * r444946;
        double r444948 = z;
        double r444949 = r444946 * r444948;
        double r444950 = r444947 - r444949;
        double r444951 = r444946 * r444946;
        double r444952 = r444950 - r444951;
        double r444953 = r444952 + r444951;
        return r444953;
}

double f(double x, double y, double z) {
        double r444954 = y;
        double r444955 = x;
        double r444956 = z;
        double r444957 = r444955 - r444956;
        double r444958 = r444954 * r444957;
        return r444958;
}

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 z\right) - y \cdot y\right) + y \cdot y\]
  2. Simplified0.0

    \[\leadsto \color{blue}{y \cdot \left(x - z\right)}\]
  3. Using strategy rm
  4. Applied sub-neg0.0

    \[\leadsto y \cdot \color{blue}{\left(x + \left(-z\right)\right)}\]
  5. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{y \cdot x + y \cdot \left(-z\right)}\]
  6. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019291 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"
  :precision binary64

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

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