\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\begin{array}{l}
\mathbf{if}\;z \cdot 3 \le 1.934650635555646046239049173909307910435 \cdot 10^{-6}:\\
\;\;\;\;\left(\mathsf{fma}\left(\frac{\frac{-1}{z}}{3}, y, \frac{\frac{1}{z}}{3} \cdot y\right) + \frac{\frac{1}{z}}{\frac{y}{\frac{t}{3}}}\right) + \mathsf{fma}\left(1, x, y \cdot \frac{\frac{-1}{z}}{3}\right)\\
\mathbf{elif}\;z \cdot 3 \le 2.296793905184516690316228557659555390868 \cdot 10^{221}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{1}{z}}{y} \cdot \frac{t}{3}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(-\frac{\frac{y}{z}}{\sqrt[3]{3}}, \frac{1}{\sqrt[3]{3} \cdot \sqrt[3]{3}}, \frac{\frac{y}{z}}{\sqrt[3]{3}} \cdot \frac{1}{\sqrt[3]{3} \cdot \sqrt[3]{3}}\right) + \frac{\frac{1}{z}}{\frac{y}{\frac{t}{3}}}\right) + \mathsf{fma}\left(1, x, \frac{-1}{\sqrt[3]{3} \cdot \sqrt[3]{3}} \cdot \frac{\frac{y}{z}}{\sqrt[3]{3}}\right)\\
\end{array}double f(double x, double y, double z, double t) {
double r492106 = x;
double r492107 = y;
double r492108 = z;
double r492109 = 3.0;
double r492110 = r492108 * r492109;
double r492111 = r492107 / r492110;
double r492112 = r492106 - r492111;
double r492113 = t;
double r492114 = r492110 * r492107;
double r492115 = r492113 / r492114;
double r492116 = r492112 + r492115;
return r492116;
}
double f(double x, double y, double z, double t) {
double r492117 = z;
double r492118 = 3.0;
double r492119 = r492117 * r492118;
double r492120 = 1.934650635555646e-06;
bool r492121 = r492119 <= r492120;
double r492122 = -1.0;
double r492123 = r492122 / r492117;
double r492124 = r492123 / r492118;
double r492125 = y;
double r492126 = 1.0;
double r492127 = r492126 / r492117;
double r492128 = r492127 / r492118;
double r492129 = r492128 * r492125;
double r492130 = fma(r492124, r492125, r492129);
double r492131 = t;
double r492132 = r492131 / r492118;
double r492133 = r492125 / r492132;
double r492134 = r492127 / r492133;
double r492135 = r492130 + r492134;
double r492136 = x;
double r492137 = r492125 * r492124;
double r492138 = fma(r492126, r492136, r492137);
double r492139 = r492135 + r492138;
double r492140 = 2.2967939051845167e+221;
bool r492141 = r492119 <= r492140;
double r492142 = r492125 / r492119;
double r492143 = r492136 - r492142;
double r492144 = r492127 / r492125;
double r492145 = r492144 * r492132;
double r492146 = r492143 + r492145;
double r492147 = r492125 / r492117;
double r492148 = cbrt(r492118);
double r492149 = r492147 / r492148;
double r492150 = -r492149;
double r492151 = r492148 * r492148;
double r492152 = r492126 / r492151;
double r492153 = r492149 * r492152;
double r492154 = fma(r492150, r492152, r492153);
double r492155 = r492154 + r492134;
double r492156 = r492122 / r492151;
double r492157 = r492156 * r492149;
double r492158 = fma(r492126, r492136, r492157);
double r492159 = r492155 + r492158;
double r492160 = r492141 ? r492146 : r492159;
double r492161 = r492121 ? r492139 : r492160;
return r492161;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 3.6 |
|---|---|
| Target | 1.7 |
| Herbie | 2.7 |
if (* z 3.0) < 1.934650635555646e-06Initial program 5.2
rmApplied associate-/r*2.2
rmApplied *-un-lft-identity2.2
Applied times-frac2.2
Applied associate-/l*2.9
rmApplied associate-/r*2.9
rmApplied *-un-lft-identity2.9
Applied div-inv2.9
Applied times-frac2.9
Applied *-un-lft-identity2.9
Applied prod-diff2.9
Applied associate-+l+2.9
Simplified2.9
if 1.934650635555646e-06 < (* z 3.0) < 2.2967939051845167e+221Initial program 0.2
rmApplied associate-/r*0.9
rmApplied *-un-lft-identity0.9
Applied times-frac0.9
Applied associate-/l*4.3
rmApplied associate-/r/0.3
if 2.2967939051845167e+221 < (* z 3.0) Initial program 0.8
rmApplied associate-/r*1.1
rmApplied *-un-lft-identity1.1
Applied times-frac1.0
Applied associate-/l*7.1
rmApplied associate-/r*7.2
rmApplied add-cube-cbrt7.2
Applied *-un-lft-identity7.2
Applied *-un-lft-identity7.2
Applied times-frac7.2
Applied times-frac7.2
Applied *-un-lft-identity7.2
Applied prod-diff7.2
Applied associate-+l+7.2
Simplified7.2
Final simplification2.7
herbie shell --seed 2019208 +o rules:numerics
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y))
(+ (- x (/ y (* z 3))) (/ t (* (* z 3) y))))