Average Error: 0.0 → 0.0
Time: 35.1s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[\left(x + \left(y - z\right) \cdot t\right) + \left(-x\right) \cdot \left(y - z\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
\left(x + \left(y - z\right) \cdot t\right) + \left(-x\right) \cdot \left(y - z\right)
double f(double x, double y, double z, double t) {
        double r512938 = x;
        double r512939 = y;
        double r512940 = z;
        double r512941 = r512939 - r512940;
        double r512942 = t;
        double r512943 = r512942 - r512938;
        double r512944 = r512941 * r512943;
        double r512945 = r512938 + r512944;
        return r512945;
}

double f(double x, double y, double z, double t) {
        double r512946 = x;
        double r512947 = y;
        double r512948 = z;
        double r512949 = r512947 - r512948;
        double r512950 = t;
        double r512951 = r512949 * r512950;
        double r512952 = r512946 + r512951;
        double r512953 = -r512946;
        double r512954 = r512953 * r512949;
        double r512955 = r512952 + r512954;
        return r512955;
}

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. Simplified0.0

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

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

Reproduce

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

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

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