Average Error: 17.1 → 0.0
Time: 18.3s
Precision: 64
\[\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y\]
\[\left(-z\right) \cdot y + y \cdot x\]
\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\left(-z\right) \cdot y + y \cdot x
double f(double x, double y, double z) {
        double r19007769 = x;
        double r19007770 = y;
        double r19007771 = r19007769 * r19007770;
        double r19007772 = z;
        double r19007773 = r19007770 * r19007772;
        double r19007774 = r19007771 - r19007773;
        double r19007775 = r19007770 * r19007770;
        double r19007776 = r19007774 - r19007775;
        double r19007777 = r19007776 + r19007775;
        return r19007777;
}

double f(double x, double y, double z) {
        double r19007778 = z;
        double r19007779 = -r19007778;
        double r19007780 = y;
        double r19007781 = r19007779 * r19007780;
        double r19007782 = x;
        double r19007783 = r19007780 * r19007782;
        double r19007784 = r19007781 + r19007783;
        return r19007784;
}

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

Derivation

  1. Initial program 17.1

    \[\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. Using strategy rm
  4. Applied sub-neg0.0

    \[\leadsto y \cdot \color{blue}{\left(x + \left(-z\right)\right)}\]
  5. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{y \cdot x + y \cdot \left(-z\right)}\]
  6. Final simplification0.0

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

Reproduce

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