\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r1988596 = 1.0;
double r1988597 = x;
double r1988598 = r1988596 + r1988597;
double r1988599 = log(r1988598);
return r1988599;
}
double f(double x) {
double r1988600 = x;
double r1988601 = log1p(r1988600);
return r1988601;
}




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)))