Average Error: 7.8 → 7.8
Time: 3.5s
Precision: 64
\[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\]
\[\frac{x \cdot y - 9 \cdot \left(t \cdot z\right)}{a \cdot 2}\]
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\frac{x \cdot y - 9 \cdot \left(t \cdot z\right)}{a \cdot 2}
double f(double x, double y, double z, double t, double a) {
        double r743607 = x;
        double r743608 = y;
        double r743609 = r743607 * r743608;
        double r743610 = z;
        double r743611 = 9.0;
        double r743612 = r743610 * r743611;
        double r743613 = t;
        double r743614 = r743612 * r743613;
        double r743615 = r743609 - r743614;
        double r743616 = a;
        double r743617 = 2.0;
        double r743618 = r743616 * r743617;
        double r743619 = r743615 / r743618;
        return r743619;
}

double f(double x, double y, double z, double t, double a) {
        double r743620 = x;
        double r743621 = y;
        double r743622 = r743620 * r743621;
        double r743623 = 9.0;
        double r743624 = t;
        double r743625 = z;
        double r743626 = r743624 * r743625;
        double r743627 = r743623 * r743626;
        double r743628 = r743622 - r743627;
        double r743629 = a;
        double r743630 = 2.0;
        double r743631 = r743629 * r743630;
        double r743632 = r743628 / r743631;
        return r743632;
}

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.8
Target5.4
Herbie7.8
\[\begin{array}{l} \mathbf{if}\;a \lt -2.090464557976709043451944897028999329376 \cdot 10^{86}:\\ \;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\ \mathbf{elif}\;a \lt 2.144030707833976090627817222818061808815 \cdot 10^{99}:\\ \;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\ \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.8

    \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\]
  2. Taylor expanded around inf 7.8

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

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

Reproduce

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

  :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 t))) (* a 2)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))

  (/ (- (* x y) (* (* z 9) t)) (* a 2)))