Average Error: 20.4 → 7.1
Time: 6.3s
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 -3.69731778010488698 \cdot 10^{132}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\frac{z \cdot c}{y}}\right) - 4 \cdot \frac{a \cdot t}{c}\\ \mathbf{elif}\;\left(x \cdot 9\right) \cdot y \le 9.1488994734661193 \cdot 10^{242}:\\ \;\;\;\;\left(\frac{1}{z} \cdot \frac{b}{c} + 9 \cdot \frac{x \cdot y}{z \cdot c}\right) - 4 \cdot \frac{\frac{a}{\frac{\sqrt[3]{c} \cdot \sqrt[3]{c}}{\sqrt[3]{t} \cdot \sqrt[3]{t}}}}{\frac{\sqrt[3]{c}}{\sqrt[3]{t}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{z} \cdot \frac{b}{c} + \left(9 \cdot \frac{x}{z}\right) \cdot \frac{y}{c}\right) - 4 \cdot \frac{a}{\frac{c}{t}}\\ \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 -3.69731778010488698 \cdot 10^{132}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \frac{x}{\frac{z \cdot c}{y}}\right) - 4 \cdot \frac{a \cdot t}{c}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c) {
        double r778713 = x;
        double r778714 = 9.0;
        double r778715 = r778713 * r778714;
        double r778716 = y;
        double r778717 = r778715 * r778716;
        double r778718 = z;
        double r778719 = 4.0;
        double r778720 = r778718 * r778719;
        double r778721 = t;
        double r778722 = r778720 * r778721;
        double r778723 = a;
        double r778724 = r778722 * r778723;
        double r778725 = r778717 - r778724;
        double r778726 = b;
        double r778727 = r778725 + r778726;
        double r778728 = c;
        double r778729 = r778718 * r778728;
        double r778730 = r778727 / r778729;
        return r778730;
}

double f(double x, double y, double z, double t, double a, double b, double c) {
        double r778731 = x;
        double r778732 = 9.0;
        double r778733 = r778731 * r778732;
        double r778734 = y;
        double r778735 = r778733 * r778734;
        double r778736 = -3.697317780104887e+132;
        bool r778737 = r778735 <= r778736;
        double r778738 = b;
        double r778739 = z;
        double r778740 = c;
        double r778741 = r778739 * r778740;
        double r778742 = r778738 / r778741;
        double r778743 = r778741 / r778734;
        double r778744 = r778731 / r778743;
        double r778745 = r778732 * r778744;
        double r778746 = r778742 + r778745;
        double r778747 = 4.0;
        double r778748 = a;
        double r778749 = t;
        double r778750 = r778748 * r778749;
        double r778751 = r778750 / r778740;
        double r778752 = r778747 * r778751;
        double r778753 = r778746 - r778752;
        double r778754 = 9.14889947346612e+242;
        bool r778755 = r778735 <= r778754;
        double r778756 = 1.0;
        double r778757 = r778756 / r778739;
        double r778758 = r778738 / r778740;
        double r778759 = r778757 * r778758;
        double r778760 = r778731 * r778734;
        double r778761 = r778760 / r778741;
        double r778762 = r778732 * r778761;
        double r778763 = r778759 + r778762;
        double r778764 = cbrt(r778740);
        double r778765 = r778764 * r778764;
        double r778766 = cbrt(r778749);
        double r778767 = r778766 * r778766;
        double r778768 = r778765 / r778767;
        double r778769 = r778748 / r778768;
        double r778770 = r778764 / r778766;
        double r778771 = r778769 / r778770;
        double r778772 = r778747 * r778771;
        double r778773 = r778763 - r778772;
        double r778774 = r778731 / r778739;
        double r778775 = r778732 * r778774;
        double r778776 = r778734 / r778740;
        double r778777 = r778775 * r778776;
        double r778778 = r778759 + r778777;
        double r778779 = r778740 / r778749;
        double r778780 = r778748 / r778779;
        double r778781 = r778747 * r778780;
        double r778782 = r778778 - r778781;
        double r778783 = r778755 ? r778773 : r778782;
        double r778784 = r778737 ? r778753 : r778783;
        return r778784;
}

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.4
Target14.6
Herbie7.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.10015674080410512 \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.17088779117474882 \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.8768236795461372 \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.3838515042456319 \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 3 regimes
  2. if (* (* x 9.0) y) < -3.697317780104887e+132

    1. Initial program 33.3

      \[\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 26.1

      \[\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*15.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}\]

    if -3.697317780104887e+132 < (* (* x 9.0) y) < 9.14889947346612e+242

    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. Taylor expanded around 0 7.8

      \[\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 *-un-lft-identity7.8

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

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

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

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

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

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

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

    if 9.14889947346612e+242 < (* (* x 9.0) y)

    1. Initial program 47.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 43.3

      \[\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 *-un-lft-identity43.3

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

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

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

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

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

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

Reproduce

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