Average Error: 0.0 → 0.0
Time: 7.4s
Precision: 64
\[t \cdot a + \left(1 - t\right) \cdot b\]
\[a \cdot t + 1 \cdot \left(b - t \cdot b\right)\]
t \cdot a + \left(1 - t\right) \cdot b
a \cdot t + 1 \cdot \left(b - t \cdot b\right)
double f(double t, double a, double b) {
        double r2110920 = t;
        double r2110921 = a;
        double r2110922 = r2110920 * r2110921;
        double r2110923 = 1.0;
        double r2110924 = r2110923 - r2110920;
        double r2110925 = b;
        double r2110926 = r2110924 * r2110925;
        double r2110927 = r2110922 + r2110926;
        return r2110927;
}

double f(double t, double a, double b) {
        double r2110928 = a;
        double r2110929 = t;
        double r2110930 = r2110928 * r2110929;
        double r2110931 = 1.0;
        double r2110932 = b;
        double r2110933 = r2110929 * r2110932;
        double r2110934 = r2110932 - r2110933;
        double r2110935 = r2110931 * r2110934;
        double r2110936 = r2110930 + r2110935;
        return r2110936;
}

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 \color{blue}{\left(a \cdot t + 1 \cdot b\right) - 1 \cdot \left(t \cdot b\right)}\]
  6. Simplified0.0

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

    \[\leadsto a \cdot t + 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)))