\frac{\left(x - a\right) \cdot \left(d - c\right)}{b - a} + c\frac{\left(x - a\right) \cdot \left(d - c\right)}{b - a} + cdouble code(double x, double a, double d, double c, double b) {
return ((double) (((double) (((double) (((double) (x - a)) * ((double) (d - c)))) / ((double) (b - a)))) + c));
}
double code(double x, double a, double d, double c, double b) {
return ((double) (((double) (((double) (((double) (x - a)) * ((double) (d - c)))) / ((double) (b - a)))) + c));
}



Bits error versus x



Bits error versus a



Bits error versus d



Bits error versus c



Bits error versus b
Results
Initial program 24.0
Final simplification24.0
herbie shell --seed 2020153
(FPCore (x a d c b)
:name "(+ (/ (* (- x a) (- d c)) (- b a)) c)"
:precision binary64
(+ (/ (* (- x a) (- d c)) (- b a)) c))