Average Error: 0 → 0
Time: 5.7s
Precision: 64
$\left(1 - a\right) \cdot pa + a \cdot pb$
$\left(1 - a\right) \cdot pa + a \cdot pb$
\left(1 - a\right) \cdot pa + a \cdot pb
\left(1 - a\right) \cdot pa + a \cdot pb
double f(double a, double pa, double pb) {
double r2172210 = 1.0;
double r2172211 = a;
double r2172212 = r2172210 - r2172211;
double r2172213 = pa;
double r2172214 = r2172212 * r2172213;
double r2172215 = pb;
double r2172216 = r2172211 * r2172215;
double r2172217 = r2172214 + r2172216;
return r2172217;
}


double f(double a, double pa, double pb) {
double r2172218 = 1.0;
double r2172219 = a;
double r2172220 = r2172218 - r2172219;
double r2172221 = pa;
double r2172222 = r2172220 * r2172221;
double r2172223 = pb;
double r2172224 = r2172219 * r2172223;
double r2172225 = r2172222 + r2172224;
return r2172225;
}



# Try it out

Your Program's Arguments

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0

$\left(1 - a\right) \cdot pa + a \cdot pb$
2. Final simplification0

$\leadsto \left(1 - a\right) \cdot pa + a \cdot pb$

# Reproduce

herbie shell --seed 1
(FPCore (a pa pb)
:name "((1.0 - a) * pa) + (a* pb)"
:precision binary32
(+ (* (- 1 a) pa) (* a pb)))