Average Error: 7.7 → 7.6
Time: 3.2s
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 r708602 = x;
        double r708603 = y;
        double r708604 = r708602 * r708603;
        double r708605 = z;
        double r708606 = 9.0;
        double r708607 = r708605 * r708606;
        double r708608 = t;
        double r708609 = r708607 * r708608;
        double r708610 = r708604 - r708609;
        double r708611 = a;
        double r708612 = 2.0;
        double r708613 = r708611 * r708612;
        double r708614 = r708610 / r708613;
        return r708614;
}

double f(double x, double y, double z, double t, double a) {
        double r708615 = x;
        double r708616 = y;
        double r708617 = r708615 * r708616;
        double r708618 = 9.0;
        double r708619 = t;
        double r708620 = z;
        double r708621 = r708619 * r708620;
        double r708622 = r708618 * r708621;
        double r708623 = r708617 - r708622;
        double r708624 = a;
        double r708625 = 2.0;
        double r708626 = r708624 * r708625;
        double r708627 = r708623 / r708626;
        return r708627;
}

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.7
Target5.6
Herbie7.6
\[\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.14403070783397609 \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.7

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

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

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

Reproduce

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