Average Error: 0.0 → 0.0
Time: 1.6s
Precision: 64
$\frac{x - \mathsf{min}\left(x, -65535\right)}{\mathsf{max}\left(x, 65535\right) - \mathsf{min}\left(x, -65535\right)}$
$\frac{x - \mathsf{min}\left(x, -65535\right)}{\mathsf{max}\left(x, 65535\right) - \mathsf{min}\left(x, -65535\right)}$
\frac{x - \mathsf{min}\left(x, -65535\right)}{\mathsf{max}\left(x, 65535\right) - \mathsf{min}\left(x, -65535\right)}
\frac{x - \mathsf{min}\left(x, -65535\right)}{\mathsf{max}\left(x, 65535\right) - \mathsf{min}\left(x, -65535\right)}
double f(double x) {
double r1643802 = x;
double r1643803 = 65535.0;
double r1643804 = -r1643803;
double r1643805 = fmin(r1643802, r1643804);
double r1643806 = r1643802 - r1643805;
double r1643807 = fmax(r1643802, r1643803);
double r1643808 = r1643807 - r1643805;
double r1643809 = r1643806 / r1643808;
return r1643809;
}


double f(double x) {
double r1643810 = x;
double r1643811 = 65535.0;
double r1643812 = -r1643811;
double r1643813 = fmin(r1643810, r1643812);
double r1643814 = r1643810 - r1643813;
double r1643815 = fmax(r1643810, r1643811);
double r1643816 = r1643815 - r1643813;
double r1643817 = r1643814 / r1643816;
return r1643817;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\frac{x - \mathsf{min}\left(x, -65535\right)}{\mathsf{max}\left(x, 65535\right) - \mathsf{min}\left(x, -65535\right)}$
2. Final simplification0.0

$\leadsto \frac{x - \mathsf{min}\left(x, -65535\right)}{\mathsf{max}\left(x, 65535\right) - \mathsf{min}\left(x, -65535\right)}$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "(x-min(x,-65535))/(max(x,65535)-min(x,-65535))"
:precision binary64
(/ (- x (fmin x (- 65535))) (- (fmax x 65535) (fmin x (- 65535)))))