Average Error: 17.0 → 0.0
Time: 17.1s
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 r16878223 = x;
        double r16878224 = y;
        double r16878225 = r16878223 * r16878224;
        double r16878226 = z;
        double r16878227 = r16878224 * r16878226;
        double r16878228 = r16878225 - r16878227;
        double r16878229 = r16878224 * r16878224;
        double r16878230 = r16878228 - r16878229;
        double r16878231 = r16878230 + r16878229;
        return r16878231;
}

double f(double x, double y, double z) {
        double r16878232 = x;
        double r16878233 = z;
        double r16878234 = r16878232 - r16878233;
        double r16878235 = y;
        double r16878236 = r16878234 * r16878235;
        return r16878236;
}

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

Derivation

  1. Initial program 17.0

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