2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
2 \cdot \mathsf{fma}\left(y, x, z \cdot t - \left(c \cdot i\right) \cdot \mathsf{fma}\left(c, b, a\right)\right)double f(double x, double y, double z, double t, double a, double b, double c, double i) {
double r450690 = 2.0;
double r450691 = x;
double r450692 = y;
double r450693 = r450691 * r450692;
double r450694 = z;
double r450695 = t;
double r450696 = r450694 * r450695;
double r450697 = r450693 + r450696;
double r450698 = a;
double r450699 = b;
double r450700 = c;
double r450701 = r450699 * r450700;
double r450702 = r450698 + r450701;
double r450703 = r450702 * r450700;
double r450704 = i;
double r450705 = r450703 * r450704;
double r450706 = r450697 - r450705;
double r450707 = r450690 * r450706;
return r450707;
}
double f(double x, double y, double z, double t, double a, double b, double c, double i) {
double r450708 = 2.0;
double r450709 = y;
double r450710 = x;
double r450711 = z;
double r450712 = t;
double r450713 = r450711 * r450712;
double r450714 = c;
double r450715 = i;
double r450716 = r450714 * r450715;
double r450717 = b;
double r450718 = a;
double r450719 = fma(r450714, r450717, r450718);
double r450720 = r450716 * r450719;
double r450721 = r450713 - r450720;
double r450722 = fma(r450709, r450710, r450721);
double r450723 = r450708 * r450722;
return r450723;
}




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.3 |
|---|---|
| Target | 1.8 |
| Herbie | 1.8 |
Initial program 6.3
Simplified6.3
rmApplied associate-*l*5.1
rmApplied add-cube-cbrt5.4
Applied associate-*l*5.4
rmApplied pow15.4
Applied pow15.4
Applied pow-prod-down5.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
Simplified1.8
Final simplification1.8
herbie shell --seed 2019304 +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))))