Average Error: 0.0 → 0.0
Time: 9.6s
Precision: 64
\[\left(1 - t\right) \cdot a + t \cdot b\]
\[1 \cdot a + t \cdot \left(b - a\right)\]
\left(1 - t\right) \cdot a + t \cdot b
1 \cdot a + t \cdot \left(b - a\right)
double f(double t, double a, double b) {
        double r2093558 = 1.0;
        double r2093559 = t;
        double r2093560 = r2093558 - r2093559;
        double r2093561 = a;
        double r2093562 = r2093560 * r2093561;
        double r2093563 = b;
        double r2093564 = r2093559 * r2093563;
        double r2093565 = r2093562 + r2093564;
        return r2093565;
}

double f(double t, double a, double b) {
        double r2093566 = 1.0;
        double r2093567 = a;
        double r2093568 = r2093566 * r2093567;
        double r2093569 = t;
        double r2093570 = b;
        double r2093571 = r2093570 - r2093567;
        double r2093572 = r2093569 * r2093571;
        double r2093573 = r2093568 + r2093572;
        return r2093573;
}

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

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

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

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

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

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

Reproduce

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