\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r1274986 = 1.0;
double r1274987 = x;
double r1274988 = r1274986 + r1274987;
double r1274989 = log(r1274988);
return r1274989;
}
double f(double x) {
double r1274990 = x;
double r1274991 = log1p(r1274990);
return r1274991;
}




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