Average Error: 0.0 → 0.0
Time: 13.0s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[x + \left(\left(y \cdot t + \left(-z \cdot t\right)\right) + \left(-x\right) \cdot \left(y - z\right)\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
x + \left(\left(y \cdot t + \left(-z \cdot t\right)\right) + \left(-x\right) \cdot \left(y - z\right)\right)
double f(double x, double y, double z, double t) {
        double r567985 = x;
        double r567986 = y;
        double r567987 = z;
        double r567988 = r567986 - r567987;
        double r567989 = t;
        double r567990 = r567989 - r567985;
        double r567991 = r567988 * r567990;
        double r567992 = r567985 + r567991;
        return r567992;
}

double f(double x, double y, double z, double t) {
        double r567993 = x;
        double r567994 = y;
        double r567995 = t;
        double r567996 = r567994 * r567995;
        double r567997 = z;
        double r567998 = r567997 * r567995;
        double r567999 = -r567998;
        double r568000 = r567996 + r567999;
        double r568001 = -r567993;
        double r568002 = r567994 - r567997;
        double r568003 = r568001 * r568002;
        double r568004 = r568000 + r568003;
        double r568005 = r567993 + r568004;
        return r568005;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)\]

Derivation

  1. Initial program 0.0

    \[x + \left(y - z\right) \cdot \left(t - x\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

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

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

    \[\leadsto x + \left(\color{blue}{t \cdot \left(y - z\right)} + \left(y - z\right) \cdot \left(-x\right)\right)\]
  6. Using strategy rm
  7. Applied sub-neg0.0

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

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

    \[\leadsto x + \left(\left(t \cdot y + \color{blue}{\left(-t\right) \cdot z}\right) + \left(y - z\right) \cdot \left(-x\right)\right)\]
  10. Final simplification0.0

    \[\leadsto x + \left(\left(y \cdot t + \left(-z \cdot t\right)\right) + \left(-x\right) \cdot \left(y - z\right)\right)\]

Reproduce

herbie shell --seed 2019194 
(FPCore (x y z t)
  :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"

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

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