\tan \left(x + \varepsilon\right) - \tan x
\tan \left(x + \varepsilon\right) - \tan x
(FPCore (x eps) :precision binary64 (- (tan (+ x eps)) (tan x)))
(FPCore (x eps) :precision binary64 (- (tan (+ x eps)) (tan x)))
double code(double x, double eps) {
return tan(x + eps) - tan(x);
}
double code(double x, double eps) {
return tan(x + eps) - tan(x);
}




Bits error versus x




Bits error versus eps
Results
| Original | 37.1 |
|---|---|
| Target | 15.4 |
| Herbie | 37.1 |
Initial program 37.1
Simplified37.1
Final simplification37.1
herbie shell --seed 2021023
(FPCore (x eps)
:name "2tan (problem 3.3.2)"
:precision binary64
:herbie-target
(/ (sin eps) (* (cos x) (cos (+ x eps))))
(- (tan (+ x eps)) (tan x)))