\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -2.073980726117884802107450590791436932533 \cdot 10^{-225} \lor \neg \left(a \le 1.563379921336354695015274590614129069856 \cdot 10^{-22}\right):\\
\;\;\;\;\frac{t - z}{a - t} \cdot y + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{t} + x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r341007 = x;
double r341008 = y;
double r341009 = r341007 + r341008;
double r341010 = z;
double r341011 = t;
double r341012 = r341010 - r341011;
double r341013 = r341012 * r341008;
double r341014 = a;
double r341015 = r341014 - r341011;
double r341016 = r341013 / r341015;
double r341017 = r341009 - r341016;
return r341017;
}
double f(double x, double y, double z, double t, double a) {
double r341018 = a;
double r341019 = -2.0739807261178848e-225;
bool r341020 = r341018 <= r341019;
double r341021 = 1.5633799213363547e-22;
bool r341022 = r341018 <= r341021;
double r341023 = !r341022;
bool r341024 = r341020 || r341023;
double r341025 = t;
double r341026 = z;
double r341027 = r341025 - r341026;
double r341028 = r341018 - r341025;
double r341029 = r341027 / r341028;
double r341030 = y;
double r341031 = r341029 * r341030;
double r341032 = x;
double r341033 = r341032 + r341030;
double r341034 = r341031 + r341033;
double r341035 = r341026 * r341030;
double r341036 = r341035 / r341025;
double r341037 = r341036 + r341032;
double r341038 = r341024 ? r341034 : r341037;
return r341038;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 16.2 |
|---|---|
| Target | 8.3 |
| Herbie | 9.6 |
if a < -2.0739807261178848e-225 or 1.5633799213363547e-22 < a Initial program 14.7
Simplified8.4
rmApplied fma-udef8.4
if -2.0739807261178848e-225 < a < 1.5633799213363547e-22Initial program 19.8
Simplified19.5
rmApplied fma-udef19.5
rmApplied add-cube-cbrt19.8
Applied associate-/r*19.8
rmApplied add-cube-cbrt19.8
Applied cbrt-prod19.8
Applied add-cube-cbrt19.9
Applied times-frac19.8
Applied times-frac19.9
Applied associate-*l*17.1
Simplified17.2
Taylor expanded around inf 12.6
Final simplification9.6
herbie shell --seed 2019325 +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))))