Average Error: 0.0 → 0.0
Time: 3.5s
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(y - z\right) \cdot \left(-x\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(y - z\right) \cdot \left(-x\right)
double f(double x, double y, double z, double t) {
        double r780212 = x;
        double r780213 = y;
        double r780214 = z;
        double r780215 = r780213 - r780214;
        double r780216 = t;
        double r780217 = r780216 - r780212;
        double r780218 = r780215 * r780217;
        double r780219 = r780212 + r780218;
        return r780219;
}

double f(double x, double y, double z, double t) {
        double r780220 = x;
        double r780221 = y;
        double r780222 = t;
        double r780223 = r780221 * r780222;
        double r780224 = r780220 + r780223;
        double r780225 = z;
        double r780226 = -r780225;
        double r780227 = r780226 * r780222;
        double r780228 = r780224 + r780227;
        double r780229 = r780221 - r780225;
        double r780230 = -r780220;
        double r780231 = r780229 * r780230;
        double r780232 = r780228 + r780231;
        return r780232;
}

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. Applied associate-+r+0.0

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

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

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

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

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

    \[\leadsto \left(\left(x + y \cdot t\right) + \left(-z\right) \cdot t\right) + \left(y - z\right) \cdot \left(-x\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))))