\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le 3.887474187627610927514063365556824489489 \cdot 10^{-297}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot y}} + x\\
\mathbf{elif}\;x \le 2.739468334789370649568254673285532362384 \cdot 10^{-99}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} + x\\
\end{array}double f(double x, double y, double z) {
double r205928 = x;
double r205929 = y;
double r205930 = z;
double r205931 = r205929 + r205930;
double r205932 = r205928 * r205931;
double r205933 = r205932 / r205930;
return r205933;
}
double f(double x, double y, double z) {
double r205934 = x;
double r205935 = 3.887474187627611e-297;
bool r205936 = r205934 <= r205935;
double r205937 = 1.0;
double r205938 = z;
double r205939 = y;
double r205940 = r205934 * r205939;
double r205941 = r205938 / r205940;
double r205942 = r205937 / r205941;
double r205943 = r205942 + r205934;
double r205944 = 2.7394683347893706e-99;
bool r205945 = r205934 <= r205944;
double r205946 = r205934 / r205938;
double r205947 = fma(r205946, r205939, r205934);
double r205948 = r205938 / r205939;
double r205949 = r205934 / r205948;
double r205950 = r205949 + r205934;
double r205951 = r205945 ? r205947 : r205950;
double r205952 = r205936 ? r205943 : r205951;
return r205952;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 12.4 |
|---|---|
| Target | 3.2 |
| Herbie | 3.2 |
if x < 3.887474187627611e-297Initial program 12.2
Simplified3.5
Taylor expanded around 0 4.7
Simplified4.9
rmApplied fma-udef4.9
Simplified4.7
rmApplied clear-num4.8
if 3.887474187627611e-297 < x < 2.7394683347893706e-99Initial program 6.3
Simplified8.2
Taylor expanded around 0 3.5
Simplified3.1
if 2.7394683347893706e-99 < x Initial program 16.5
Simplified0.7
Taylor expanded around 0 5.2
Simplified5.6
rmApplied fma-udef5.6
Simplified5.2
rmApplied associate-/l*0.6
Final simplification3.2
herbie shell --seed 2019322 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))