Average Error: 0.3 → 0.3
Time: 37.0s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \tan x \cdot \tan x}{\tan x \cdot \tan x + 1}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 - \tan x \cdot \tan x}{\tan x \cdot \tan x + 1}
double f(double x) {
        double r512687 = 1.0;
        double r512688 = x;
        double r512689 = tan(r512688);
        double r512690 = r512689 * r512689;
        double r512691 = r512687 - r512690;
        double r512692 = r512687 + r512690;
        double r512693 = r512691 / r512692;
        return r512693;
}

double f(double x) {
        double r512694 = 1.0;
        double r512695 = x;
        double r512696 = tan(r512695);
        double r512697 = r512696 * r512696;
        double r512698 = r512694 - r512697;
        double r512699 = r512697 + r512694;
        double r512700 = r512698 / r512699;
        return r512700;
}

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 div-sub0.4

    \[\leadsto \color{blue}{\frac{1}{1 + \tan x \cdot \tan x} - \frac{\tan x \cdot \tan x}{1 + \tan x \cdot \tan x}}\]
  4. Using strategy rm
  5. Applied sub-div0.3

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

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

Reproduce

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