Average Error: 17.8 → 0.0
Time: 11.8s
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 r405850 = x;
        double r405851 = y;
        double r405852 = r405850 * r405851;
        double r405853 = z;
        double r405854 = r405851 * r405853;
        double r405855 = r405852 - r405854;
        double r405856 = r405851 * r405851;
        double r405857 = r405855 - r405856;
        double r405858 = r405857 + r405856;
        return r405858;
}

double f(double x, double y, double z) {
        double r405859 = x;
        double r405860 = z;
        double r405861 = r405859 - r405860;
        double r405862 = y;
        double r405863 = r405861 * r405862;
        return r405863;
}

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

Derivation

  1. Initial program 17.8

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