\log \left(1 + x\right)
\mathsf{log1p}\left(x\right)
(FPCore (x) :precision binary64 (log (+ 1.0 x)))
(FPCore (x) :precision binary64 (log1p x))
double code(double x) {
return log(1.0 + x);
}
double code(double x) {
return log1p(x);
}




Bits error versus x
Results
| Original | 38.5 |
|---|---|
| Target | 0.3 |
| Herbie | 0.0 |
Initial program 38.5
Simplified0.0
Final simplification0.0
herbie shell --seed 2022020
(FPCore (x)
:name "ln(1 + x)"
:precision binary64
:herbie-target
(if (== (+ 1.0 x) 1.0) x (/ (* x (log (+ 1.0 x))) (- (+ 1.0 x) 1.0)))
(log (+ 1.0 x)))