Average Error: 0.0 → 0.0
Time: 9.8s
Precision: 64
\[\left(1 - \lambda\right) \cdot pa + \lambda \cdot pb\]
\[\left(1 - \lambda\right) \cdot pa + \lambda \cdot pb\]
\left(1 - \lambda\right) \cdot pa + \lambda \cdot pb
\left(1 - \lambda\right) \cdot pa + \lambda \cdot pb
double f(double lambda, double pa, double pb) {
        double r2166519 = 1.0;
        double r2166520 = lambda;
        double r2166521 = r2166519 - r2166520;
        double r2166522 = pa;
        double r2166523 = r2166521 * r2166522;
        double r2166524 = pb;
        double r2166525 = r2166520 * r2166524;
        double r2166526 = r2166523 + r2166525;
        return r2166526;
}

double f(double lambda, double pa, double pb) {
        double r2166527 = 1.0;
        double r2166528 = lambda;
        double r2166529 = r2166527 - r2166528;
        double r2166530 = pa;
        double r2166531 = r2166529 * r2166530;
        double r2166532 = pb;
        double r2166533 = r2166528 * r2166532;
        double r2166534 = r2166531 + r2166533;
        return r2166534;
}

Error

Bits error versus lambda

Bits error versus pa

Bits error versus pb

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(1 - \lambda\right) \cdot pa + \lambda \cdot pb\]
  2. Final simplification0.0

    \[\leadsto \left(1 - \lambda\right) \cdot pa + \lambda \cdot pb\]

Reproduce

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