Average Error: 0.0 → 0.0
Time: 17.4s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[\left(\left(x + y \cdot t\right) + \left(-z\right) \cdot t\right) + \left(-x\right) \cdot \left(y - z\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
\left(\left(x + y \cdot t\right) + \left(-z\right) \cdot t\right) + \left(-x\right) \cdot \left(y - z\right)
double f(double x, double y, double z, double t) {
        double r54940064 = x;
        double r54940065 = y;
        double r54940066 = z;
        double r54940067 = r54940065 - r54940066;
        double r54940068 = t;
        double r54940069 = r54940068 - r54940064;
        double r54940070 = r54940067 * r54940069;
        double r54940071 = r54940064 + r54940070;
        return r54940071;
}

double f(double x, double y, double z, double t) {
        double r54940072 = x;
        double r54940073 = y;
        double r54940074 = t;
        double r54940075 = r54940073 * r54940074;
        double r54940076 = r54940072 + r54940075;
        double r54940077 = z;
        double r54940078 = -r54940077;
        double r54940079 = r54940078 * r54940074;
        double r54940080 = r54940076 + r54940079;
        double r54940081 = -r54940072;
        double r54940082 = r54940073 - r54940077;
        double r54940083 = r54940081 * r54940082;
        double r54940084 = r54940080 + r54940083;
        return r54940084;
}

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-rgt-in0.0

    \[\leadsto x + \color{blue}{\left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)}\]
  5. Applied associate-+r+0.0

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

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

    \[\leadsto \left(x + \color{blue}{\left(y \cdot t + \left(-z\right) \cdot t\right)}\right) + \left(-x\right) \cdot \left(y - z\right)\]
  9. Applied associate-+r+0.0

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

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

Reproduce

herbie shell --seed 2019174 
(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))))