\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\right)\right)double f(double x) {
double r11629 = 1.0;
double r11630 = x;
double r11631 = tan(r11630);
double r11632 = r11631 * r11631;
double r11633 = r11629 - r11632;
double r11634 = r11629 + r11632;
double r11635 = r11633 / r11634;
return r11635;
}
double f(double x) {
double r11636 = 1.0;
double r11637 = x;
double r11638 = tan(r11637);
double r11639 = r11638 * r11638;
double r11640 = r11636 - r11639;
double r11641 = r11636 + r11639;
double r11642 = r11640 / r11641;
double r11643 = log1p(r11642);
double r11644 = expm1(r11643);
return r11644;
}



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