Average Error: 0 → 0
Time: 5.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 r2166727 = 1.0;
        double r2166728 = lambda;
        double r2166729 = r2166727 - r2166728;
        double r2166730 = pa;
        double r2166731 = r2166729 * r2166730;
        double r2166732 = pb;
        double r2166733 = r2166728 * r2166732;
        double r2166734 = r2166731 + r2166733;
        return r2166734;
}

double f(double lambda, double pa, double pb) {
        double r2166735 = 1.0;
        double r2166736 = lambda;
        double r2166737 = r2166735 - r2166736;
        double r2166738 = pa;
        double r2166739 = r2166737 * r2166738;
        double r2166740 = pb;
        double r2166741 = r2166736 * r2166740;
        double r2166742 = r2166739 + r2166741;
        return r2166742;
}

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

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

    \[\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 binary32
  (+ (* (- 1 lambda) pa) (* lambda pb)))