Average Error: 0.0 → 0.0
Time: 9.8s
Precision: 64
$\left(1 - a\right) \cdot b + a \cdot c$
$\left(1 - a\right) \cdot b + a \cdot c$
\left(1 - a\right) \cdot b + a \cdot c
\left(1 - a\right) \cdot b + a \cdot c
double f(double a, double b, double c) {
double r1186451 = 1.0;
double r1186452 = a;
double r1186453 = r1186451 - r1186452;
double r1186454 = b;
double r1186455 = r1186453 * r1186454;
double r1186456 = c;
double r1186457 = r1186452 * r1186456;
double r1186458 = r1186455 + r1186457;
return r1186458;
}


double f(double a, double b, double c) {
double r1186459 = 1.0;
double r1186460 = a;
double r1186461 = r1186459 - r1186460;
double r1186462 = b;
double r1186463 = r1186461 * r1186462;
double r1186464 = c;
double r1186465 = r1186460 * r1186464;
double r1186466 = r1186463 + r1186465;
return r1186466;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

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

$\leadsto \left(1 - a\right) \cdot b + a \cdot c$

# Reproduce

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