Average Error: 20.2 → 8.6
Time: 17.8s
Precision: 64
\[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\]
\[\begin{array}{l} \mathbf{if}\;\left(x \cdot 9\right) \cdot y \le -2.106611902941222340597613930431254723614 \cdot 10^{301}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\right) - 4 \cdot \frac{t \cdot a}{c}\\ \mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 2.831845126854037649168687939940533358132 \cdot 10^{-289}:\\ \;\;\;\;\left(\frac{1}{z} \cdot \frac{b}{c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 7509611327214221017481216:\\ \;\;\;\;\frac{1}{\frac{c}{\frac{\left(x \cdot 9\right) \cdot y + b}{z} - \left(a \cdot 4\right) \cdot t}}\\ \mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 1.093798445901707015620884267821152876675 \cdot 10^{251}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(\left(t \cdot \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right)\right) \cdot \frac{\sqrt[3]{a}}{c}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\right) - 4 \cdot \frac{t \cdot a}{c}\\ \end{array}\]
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\begin{array}{l}
\mathbf{if}\;\left(x \cdot 9\right) \cdot y \le -2.106611902941222340597613930431254723614 \cdot 10^{301}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\right) - 4 \cdot \frac{t \cdot a}{c}\\

\mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 2.831845126854037649168687939940533358132 \cdot 10^{-289}:\\
\;\;\;\;\left(\frac{1}{z} \cdot \frac{b}{c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\\

\mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 7509611327214221017481216:\\
\;\;\;\;\frac{1}{\frac{c}{\frac{\left(x \cdot 9\right) \cdot y + b}{z} - \left(a \cdot 4\right) \cdot t}}\\

\mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 1.093798445901707015620884267821152876675 \cdot 10^{251}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(\left(t \cdot \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right)\right) \cdot \frac{\sqrt[3]{a}}{c}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\right) - 4 \cdot \frac{t \cdot a}{c}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c) {
        double r540549 = x;
        double r540550 = 9.0;
        double r540551 = r540549 * r540550;
        double r540552 = y;
        double r540553 = r540551 * r540552;
        double r540554 = z;
        double r540555 = 4.0;
        double r540556 = r540554 * r540555;
        double r540557 = t;
        double r540558 = r540556 * r540557;
        double r540559 = a;
        double r540560 = r540558 * r540559;
        double r540561 = r540553 - r540560;
        double r540562 = b;
        double r540563 = r540561 + r540562;
        double r540564 = c;
        double r540565 = r540554 * r540564;
        double r540566 = r540563 / r540565;
        return r540566;
}

