Average Error: 17.2 → 0.0
Time: 10.0s
Precision: 64
\[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y\]
\[\left(x - z\right) \cdot y\]
\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\right) - y \cdot y
\left(x - z\right) \cdot y
double f(double x, double y, double z) {
        double r619848 = x;
        double r619849 = y;
        double r619850 = r619848 * r619849;
        double r619851 = r619849 * r619849;
        double r619852 = r619850 + r619851;
        double r619853 = z;
        double r619854 = r619849 * r619853;
        double r619855 = r619852 - r619854;
        double r619856 = r619855 - r619851;
        return r619856;
}

double f(double x, double y, double z) {
        double r619857 = x;
        double r619858 = z;
        double r619859 = r619857 - r619858;
        double r619860 = y;
        double r619861 = r619859 * r619860;
        return r619861;
}

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

Derivation

  1. Initial program 17.2

    \[\left(\left(x \cdot y + y \cdot y\right) - y \cdot z\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 2020047 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, C"
  :precision binary64

  :herbie-target
  (* (- x z) y)

  (- (- (+ (* x y) (* y y)) (* y z)) (* y y)))