\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r1482282 = 1.0;
double r1482283 = x;
double r1482284 = r1482282 + r1482283;
double r1482285 = log(r1482284);
return r1482285;
}
double f(double x) {
double r1482286 = x;
double r1482287 = log1p(r1482286);
return r1482287;
}




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