\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\frac{\left(\tan x + 1\right) \cdot \left(1 - \tan x\right)}{1 + {\tan x}^{2}}(FPCore (x) :precision binary64 (/ (- 1.0 (* (tan x) (tan x))) (+ 1.0 (* (tan x) (tan x)))))
(FPCore (x) :precision binary64 (/ (* (+ (tan x) 1.0) (- 1.0 (tan x))) (+ 1.0 (pow (tan x) 2.0))))
double code(double x) {
return (1.0 - (tan(x) * tan(x))) / (1.0 + (tan(x) * tan(x)));
}
double code(double x) {
return ((tan(x) + 1.0) * (1.0 - tan(x))) / (1.0 + pow(tan(x), 2.0));
}






Bits error versus x
Results
| Alternative 1 | |
|---|---|
| Error | 0.3 |
| Cost | 26176 |
| Alternative 2 | |
|---|---|
| Error | 25.9 |
| Cost | 13056 |
| Alternative 3 | |
|---|---|
| Error | 28.7 |
| Cost | 64 |


Initial program 0.3
rmApplied add-sqr-sqrt_binary64_1000.3
Applied difference-of-squares_binary64_470.4
Simplified0.4
Simplified0.4
rmApplied pow2_binary64_1590.4
rmApplied pow1_binary64_1390.4
Applied pow1_binary64_1390.4
Applied pow-prod-down_binary64_1490.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2021040
(FPCore (x)
:name "Trigonometry B"
:precision binary64
(/ (- 1.0 (* (tan x) (tan x))) (+ 1.0 (* (tan x) (tan x)))))