Average Error: 0.0 → 0.0
Time: 3.9s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[x + \left(\left(y - z\right) \cdot t + \left(y - z\right) \cdot \left(-x\right)\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
x + \left(\left(y - z\right) \cdot t + \left(y - z\right) \cdot \left(-x\right)\right)
double f(double x, double y, double z, double t) {
        double r901395 = x;
        double r901396 = y;
        double r901397 = z;
        double r901398 = r901396 - r901397;
        double r901399 = t;
        double r901400 = r901399 - r901395;
        double r901401 = r901398 * r901400;
        double r901402 = r901395 + r901401;
        return r901402;
}

double f(double x, double y, double z, double t) {
        double r901403 = x;
        double r901404 = y;
        double r901405 = z;
        double r901406 = r901404 - r901405;
        double r901407 = t;
        double r901408 = r901406 * r901407;
        double r901409 = -r901403;
        double r901410 = r901406 * r901409;
        double r901411 = r901408 + r901410;
        double r901412 = r901403 + r901411;
        return r901412;
}

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. Final simplification0.0

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

Reproduce

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