Average Error: 7.8 → 7.7
Time: 4.3s
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 r676598 = x;
        double r676599 = y;
        double r676600 = r676598 * r676599;
        double r676601 = z;
        double r676602 = 9.0;
        double r676603 = r676601 * r676602;
        double r676604 = t;
        double r676605 = r676603 * r676604;
        double r676606 = r676600 - r676605;
        double r676607 = a;
        double r676608 = 2.0;
        double r676609 = r676607 * r676608;
        double r676610 = r676606 / r676609;
        return r676610;
}

double f(double x, double y, double z, double t, double a) {
        double r676611 = x;
        double r676612 = y;
        double r676613 = r676611 * r676612;
        double r676614 = 9.0;
        double r676615 = t;
        double r676616 = z;
        double r676617 = r676615 * r676616;
        double r676618 = r676614 * r676617;
        double r676619 = r676613 - r676618;
        double r676620 = a;
        double r676621 = 2.0;
        double r676622 = r676620 * r676621;
        double r676623 = r676619 / r676622;
        return r676623;
}

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

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

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

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

Reproduce

herbie shell --seed 2020036 +o rules:numerics
(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)))