Average Error: 17.3 → 0.0
Time: 8.3s
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 r27846917 = x;
        double r27846918 = y;
        double r27846919 = r27846917 * r27846918;
        double r27846920 = z;
        double r27846921 = r27846918 * r27846920;
        double r27846922 = r27846919 - r27846921;
        double r27846923 = r27846918 * r27846918;
        double r27846924 = r27846922 - r27846923;
        double r27846925 = r27846924 + r27846923;
        return r27846925;
}

double f(double x, double y, double z) {
        double r27846926 = x;
        double r27846927 = z;
        double r27846928 = r27846926 - r27846927;
        double r27846929 = y;
        double r27846930 = r27846928 * r27846929;
        return r27846930;
}

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