\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r2140643 = 1.0;
double r2140644 = x;
double r2140645 = r2140643 + r2140644;
double r2140646 = log(r2140645);
return r2140646;
}
double f(double x) {
double r2140647 = x;
double r2140648 = log1p(r2140647);
return r2140648;
}




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