\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r1604701 = 1.0;
double r1604702 = x;
double r1604703 = r1604701 + r1604702;
double r1604704 = log(r1604703);
return r1604704;
}
double f(double x) {
double r1604705 = x;
double r1604706 = log1p(r1604705);
return r1604706;
}




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