Average Error: 0.3 → 0.3
Time: 4.8s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r11282 = 1.0;
        double r11283 = x;
        double r11284 = tan(r11283);
        double r11285 = r11284 * r11284;
        double r11286 = r11282 - r11285;
        double r11287 = r11282 + r11285;
        double r11288 = r11286 / r11287;
        return r11288;
}

double f(double x) {
        double r11289 = 1.0;
        double r11290 = x;
        double r11291 = tan(r11290);
        double r11292 = r11291 * r11291;
        double r11293 = r11289 - r11292;
        double r11294 = r11289 + r11292;
        double r11295 = r11293 / r11294;
        return r11295;
}

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

    \[\leadsto \color{blue}{\left(1 \cdot \left(\sqrt{1} + \tan x\right)\right)} \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}\]
  10. Applied associate-*l*0.4

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

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

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

Reproduce

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