\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r855205 = 1.0;
double r855206 = x;
double r855207 = r855205 + r855206;
double r855208 = log(r855207);
return r855208;
}
double f(double x) {
double r855209 = x;
double r855210 = log1p(r855209);
return r855210;
}




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