\mathsf{max}\left(\mathsf{min}\left(x \cdot y + z, a\right), b\right)\mathsf{max}\left(\mathsf{min}\left(x \cdot y + z, a\right), b\right)double code(double x, double y, double z, double a, double b) {
return ((double) fmax(((double) fmin(((double) (((double) (x * y)) + z)), a)), b));
}
double code(double x, double y, double z, double a, double b) {
return ((double) fmax(((double) fmin(((double) (((double) (x * y)) + z)), a)), b));
}



Bits error versus x



Bits error versus y



Bits error versus z



Bits error versus a



Bits error versus b
Results
Initial program 0.0
Final simplification0.0
herbie shell --seed 2020152
(FPCore (x y z a b)
:name "(fmax (fmin (+ (* x y) z) a) b)"
:precision binary64
(fmax (fmin (+ (* x y) z) a) b))