Average Error: 24.0 → 24.0
Time: 1.4s
Precision: binary64
\[\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} + c\]
\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} + 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));
}
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));
}

Error

Bits error versus x

Bits error versus a

Bits error versus d

Bits error versus c

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 24.0

    \[\frac{\left(x - a\right) \cdot \left(d - c\right)}{b - a} + c\]
  2. Final simplification24.0

    \[\leadsto \frac{\left(x - a\right) \cdot \left(d - c\right)}{b - a} + c\]

Reproduce

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))