Average Error: 0.0 → 0.0
Time: 22.5s
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 r1032008 = x;
        double r1032009 = y;
        double r1032010 = z;
        double r1032011 = r1032009 - r1032010;
        double r1032012 = t;
        double r1032013 = r1032012 - r1032008;
        double r1032014 = r1032011 * r1032013;
        double r1032015 = r1032008 + r1032014;
        return r1032015;
}

double f(double x, double y, double z, double t) {
        double r1032016 = x;
        double r1032017 = y;
        double r1032018 = t;
        double r1032019 = r1032017 * r1032018;
        double r1032020 = z;
        double r1032021 = -r1032020;
        double r1032022 = r1032021 * r1032018;
        double r1032023 = r1032019 + r1032022;
        double r1032024 = r1032016 + r1032023;
        double r1032025 = -r1032016;
        double r1032026 = r1032017 - r1032020;
        double r1032027 = r1032025 * r1032026;
        double r1032028 = r1032024 + r1032027;
        return r1032028;
}

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 2020042 
(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))))