Average Error: 0.0 → 0.0
Time: 3.0s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[\left(x + t \cdot \left(y - z\right)\right) + \left(-x\right) \cdot \left(y - z\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
\left(x + t \cdot \left(y - z\right)\right) + \left(-x\right) \cdot \left(y - z\right)
double f(double x, double y, double z, double t) {
        double r878679 = x;
        double r878680 = y;
        double r878681 = z;
        double r878682 = r878680 - r878681;
        double r878683 = t;
        double r878684 = r878683 - r878679;
        double r878685 = r878682 * r878684;
        double r878686 = r878679 + r878685;
        return r878686;
}

double f(double x, double y, double z, double t) {
        double r878687 = x;
        double r878688 = t;
        double r878689 = y;
        double r878690 = z;
        double r878691 = r878689 - r878690;
        double r878692 = r878688 * r878691;
        double r878693 = r878687 + r878692;
        double r878694 = -r878687;
        double r878695 = r878694 * r878691;
        double r878696 = r878693 + r878695;
        return r878696;
}

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 + t \cdot \left(y - z\right)\right) + \left(-x\right) \cdot \left(y - z\right)\]

Reproduce

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