Average Error: 17.3 → 0.0
Time: 6.7s
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 r22509174 = x;
        double r22509175 = y;
        double r22509176 = r22509174 * r22509175;
        double r22509177 = z;
        double r22509178 = r22509175 * r22509177;
        double r22509179 = r22509176 - r22509178;
        double r22509180 = r22509175 * r22509175;
        double r22509181 = r22509179 - r22509180;
        double r22509182 = r22509181 + r22509180;
        return r22509182;
}

double f(double x, double y, double z) {
        double r22509183 = x;
        double r22509184 = z;
        double r22509185 = r22509183 - r22509184;
        double r22509186 = y;
        double r22509187 = r22509185 * r22509186;
        return r22509187;
}

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

Derivation

  1. Initial program 17.3

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

Reproduce

herbie shell --seed 2019163 +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)))