Average Error: 0.3 → 0.4
Time: 10.1s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(\sqrt{1} + \tan x\right) \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\left(\sqrt{1} + \tan x\right) \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r11639 = 1.0;
        double r11640 = x;
        double r11641 = tan(r11640);
        double r11642 = r11641 * r11641;
        double r11643 = r11639 - r11642;
        double r11644 = r11639 + r11642;
        double r11645 = r11643 / r11644;
        return r11645;
}

double f(double x) {
        double r11646 = 1.0;
        double r11647 = sqrt(r11646);
        double r11648 = x;
        double r11649 = tan(r11648);
        double r11650 = r11647 + r11649;
        double r11651 = r11647 - r11649;
        double r11652 = r11649 * r11649;
        double r11653 = r11646 + r11652;
        double r11654 = r11651 / r11653;
        double r11655 = r11650 * r11654;
        return r11655;
}

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. Final simplification0.4

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

Reproduce

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