Average Error: 20.5 → 9.1
Time: 5.7s
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}\;c \le -5.320924991453162905583391526655925012427 \cdot 10^{267}:\\ \;\;\;\;\left(\frac{1}{z} \cdot \frac{b}{c} + 9 \cdot \frac{\frac{x}{\frac{z}{\sqrt[3]{y} \cdot \sqrt[3]{y}}}}{\frac{c}{\sqrt[3]{y}}}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;c \le -3.565902426933372859881473324528820666968 \cdot 10^{-35}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\frac{z \cdot c}{y}}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\ \mathbf{elif}\;c \le 2.339496182483294167334685603502409667373 \cdot 10^{-182}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{1}{z \cdot c} \cdot \left(x \cdot y\right)\right)\right) - 4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;c \le 2.516115018174582561341783214109559728241 \cdot 10^{242}:\\ \;\;\;\;\left(\frac{1}{z} \cdot \frac{b}{c} + 9 \cdot \frac{\frac{x}{\frac{z}{\sqrt[3]{y} \cdot \sqrt[3]{y}}}}{\frac{c}{\sqrt[3]{y}}}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\frac{z \cdot c}{y}}\right) - 4 \cdot \left(\frac{a}{\sqrt{c}} \cdot \frac{t}{\sqrt{c}}\right)\\ \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}\;c \le -5.320924991453162905583391526655925012427 \cdot 10^{267}:\\
\;\;\;\;\left(\frac{1}{z} \cdot \frac{b}{c} + 9 \cdot \frac{\frac{x}{\frac{z}{\sqrt[3]{y} \cdot \sqrt[3]{y}}}}{\frac{c}{\sqrt[3]{y}}}\right) - 4 \cdot \frac{a \cdot t}{c}\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c) {
        double r689600 = x;
        double r689601 = 9.0;
        double r689602 = r689600 * r689601;
        double r689603 = y;
        double r689604 = r689602 * r689603;
        double r689605 = z;
        double r689606 = 4.0;
        double r689607 = r689605 * r689606;
        double r689608 = t;
        double r689609 = r689607 * r689608;
        double r689610 = a;
        double r689611 = r689609 * r689610;
        double r689612 = r689604 - r689611;
        double r689613 = b;
        double r689614 = r689612 + r689613;
        double r689615 = c;
        double r689616 = r689605 * r689615;
        double r689617 = r689614 / r689616;
        return r689617;
}

