Average Error: 7.7 → 4.0
Time: 3.5s
Precision: 64
\[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\]
\[\begin{array}{l} \mathbf{if}\;\left(z \cdot 9\right) \cdot t \le -4.160669233039557 \cdot 10^{306}:\\ \;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{z \cdot 9}{a} \cdot \frac{t}{2}\\ \mathbf{elif}\;\left(z \cdot 9\right) \cdot t \le -1.1575439955519718 \cdot 10^{-74}:\\ \;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\\ \mathbf{elif}\;\left(z \cdot 9\right) \cdot t \le 1.06019818429476599 \cdot 10^{-116}:\\ \;\;\;\;\frac{x \cdot y}{a \cdot 2} - \frac{z}{1} \cdot \left(\frac{9}{a} \cdot \frac{t}{2}\right)\\ \mathbf{elif}\;\left(z \cdot 9\right) \cdot t \le 2.8684979825191242 \cdot 10^{241}:\\ \;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{z \cdot 9}{a} \cdot \frac{t}{2}\\ \end{array}\]
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\begin{array}{l}
\mathbf{if}\;\left(z \cdot 9\right) \cdot t \le -4.160669233039557 \cdot 10^{306}:\\
\;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{z \cdot 9}{a} \cdot \frac{t}{2}\\

\mathbf{elif}\;\left(z \cdot 9\right) \cdot t \le -1.1575439955519718 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\\

\mathbf{elif}\;\left(z \cdot 9\right) \cdot t \le 1.06019818429476599 \cdot 10^{-116}:\\
\;\;\;\;\frac{x \cdot y}{a \cdot 2} - \frac{z}{1} \cdot \left(\frac{9}{a} \cdot \frac{t}{2}\right)\\

\mathbf{elif}\;\left(z \cdot 9\right) \cdot t \le 2.8684979825191242 \cdot 10^{241}:\\
\;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{z \cdot 9}{a} \cdot \frac{t}{2}\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r714396 = x;
        double r714397 = y;
        double r714398 = r714396 * r714397;
        double r714399 = z;
        double r714400 = 9.0;
        double r714401 = r714399 * r714400;
        double r714402 = t;
        double r714403 = r714401 * r714402;
        double r714404 = r714398 - r714403;
        double r714405 = a;
        double r714406 = 2.0;
        double r714407 = r714405 * r714406;
        double r714408 = r714404 / r714407;
        return r714408;
}

double f(double x, double y, double z, double t, double a) {
        double r714409 = z;
        double r714410 = 9.0;
        double r714411 = r714409 * r714410;
        double r714412 = t;
        double r714413 = r714411 * r714412;
        double r714414 = -4.160669233039557e+306;
        bool r714415 = r714413 <= r714414;
        double r714416 = x;
        double r714417 = a;
        double r714418 = 2.0;
        double r714419 = r714417 * r714418;
        double r714420 = y;
        double r714421 = r714419 / r714420;
        double r714422 = r714416 / r714421;
        double r714423 = r714411 / r714417;
        double r714424 = r714412 / r714418;
        double r714425 = r714423 * r714424;
        double r714426 = r714422 - r714425;
        double r714427 = -1.1575439955519718e-74;
        bool r714428 = r714413 <= r714427;
        double r714429 = r714413 / r714419;
        double r714430 = r714422 - r714429;
        double r714431 = 1.060198184294766e-116;
        bool r714432 = r714413 <= r714431;
        double r714433 = r714416 * r714420;
        double r714434 = r714433 / r714419;
        double r714435 = 1.0;
        double r714436 = r714409 / r714435;
        double r714437 = r714410 / r714417;
        double r714438 = r714437 * r714424;
        double r714439 = r714436 * r714438;
        double r714440 = r714434 - r714439;
        double r714441 = 2.868497982519124e+241;
        bool r714442 = r714413 <= r714441;
        double r714443 = r714442 ? r714430 : r714426;
        double r714444 = r714432 ? r714440 : r714443;
        double r714445 = r714428 ? r714430 : r714444;
        double r714446 = r714415 ? r714426 : r714445;
        return r714446;
}

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.8
Herbie4.0
\[\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. Split input into 3 regimes
  2. if (* (* z 9.0) t) < -4.160669233039557e+306 or 2.868497982519124e+241 < (* (* z 9.0) t)

    1. Initial program 46.1

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\]
    2. Using strategy rm
    3. Applied div-sub46.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}}\]
    4. Using strategy rm
    5. Applied times-frac8.0

      \[\leadsto \frac{x \cdot y}{a \cdot 2} - \color{blue}{\frac{z \cdot 9}{a} \cdot \frac{t}{2}}\]
    6. Using strategy rm
    7. Applied associate-/l*1.4

      \[\leadsto \color{blue}{\frac{x}{\frac{a \cdot 2}{y}}} - \frac{z \cdot 9}{a} \cdot \frac{t}{2}\]

    if -4.160669233039557e+306 < (* (* z 9.0) t) < -1.1575439955519718e-74 or 1.060198184294766e-116 < (* (* z 9.0) t) < 2.868497982519124e+241

    1. Initial program 4.0

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\]
    2. Using strategy rm
    3. Applied div-sub4.0

      \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}}\]
    4. Using strategy rm
    5. Applied associate-/l*3.3

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

    if -1.1575439955519718e-74 < (* (* z 9.0) t) < 1.060198184294766e-116

    1. Initial program 4.6

      \[\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}\]
    2. Using strategy rm
    3. Applied div-sub4.6

      \[\leadsto \color{blue}{\frac{x \cdot y}{a \cdot 2} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}}\]
    4. Using strategy rm
    5. Applied times-frac5.3

      \[\leadsto \frac{x \cdot y}{a \cdot 2} - \color{blue}{\frac{z \cdot 9}{a} \cdot \frac{t}{2}}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity5.3

      \[\leadsto \frac{x \cdot y}{a \cdot 2} - \frac{z \cdot 9}{\color{blue}{1 \cdot a}} \cdot \frac{t}{2}\]
    8. Applied times-frac5.3

      \[\leadsto \frac{x \cdot y}{a \cdot 2} - \color{blue}{\left(\frac{z}{1} \cdot \frac{9}{a}\right)} \cdot \frac{t}{2}\]
    9. Applied associate-*l*5.4

      \[\leadsto \frac{x \cdot y}{a \cdot 2} - \color{blue}{\frac{z}{1} \cdot \left(\frac{9}{a} \cdot \frac{t}{2}\right)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification4.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(z \cdot 9\right) \cdot t \le -4.160669233039557 \cdot 10^{306}:\\ \;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{z \cdot 9}{a} \cdot \frac{t}{2}\\ \mathbf{elif}\;\left(z \cdot 9\right) \cdot t \le -1.1575439955519718 \cdot 10^{-74}:\\ \;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\\ \mathbf{elif}\;\left(z \cdot 9\right) \cdot t \le 1.06019818429476599 \cdot 10^{-116}:\\ \;\;\;\;\frac{x \cdot y}{a \cdot 2} - \frac{z}{1} \cdot \left(\frac{9}{a} \cdot \frac{t}{2}\right)\\ \mathbf{elif}\;\left(z \cdot 9\right) \cdot t \le 2.8684979825191242 \cdot 10^{241}:\\ \;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{\left(z \cdot 9\right) \cdot t}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{a \cdot 2}{y}} - \frac{z \cdot 9}{a} \cdot \frac{t}{2}\\ \end{array}\]

Reproduce

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