\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r2144735 = 1.0;
double r2144736 = x;
double r2144737 = r2144735 + r2144736;
double r2144738 = log(r2144737);
return r2144738;
}
double f(double x) {
double r2144739 = x;
double r2144740 = log1p(r2144739);
return r2144740;
}




Bits error versus x
Results
| Original | 39.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.0 |
Initial program 39.8
Simplified0.0
Final simplification0.0
herbie shell --seed 2019164 +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)))