Average Error: 7.3 → 7.3
Time: 18.9s
Precision: 64
\[\frac{x \cdot y - \left(z \cdot 9.0\right) \cdot t}{a \cdot 2.0}\]
\[\frac{x \cdot y - z \cdot \left(9.0 \cdot t\right)}{a \cdot 2.0}\]
\frac{x \cdot y - \left(z \cdot 9.0\right) \cdot t}{a \cdot 2.0}
\frac{x \cdot y - z \cdot \left(9.0 \cdot t\right)}{a \cdot 2.0}
double f(double x, double y, double z, double t, double a) {
        double r38172564 = x;
        double r38172565 = y;
        double r38172566 = r38172564 * r38172565;
        double r38172567 = z;
        double r38172568 = 9.0;
        double r38172569 = r38172567 * r38172568;
        double r38172570 = t;
        double r38172571 = r38172569 * r38172570;
        double r38172572 = r38172566 - r38172571;
        double r38172573 = a;
        double r38172574 = 2.0;
        double r38172575 = r38172573 * r38172574;
        double r38172576 = r38172572 / r38172575;
        return r38172576;
}

double f(double x, double y, double z, double t, double a) {
        double r38172577 = x;
        double r38172578 = y;
        double r38172579 = r38172577 * r38172578;
        double r38172580 = z;
        double r38172581 = 9.0;
        double r38172582 = t;
        double r38172583 = r38172581 * r38172582;
        double r38172584 = r38172580 * r38172583;
        double r38172585 = r38172579 - r38172584;
        double r38172586 = a;
        double r38172587 = 2.0;
        double r38172588 = r38172586 * r38172587;
        double r38172589 = r38172585 / r38172588;
        return r38172589;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.3
Target5.4
Herbie7.3
\[\begin{array}{l} \mathbf{if}\;a \lt -2.090464557976709 \cdot 10^{+86}:\\ \;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;a \lt 2.144030707833976 \cdot 10^{+99}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9.0 \cdot t\right)}{a \cdot 2.0}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\ \end{array}\]

Derivation

  1. Initial program 7.3

    \[\frac{x \cdot y - \left(z \cdot 9.0\right) \cdot t}{a \cdot 2.0}\]
  2. Using strategy rm
  3. Applied associate-*l*7.3

    \[\leadsto \frac{x \cdot y - \color{blue}{z \cdot \left(9.0 \cdot t\right)}}{a \cdot 2.0}\]
  4. Final simplification7.3

    \[\leadsto \frac{x \cdot y - z \cdot \left(9.0 \cdot t\right)}{a \cdot 2.0}\]

Reproduce

herbie shell --seed 2019164 
(FPCore (x y z t a)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, I"

  :herbie-target
  (if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))

  (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))