# ?

Average Error: 0.0 → 0.0
Time: 2.7s
Precision: binary64
Cost: 320

# ?

$-1.79 \cdot 10^{+308} \leq x \land x \leq 1.79 \cdot 10^{+308}$
$\frac{1}{x - 0.5}$
$\frac{1}{x + -0.5}$
(FPCore (x) :precision binary64 (/ 1.0 (- x 0.5)))
(FPCore (x) :precision binary64 (/ 1.0 (+ x -0.5)))
double code(double x) {
return 1.0 / (x - 0.5);
}

double code(double x) {
return 1.0 / (x + -0.5);
}

real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 / (x - 0.5d0)
end function

real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0 / (x + (-0.5d0))
end function

public static double code(double x) {
return 1.0 / (x - 0.5);
}

public static double code(double x) {
return 1.0 / (x + -0.5);
}

def code(x):
return 1.0 / (x - 0.5)

def code(x):
return 1.0 / (x + -0.5)

function code(x)
return Float64(1.0 / Float64(x - 0.5))
end

function code(x)
return Float64(1.0 / Float64(x + -0.5))
end

function tmp = code(x)
tmp = 1.0 / (x - 0.5);
end

function tmp = code(x)
tmp = 1.0 / (x + -0.5);
end

code[x_] := N[(1.0 / N[(x - 0.5), $MachinePrecision]),$MachinePrecision]

code[x_] := N[(1.0 / N[(x + -0.5), $MachinePrecision]),$MachinePrecision]

\frac{1}{x - 0.5}

\frac{1}{x + -0.5}


# Try it out?

Results

 In Out
Enter valid numbers for all inputs

# Derivation?

1. Initial program 0.0

$\frac{1}{x - 0.5}$
2. Final simplification0.0

$\leadsto \frac{1}{x + -0.5}$

# Alternatives

Alternative 1
Error1.0
Cost584
$\begin{array}{l} \mathbf{if}\;x \leq -0.38:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{elif}\;x \leq 0.5:\\ \;\;\;\;x \cdot -4 + -2\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x}\\ \end{array}$
Alternative 2
Error1.3
Cost456
$\begin{array}{l} \mathbf{if}\;x \leq -0.5:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{elif}\;x \leq 0.5:\\ \;\;\;\;-2\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x}\\ \end{array}$
Alternative 3
Error31.5
Cost64
$-2$

# Reproduce?

herbie shell --seed 1
(FPCore (x)
:name "1 / (x - 0.5)"
:precision binary64
:pre (and (<= -1.79e+308 x) (<= x 1.79e+308))
(/ 1.0 (- x 0.5)))