\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)double f(double x) {
double r1224864 = 1.0;
double r1224865 = x;
double r1224866 = r1224864 + r1224865;
double r1224867 = log(r1224866);
return r1224867;
}
double f(double x) {
double r1224868 = x;
double r1224869 = log1p(r1224868);
return r1224869;
}




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