\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b
\begin{array}{l}
\mathbf{if}\;y \le -1.093967716233190167127795978495846537109 \cdot 10^{80}:\\
\;\;\;\;\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right) - \left(\sqrt[3]{9} \cdot \sqrt[3]{9}\right) \cdot \left(\sqrt[3]{\sqrt[3]{9} \cdot \sqrt[3]{9}} \cdot \left(\sqrt[3]{\sqrt[3]{9}} \cdot \left(\left(t \cdot z\right) \cdot y\right)\right)\right)\right)\\
\mathbf{elif}\;y \le 6.392287508762893125747406036083933338353 \cdot 10^{178}:\\
\;\;\;\;\mathsf{fma}\left(2, x, 27 \cdot \left(a \cdot b\right) - {\left(\left(9 \cdot \left(t \cdot y\right)\right) \cdot z\right)}^{1}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(2, x, \left(27 \cdot a\right) \cdot b - 9 \cdot \left(\left(t \cdot z\right) \cdot y\right)\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b) {
double r754888 = x;
double r754889 = 2.0;
double r754890 = r754888 * r754889;
double r754891 = y;
double r754892 = 9.0;
double r754893 = r754891 * r754892;
double r754894 = z;
double r754895 = r754893 * r754894;
double r754896 = t;
double r754897 = r754895 * r754896;
double r754898 = r754890 - r754897;
double r754899 = a;
double r754900 = 27.0;
double r754901 = r754899 * r754900;
double r754902 = b;
double r754903 = r754901 * r754902;
double r754904 = r754898 + r754903;
return r754904;
}
double f(double x, double y, double z, double t, double a, double b) {
double r754905 = y;
double r754906 = -1.0939677162331902e+80;
bool r754907 = r754905 <= r754906;
double r754908 = 2.0;
double r754909 = x;
double r754910 = 27.0;
double r754911 = a;
double r754912 = b;
double r754913 = r754911 * r754912;
double r754914 = r754910 * r754913;
double r754915 = 9.0;
double r754916 = cbrt(r754915);
double r754917 = r754916 * r754916;
double r754918 = cbrt(r754917);
double r754919 = cbrt(r754916);
double r754920 = t;
double r754921 = z;
double r754922 = r754920 * r754921;
double r754923 = r754922 * r754905;
double r754924 = r754919 * r754923;
double r754925 = r754918 * r754924;
double r754926 = r754917 * r754925;
double r754927 = r754914 - r754926;
double r754928 = fma(r754908, r754909, r754927);
double r754929 = 6.392287508762893e+178;
bool r754930 = r754905 <= r754929;
double r754931 = r754920 * r754905;
double r754932 = r754915 * r754931;
double r754933 = r754932 * r754921;
double r754934 = 1.0;
double r754935 = pow(r754933, r754934);
double r754936 = r754914 - r754935;
double r754937 = fma(r754908, r754909, r754936);
double r754938 = r754910 * r754911;
double r754939 = r754938 * r754912;
double r754940 = r754915 * r754923;
double r754941 = r754939 - r754940;
double r754942 = fma(r754908, r754909, r754941);
double r754943 = r754930 ? r754937 : r754942;
double r754944 = r754907 ? r754928 : r754943;
return r754944;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
| Original | 3.6 |
|---|---|
| Target | 2.7 |
| Herbie | 1.4 |
if y < -1.0939677162331902e+80Initial program 9.9
Simplified9.9
Taylor expanded around inf 9.5
Simplified9.5
rmApplied associate-*r*0.6
rmApplied add-cube-cbrt0.6
Applied associate-*l*0.7
rmApplied add-cube-cbrt0.7
Applied cbrt-prod0.9
Applied associate-*l*0.8
if -1.0939677162331902e+80 < y < 6.392287508762893e+178Initial program 1.7
Simplified1.7
Taylor expanded around inf 1.6
Simplified1.6
rmApplied associate-*r*4.3
rmApplied add-cube-cbrt4.3
Applied associate-*l*4.3
rmApplied pow14.3
Applied pow14.3
Applied pow14.3
Applied pow-prod-down4.3
Applied pow-prod-down4.3
Applied pow14.3
Applied pow-prod-down4.3
Applied pow14.3
Applied pow14.3
Applied pow-prod-down4.3
Applied pow-prod-down4.3
Simplified1.5
if 6.392287508762893e+178 < y Initial program 11.9
Simplified11.8
Taylor expanded around inf 11.5
Simplified11.5
rmApplied associate-*r*1.9
rmApplied associate-*r*2.0
Final simplification1.4
herbie shell --seed 2019354 +o rules:numerics
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b)))
(+ (- (* x 2) (* (* (* y 9) z) t)) (* (* a 27) b)))