Average Error: 20.4 → 10.2
Time: 18.1s
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}\;y \le 1.447400587919281219909541782848661125831 \cdot 10^{-170}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + \left(9 \cdot \left(\sqrt[3]{\frac{x \cdot y}{z \cdot c}} \cdot \sqrt[3]{\frac{x \cdot y}{z \cdot c}}\right)\right) \cdot \sqrt[3]{\frac{x \cdot y}{z \cdot c}}\right) - 4 \cdot \frac{t}{\frac{c}{a}}\\ \mathbf{elif}\;y \le 4.428008425685853774097860177584594780552 \cdot 10^{53} \lor \neg \left(y \le 3.764058605690289843130801519020404504673 \cdot 10^{280}\right):\\ \;\;\;\;\left(\frac{b + \left(x \cdot 9\right) \cdot y}{z} - \left(a \cdot 4\right) \cdot t\right) \cdot \frac{1}{c}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\right) - 4 \cdot \left(t \cdot \frac{a}{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}\;y \le 1.447400587919281219909541782848661125831 \cdot 10^{-170}:\\
\;\;\;\;\left(\frac{b}{z \cdot c} + \left(9 \cdot \left(\sqrt[3]{\frac{x \cdot y}{z \cdot c}} \cdot \sqrt[3]{\frac{x \cdot y}{z \cdot c}}\right)\right) \cdot \sqrt[3]{\frac{x \cdot y}{z \cdot c}}\right) - 4 \cdot \frac{t}{\frac{c}{a}}\\

\mathbf{elif}\;y \le 4.428008425685853774097860177584594780552 \cdot 10^{53} \lor \neg \left(y \le 3.764058605690289843130801519020404504673 \cdot 10^{280}\right):\\
\;\;\;\;\left(\frac{b + \left(x \cdot 9\right) \cdot y}{z} - \left(a \cdot 4\right) \cdot t\right) \cdot \frac{1}{c}\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c) {
        double r451930 = x;
        double r451931 = 9.0;
        double r451932 = r451930 * r451931;
        double r451933 = y;
        double r451934 = r451932 * r451933;
        double r451935 = z;
        double r451936 = 4.0;
        double r451937 = r451935 * r451936;
        double r451938 = t;
        double r451939 = r451937 * r451938;
        double r451940 = a;
        double r451941 = r451939 * r451940;
        double r451942 = r451934 - r451941;
        double r451943 = b;
        double r451944 = r451942 + r451943;
        double r451945 = c;
        double r451946 = r451935 * r451945;
        double r451947 = r451944 / r451946;
        return r451947;
}

double f(double x, double y, double z, double t, double a, double b, double c) {
        double r451948 = y;
        double r451949 = 1.4474005879192812e-170;
        bool r451950 = r451948 <= r451949;
        double r451951 = b;
        double r451952 = z;
        double r451953 = c;
        double r451954 = r451952 * r451953;
        double r451955 = r451951 / r451954;
        double r451956 = 9.0;
        double r451957 = x;
        double r451958 = r451957 * r451948;
        double r451959 = r451958 / r451954;
        double r451960 = cbrt(r451959);
        double r451961 = r451960 * r451960;
        double r451962 = r451956 * r451961;
        double r451963 = r451962 * r451960;
        double r451964 = r451955 + r451963;
        double r451965 = 4.0;
        double r451966 = t;
        double r451967 = a;
        double r451968 = r451953 / r451967;
        double r451969 = r451966 / r451968;
        double r451970 = r451965 * r451969;
        double r451971 = r451964 - r451970;
        double r451972 = 4.428008425685854e+53;
        bool r451973 = r451948 <= r451972;
        double r451974 = 3.76405860569029e+280;
        bool r451975 = r451948 <= r451974;
        double r451976 = !r451975;
        bool r451977 = r451973 || r451976;
        double r451978 = r451957 * r451956;
        double r451979 = r451978 * r451948;
        double r451980 = r451951 + r451979;
        double r451981 = r451980 / r451952;
        double r451982 = r451967 * r451965;
        double r451983 = r451982 * r451966;
        double r451984 = r451981 - r451983;
        double r451985 = 1.0;
        double r451986 = r451985 / r451953;
        double r451987 = r451984 * r451986;
        double r451988 = r451957 / r451952;
        double r451989 = r451948 / r451953;
        double r451990 = r451988 * r451989;
        double r451991 = r451956 * r451990;
        double r451992 = r451955 + r451991;
        double r451993 = r451967 / r451953;
        double r451994 = r451966 * r451993;
        double r451995 = r451965 * r451994;
        double r451996 = r451992 - r451995;
        double r451997 = r451977 ? r451987 : r451996;
        double r451998 = r451950 ? r451971 : r451997;
        return r451998;
}

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.4
Herbie10.2
\[\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 3 regimes
  2. if y < 1.4474005879192812e-170

    1. Initial program 19.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. Simplified12.4

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

      \[\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 associate-/l*9.9

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

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

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

    if 1.4474005879192812e-170 < y < 4.428008425685854e+53 or 3.76405860569029e+280 < y

    1. Initial program 18.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. Simplified10.5

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

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

    if 4.428008425685854e+53 < y < 3.76405860569029e+280

    1. Initial program 26.1

      \[\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. Simplified20.6

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

      \[\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-identity18.6

      \[\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-frac17.6

      \[\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. Simplified17.6

      \[\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 times-frac10.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le 1.447400587919281219909541782848661125831 \cdot 10^{-170}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + \left(9 \cdot \left(\sqrt[3]{\frac{x \cdot y}{z \cdot c}} \cdot \sqrt[3]{\frac{x \cdot y}{z \cdot c}}\right)\right) \cdot \sqrt[3]{\frac{x \cdot y}{z \cdot c}}\right) - 4 \cdot \frac{t}{\frac{c}{a}}\\ \mathbf{elif}\;y \le 4.428008425685853774097860177584594780552 \cdot 10^{53} \lor \neg \left(y \le 3.764058605690289843130801519020404504673 \cdot 10^{280}\right):\\ \;\;\;\;\left(\frac{b + \left(x \cdot 9\right) \cdot y}{z} - \left(a \cdot 4\right) \cdot t\right) \cdot \frac{1}{c}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{b}{z \cdot c} + 9 \cdot \left(\frac{x}{z} \cdot \frac{y}{c}\right)\right) - 4 \cdot \left(t \cdot \frac{a}{c}\right)\\ \end{array}\]

Reproduce

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