Average Error: 12.9 → 0.0
Time: 18.2s
Precision: 64
\[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
\[y \cdot x - y \cdot z\]
\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z
y \cdot x - y \cdot z
double f(double x, double y, double z) {
        double r343853 = x;
        double r343854 = y;
        double r343855 = r343853 * r343854;
        double r343856 = r343854 * r343854;
        double r343857 = r343855 - r343856;
        double r343858 = r343857 + r343856;
        double r343859 = z;
        double r343860 = r343854 * r343859;
        double r343861 = r343858 - r343860;
        return r343861;
}

double f(double x, double y, double z) {
        double r343862 = y;
        double r343863 = x;
        double r343864 = r343862 * r343863;
        double r343865 = z;
        double r343866 = r343862 * r343865;
        double r343867 = r343864 - r343866;
        return r343867;
}

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

Original12.9
Target0.0
Herbie0.0
\[\left(x - z\right) \cdot y\]

Derivation

  1. Initial program 12.9

    \[\left(\left(x \cdot y - y \cdot y\right) + y \cdot y\right) - y \cdot z\]
  2. Using strategy rm
  3. Applied distribute-rgt-out--13.0

    \[\leadsto \left(\color{blue}{y \cdot \left(x - y\right)} + y \cdot y\right) - y \cdot z\]
  4. Applied distribute-lft-out8.8

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

    \[\leadsto y \cdot \color{blue}{x} - y \cdot z\]
  6. Final simplification0.0

    \[\leadsto y \cdot x - y \cdot z\]

Reproduce

herbie shell --seed 2019326 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, D"
  :precision binary64

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

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