Average Error: 0.0 → 0.0
Time: 24.6s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[\left(\left(x + y \cdot t\right) + \left(-z\right) \cdot t\right) + \left(-x\right) \cdot \left(y - z\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
\left(\left(x + y \cdot t\right) + \left(-z\right) \cdot t\right) + \left(-x\right) \cdot \left(y - z\right)
double f(double x, double y, double z, double t) {
        double r954992 = x;
        double r954993 = y;
        double r954994 = z;
        double r954995 = r954993 - r954994;
        double r954996 = t;
        double r954997 = r954996 - r954992;
        double r954998 = r954995 * r954997;
        double r954999 = r954992 + r954998;
        return r954999;
}

double f(double x, double y, double z, double t) {
        double r955000 = x;
        double r955001 = y;
        double r955002 = t;
        double r955003 = r955001 * r955002;
        double r955004 = r955000 + r955003;
        double r955005 = z;
        double r955006 = -r955005;
        double r955007 = r955006 * r955002;
        double r955008 = r955004 + r955007;
        double r955009 = -r955000;
        double r955010 = r955001 - r955005;
        double r955011 = r955009 * r955010;
        double r955012 = r955008 + r955011;
        return r955012;
}

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. Using strategy rm
  7. Applied sub-neg0.0

    \[\leadsto \left(x + t \cdot \color{blue}{\left(y + \left(-z\right)\right)}\right) + \left(-x\right) \cdot \left(y - z\right)\]
  8. Applied distribute-rgt-in0.0

    \[\leadsto \left(x + \color{blue}{\left(y \cdot t + \left(-z\right) \cdot t\right)}\right) + \left(-x\right) \cdot \left(y - z\right)\]
  9. Applied associate-+r+0.0

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

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

Reproduce

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