Average Error: 0.0 → 0.0
Time: 32.2s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[\left(x + \left(y \cdot t + \left(-z\right) \cdot t\right)\right) + \left(-x\right) \cdot \left(y - z\right)\]
x + \left(y - z\right) \cdot \left(t - x\right)
\left(x + \left(y \cdot t + \left(-z\right) \cdot t\right)\right) + \left(-x\right) \cdot \left(y - z\right)
double f(double x, double y, double z, double t) {
        double r656482 = x;
        double r656483 = y;
        double r656484 = z;
        double r656485 = r656483 - r656484;
        double r656486 = t;
        double r656487 = r656486 - r656482;
        double r656488 = r656485 * r656487;
        double r656489 = r656482 + r656488;
        return r656489;
}

double f(double x, double y, double z, double t) {
        double r656490 = x;
        double r656491 = y;
        double r656492 = t;
        double r656493 = r656491 * r656492;
        double r656494 = z;
        double r656495 = -r656494;
        double r656496 = r656495 * r656492;
        double r656497 = r656493 + r656496;
        double r656498 = r656490 + r656497;
        double r656499 = -r656490;
        double r656500 = r656491 - r656494;
        double r656501 = r656499 * r656500;
        double r656502 = r656498 + r656501;
        return r656502;
}

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

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

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

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

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

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

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

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