\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\left(1 + \tan x\right) \cdot \frac{1 - \tan x}{\tan x \cdot \tan x + 1}double f(double x) {
double r1685024 = 1.0;
double r1685025 = x;
double r1685026 = tan(r1685025);
double r1685027 = r1685026 * r1685026;
double r1685028 = r1685024 - r1685027;
double r1685029 = r1685024 + r1685027;
double r1685030 = r1685028 / r1685029;
return r1685030;
}
double f(double x) {
double r1685031 = 1.0;
double r1685032 = x;
double r1685033 = tan(r1685032);
double r1685034 = r1685031 + r1685033;
double r1685035 = r1685031 - r1685033;
double r1685036 = r1685033 * r1685033;
double r1685037 = r1685036 + r1685031;
double r1685038 = r1685035 / r1685037;
double r1685039 = r1685034 * r1685038;
return r1685039;
}



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