Average Error: 18.0 → 0.0
Time: 13.2s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot x + y \cdot \left(-z\right)\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot x + y \cdot \left(-z\right)
double f(double x, double y, double z) {
        double r621033 = x;
        double r621034 = y;
        double r621035 = r621033 * r621034;
        double r621036 = z;
        double r621037 = r621034 * r621036;
        double r621038 = r621035 - r621037;
        double r621039 = r621034 * r621034;
        double r621040 = r621038 - r621039;
        double r621041 = r621040 + r621039;
        return r621041;
}

double f(double x, double y, double z) {
        double r621042 = y;
        double r621043 = x;
        double r621044 = r621042 * r621043;
        double r621045 = z;
        double r621046 = -r621045;
        double r621047 = r621042 * r621046;
        double r621048 = r621044 + r621047;
        return r621048;
}

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}{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. Final simplification0.0

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

Reproduce

herbie shell --seed 2019350 
(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)))