\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\frac{1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)}{\tan x \cdot \tan x + 1}}{\tan x \cdot \tan x + 1}\right)\right)double f(double x) {
double r525175 = 1.0;
double r525176 = x;
double r525177 = tan(r525176);
double r525178 = r525177 * r525177;
double r525179 = r525175 - r525178;
double r525180 = r525175 + r525178;
double r525181 = r525179 / r525180;
return r525181;
}
double f(double x) {
double r525182 = 1.0;
double r525183 = x;
double r525184 = tan(r525183);
double r525185 = r525184 * r525184;
double r525186 = r525185 * r525185;
double r525187 = r525182 - r525186;
double r525188 = r525185 + r525182;
double r525189 = r525187 / r525188;
double r525190 = r525189 / r525188;
double r525191 = log1p(r525190);
double r525192 = expm1(r525191);
return r525192;
}



Bits error versus x
Results
Initial program 0.3
rmApplied expm1-log1p-u0.4
rmApplied flip--0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019138 +o rules:numerics
(FPCore (x)
:name "Trigonometry B"
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))