Average Error: 0.0 → 0.0
Time: 12.1s
Precision: 64
\[x + \left(y - z\right) \cdot \left(t - x\right)\]
\[\left(\left(z \cdot x + \left(-x\right) \cdot y\right) + \left(t \cdot y + \left(-t\right) \cdot z\right)\right) + x\]
x + \left(y - z\right) \cdot \left(t - x\right)
\left(\left(z \cdot x + \left(-x\right) \cdot y\right) + \left(t \cdot y + \left(-t\right) \cdot z\right)\right) + x
double f(double x, double y, double z, double t) {
        double r40090771 = x;
        double r40090772 = y;
        double r40090773 = z;
        double r40090774 = r40090772 - r40090773;
        double r40090775 = t;
        double r40090776 = r40090775 - r40090771;
        double r40090777 = r40090774 * r40090776;
        double r40090778 = r40090771 + r40090777;
        return r40090778;
}

double f(double x, double y, double z, double t) {
        double r40090779 = z;
        double r40090780 = x;
        double r40090781 = r40090779 * r40090780;
        double r40090782 = -r40090780;
        double r40090783 = y;
        double r40090784 = r40090782 * r40090783;
        double r40090785 = r40090781 + r40090784;
        double r40090786 = t;
        double r40090787 = r40090786 * r40090783;
        double r40090788 = -r40090786;
        double r40090789 = r40090788 * r40090779;
        double r40090790 = r40090787 + r40090789;
        double r40090791 = r40090785 + r40090790;
        double r40090792 = r40090791 + r40090780;
        return r40090792;
}

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. Using strategy rm
  6. Applied sub-neg0.0

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

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

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

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

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

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

Reproduce

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