\frac{x}{y} \cdot \left(z - t\right) + t\frac{x}{y} \cdot z + \mathsf{fma}\left(\frac{x}{y}, -t, t\right)double f(double x, double y, double z, double t) {
double r273118 = x;
double r273119 = y;
double r273120 = r273118 / r273119;
double r273121 = z;
double r273122 = t;
double r273123 = r273121 - r273122;
double r273124 = r273120 * r273123;
double r273125 = r273124 + r273122;
return r273125;
}
double f(double x, double y, double z, double t) {
double r273126 = x;
double r273127 = y;
double r273128 = r273126 / r273127;
double r273129 = z;
double r273130 = r273128 * r273129;
double r273131 = t;
double r273132 = -r273131;
double r273133 = fma(r273128, r273132, r273131);
double r273134 = r273130 + r273133;
return r273134;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 1.8 |
|---|---|
| Target | 2.0 |
| Herbie | 1.7 |
Initial program 1.8
rmApplied sub-neg1.8
Applied distribute-lft-in1.8
Applied associate-+l+1.8
Simplified1.7
Final simplification1.7
herbie shell --seed 2019303 +o rules:numerics
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(if (< z 2.7594565545626922e-282) (+ (* (/ x y) (- z t)) t) (if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t)))
(+ (* (/ x y) (- z t)) t))