Average Error: 0.0 → 0.0
Time: 11.8s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[x + \left(\left(x \cdot \left(z - y\right) - t \cdot z\right) + y \cdot t\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
x + \left(\left(x \cdot \left(z - y\right) - t \cdot z\right) + y \cdot t\right)
double f(double x, double y, double z, double t) {
        double r518969 = x;
        double r518970 = y;
        double r518971 = z;
        double r518972 = r518970 - r518971;
        double r518973 = t;
        double r518974 = r518973 - r518969;
        double r518975 = r518972 * r518974;
        double r518976 = r518969 + r518975;
        return r518976;
}

double f(double x, double y, double z, double t) {
        double r518977 = x;
        double r518978 = z;
        double r518979 = y;
        double r518980 = r518978 - r518979;
        double r518981 = r518977 * r518980;
        double r518982 = t;
        double r518983 = r518982 * r518978;
        double r518984 = r518981 - r518983;
        double r518985 = r518979 * r518982;
        double r518986 = r518984 + r518985;
        double r518987 = r518977 + r518986;
        return r518987;
}

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

    \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(t - x\right) + x}\]
  3. Using strategy rm
  4. Applied sub-neg0.0

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

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

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

    \[\leadsto \left(t \cdot \left(y - z\right) + \color{blue}{\left(-x\right) \cdot \left(y - z\right)}\right) + x\]
  8. Using strategy rm
  9. Applied sub-neg0.0

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

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

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

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

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

Reproduce

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

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

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