Average Error: 0.3 → 0.3
Time: 988.0ms
Precision: binary64
\[Pmin + \frac{\left(Pmax - Pmin\right) \cdot R}{100}\]
\[Pmin + \frac{\left(Pmax - Pmin\right) \cdot R}{100}\]
Pmin + \frac{\left(Pmax - Pmin\right) \cdot R}{100}
Pmin + \frac{\left(Pmax - Pmin\right) \cdot R}{100}
double code(double Pmin, double Pmax, double R) {
	return ((double) (Pmin + ((double) (((double) (((double) (Pmax - Pmin)) * R)) / 100.0))));
}
double code(double Pmin, double Pmax, double R) {
	return ((double) (Pmin + ((double) (((double) (((double) (Pmax - Pmin)) * R)) / 100.0))));
}

Error

Bits error versus Pmin

Bits error versus Pmax

Bits error versus R

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.3

    \[Pmin + \frac{\left(Pmax - Pmin\right) \cdot R}{100}\]
  2. Final simplification0.3

    \[\leadsto Pmin + \frac{\left(Pmax - Pmin\right) \cdot R}{100}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (Pmin Pmax R)
  :name "(+ Pmin (/ (* (- Pmax Pmin) R) 100))"
  :precision binary64
  (+ Pmin (/ (* (- Pmax Pmin) R) 100.0)))