\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\frac{1 - \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}{\frac{{\left(\sin x\right)}^{2}}{\mathsf{log1p}\left(\mathsf{expm1}\left({\left(\cos x\right)}^{2}\right)\right)} + 1}double f(double x) {
double r11306 = 1.0;
double r11307 = x;
double r11308 = tan(r11307);
double r11309 = r11308 * r11308;
double r11310 = r11306 - r11309;
double r11311 = r11306 + r11309;
double r11312 = r11310 / r11311;
return r11312;
}
double f(double x) {
double r11313 = 1.0;
double r11314 = x;
double r11315 = sin(r11314);
double r11316 = 2.0;
double r11317 = pow(r11315, r11316);
double r11318 = cos(r11314);
double r11319 = pow(r11318, r11316);
double r11320 = r11317 / r11319;
double r11321 = r11313 - r11320;
double r11322 = expm1(r11319);
double r11323 = log1p(r11322);
double r11324 = r11317 / r11323;
double r11325 = r11324 + r11313;
double r11326 = r11321 / r11325;
return r11326;
}



Bits error versus x
Results
Initial program 0.3
Taylor expanded around inf 0.4
rmApplied log1p-expm1-u0.4
Final simplification0.4
herbie shell --seed 2020064 +o rules:numerics
(FPCore (x)
:name "Trigonometry B"
:precision binary64
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))