Average Error: 0.0 → 0.0
Time: 8.4s
Precision: 64
\[0.0 \le a \le 1\]
\[\left(1 - a\right) \cdot b + a \cdot c\]
\[\left(1 - a\right) \cdot b + a \cdot c\]
\left(1 - a\right) \cdot b + a \cdot c
\left(1 - a\right) \cdot b + a \cdot c
double f(double a, double b, double c) {
        double r1191940 = 1.0;
        double r1191941 = a;
        double r1191942 = r1191940 - r1191941;
        double r1191943 = b;
        double r1191944 = r1191942 * r1191943;
        double r1191945 = c;
        double r1191946 = r1191941 * r1191945;
        double r1191947 = r1191944 + r1191946;
        return r1191947;
}

double f(double a, double b, double c) {
        double r1191948 = 1.0;
        double r1191949 = a;
        double r1191950 = r1191948 - r1191949;
        double r1191951 = b;
        double r1191952 = r1191950 * r1191951;
        double r1191953 = c;
        double r1191954 = r1191949 * r1191953;
        double r1191955 = r1191952 + r1191954;
        return r1191955;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(1 - a\right) \cdot b + a \cdot c\]
  2. Final simplification0.0

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

Reproduce

herbie shell --seed 1 
(FPCore (a b c)
  :name "(1 - a) * b + a * c"
  :precision binary64
  :pre (<= 0.0 a 1)
  (+ (* (- 1 a) b) (* a c)))