Average Error: 0.0 → 0.0
Time: 14.3s
Precision: 64
$\left(y - y \cdot x\right) + z \cdot x$
$y + \left(z - y\right) \cdot x$
\left(y - y \cdot x\right) + z \cdot x
y + \left(z - y\right) \cdot x
double f(double y, double x, double z) {
double r50948940 = y;
double r50948941 = x;
double r50948942 = r50948940 * r50948941;
double r50948943 = r50948940 - r50948942;
double r50948944 = z;
double r50948945 = r50948944 * r50948941;
double r50948946 = r50948943 + r50948945;
return r50948946;
}


double f(double y, double x, double z) {
double r50948947 = y;
double r50948948 = z;
double r50948949 = r50948948 - r50948947;
double r50948950 = x;
double r50948951 = r50948949 * r50948950;
double r50948952 = r50948947 + r50948951;
return r50948952;
}



# Try it out

Your Program's Arguments

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.0

$\left(y - y \cdot x\right) + z \cdot x$
2. Simplified0.0

$\leadsto \color{blue}{x \cdot \left(z - y\right) + y}$
3. Final simplification0.0

$\leadsto y + \left(z - y\right) \cdot x$

# Reproduce

herbie shell --seed 1
(FPCore (y x z)
:name "y - y*x + z*x"
(+ (- y (* y x)) (* z x)))