Average Error: 0.0 → 0.0
Time: 14.0s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[\left(-x\right) \cdot \left(y - z\right) + \left(t \cdot \left(y - z\right) + x\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
\left(-x\right) \cdot \left(y - z\right) + \left(t \cdot \left(y - z\right) + x\right)
double f(double x, double y, double z, double t) {
        double r40677794 = x;
        double r40677795 = y;
        double r40677796 = z;
        double r40677797 = r40677795 - r40677796;
        double r40677798 = t;
        double r40677799 = r40677798 - r40677794;
        double r40677800 = r40677797 * r40677799;
        double r40677801 = r40677794 + r40677800;
        return r40677801;
}

double f(double x, double y, double z, double t) {
        double r40677802 = x;
        double r40677803 = -r40677802;
        double r40677804 = y;
        double r40677805 = z;
        double r40677806 = r40677804 - r40677805;
        double r40677807 = r40677803 * r40677806;
        double r40677808 = t;
        double r40677809 = r40677808 * r40677806;
        double r40677810 = r40677809 + r40677802;
        double r40677811 = r40677807 + r40677810;
        return r40677811;
}

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. Final simplification0.0

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

Reproduce

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