\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\frac{1 - \tan x \cdot \tan x}{\mathsf{fma}\left(\left(\tan x\right), \left(\tan x\right), 1\right)}double f(double x) {
double r5014025 = 1.0;
double r5014026 = x;
double r5014027 = tan(r5014026);
double r5014028 = r5014027 * r5014027;
double r5014029 = r5014025 - r5014028;
double r5014030 = r5014025 + r5014028;
double r5014031 = r5014029 / r5014030;
return r5014031;
}
double f(double x) {
double r5014032 = 1.0;
double r5014033 = x;
double r5014034 = tan(r5014033);
double r5014035 = r5014034 * r5014034;
double r5014036 = r5014032 - r5014035;
double r5014037 = fma(r5014034, r5014034, r5014032);
double r5014038 = r5014036 / r5014037;
return r5014038;
}



Bits error versus x
Initial program 0.3
rmApplied *-un-lft-identity0.3
Applied difference-of-squares0.4
rmApplied flip-+0.3
Applied associate-*l/0.4
Applied associate-/l/0.4
Simplified0.4
rmApplied associate-/l*0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019128 +o rules:numerics
(FPCore (x)
:name "Trigonometry B"
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))