Average Error: 0.0 → 0.0
Time: 3.6s
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 r704587 = x;
        double r704588 = y;
        double r704589 = z;
        double r704590 = r704588 - r704589;
        double r704591 = t;
        double r704592 = r704591 - r704587;
        double r704593 = r704590 * r704592;
        double r704594 = r704587 + r704593;
        return r704594;
}

double f(double x, double y, double z, double t) {
        double r704595 = x;
        double r704596 = t;
        double r704597 = y;
        double r704598 = z;
        double r704599 = r704597 - r704598;
        double r704600 = r704596 * r704599;
        double r704601 = r704595 + r704600;
        double r704602 = -r704595;
        double r704603 = r704602 * r704599;
        double r704604 = r704601 + r704603;
        return r704604;
}

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 2020024 
(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))))