1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \leq -93755730.34262806 \lor \neg \left(y \leq 85028056.792489\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{\frac{x}{y} + 1 \cdot \frac{\frac{x}{y} + -1}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 + \left(y + 1\right) \cdot \frac{y - x}{1 \cdot 1 - y \cdot y}\right)\\
\end{array}double code(double x, double y) {
return ((double) (1.0 - ((double) log(((double) (1.0 - (((double) (x - y)) / ((double) (1.0 - y)))))))));
}
double code(double x, double y) {
double VAR;
if (((y <= -93755730.34262806) || !(y <= 85028056.792489))) {
VAR = ((double) log((((double) exp(1.0)) / ((double) ((x / y) + ((double) (1.0 * (((double) ((x / y) + -1.0)) / y))))))));
} else {
VAR = ((double) (1.0 - ((double) log(((double) (1.0 + ((double) (((double) (y + 1.0)) * (((double) (y - x)) / ((double) (((double) (1.0 * 1.0)) - ((double) (y * y)))))))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -93755730.342628062 or 85028056.7924890071 < y Initial program Error: 47.0 bits
Taylor expanded around inf Error: 0.1 bits
SimplifiedError: 0.1 bits
rmApplied add-log-expError: 0.1 bits
Applied diff-logError: 0.2 bits
SimplifiedError: 0.2 bits
if -93755730.342628062 < y < 85028056.7924890071Initial program Error: 0.1 bits
rmApplied flip--Error: 0.1 bits
Applied associate-/r/Error: 0.1 bits
Final simplificationError: 0.1 bits
herbie shell --seed 2020200
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< y -81284752.61947241) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1.0) (- 1.0 (/ (- x y) (- 1.0 y))))) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y)))))))
(- 1.0 (log (- 1.0 (/ (- x y) (- 1.0 y))))))