Average Error: 0.3 → 0.4
Time: 17.8s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x \cdot \tan x}}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x \cdot \tan x}}
double f(double x) {
        double r19253 = 1.0;
        double r19254 = x;
        double r19255 = tan(r19254);
        double r19256 = r19255 * r19255;
        double r19257 = r19253 - r19256;
        double r19258 = r19253 + r19256;
        double r19259 = r19257 / r19258;
        return r19259;
}

double f(double x) {
        double r19260 = 1.0;
        double r19261 = 1.0;
        double r19262 = x;
        double r19263 = tan(r19262);
        double r19264 = r19263 * r19263;
        double r19265 = r19261 + r19264;
        double r19266 = r19261 - r19264;
        double r19267 = r19265 / r19266;
        double r19268 = r19260 / r19267;
        return r19268;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.3

    \[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
  2. Using strategy rm
  3. Applied clear-num0.4

    \[\leadsto \color{blue}{\frac{1}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x \cdot \tan x}}}\]
  4. Final simplification0.4

    \[\leadsto \frac{1}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x \cdot \tan x}}\]

Reproduce

herbie shell --seed 2019323 
(FPCore (x)
  :name "Trigonometry B"
  :precision binary64
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))