Average Error: 0.0 → 0.0
Time: 10.3s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[\left(\left(t - x\right) \cdot \left(-z\right) + \left(t - x\right) \cdot y\right) + x\]
x + \left(y - z\right) \cdot \left(t - x\right)
\left(\left(t - x\right) \cdot \left(-z\right) + \left(t - x\right) \cdot y\right) + x
double f(double x, double y, double z, double t) {
        double r546406 = x;
        double r546407 = y;
        double r546408 = z;
        double r546409 = r546407 - r546408;
        double r546410 = t;
        double r546411 = r546410 - r546406;
        double r546412 = r546409 * r546411;
        double r546413 = r546406 + r546412;
        return r546413;
}

double f(double x, double y, double z, double t) {
        double r546414 = t;
        double r546415 = x;
        double r546416 = r546414 - r546415;
        double r546417 = z;
        double r546418 = -r546417;
        double r546419 = r546416 * r546418;
        double r546420 = y;
        double r546421 = r546416 * r546420;
        double r546422 = r546419 + r546421;
        double r546423 = r546422 + r546415;
        return r546423;
}

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 *-commutative0.0

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

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

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

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

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

Reproduce

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