\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r2040229 = 1.0;
double r2040230 = x;
double r2040231 = r2040229 + r2040230;
double r2040232 = log(r2040231);
return r2040232;
}
double f(double x) {
double r2040233 = x;
double r2040234 = log1p(r2040233);
return r2040234;
}




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