Average Error: 0 → 0
Time: 413.0ms
Precision: binary64
\[\mathsf{min}\left(\mathsf{max}\left(\mathsf{min}\left(x, x\right), x\right), x\right)\]
\[\mathsf{min}\left(\mathsf{max}\left(\mathsf{min}\left(x, x\right), x\right), x\right)\]
\mathsf{min}\left(\mathsf{max}\left(\mathsf{min}\left(x, x\right), x\right), x\right)
\mathsf{min}\left(\mathsf{max}\left(\mathsf{min}\left(x, x\right), x\right), x\right)
double code(double x) {
	return ((double) fmin(((double) fmax(((double) fmin(x, x)), x)), x));
}
double code(double x) {
	return ((double) fmin(((double) fmax(((double) fmin(x, x)), x)), x));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0

    \[\mathsf{min}\left(\mathsf{max}\left(\mathsf{min}\left(x, x\right), x\right), x\right)\]
  2. Final simplification0

    \[\leadsto \mathsf{min}\left(\mathsf{max}\left(\mathsf{min}\left(x, x\right), x\right), x\right)\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x)
  :name "(fmin (fmax (fmin x x) x) x)"
  :precision binary64
  (fmin (fmax (fmin x x) x) x))