1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\begin{array}{l}
\mathbf{if}\;y \le -360301218.9043175 \lor \neg \left(y \le 149564260.861771911\right):\\
\;\;\;\;1 \cdot \left(\frac{1}{y} - \frac{x}{y}\right) + x\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{y + 1} \cdot \left(\left(1 - x\right) \cdot y\right)\\
\end{array}double f(double x, double y) {
double r4132 = 1.0;
double r4133 = x;
double r4134 = r4132 - r4133;
double r4135 = y;
double r4136 = r4134 * r4135;
double r4137 = r4135 + r4132;
double r4138 = r4136 / r4137;
double r4139 = r4132 - r4138;
return r4139;
}
double f(double x, double y) {
double r4140 = y;
double r4141 = -360301218.9043175;
bool r4142 = r4140 <= r4141;
double r4143 = 149564260.8617719;
bool r4144 = r4140 <= r4143;
double r4145 = !r4144;
bool r4146 = r4142 || r4145;
double r4147 = 1.0;
double r4148 = 1.0;
double r4149 = r4148 / r4140;
double r4150 = x;
double r4151 = r4150 / r4140;
double r4152 = r4149 - r4151;
double r4153 = r4147 * r4152;
double r4154 = r4153 + r4150;
double r4155 = r4140 + r4147;
double r4156 = r4148 / r4155;
double r4157 = r4147 - r4150;
double r4158 = r4157 * r4140;
double r4159 = r4156 * r4158;
double r4160 = r4147 - r4159;
double r4161 = r4146 ? r4154 : r4160;
return r4161;
}




Bits error versus x




Bits error versus y
Results
| Original | 22.7 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
if y < -360301218.9043175 or 149564260.8617719 < y Initial program 46.1
Taylor expanded around inf 0.2
Simplified0.2
if -360301218.9043175 < y < 149564260.8617719Initial program 0.2
rmApplied associate-/l*0.2
rmApplied div-inv0.2
Applied *-un-lft-identity0.2
Applied times-frac0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020025
(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))))