\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 -1.252202118917326 \cdot 10^{240}:\\
\;\;\;\;\mathsf{fma}\left(9, \frac{x}{z \cdot c} \cdot y, \frac{b}{z \cdot c} - 4 \cdot \frac{a}{\frac{c}{t}}\right)\\
\mathbf{elif}\;c \le -32082327.647484176:\\
\;\;\;\;\mathsf{fma}\left(9, \left(\frac{1}{z} \cdot \frac{x}{c}\right) \cdot y, \frac{b}{z \cdot c} - 4 \cdot \frac{a \cdot t}{c}\right)\\
\mathbf{elif}\;c \le 0.00144591862123770866:\\
\;\;\;\;\mathsf{fma}\left(-4, \frac{t \cdot a}{c}, \frac{\frac{\mathsf{fma}\left(9 \cdot x, y, b\right)}{z}}{c}\right)\\
\mathbf{elif}\;c \le 3.1709786398942339 \cdot 10^{235}:\\
\;\;\;\;\mathsf{fma}\left(9, \frac{x}{\frac{z \cdot c}{y}}, \frac{b}{z \cdot c} - 4 \cdot \left(\frac{a}{\sqrt[3]{c} \cdot \sqrt[3]{c}} \cdot \frac{t}{\sqrt[3]{c}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(9, \frac{\frac{x}{z}}{\frac{c}{y}}, \frac{b}{z \cdot c} - 4 \cdot \frac{a \cdot t}{c}\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c) {
double r642833 = x;
double r642834 = 9.0;
double r642835 = r642833 * r642834;
double r642836 = y;
double r642837 = r642835 * r642836;
double r642838 = z;
double r642839 = 4.0;
double r642840 = r642838 * r642839;
double r642841 = t;
double r642842 = r642840 * r642841;
double r642843 = a;
double r642844 = r642842 * r642843;
double r642845 = r642837 - r642844;
double r642846 = b;
double r642847 = r642845 + r642846;
double r642848 = c;
double r642849 = r642838 * r642848;
double r642850 = r642847 / r642849;
return r642850;
}
double f(double x, double y, double z, double t, double a, double b, double c) {
double r642851 = c;
double r642852 = -1.252202118917326e+240;
bool r642853 = r642851 <= r642852;
double r642854 = 9.0;
double r642855 = x;
double r642856 = z;
double r642857 = r642856 * r642851;
double r642858 = r642855 / r642857;
double r642859 = y;
double r642860 = r642858 * r642859;
double r642861 = b;
double r642862 = r642861 / r642857;
double r642863 = 4.0;
double r642864 = a;
double r642865 = t;
double r642866 = r642851 / r642865;
double r642867 = r642864 / r642866;
double r642868 = r642863 * r642867;
double r642869 = r642862 - r642868;
double r642870 = fma(r642854, r642860, r642869);
double r642871 = -32082327.647484176;
bool r642872 = r642851 <= r642871;
double r642873 = 1.0;
double r642874 = r642873 / r642856;
double r642875 = r642855 / r642851;
double r642876 = r642874 * r642875;
double r642877 = r642876 * r642859;
double r642878 = r642864 * r642865;
double r642879 = r642878 / r642851;
double r642880 = r642863 * r642879;
double r642881 = r642862 - r642880;
double r642882 = fma(r642854, r642877, r642881);
double r642883 = 0.0014459186212377087;
bool r642884 = r642851 <= r642883;
double r642885 = -r642863;
double r642886 = r642865 * r642864;
double r642887 = r642886 / r642851;
double r642888 = r642854 * r642855;
double r642889 = fma(r642888, r642859, r642861);
double r642890 = r642889 / r642856;
double r642891 = r642890 / r642851;
double r642892 = fma(r642885, r642887, r642891);
double r642893 = 3.170978639894234e+235;
bool r642894 = r642851 <= r642893;
double r642895 = r642857 / r642859;
double r642896 = r642855 / r642895;
double r642897 = cbrt(r642851);
double r642898 = r642897 * r642897;
double r642899 = r642864 / r642898;
double r642900 = r642865 / r642897;
double r642901 = r642899 * r642900;
double r642902 = r642863 * r642901;
double r642903 = r642862 - r642902;
double r642904 = fma(r642854, r642896, r642903);
double r642905 = r642855 / r642856;
double r642906 = r642851 / r642859;
double r642907 = r642905 / r642906;
double r642908 = fma(r642854, r642907, r642881);
double r642909 = r642894 ? r642904 : r642908;
double r642910 = r642884 ? r642892 : r642909;
double r642911 = r642872 ? r642882 : r642910;
double r642912 = r642853 ? r642870 : r642911;
return r642912;
}




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
| Original | 20.8 |
|---|---|
| Target | 14.8 |
| Herbie | 8.1 |
if c < -1.252202118917326e+240Initial program 27.0
Simplified20.5
Taylor expanded around 0 20.5
Simplified20.5
rmApplied associate-/l*18.7
rmApplied associate-/r/18.7
rmApplied associate-/l*14.4
if -1.252202118917326e+240 < c < -32082327.647484176Initial program 22.0
Simplified13.5
Taylor expanded around 0 13.5
Simplified13.5
rmApplied associate-/l*11.4
rmApplied associate-/r/11.2
rmApplied *-un-lft-identity11.2
Applied times-frac9.3
if -32082327.647484176 < c < 0.0014459186212377087Initial program 14.9
Simplified5.3
rmApplied associate-/r*2.7
Simplified2.7
if 0.0014459186212377087 < c < 3.170978639894234e+235Initial program 22.3
Simplified13.9
Taylor expanded around 0 13.9
Simplified13.9
rmApplied associate-/l*12.1
rmApplied add-cube-cbrt12.4
Applied times-frac8.1
if 3.170978639894234e+235 < c Initial program 28.6
Simplified20.2
Taylor expanded around 0 20.1
Simplified20.1
rmApplied associate-/l*18.6
rmApplied *-un-lft-identity18.6
Applied times-frac16.0
Applied associate-/r*17.9
Simplified17.9
Final simplification8.1
herbie shell --seed 2020062 +o rules:numerics
(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)))