Average Error: 17.8 → 0.0
Time: 33.6s
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 r334818 = x;
        double r334819 = y;
        double r334820 = r334818 * r334819;
        double r334821 = r334819 * r334819;
        double r334822 = r334820 + r334821;
        double r334823 = z;
        double r334824 = r334819 * r334823;
        double r334825 = r334822 - r334824;
        double r334826 = r334825 - r334821;
        return r334826;
}

double f(double x, double y, double z) {
        double r334827 = x;
        double r334828 = z;
        double r334829 = r334827 - r334828;
        double r334830 = y;
        double r334831 = r334829 * r334830;
        return r334831;
}

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 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 2019199 +o rules:numerics
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, C"

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

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