\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;t \le -1.92814178504205926 \cdot 10^{65} \lor \neg \left(t \le 4.5256314156925584 \cdot 10^{46}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t - z}{a - t}, x + y\right)\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r545882 = x;
double r545883 = y;
double r545884 = r545882 + r545883;
double r545885 = z;
double r545886 = t;
double r545887 = r545885 - r545886;
double r545888 = r545887 * r545883;
double r545889 = a;
double r545890 = r545889 - r545886;
double r545891 = r545888 / r545890;
double r545892 = r545884 - r545891;
return r545892;
}
double f(double x, double y, double z, double t, double a) {
double r545893 = t;
double r545894 = -1.9281417850420593e+65;
bool r545895 = r545893 <= r545894;
double r545896 = 4.5256314156925584e+46;
bool r545897 = r545893 <= r545896;
double r545898 = !r545897;
bool r545899 = r545895 || r545898;
double r545900 = z;
double r545901 = r545900 / r545893;
double r545902 = y;
double r545903 = x;
double r545904 = fma(r545901, r545902, r545903);
double r545905 = r545893 - r545900;
double r545906 = a;
double r545907 = r545906 - r545893;
double r545908 = r545905 / r545907;
double r545909 = r545903 + r545902;
double r545910 = fma(r545902, r545908, r545909);
double r545911 = r545899 ? r545904 : r545910;
return r545911;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 16.3 |
|---|---|
| Target | 8.1 |
| Herbie | 8.9 |
if t < -1.9281417850420593e+65 or 4.5256314156925584e+46 < t Initial program 28.2
Simplified19.9
rmApplied fma-udef20.0
rmApplied div-inv20.0
Applied associate-*l*19.0
Simplified19.0
Taylor expanded around inf 17.5
Simplified13.0
if -1.9281417850420593e+65 < t < 4.5256314156925584e+46Initial program 6.8
Simplified5.2
rmApplied fma-udef5.3
rmApplied div-inv5.3
Applied associate-*l*5.6
Simplified5.6
rmApplied fma-def5.6
Final simplification8.9
herbie shell --seed 2020065 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))