double f(double x, double y, double z, double t, double a, double b, double c) {
        double r689618 = c;
        double r689619 = -5.320924991453163e+267;
        bool r689620 = r689618 <= r689619;
        double r689621 = 1.0;
        double r689622 = z;
        double r689623 = r689621 / r689622;
        double r689624 = b;
        double r689625 = r689624 / r689618;
        double r689626 = r689623 * r689625;
        double r689627 = 9.0;
        double r689628 = x;
        double r689629 = y;
        double r689630 = cbrt(r689629);
        double r689631 = r689630 * r689630;
        double r689632 = r689622 / r689631;
        double r689633 = r689628 / r689632;
        double r689634 = r689618 / r689630;
        double r689635 = r689633 / r689634;
        double r689636 = r689627 * r689635;
        double r689637 = r689626 + r689636;
        double r689638 = 4.0;
        double r689639 = a;
        double r689640 = t;
        double r689641 = r689639 * r689640;
        double r689642 = r689641 / r689618;
        double r689643 = r689638 * r689642;
        double r689644 = r689637 - r689643;
        double r689645 = -3.565902426933373e-35;
        bool r689646 = r689618 <= r689645;
        double r689647 = r689622 * r689618;
        double r689648 = r689624 / r689647;
        double r689649 = r689647 / r689629;
        double r689650 = r689628 / r689649;
        double r689651 = r689627 * r689650;
        double r689652 = r689648 + r689651;
        double r689653 = r689640 / r689618;
        double r689654 = r689639 * r689653;
        double r689655 = r689638 * r689654;
        double r689656 = r689652 - r689655;
        double r689657 = 2.3394961824832942e-182;
        bool r689658 = r689618 <= r689657;
        double r689659 = r689621 / r689647;
        double r689660 = r689628 * r689629;
        double r689661 = r689659 * r689660;
        double r689662 = r689627 * r689661;
        double r689663 = r689648 + r689662;
        double r689664 = r689663 - r689643;
        double r689665 = 2.5161150181745826e+242;
        bool r689666 = r689618 <= r689665;
        double r689667 = sqrt(r689618);
        double r689668 = r689639 / r689667;
        double r689669 = r689640 / r689667;
        double r689670 = r689668 * r689669;
        double r689671 = r689638 * r689670;
        double r689672 = r689652 - r689671;
        double r689673 = r689666 ? r689644 : r689672;
        double r689674 = r689658 ? r689664 : r689673;
        double r689675 = r689646 ? r689656 : r689674;
        double r689676 = r689620 ? r689644 : r689675;
        return r689676;
}

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.5
Target14.3
Herbie9.1
\[\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.100156740804105117061698089246936481893 \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 c < -5.320924991453163e+267 or 2.3394961824832942e-182 < c < 2.5161150181745826e+242

    1. Initial program 20.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. Taylor expanded around 0 12.4

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

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

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

      \[\leadsto \left(\color{blue}{\frac{1}{z} \cdot \frac{b}{c}} + 9 \cdot \frac{x}{\frac{z \cdot c}{y}}\right) - 4 \cdot \frac{a \cdot t}{c}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt11.7

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

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

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

    if -5.320924991453163e+267 < c < -3.565902426933373e-35

    1. Initial program 21.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. Taylor expanded around 0 13.2

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

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

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

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

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

    if -3.565902426933373e-35 < c < 2.3394961824832942e-182

    1. Initial program 13.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. Taylor expanded around 0 5.4

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

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

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\color{blue}{\left(z \cdot c\right) \cdot \frac{1}{y}}}\right) - 4 \cdot \frac{a \cdot t}{c}\]
    7. Applied *-un-lft-identity6.8

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

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

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

    if 2.5161150181745826e+242 < c

    1. Initial program 27.0

      \[\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. Taylor expanded around 0 19.2

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

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

      \[\leadsto \left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\frac{z \cdot c}{y}}\right) - 4 \cdot \frac{a \cdot t}{\color{blue}{\sqrt{c} \cdot \sqrt{c}}}\]
    7. Applied times-frac12.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \le -5.320924991453162905583391526655925012427 \cdot 10^{267}:\\ \;\;\;\;\left(\frac{1}{z} \cdot \frac{b}{c} + 9 \cdot \frac{\frac{x}{\frac{z}{\sqrt[3]{y} \cdot \sqrt[3]{y}}}}{\frac{c}{\sqrt[3]{y}}}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;c \le -3.565902426933372859881473324528820666968 \cdot 10^{-35}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\frac{z \cdot c}{y}}\right) - 4 \cdot \left(a \cdot \frac{t}{c}\right)\\ \mathbf{elif}\;c \le 2.339496182483294167334685603502409667373 \cdot 10^{-182}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{1}{z \cdot c} \cdot \left(x \cdot y\right)\right)\right) - 4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;c \le 2.516115018174582561341783214109559728241 \cdot 10^{242}:\\ \;\;\;\;\left(\frac{1}{z} \cdot \frac{b}{c} + 9 \cdot \frac{\frac{x}{\frac{z}{\sqrt[3]{y} \cdot \sqrt[3]{y}}}}{\frac{c}{\sqrt[3]{y}}}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\frac{z \cdot c}{y}}\right) - 4 \cdot \left(\frac{a}{\sqrt{c}} \cdot \frac{t}{\sqrt{c}}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019356 
(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.1001567408041051e-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.1708877911747488e-53) (/ (+ (- (* (* x 9) y) (* (* z 4) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9 (/ y c)) (/ x z)) (/ b (* c z))) (* 4 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9) y) (* (* (* z 4) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* 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)))