Average Error: 0.0 → 0.0
Time: 13.5s
Precision: 64
\[L \cdot \left(1 - x\right) + H \cdot x\]
\[L - \left(L - H\right) \cdot x\]
L \cdot \left(1 - x\right) + H \cdot x
L - \left(L - H\right) \cdot x
double f(double L, double x, double H) {
        double r49402482 = L;
        double r49402483 = 1.0;
        double r49402484 = x;
        double r49402485 = r49402483 - r49402484;
        double r49402486 = r49402482 * r49402485;
        double r49402487 = H;
        double r49402488 = r49402487 * r49402484;
        double r49402489 = r49402486 + r49402488;
        return r49402489;
}

double f(double L, double x, double H) {
        double r49402490 = L;
        double r49402491 = H;
        double r49402492 = r49402490 - r49402491;
        double r49402493 = x;
        double r49402494 = r49402492 * r49402493;
        double r49402495 = r49402490 - r49402494;
        return r49402495;
}

Error

Bits error versus L

Bits error versus x

Bits error versus H

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[L \cdot \left(1 - x\right) + H \cdot x\]
  2. Simplified0.0

    \[\leadsto \color{blue}{L - \left(L - H\right) \cdot x}\]
  3. Final simplification0.0

    \[\leadsto L - \left(L - H\right) \cdot x\]

Reproduce

herbie shell --seed 1 
(FPCore (L x H)
  :name "L*(1-x) + H*x"
  (+ (* L (- 1 x)) (* H x)))