2.0 \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.487426699771173 \cdot 10^{+21}:\\
\;\;\;\;2.0 \cdot \left(\mathsf{fma}\left(t, z, x \cdot y\right) - \mathsf{fma}\left(c, b, a\right) \cdot \left(i \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2.0 \cdot \left(\mathsf{fma}\left(t, z, x \cdot y\right) - \left(a \cdot i + c \cdot \left(b \cdot i\right)\right) \cdot c\right)\\
\end{array}double f(double x, double y, double z, double t, double a, double b, double c, double i) {
double r30249818 = 2.0;
double r30249819 = x;
double r30249820 = y;
double r30249821 = r30249819 * r30249820;
double r30249822 = z;
double r30249823 = t;
double r30249824 = r30249822 * r30249823;
double r30249825 = r30249821 + r30249824;
double r30249826 = a;
double r30249827 = b;
double r30249828 = c;
double r30249829 = r30249827 * r30249828;
double r30249830 = r30249826 + r30249829;
double r30249831 = r30249830 * r30249828;
double r30249832 = i;
double r30249833 = r30249831 * r30249832;
double r30249834 = r30249825 - r30249833;
double r30249835 = r30249818 * r30249834;
return r30249835;
}
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
double r30249836 = c;
double r30249837 = 4.487426699771173e+21;
bool r30249838 = r30249836 <= r30249837;
double r30249839 = 2.0;
double r30249840 = t;
double r30249841 = z;
double r30249842 = x;
double r30249843 = y;
double r30249844 = r30249842 * r30249843;
double r30249845 = fma(r30249840, r30249841, r30249844);
double r30249846 = b;
double r30249847 = a;
double r30249848 = fma(r30249836, r30249846, r30249847);
double r30249849 = i;
double r30249850 = r30249849 * r30249836;
double r30249851 = r30249848 * r30249850;
double r30249852 = r30249845 - r30249851;
double r30249853 = r30249839 * r30249852;
double r30249854 = r30249847 * r30249849;
double r30249855 = r30249846 * r30249849;
double r30249856 = r30249836 * r30249855;
double r30249857 = r30249854 + r30249856;
double r30249858 = r30249857 * r30249836;
double r30249859 = r30249845 - r30249858;
double r30249860 = r30249839 * r30249859;
double r30249861 = r30249838 ? r30249853 : r30249860;
return r30249861;
}




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.2 |
|---|---|
| Target | 1.7 |
| Herbie | 1.4 |
if c < 4.487426699771173e+21Initial program 3.7
Simplified3.7
rmApplied associate-*r*5.1
rmApplied add-cube-cbrt5.4
Applied associate-*r*5.4
rmApplied pow15.4
Applied pow15.4
Applied pow15.4
Applied pow-prod-down5.4
Applied pow15.4
Applied pow15.4
Applied pow-prod-down5.4
Applied pow-prod-down5.4
Applied pow-prod-down5.4
Simplified1.1
if 4.487426699771173e+21 < c Initial program 21.0
Simplified21.0
rmApplied associate-*r*3.4
rmApplied add-cube-cbrt3.9
Applied associate-*r*3.9
Taylor expanded around inf 27.4
Simplified2.9
Final simplification1.4
herbie shell --seed 2019168 +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))))