Average Error: 0.3 → 0.4
Time: 15.1s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\frac{{1}^{3} - {\left(\tan x \cdot \tan x\right)}^{3}}{\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x + 1\right) + 1 \cdot 1}}{1 + \tan x \cdot \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\frac{{1}^{3} - {\left(\tan x \cdot \tan x\right)}^{3}}{\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x + 1\right) + 1 \cdot 1}}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r22326 = 1.0;
        double r22327 = x;
        double r22328 = tan(r22327);
        double r22329 = r22328 * r22328;
        double r22330 = r22326 - r22329;
        double r22331 = r22326 + r22329;
        double r22332 = r22330 / r22331;
        return r22332;
}

double f(double x) {
        double r22333 = 1.0;
        double r22334 = 3.0;
        double r22335 = pow(r22333, r22334);
        double r22336 = x;
        double r22337 = tan(r22336);
        double r22338 = r22337 * r22337;
        double r22339 = pow(r22338, r22334);
        double r22340 = r22335 - r22339;
        double r22341 = r22338 + r22333;
        double r22342 = r22338 * r22341;
        double r22343 = r22333 * r22333;
        double r22344 = r22342 + r22343;
        double r22345 = r22340 / r22344;
        double r22346 = r22333 + r22338;
        double r22347 = r22345 / r22346;
        return r22347;
}

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 flip3--0.4

    \[\leadsto \frac{\color{blue}{\frac{{1}^{3} - {\left(\tan x \cdot \tan x\right)}^{3}}{1 \cdot 1 + \left(\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right) + 1 \cdot \left(\tan x \cdot \tan x\right)\right)}}}{1 + \tan x \cdot \tan x}\]
  4. Simplified0.4

    \[\leadsto \frac{\frac{{1}^{3} - {\left(\tan x \cdot \tan x\right)}^{3}}{\color{blue}{\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x + 1\right) + 1 \cdot 1}}}{1 + \tan x \cdot \tan x}\]
  5. Final simplification0.4

    \[\leadsto \frac{\frac{{1}^{3} - {\left(\tan x \cdot \tan x\right)}^{3}}{\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x + 1\right) + 1 \cdot 1}}{1 + \tan x \cdot \tan x}\]

Reproduce

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