2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\begin{array}{l}
\mathbf{if}\;c \le -4.55654662541823949653768661353737387464 \cdot 10^{160} \lor \neg \left(c \le 9.075256899225485243342018453401870557589 \cdot 10^{45}\right):\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - \left(c \cdot \mathsf{fma}\left(c, b, a\right)\right) \cdot i\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c, double i) {
double r799234 = 2.0;
double r799235 = x;
double r799236 = y;
double r799237 = r799235 * r799236;
double r799238 = z;
double r799239 = t;
double r799240 = r799238 * r799239;
double r799241 = r799237 + r799240;
double r799242 = a;
double r799243 = b;
double r799244 = c;
double r799245 = r799243 * r799244;
double r799246 = r799242 + r799245;
double r799247 = r799246 * r799244;
double r799248 = i;
double r799249 = r799247 * r799248;
double r799250 = r799241 - r799249;
double r799251 = r799234 * r799250;
return r799251;
}
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
double r799252 = c;
double r799253 = -4.5565466254182395e+160;
bool r799254 = r799252 <= r799253;
double r799255 = 9.075256899225485e+45;
bool r799256 = r799252 <= r799255;
double r799257 = !r799256;
bool r799258 = r799254 || r799257;
double r799259 = 2.0;
double r799260 = y;
double r799261 = x;
double r799262 = z;
double r799263 = t;
double r799264 = r799262 * r799263;
double r799265 = b;
double r799266 = a;
double r799267 = fma(r799252, r799265, r799266);
double r799268 = i;
double r799269 = r799267 * r799268;
double r799270 = r799252 * r799269;
double r799271 = r799264 - r799270;
double r799272 = fma(r799260, r799261, r799271);
double r799273 = r799259 * r799272;
double r799274 = r799252 * r799267;
double r799275 = r799274 * r799268;
double r799276 = r799264 - r799275;
double r799277 = fma(r799260, r799261, r799276);
double r799278 = r799259 * r799277;
double r799279 = r799258 ? r799273 : r799278;
return r799279;
}




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




Bits error versus i
| Original | 6.7 |
|---|---|
| Target | 1.9 |
| Herbie | 2.6 |
if c < -4.5565466254182395e+160 or 9.075256899225485e+45 < c Initial program 28.5
Simplified28.5
rmApplied add-cube-cbrt28.7
Applied associate-*l*28.7
rmApplied pow128.7
Applied pow128.7
Applied pow128.7
Applied pow-prod-down28.7
Applied pow128.7
Applied pow128.7
Applied pow-prod-down28.7
Applied pow-prod-down28.7
Applied pow-prod-down28.7
Simplified3.7
if -4.5565466254182395e+160 < c < 9.075256899225485e+45Initial program 2.3
Simplified2.3
Final simplification2.6
herbie shell --seed 2019209 +o rules:numerics
(FPCore (x y z t a b c i)
:name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))