Average Error: 10.3 → 10.3
Time: 1.2s
Precision: binary64
\[\frac{\left(x - a\right) \cdot s}{b - a} + t\]
\[\frac{\left(x - a\right) \cdot s}{b - a} + t\]
\frac{\left(x - a\right) \cdot s}{b - a} + t
\frac{\left(x - a\right) \cdot s}{b - a} + t
double code(double x, double a, double s, double b, double t) {
	return ((double) (((double) (((double) (((double) (x - a)) * s)) / ((double) (b - a)))) + t));
}
double code(double x, double a, double s, double b, double t) {
	return ((double) (((double) (((double) (((double) (x - a)) * s)) / ((double) (b - a)))) + t));
}

Error

Bits error versus x

Bits error versus a

Bits error versus s

Bits error versus b

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 10.3

    \[\frac{\left(x - a\right) \cdot s}{b - a} + t\]
  2. Final simplification10.3

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

Reproduce

herbie shell --seed 2020153 
(FPCore (x a s b t)
  :name "(+ (/ (* (- x a) s) (- b a)) t)"
  :precision binary64
  (+ (/ (* (- x a) s) (- b a)) t))