Average Error: 7.8 → 7.7
Time: 4.1s
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 r834047 = x;
        double r834048 = y;
        double r834049 = r834047 * r834048;
        double r834050 = z;
        double r834051 = 9.0;
        double r834052 = r834050 * r834051;
        double r834053 = t;
        double r834054 = r834052 * r834053;
        double r834055 = r834049 - r834054;
        double r834056 = a;
        double r834057 = 2.0;
        double r834058 = r834056 * r834057;
        double r834059 = r834055 / r834058;
        return r834059;
}

double f(double x, double y, double z, double t, double a) {
        double r834060 = x;
        double r834061 = y;
        double r834062 = r834060 * r834061;
        double r834063 = 9.0;
        double r834064 = t;
        double r834065 = z;
        double r834066 = r834064 * r834065;
        double r834067 = r834063 * r834066;
        double r834068 = r834062 - r834067;
        double r834069 = a;
        double r834070 = 2.0;
        double r834071 = r834069 * r834070;
        double r834072 = r834068 / r834071;
        return r834072;
}

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 
(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)))