Average Error: 17.6 → 0.0
Time: 23.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 r353340 = x;
        double r353341 = y;
        double r353342 = r353340 * r353341;
        double r353343 = z;
        double r353344 = r353341 * r353343;
        double r353345 = r353342 - r353344;
        double r353346 = r353341 * r353341;
        double r353347 = r353345 - r353346;
        double r353348 = r353347 + r353346;
        return r353348;
}

double f(double x, double y, double z) {
        double r353349 = x;
        double r353350 = z;
        double r353351 = r353349 - r353350;
        double r353352 = y;
        double r353353 = r353351 * r353352;
        return r353353;
}

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

Derivation

  1. Initial program 17.6

    \[\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 2019322 +o rules:numerics
(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)))