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}\;i \le -7.472033446684188899599491262791955462412 \cdot 10^{-59}:\\
\;\;\;\;2 \cdot \left(\left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right) + y \cdot x\right)\\
\mathbf{elif}\;i \le 1.502007598359967449068109020258153999519 \cdot 10^{-55}:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(t, z, y \cdot x\right) - c \cdot \left(i \cdot \mathsf{fma}\left(b, c, a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(t \cdot z - \left(\mathsf{fma}\left(c, b, a\right) \cdot c\right) \cdot i\right) + y \cdot x\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c, double i) {
double r30143081 = 2.0;
double r30143082 = x;
double r30143083 = y;
double r30143084 = r30143082 * r30143083;
double r30143085 = z;
double r30143086 = t;
double r30143087 = r30143085 * r30143086;
double r30143088 = r30143084 + r30143087;
double r30143089 = a;
double r30143090 = b;
double r30143091 = c;
double r30143092 = r30143090 * r30143091;
double r30143093 = r30143089 + r30143092;
double r30143094 = r30143093 * r30143091;
double r30143095 = i;
double r30143096 = r30143094 * r30143095;
double r30143097 = r30143088 - r30143096;
double r30143098 = r30143081 * r30143097;
return r30143098;
}
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
double r30143099 = i;
double r30143100 = -7.472033446684189e-59;
bool r30143101 = r30143099 <= r30143100;
double r30143102 = 2.0;
double r30143103 = t;
double r30143104 = z;
double r30143105 = r30143103 * r30143104;
double r30143106 = c;
double r30143107 = b;
double r30143108 = a;
double r30143109 = fma(r30143106, r30143107, r30143108);
double r30143110 = r30143109 * r30143106;
double r30143111 = r30143110 * r30143099;
double r30143112 = r30143105 - r30143111;
double r30143113 = y;
double r30143114 = x;
double r30143115 = r30143113 * r30143114;
double r30143116 = r30143112 + r30143115;
double r30143117 = r30143102 * r30143116;
double r30143118 = 1.5020075983599674e-55;
bool r30143119 = r30143099 <= r30143118;
double r30143120 = fma(r30143103, r30143104, r30143115);
double r30143121 = fma(r30143107, r30143106, r30143108);
double r30143122 = r30143099 * r30143121;
double r30143123 = r30143106 * r30143122;
double r30143124 = r30143120 - r30143123;
double r30143125 = r30143102 * r30143124;
double r30143126 = r30143119 ? r30143125 : r30143117;
double r30143127 = r30143101 ? r30143117 : r30143126;
return r30143127;
}




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.5 |
|---|---|
| Target | 2.1 |
| Herbie | 1.8 |
if i < -7.472033446684189e-59 or 1.5020075983599674e-55 < i Initial program 1.3
Simplified1.3
rmApplied add-cube-cbrt1.7
Applied associate-*l*1.7
rmApplied pow11.7
Applied pow11.7
Applied pow-prod-down1.7
Applied pow11.7
Applied pow-prod-down1.7
Applied pow11.7
Applied pow11.7
Applied pow-prod-down1.7
Applied pow-prod-down1.7
Simplified1.2
rmApplied *-un-lft-identity1.2
Applied *-un-lft-identity1.2
Applied distribute-lft-out--1.2
Simplified1.3
rmApplied fma-udef1.3
Applied associate--l+1.3
if -7.472033446684189e-59 < i < 1.5020075983599674e-55Initial program 11.5
Simplified11.5
rmApplied associate-*r*2.2
Final simplification1.8
herbie shell --seed 2019174 +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"
:herbie-target
(* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))
(* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))