x + \frac{y \cdot \left(z - t\right)}{a - t}\mathsf{fma}\left(\frac{z - t}{a - t}, y, x\right)double f(double x, double y, double z, double t, double a) {
double r25781101 = x;
double r25781102 = y;
double r25781103 = z;
double r25781104 = t;
double r25781105 = r25781103 - r25781104;
double r25781106 = r25781102 * r25781105;
double r25781107 = a;
double r25781108 = r25781107 - r25781104;
double r25781109 = r25781106 / r25781108;
double r25781110 = r25781101 + r25781109;
return r25781110;
}
double f(double x, double y, double z, double t, double a) {
double r25781111 = z;
double r25781112 = t;
double r25781113 = r25781111 - r25781112;
double r25781114 = a;
double r25781115 = r25781114 - r25781112;
double r25781116 = r25781113 / r25781115;
double r25781117 = y;
double r25781118 = x;
double r25781119 = fma(r25781116, r25781117, r25781118);
return r25781119;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 10.6 |
|---|---|
| Target | 1.3 |
| Herbie | 1.4 |
Initial program 10.6
Simplified2.8
rmApplied div-inv2.9
rmApplied fma-udef2.9
Simplified10.6
rmApplied *-un-lft-identity10.6
Applied *-un-lft-identity10.6
Applied distribute-lft-out10.6
Simplified1.4
Final simplification1.4
herbie shell --seed 2019200 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))