\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r1661056 = 1.0;
double r1661057 = x;
double r1661058 = r1661056 + r1661057;
double r1661059 = log(r1661058);
return r1661059;
}
double f(double x) {
double r1661060 = x;
double r1661061 = log1p(r1661060);
return r1661061;
}




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