\frac{\left(a + b\right) \cdot h}{2}\frac{\left(a + b\right) \cdot h}{2}double code(double a, double b, double h) {
return ((double) (((double) (((double) (a + b)) * h)) / 2.0));
}
double code(double a, double b, double h) {
return ((double) (((double) (((double) (a + b)) * h)) / 2.0));
}



Bits error versus a



Bits error versus b



Bits error versus h
Results
Initial program 0.1
Final simplification0.1
herbie shell --seed 2020152
(FPCore (a b h)
:name "(/ (* (+ a b) h) 2)"
:precision binary64
(/ (* (+ a b) h) 2.0))