Average Error: 0.3 → 0.4
Time: 33.6s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(1 + \sqrt{\frac{\tan x \cdot \sin x}{\cos x}}\right) \cdot \frac{1 - \sqrt{\frac{\tan x \cdot \sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\left(1 + \sqrt{\frac{\tan x \cdot \sin x}{\cos x}}\right) \cdot \frac{1 - \sqrt{\frac{\tan x \cdot \sin x}{\cos x}}}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r493645 = 1.0;
        double r493646 = x;
        double r493647 = tan(r493646);
        double r493648 = r493647 * r493647;
        double r493649 = r493645 - r493648;
        double r493650 = r493645 + r493648;
        double r493651 = r493649 / r493650;
        return r493651;
}

double f(double x) {
        double r493652 = 1.0;
        double r493653 = x;
        double r493654 = tan(r493653);
        double r493655 = sin(r493653);
        double r493656 = r493654 * r493655;
        double r493657 = cos(r493653);
        double r493658 = r493656 / r493657;
        double r493659 = sqrt(r493658);
        double r493660 = r493652 + r493659;
        double r493661 = r493652 - r493659;
        double r493662 = r493654 * r493654;
        double r493663 = r493652 + r493662;
        double r493664 = r493661 / r493663;
        double r493665 = r493660 * r493664;
        return r493665;
}

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 tan-quot0.4

    \[\leadsto \frac{1 - \tan x \cdot \color{blue}{\frac{\sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  4. Applied associate-*r/0.4

    \[\leadsto \frac{1 - \color{blue}{\frac{\tan x \cdot \sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity0.4

    \[\leadsto \frac{1 - \frac{\tan x \cdot \sin x}{\cos x}}{\color{blue}{1 \cdot \left(1 + \tan x \cdot \tan x\right)}}\]
  7. Applied add-sqr-sqrt0.4

    \[\leadsto \frac{1 - \color{blue}{\sqrt{\frac{\tan x \cdot \sin x}{\cos x}} \cdot \sqrt{\frac{\tan x \cdot \sin x}{\cos x}}}}{1 \cdot \left(1 + \tan x \cdot \tan x\right)}\]
  8. Applied *-un-lft-identity0.4

    \[\leadsto \frac{\color{blue}{1 \cdot 1} - \sqrt{\frac{\tan x \cdot \sin x}{\cos x}} \cdot \sqrt{\frac{\tan x \cdot \sin x}{\cos x}}}{1 \cdot \left(1 + \tan x \cdot \tan x\right)}\]
  9. Applied difference-of-squares0.4

    \[\leadsto \frac{\color{blue}{\left(1 + \sqrt{\frac{\tan x \cdot \sin x}{\cos x}}\right) \cdot \left(1 - \sqrt{\frac{\tan x \cdot \sin x}{\cos x}}\right)}}{1 \cdot \left(1 + \tan x \cdot \tan x\right)}\]
  10. Applied times-frac0.4

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

    \[\leadsto \left(1 + \sqrt{\frac{\tan x \cdot \sin x}{\cos x}}\right) \cdot \frac{1 - \sqrt{\frac{\tan x \cdot \sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]

Reproduce

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