Average Error: 0.3 → 0.4
Time: 20.5s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(1 + \tan x\right) \cdot \frac{1 - \tan x}{\tan x \cdot \tan x + 1}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\left(1 + \tan x\right) \cdot \frac{1 - \tan x}{\tan x \cdot \tan x + 1}
double f(double x) {
        double r452806 = 1.0;
        double r452807 = x;
        double r452808 = tan(r452807);
        double r452809 = r452808 * r452808;
        double r452810 = r452806 - r452809;
        double r452811 = r452806 + r452809;
        double r452812 = r452810 / r452811;
        return r452812;
}

double f(double x) {
        double r452813 = 1.0;
        double r452814 = x;
        double r452815 = tan(r452814);
        double r452816 = r452813 + r452815;
        double r452817 = r452813 - r452815;
        double r452818 = r452815 * r452815;
        double r452819 = r452818 + r452813;
        double r452820 = r452817 / r452819;
        double r452821 = r452816 * r452820;
        return r452821;
}

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 *-un-lft-identity0.3

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

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

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

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

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

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

Reproduce

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