\mathsf{max}\left(1, \mathsf{min}\left(0.0, x\right)\right)\mathsf{max}\left(1, \mathsf{min}\left(0.0, x\right)\right)double code(double x) {
return ((double) fmax(1.0, ((double) fmin(0.0, x))));
}
double code(double x) {
return ((double) fmax(1.0, ((double) fmin(0.0, x))));
}



Bits error versus x
Results
Initial program 0
Final simplification0
herbie shell --seed 2020153
(FPCore (x)
:name "(fmax 1 (fmin 0 x))"
:precision binary64
(fmax 1.0 (fmin 0.0 x)))