1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -15892410532.141876 \lor \neg \left(y \le 132206673.377225175\right):\\
\;\;\;\;\mathsf{fma}\left(1, \frac{1}{y} - \frac{x}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \mathsf{fma}\left(\frac{x - 1}{y + 1}, y, 1\right)\\
\end{array}double f(double x, double y) {
double r609818 = 1.0;
double r609819 = x;
double r609820 = r609818 - r609819;
double r609821 = y;
double r609822 = r609820 * r609821;
double r609823 = r609821 + r609818;
double r609824 = r609822 / r609823;
double r609825 = r609818 - r609824;
return r609825;
}
double f(double x, double y) {
double r609826 = y;
double r609827 = -15892410532.141876;
bool r609828 = r609826 <= r609827;
double r609829 = 132206673.37722518;
bool r609830 = r609826 <= r609829;
double r609831 = !r609830;
bool r609832 = r609828 || r609831;
double r609833 = 1.0;
double r609834 = 1.0;
double r609835 = r609834 / r609826;
double r609836 = x;
double r609837 = r609836 / r609826;
double r609838 = r609835 - r609837;
double r609839 = fma(r609833, r609838, r609836);
double r609840 = r609836 - r609833;
double r609841 = r609826 + r609833;
double r609842 = r609840 / r609841;
double r609843 = fma(r609842, r609826, r609833);
double r609844 = r609834 * r609843;
double r609845 = r609832 ? r609839 : r609844;
return r609845;
}




Bits error versus x




Bits error versus y
| Original | 21.8 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
if y < -15892410532.141876 or 132206673.37722518 < y Initial program 45.7
Simplified29.2
rmApplied clear-num29.2
rmApplied fma-udef29.2
Simplified29.2
Taylor expanded around inf 0.1
Simplified0.1
if -15892410532.141876 < y < 132206673.37722518Initial program 0.2
Simplified0.2
rmApplied clear-num0.3
rmApplied fma-udef0.3
Simplified0.3
rmApplied *-un-lft-identity0.3
Applied *-un-lft-identity0.3
Applied distribute-lft-out0.3
Simplified0.2
Final simplification0.2
herbie shell --seed 2020039 +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))))