\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r1003112 = 1.0;
double r1003113 = x;
double r1003114 = r1003112 + r1003113;
double r1003115 = log(r1003114);
return r1003115;
}
double f(double x) {
double r1003116 = x;
double r1003117 = log1p(r1003116);
return r1003117;
}




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