Average Error: 0.0 → 0.0
Time: 3.3s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[x + \left(\left(y - z\right) \cdot t + \left(y - z\right) \cdot \left(-x\right)\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
x + \left(\left(y - z\right) \cdot t + \left(y - z\right) \cdot \left(-x\right)\right)
double f(double x, double y, double z, double t) {
        double r876514 = x;
        double r876515 = y;
        double r876516 = z;
        double r876517 = r876515 - r876516;
        double r876518 = t;
        double r876519 = r876518 - r876514;
        double r876520 = r876517 * r876519;
        double r876521 = r876514 + r876520;
        return r876521;
}

double f(double x, double y, double z, double t) {
        double r876522 = x;
        double r876523 = y;
        double r876524 = z;
        double r876525 = r876523 - r876524;
        double r876526 = t;
        double r876527 = r876525 * r876526;
        double r876528 = -r876522;
        double r876529 = r876525 * r876528;
        double r876530 = r876527 + r876529;
        double r876531 = r876522 + r876530;
        return r876531;
}

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

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

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(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))))