Average Error: 0.3 → 0.4
Time: 5.0s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(\sqrt{1} + \tan x\right) \cdot \frac{\frac{1 - \tan x \cdot \tan x}{\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{\frac{1 - \tan x \cdot \tan x}{\sqrt{1} + \tan x}}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r11549 = 1.0;
        double r11550 = x;
        double r11551 = tan(r11550);
        double r11552 = r11551 * r11551;
        double r11553 = r11549 - r11552;
        double r11554 = r11549 + r11552;
        double r11555 = r11553 / r11554;
        return r11555;
}

double f(double x) {
        double r11556 = 1.0;
        double r11557 = sqrt(r11556);
        double r11558 = x;
        double r11559 = tan(r11558);
        double r11560 = r11557 + r11559;
        double r11561 = r11559 * r11559;
        double r11562 = r11556 - r11561;
        double r11563 = r11562 / r11560;
        double r11564 = r11556 + r11561;
        double r11565 = r11563 / r11564;
        double r11566 = r11560 * r11565;
        return r11566;
}

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.3

    \[\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 flip--0.4

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

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

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

Reproduce

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