1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -29528028708.40175628662109375 \lor \neg \left(y \le 51008935.552216000854969024658203125\right):\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \frac{x - y}{1 - y}\right)\\
\end{array}double f(double x, double y) {
double r278295 = 1.0;
double r278296 = x;
double r278297 = y;
double r278298 = r278296 - r278297;
double r278299 = r278295 - r278297;
double r278300 = r278298 / r278299;
double r278301 = r278295 - r278300;
double r278302 = log(r278301);
double r278303 = r278295 - r278302;
return r278303;
}
double f(double x, double y) {
double r278304 = y;
double r278305 = -29528028708.401756;
bool r278306 = r278304 <= r278305;
double r278307 = 51008935.552216;
bool r278308 = r278304 <= r278307;
double r278309 = !r278308;
bool r278310 = r278306 || r278309;
double r278311 = 1.0;
double r278312 = x;
double r278313 = 2.0;
double r278314 = pow(r278304, r278313);
double r278315 = r278312 / r278314;
double r278316 = 1.0;
double r278317 = r278316 / r278304;
double r278318 = r278315 - r278317;
double r278319 = r278311 * r278318;
double r278320 = r278312 / r278304;
double r278321 = r278319 + r278320;
double r278322 = log(r278321);
double r278323 = r278311 - r278322;
double r278324 = r278312 - r278304;
double r278325 = r278311 - r278304;
double r278326 = r278324 / r278325;
double r278327 = r278311 - r278326;
double r278328 = log(r278327);
double r278329 = r278311 - r278328;
double r278330 = r278310 ? r278323 : r278329;
return r278330;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -29528028708.401756 or 51008935.552216 < y Initial program 46.9
Taylor expanded around inf 0.1
Simplified0.1
if -29528028708.401756 < y < 51008935.552216Initial program 0.2
rmApplied add-log-exp0.2
Applied diff-log0.2
rmApplied *-un-lft-identity0.2
Applied add-sqr-sqrt0.2
Applied times-frac0.2
Simplified0.2
rmApplied associate-*r/0.2
Applied log-div0.2
Simplified0.2
Final simplification0.1
herbie shell --seed 2019308
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< y -81284752.619472414) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y))))) (if (< y 3.0094271212461764e25) (log (/ (exp 1) (- 1 (/ (- x y) (- 1 y))))) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y)))))))
(- 1 (log (- 1 (/ (- x y) (- 1 y))))))