Average Error: 0.3 → 0.4
Time: 15.4s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\sqrt{1} + \tan x}{1 + \tan x \cdot \tan x} \cdot \left(\sqrt{1} - \tan x\right)\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\sqrt{1} + \tan x}{1 + \tan x \cdot \tan x} \cdot \left(\sqrt{1} - \tan x\right)
double f(double x) {
        double r24508 = 1.0;
        double r24509 = x;
        double r24510 = tan(r24509);
        double r24511 = r24510 * r24510;
        double r24512 = r24508 - r24511;
        double r24513 = r24508 + r24511;
        double r24514 = r24512 / r24513;
        return r24514;
}

double f(double x) {
        double r24515 = 1.0;
        double r24516 = sqrt(r24515);
        double r24517 = x;
        double r24518 = tan(r24517);
        double r24519 = r24516 + r24518;
        double r24520 = r24518 * r24518;
        double r24521 = r24515 + r24520;
        double r24522 = r24519 / r24521;
        double r24523 = r24516 - r24518;
        double r24524 = r24522 * r24523;
        return r24524;
}

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 add-sqr-sqrt0.3

    \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{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(\sqrt{1} + \tan x\right) \cdot \left(\sqrt{1} - \tan x\right)}}{1 \cdot \left(1 + \tan x \cdot \tan x\right)}\]
  6. Applied times-frac0.4

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

    \[\leadsto \color{blue}{\left(\sqrt{1} + \tan x\right)} \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}\]
  8. Using strategy rm
  9. Applied div-sub0.4

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

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

Reproduce

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