Average Error: 0.0 → 0.0
Time: 14.0s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[\left(z \cdot x + \left(y \cdot t + \left(-\left(t \cdot z + x \cdot y\right)\right)\right)\right) + x\]
x + \left(y - z\right) \cdot \left(t - x\right)
\left(z \cdot x + \left(y \cdot t + \left(-\left(t \cdot z + x \cdot y\right)\right)\right)\right) + x
double f(double x, double y, double z, double t) {
        double r782078 = x;
        double r782079 = y;
        double r782080 = z;
        double r782081 = r782079 - r782080;
        double r782082 = t;
        double r782083 = r782082 - r782078;
        double r782084 = r782081 * r782083;
        double r782085 = r782078 + r782084;
        return r782085;
}

double f(double x, double y, double z, double t) {
        double r782086 = z;
        double r782087 = x;
        double r782088 = r782086 * r782087;
        double r782089 = y;
        double r782090 = t;
        double r782091 = r782089 * r782090;
        double r782092 = r782090 * r782086;
        double r782093 = r782087 * r782089;
        double r782094 = r782092 + r782093;
        double r782095 = -r782094;
        double r782096 = r782091 + r782095;
        double r782097 = r782088 + r782096;
        double r782098 = r782097 + r782087;
        return r782098;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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