Average Error: 17.7 → 0.0
Time: 31.2s
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 r24963379 = x;
        double r24963380 = y;
        double r24963381 = r24963379 * r24963380;
        double r24963382 = z;
        double r24963383 = r24963380 * r24963382;
        double r24963384 = r24963381 - r24963383;
        double r24963385 = r24963380 * r24963380;
        double r24963386 = r24963384 - r24963385;
        double r24963387 = r24963386 + r24963385;
        return r24963387;
}

double f(double x, double y, double z) {
        double r24963388 = x;
        double r24963389 = z;
        double r24963390 = r24963388 - r24963389;
        double r24963391 = y;
        double r24963392 = r24963390 * r24963391;
        return r24963392;
}

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

Derivation

  1. Initial program 17.7

    \[\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 2019168 +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)))