\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r2234210 = 1.0;
double r2234211 = x;
double r2234212 = r2234210 + r2234211;
double r2234213 = log(r2234212);
return r2234213;
}
double f(double x) {
double r2234214 = x;
double r2234215 = log1p(r2234214);
return r2234215;
}




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