Average Error: 17.6 → 0.0
Time: 1.7s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[y \cdot \left(x - z\right)\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r671949 = x;
        double r671950 = y;
        double r671951 = r671949 * r671950;
        double r671952 = z;
        double r671953 = r671950 * r671952;
        double r671954 = r671951 - r671953;
        double r671955 = r671950 * r671950;
        double r671956 = r671954 - r671955;
        double r671957 = r671956 + r671955;
        return r671957;
}

double f(double x, double y, double z) {
        double r671958 = y;
        double r671959 = x;
        double r671960 = z;
        double r671961 = r671959 - r671960;
        double r671962 = r671958 * r671961;
        return r671962;
}

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}{y \cdot \left(x - z\right)}\]
  3. Final simplification0.0

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

Reproduce

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