# ?

Average Error: 0.2 → 0
Time: 4.1s
Precision: binary64
Cost: 192

# ?

$1 \leq x \land x \leq 10000$
$\frac{50 \cdot x}{1000}$
$\frac{x}{20}$
(FPCore (x) :precision binary64 (/ (* 50.0 x) 1000.0))
(FPCore (x) :precision binary64 (/ x 20.0))
double code(double x) {
return (50.0 * x) / 1000.0;
}

double code(double x) {
return x / 20.0;
}

real(8) function code(x)
real(8), intent (in) :: x
code = (50.0d0 * x) / 1000.0d0
end function

real(8) function code(x)
real(8), intent (in) :: x
code = x / 20.0d0
end function

public static double code(double x) {
return (50.0 * x) / 1000.0;
}

public static double code(double x) {
return x / 20.0;
}

def code(x):
return (50.0 * x) / 1000.0

def code(x):
return x / 20.0

function code(x)
return Float64(Float64(50.0 * x) / 1000.0)
end

function code(x)
return Float64(x / 20.0)
end

function tmp = code(x)
tmp = (50.0 * x) / 1000.0;
end

function tmp = code(x)
tmp = x / 20.0;
end

code[x_] := N[(N[(50.0 * x), $MachinePrecision] / 1000.0),$MachinePrecision]

code[x_] := N[(x / 20.0), \$MachinePrecision]

\frac{50 \cdot x}{1000}

\frac{x}{20}


# Try it out?

Results

 In Out
Enter valid numbers for all inputs

# Derivation?

1. Initial program 0.2

$\frac{50 \cdot x}{1000}$
2. Applied egg-rr0.3

$\leadsto \color{blue}{{\left(\frac{20}{x}\right)}^{-1}}$
3. Applied egg-rr0

$\leadsto \color{blue}{\frac{x}{20}}$
4. Final simplification0

$\leadsto \frac{x}{20}$

# Alternatives

Alternative 1
Error0.3
Cost192
$x \cdot 0.05$

# Reproduce?

herbie shell --seed 1
(FPCore (x)
:name "50 * x / 1000"
:precision binary64
:pre (and (<= 1.0 x) (<= x 10000.0))
(/ (* 50.0 x) 1000.0))