\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r2034345 = 1.0;
double r2034346 = x;
double r2034347 = r2034345 + r2034346;
double r2034348 = log(r2034347);
return r2034348;
}
double f(double x) {
double r2034349 = x;
double r2034350 = log1p(r2034349);
return r2034350;
}




Bits error versus x
Results
| Original | 38.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.0 |
Initial program 38.9
Simplified0.0
Final simplification0.0
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x)
:name "ln(1 + x)"
:herbie-target
(if (== (+ 1 x) 1) x (/ (* x (log (+ 1 x))) (- (+ 1 x) 1)))
(log (+ 1 x)))