Average Error: 17.2 → 0.0
Time: 6.3s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot \left(-z\right) + x \cdot y\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot \left(-z\right) + x \cdot y
double f(double x, double y, double z) {
        double r10510287 = x;
        double r10510288 = y;
        double r10510289 = r10510287 * r10510288;
        double r10510290 = z;
        double r10510291 = r10510288 * r10510290;
        double r10510292 = r10510289 - r10510291;
        double r10510293 = r10510288 * r10510288;
        double r10510294 = r10510292 - r10510293;
        double r10510295 = r10510294 + r10510293;
        return r10510295;
}

double f(double x, double y, double z) {
        double r10510296 = y;
        double r10510297 = z;
        double r10510298 = -r10510297;
        double r10510299 = r10510296 * r10510298;
        double r10510300 = x;
        double r10510301 = r10510300 * r10510296;
        double r10510302 = r10510299 + r10510301;
        return r10510302;
}

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

Derivation

  1. Initial program 17.2

    \[\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-rgt-in0.0

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

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

Reproduce

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