\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{\mathsf{fma}\left(\tan x, \tan x, 1\right)}double f(double x) {
double r18304 = 1.0;
double r18305 = x;
double r18306 = tan(r18305);
double r18307 = r18306 * r18306;
double r18308 = r18304 - r18307;
double r18309 = r18304 + r18307;
double r18310 = r18308 / r18309;
return r18310;
}
double f(double x) {
double r18311 = 1.0;
double r18312 = x;
double r18313 = tan(r18312);
double r18314 = r18313 * r18313;
double r18315 = r18311 - r18314;
double r18316 = 1.0;
double r18317 = fma(r18313, r18313, r18311);
double r18318 = r18316 / r18317;
double r18319 = r18315 * r18318;
return r18319;
}



Bits error versus x
Initial program 0.3
Simplified0.3
rmApplied clear-num0.4
rmApplied flip--0.4
Applied associate-/r/0.5
Applied add-cube-cbrt0.5
Applied times-frac0.5
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019325 +o rules:numerics
(FPCore (x)
:name "Trigonometry B"
:precision binary64
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))