\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r963032 = 1.0;
double r963033 = x;
double r963034 = r963032 + r963033;
double r963035 = log(r963034);
return r963035;
}
double f(double x) {
double r963036 = x;
double r963037 = log1p(r963036);
return r963037;
}




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