# ?

Average Error: 0.0 → 0.0
Time: 9.0s
Precision: binary64
Cost: 448

# ?

$\left(-1 \leq a \land a \leq 1\right) \land \left(-1 \leq b \land b \leq 1\right)$
$a + \frac{1}{a - b}$
$a + \frac{1}{a - b}$
(FPCore (a b) :precision binary64 (+ a (/ 1.0 (- a b))))
(FPCore (a b) :precision binary64 (+ a (/ 1.0 (- a b))))
double code(double a, double b) {
return a + (1.0 / (a - b));
}

double code(double a, double b) {
return a + (1.0 / (a - b));
}

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

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

public static double code(double a, double b) {
return a + (1.0 / (a - b));
}

public static double code(double a, double b) {
return a + (1.0 / (a - b));
}

def code(a, b):
return a + (1.0 / (a - b))

def code(a, b):
return a + (1.0 / (a - b))

function code(a, b)
return Float64(a + Float64(1.0 / Float64(a - b)))
end

function code(a, b)
return Float64(a + Float64(1.0 / Float64(a - b)))
end

function tmp = code(a, b)
tmp = a + (1.0 / (a - b));
end

function tmp = code(a, b)
tmp = a + (1.0 / (a - b));
end

code[a_, b_] := N[(a + N[(1.0 / N[(a - b), $MachinePrecision]),$MachinePrecision]), $MachinePrecision]  code[a_, b_] := N[(a + N[(1.0 / N[(a - b),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]

a + \frac{1}{a - b}

a + \frac{1}{a - b}


# Try it out?

Results

 In Out
Enter valid numbers for all inputs

# Derivation?

1. Initial program 0.0

$a + \frac{1}{a - b}$
2. Final simplification0.0

$\leadsto a + \frac{1}{a - b}$

# Alternatives

Alternative 1
Error17.1
Cost721
$\begin{array}{l} \mathbf{if}\;b \leq -8.2 \cdot 10^{-138}:\\ \;\;\;\;\frac{-1}{b}\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{-172} \lor \neg \left(b \leq 1.18 \cdot 10^{-147}\right) \land b \leq 8.8 \cdot 10^{-130}:\\ \;\;\;\;\frac{1}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{b}\\ \end{array}$
Alternative 2
Error16.7
Cost720
$\begin{array}{l} \mathbf{if}\;b \leq -6 \cdot 10^{-137}:\\ \;\;\;\;\frac{-1}{b}\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-174}:\\ \;\;\;\;a + \frac{1}{a}\\ \mathbf{elif}\;b \leq 5.8 \cdot 10^{-148}:\\ \;\;\;\;\frac{-1}{b}\\ \mathbf{elif}\;b \leq 8.8 \cdot 10^{-130}:\\ \;\;\;\;\frac{1}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{b}\\ \end{array}$
Alternative 3
Error32.3
Cost192
$\frac{-1}{b}$
Alternative 4
Error61.6
Cost64
$a$

# Reproduce?

herbie shell --seed 1
(FPCore (a b)
:name "a + 1/(a - b)"
:precision binary64
:pre (and (and (<= -1.0 a) (<= a 1.0)) (and (<= -1.0 b) (<= b 1.0)))
(+ a (/ 1.0 (- a b))))