Average Error: 0.0 → 0.0
Time: 1.0s
Precision: binary64
\[\mathsf{max}\left(\mathsf{min}\left(x \cdot y + z, a\right), b\right)\]
\[\mathsf{max}\left(\mathsf{min}\left(x \cdot y + z, a\right), b\right)\]
\mathsf{max}\left(\mathsf{min}\left(x \cdot y + z, a\right), b\right)
\mathsf{max}\left(\mathsf{min}\left(x \cdot y + z, a\right), b\right)
double code(double x, double y, double z, double a, double b) {
	return ((double) fmax(((double) fmin(((double) (((double) (x * y)) + z)), a)), b));
}
double code(double x, double y, double z, double a, double b) {
	return ((double) fmax(((double) fmin(((double) (((double) (x * y)) + z)), a)), b));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\mathsf{max}\left(\mathsf{min}\left(x \cdot y + z, a\right), b\right)\]
  2. Final simplification0.0

    \[\leadsto \mathsf{max}\left(\mathsf{min}\left(x \cdot y + z, a\right), b\right)\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x y z a b)
  :name "(fmax (fmin (+ (* x y) z) a) b)"
  :precision binary64
  (fmax (fmin (+ (* x y) z) a) b))