Average Error: 0.0 → 0.0
Time: 3.7s
Precision: 64
$\left(a + b\right) - 2 \cdot n$
$\left(a + b\right) - 2 \cdot n$
\left(a + b\right) - 2 \cdot n
\left(a + b\right) - 2 \cdot n
double f(double a, double b, double n) {
double r3415689 = a;
double r3415690 = b;
double r3415691 = r3415689 + r3415690;
double r3415692 = 2.0;
double r3415693 = n;
double r3415694 = r3415692 * r3415693;
double r3415695 = r3415691 - r3415694;
return r3415695;
}


double f(double a, double b, double n) {
double r3415696 = a;
double r3415697 = b;
double r3415698 = r3415696 + r3415697;
double r3415699 = 2.0;
double r3415700 = n;
double r3415701 = r3415699 * r3415700;
double r3415702 = r3415698 - r3415701;
return r3415702;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\left(a + b\right) - 2 \cdot n$
2. Final simplification0.0

$\leadsto \left(a + b\right) - 2 \cdot n$

# Reproduce

herbie shell --seed 1
(FPCore (a b n)
:name "(a+b)-2*n"
:precision binary64
(- (+ a b) (* 2 n)))