Average Error: 0.0 → 0.0
Time: 10.2s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[\left(x \cdot \left(\left(1 - y\right) + z\right) - z \cdot t\right) + y \cdot t\]
x + \left(y - z\right) \cdot \left(t - x\right)
\left(x \cdot \left(\left(1 - y\right) + z\right) - z \cdot t\right) + y \cdot t
double f(double x, double y, double z, double t) {
        double r663069 = x;
        double r663070 = y;
        double r663071 = z;
        double r663072 = r663070 - r663071;
        double r663073 = t;
        double r663074 = r663073 - r663069;
        double r663075 = r663072 * r663074;
        double r663076 = r663069 + r663075;
        return r663076;
}

double f(double x, double y, double z, double t) {
        double r663077 = x;
        double r663078 = 1.0;
        double r663079 = y;
        double r663080 = r663078 - r663079;
        double r663081 = z;
        double r663082 = r663080 + r663081;
        double r663083 = r663077 * r663082;
        double r663084 = t;
        double r663085 = r663081 * r663084;
        double r663086 = r663083 - r663085;
        double r663087 = r663079 * r663084;
        double r663088 = r663086 + r663087;
        return r663088;
}

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-rgt-in0.0

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

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

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

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

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

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

    \[\leadsto y \cdot t + \color{blue}{\left(\left(x - \left(y - z\right) \cdot x\right) - t \cdot z\right)}\]
  13. Using strategy rm
  14. Applied *-un-lft-identity0.0

    \[\leadsto y \cdot t + \left(\left(\color{blue}{1 \cdot x} - \left(y - z\right) \cdot x\right) - t \cdot z\right)\]
  15. Applied distribute-rgt-out--0.0

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

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

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

Reproduce

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