double f(double x, double y, double z, double t, double a, double b, double c) {
        double r540567 = x;
        double r540568 = 9.0;
        double r540569 = r540567 * r540568;
        double r540570 = y;
        double r540571 = r540569 * r540570;
        double r540572 = -2.1066119029412223e+301;
        bool r540573 = r540571 <= r540572;
        double r540574 = b;
        double r540575 = z;
        double r540576 = c;
        double r540577 = r540575 * r540576;
        double r540578 = r540574 / r540577;
        double r540579 = r540567 / r540575;
        double r540580 = r540570 / r540576;
        double r540581 = r540579 * r540580;
        double r540582 = r540568 * r540581;
        double r540583 = r540578 + r540582;
        double r540584 = 4.0;
        double r540585 = t;
        double r540586 = a;
        double r540587 = r540585 * r540586;
        double r540588 = r540587 / r540576;
        double r540589 = r540584 * r540588;
        double r540590 = r540583 - r540589;
        double r540591 = 2.8318451268540376e-289;
        bool r540592 = r540571 <= r540591;
        double r540593 = 1.0;
        double r540594 = r540593 / r540575;
        double r540595 = r540574 / r540576;
        double r540596 = r540594 * r540595;
        double r540597 = r540567 * r540570;
        double r540598 = r540597 / r540577;
        double r540599 = r540568 * r540598;
        double r540600 = r540596 + r540599;
        double r540601 = r540586 / r540576;
        double r540602 = r540585 * r540601;
        double r540603 = r540584 * r540602;
        double r540604 = r540600 - r540603;
        double r540605 = 7.509611327214221e+24;
        bool r540606 = r540571 <= r540605;
        double r540607 = r540571 + r540574;
        double r540608 = r540607 / r540575;
        double r540609 = r540586 * r540584;
        double r540610 = r540609 * r540585;
        double r540611 = r540608 - r540610;
        double r540612 = r540576 / r540611;
        double r540613 = r540593 / r540612;
        double r540614 = 1.093798445901707e+251;
        bool r540615 = r540571 <= r540614;
        double r540616 = r540578 + r540599;
        double r540617 = cbrt(r540586);
        double r540618 = r540617 * r540617;
        double r540619 = r540585 * r540618;
        double r540620 = r540617 / r540576;
        double r540621 = r540619 * r540620;
        double r540622 = r540584 * r540621;
        double r540623 = r540616 - r540622;
        double r540624 = r540615 ? r540623 : r540590;
        double r540625 = r540606 ? r540613 : r540624;
        double r540626 = r540592 ? r540604 : r540625;
        double r540627 = r540573 ? r540590 : r540626;
        return r540627;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original20.2
Target14.6
Herbie8.6
\[\begin{array}{l} \mathbf{if}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \lt -1.100156740804104887233830094663413900721 \cdot 10^{-171}:\\ \;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \lt -0.0:\\ \;\;\;\;\frac{\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z}}{c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \lt 1.170887791174748819600820354912645756062 \cdot 10^{-53}:\\ \;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \lt 2.876823679546137226963937101710277849382 \cdot 10^{130}:\\ \;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + \frac{b}{c \cdot z}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c} \lt 1.383851504245631860711731716196098366993 \cdot 10^{158}:\\ \;\;\;\;\frac{\left(\left(x \cdot 9\right) \cdot y - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + \frac{b}{c \cdot z}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \end{array}\]

Derivation

  1. Split input into 4 regimes
  2. if (* (* x 9.0) y) < -2.1066119029412223e+301 or 1.093798445901707e+251 < (* (* x 9.0) y)

    1. Initial program 54.2

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\]
    2. Simplified54.4

      \[\leadsto \color{blue}{\frac{\frac{\left(x \cdot 9\right) \cdot y + b}{z} - \left(a \cdot 4\right) \cdot t}{c}}\]
    3. Taylor expanded around 0 51.3

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

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

    if -2.1066119029412223e+301 < (* (* x 9.0) y) < 2.8318451268540376e-289

    1. Initial program 16.8

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\]
    2. Simplified9.1

      \[\leadsto \color{blue}{\frac{\frac{\left(x \cdot 9\right) \cdot y + b}{z} - \left(a \cdot 4\right) \cdot t}{c}}\]
    3. Taylor expanded around 0 8.3

      \[\leadsto \color{blue}{\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{t \cdot a}{c}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity8.3

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{t \cdot a}{\color{blue}{1 \cdot c}}\]
    6. Applied times-frac7.3

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \color{blue}{\left(\frac{t}{1} \cdot \frac{a}{c}\right)}\]
    7. Simplified7.3

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(\color{blue}{t} \cdot \frac{a}{c}\right)\]
    8. Using strategy rm
    9. Applied *-un-lft-identity7.3

      \[\leadsto \left(\frac{\color{blue}{1 \cdot b}}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\]
    10. Applied times-frac8.5

      \[\leadsto \left(\color{blue}{\frac{1}{z} \cdot \frac{b}{c}} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\]

    if 2.8318451268540376e-289 < (* (* x 9.0) y) < 7.509611327214221e+24

    1. Initial program 15.5

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\]
    2. Simplified7.9

      \[\leadsto \color{blue}{\frac{\frac{\left(x \cdot 9\right) \cdot y + b}{z} - \left(a \cdot 4\right) \cdot t}{c}}\]
    3. Using strategy rm
    4. Applied clear-num8.2

      \[\leadsto \color{blue}{\frac{1}{\frac{c}{\frac{\left(x \cdot 9\right) \cdot y + b}{z} - \left(a \cdot 4\right) \cdot t}}}\]

    if 7.509611327214221e+24 < (* (* x 9.0) y) < 1.093798445901707e+251

    1. Initial program 17.6

      \[\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}\]
    2. Simplified11.4

      \[\leadsto \color{blue}{\frac{\frac{\left(x \cdot 9\right) \cdot y + b}{z} - \left(a \cdot 4\right) \cdot t}{c}}\]
    3. Taylor expanded around 0 8.0

      \[\leadsto \color{blue}{\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{t \cdot a}{c}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity8.0

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{t \cdot a}{\color{blue}{1 \cdot c}}\]
    6. Applied times-frac7.3

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \color{blue}{\left(\frac{t}{1} \cdot \frac{a}{c}\right)}\]
    7. Simplified7.3

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(\color{blue}{t} \cdot \frac{a}{c}\right)\]
    8. Using strategy rm
    9. Applied *-un-lft-identity7.3

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{a}{\color{blue}{1 \cdot c}}\right)\]
    10. Applied add-cube-cbrt7.6

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}}{1 \cdot c}\right)\]
    11. Applied times-frac7.6

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(t \cdot \color{blue}{\left(\frac{\sqrt[3]{a} \cdot \sqrt[3]{a}}{1} \cdot \frac{\sqrt[3]{a}}{c}\right)}\right)\]
    12. Applied associate-*r*6.5

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \color{blue}{\left(\left(t \cdot \frac{\sqrt[3]{a} \cdot \sqrt[3]{a}}{1}\right) \cdot \frac{\sqrt[3]{a}}{c}\right)}\]
    13. Simplified6.5

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(\color{blue}{\left(t \cdot \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right)\right)} \cdot \frac{\sqrt[3]{a}}{c}\right)\]
  3. Recombined 4 regimes into one program.
  4. Final simplification8.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot 9\right) \cdot y \le -2.106611902941222340597613930431254723614 \cdot 10^{301}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\right) - 4 \cdot \frac{t \cdot a}{c}\\ \mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 2.831845126854037649168687939940533358132 \cdot 10^{-289}:\\ \;\;\;\;\left(\frac{1}{z} \cdot \frac{b}{c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 7509611327214221017481216:\\ \;\;\;\;\frac{1}{\frac{c}{\frac{\left(x \cdot 9\right) \cdot y + b}{z} - \left(a \cdot 4\right) \cdot t}}\\ \mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 1.093798445901707015620884267821152876675 \cdot 10^{251}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \left(\left(t \cdot \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right)\right) \cdot \frac{\sqrt[3]{a}}{c}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\right) - 4 \cdot \frac{t \cdot a}{c}\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -1.1001567408041049e-171) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) -0.0) (/ (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 1.17088779117474882e-53) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 2.8768236795461372e130) (- (+ (* (* 9 (/ y c)) (/ x z)) (/ b (* c z))) (* 4 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 1.3838515042456319e158) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (- (+ (* 9 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4 (/ (* a t) c))))))))

  (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)))