\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\frac{1 + \tan x}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x}}double f(double x) {
double r3023146 = 1.0;
double r3023147 = x;
double r3023148 = tan(r3023147);
double r3023149 = r3023148 * r3023148;
double r3023150 = r3023146 - r3023149;
double r3023151 = r3023146 + r3023149;
double r3023152 = r3023150 / r3023151;
return r3023152;
}
double f(double x) {
double r3023153 = 1.0;
double r3023154 = x;
double r3023155 = tan(r3023154);
double r3023156 = r3023153 + r3023155;
double r3023157 = r3023155 * r3023155;
double r3023158 = r3023153 + r3023157;
double r3023159 = r3023153 - r3023155;
double r3023160 = r3023158 / r3023159;
double r3023161 = r3023156 / r3023160;
return r3023161;
}



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