1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -153989642.26731661 \lor \neg \left(y \le 96213748.28506726\right):\\
\;\;\;\;\left(\frac{1}{y} + x\right) - 1 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x - 1}{y \cdot y - 1 \cdot 1} \cdot \left(y - 1\right), y, 1\right)\\
\end{array}double f(double x, double y) {
double r731146 = 1.0;
double r731147 = x;
double r731148 = r731146 - r731147;
double r731149 = y;
double r731150 = r731148 * r731149;
double r731151 = r731149 + r731146;
double r731152 = r731150 / r731151;
double r731153 = r731146 - r731152;
return r731153;
}
double f(double x, double y) {
double r731154 = y;
double r731155 = -153989642.2673166;
bool r731156 = r731154 <= r731155;
double r731157 = 96213748.28506726;
bool r731158 = r731154 <= r731157;
double r731159 = !r731158;
bool r731160 = r731156 || r731159;
double r731161 = 1.0;
double r731162 = r731161 / r731154;
double r731163 = x;
double r731164 = r731162 + r731163;
double r731165 = r731163 / r731154;
double r731166 = r731161 * r731165;
double r731167 = r731164 - r731166;
double r731168 = r731163 - r731161;
double r731169 = r731154 * r731154;
double r731170 = r731161 * r731161;
double r731171 = r731169 - r731170;
double r731172 = r731168 / r731171;
double r731173 = r731154 - r731161;
double r731174 = r731172 * r731173;
double r731175 = fma(r731174, r731154, r731161);
double r731176 = r731160 ? r731167 : r731175;
return r731176;
}




Bits error versus x




Bits error versus y
| Original | 21.9 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
if y < -153989642.2673166 or 96213748.28506726 < y Initial program 45.0
Simplified29.1
rmApplied flip-+45.3
Applied associate-/r/45.4
Taylor expanded around inf 0.2
Simplified0.2
if -153989642.2673166 < y < 96213748.28506726Initial program 0.1
Simplified0.1
rmApplied flip-+0.1
Applied associate-/r/0.1
Final simplification0.2
herbie shell --seed 2020046 +o rules:numerics
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:herbie-target
(if (< y -3693.8482788297247) (- (/ 1 y) (- (/ x y) x)) (if (< y 6799310503.41891) (- 1 (/ (* (- 1 x) y) (+ y 1))) (- (/ 1 y) (- (/ x y) x))))
(- 1 (/ (* (- 1 x) y) (+ y 1))))