\left(\left(x \cdot y - y \cdot z\right) - y \cdot y\right) + y \cdot y
\mathsf{fma}\left(y, x, \left(-y\right) \cdot z\right)double f(double x, double y, double z) {
double r478211 = x;
double r478212 = y;
double r478213 = r478211 * r478212;
double r478214 = z;
double r478215 = r478212 * r478214;
double r478216 = r478213 - r478215;
double r478217 = r478212 * r478212;
double r478218 = r478216 - r478217;
double r478219 = r478218 + r478217;
return r478219;
}
double f(double x, double y, double z) {
double r478220 = y;
double r478221 = x;
double r478222 = -r478220;
double r478223 = z;
double r478224 = r478222 * r478223;
double r478225 = fma(r478220, r478221, r478224);
return r478225;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 17.3 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 17.3
Simplified0.0
rmApplied sub-neg0.0
Applied distribute-lft-in0.0
Simplified0.0
rmApplied fma-def0.0
Final simplification0.0
herbie shell --seed 2019194 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$c/ from linear-1.19.1.3, B"
:herbie-target
(* (- x z) y)
(+ (- (- (* x y) (* y z)) (* y y)) (* y y)))