Average Error: 0.0 → 0.0
Time: 11.0s
Precision: 64
$\left(1 \cdot f - x\right) \cdot a + x \cdot b$
$\left(1 \cdot f - x\right) \cdot a + x \cdot b$
\left(1 \cdot f - x\right) \cdot a + x \cdot b
\left(1 \cdot f - x\right) \cdot a + x \cdot b
double f(double f, double x, double a, double b) {
double r1757103 = 1.0;
double r1757104 = f;
double r1757105 = r1757103 * r1757104;
double r1757106 = x;
double r1757107 = r1757105 - r1757106;
double r1757108 = a;
double r1757109 = r1757107 * r1757108;
double r1757110 = b;
double r1757111 = r1757106 * r1757110;
double r1757112 = r1757109 + r1757111;
return r1757112;
}


double f(double f, double x, double a, double b) {
double r1757113 = 1.0;
double r1757114 = f;
double r1757115 = r1757113 * r1757114;
double r1757116 = x;
double r1757117 = r1757115 - r1757116;
double r1757118 = a;
double r1757119 = r1757117 * r1757118;
double r1757120 = b;
double r1757121 = r1757116 * r1757120;
double r1757122 = r1757119 + r1757121;
return r1757122;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\left(1 \cdot f - x\right) \cdot a + x \cdot b$
2. Final simplification0.0

$\leadsto \left(1 \cdot f - x\right) \cdot a + x \cdot b$

# Reproduce

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