Average Error: 0.0 → 0.0
Time: 7.3s
Precision: 64
\[t \cdot a + \left(1 - t\right) \cdot b\]
\[t \cdot a + 1 \cdot \left(b - t \cdot b\right)\]
t \cdot a + \left(1 - t\right) \cdot b
t \cdot a + 1 \cdot \left(b - t \cdot b\right)
double f(double t, double a, double b) {
        double r2116507 = t;
        double r2116508 = a;
        double r2116509 = r2116507 * r2116508;
        double r2116510 = 1.0;
        double r2116511 = r2116510 - r2116507;
        double r2116512 = b;
        double r2116513 = r2116511 * r2116512;
        double r2116514 = r2116509 + r2116513;
        return r2116514;
}

double f(double t, double a, double b) {
        double r2116515 = t;
        double r2116516 = a;
        double r2116517 = r2116515 * r2116516;
        double r2116518 = 1.0;
        double r2116519 = b;
        double r2116520 = r2116515 * r2116519;
        double r2116521 = r2116519 - r2116520;
        double r2116522 = r2116518 * r2116521;
        double r2116523 = r2116517 + r2116522;
        return r2116523;
}

Error

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[t \cdot a + \left(1 - t\right) \cdot b\]
  2. Using strategy rm
  3. Applied flip--8.0

    \[\leadsto t \cdot a + \color{blue}{\frac{1 \cdot 1 - t \cdot t}{1 + t}} \cdot b\]
  4. Applied associate-*l/10.3

    \[\leadsto t \cdot a + \color{blue}{\frac{\left(1 \cdot 1 - t \cdot t\right) \cdot b}{1 + t}}\]
  5. Taylor expanded around 0 0.0

    \[\leadsto t \cdot a + \color{blue}{\left(1 \cdot b - 1 \cdot \left(t \cdot b\right)\right)}\]
  6. Simplified0.0

    \[\leadsto t \cdot a + \color{blue}{1 \cdot \left(b - t \cdot b\right)}\]
  7. Final simplification0.0

    \[\leadsto t \cdot a + 1 \cdot \left(b - t \cdot b\right)\]

Reproduce

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