Average Error: 0.3 → 0.4
Time: 8.3s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(\tan x + \sqrt{1}\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(\tan x + \sqrt{1}\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 r11977 = 1.0;
        double r11978 = x;
        double r11979 = tan(r11978);
        double r11980 = r11979 * r11979;
        double r11981 = r11977 - r11980;
        double r11982 = r11977 + r11980;
        double r11983 = r11981 / r11982;
        return r11983;
}

double f(double x) {
        double r11984 = x;
        double r11985 = tan(r11984);
        double r11986 = 1.0;
        double r11987 = sqrt(r11986);
        double r11988 = r11985 + r11987;
        double r11989 = r11985 * r11985;
        double r11990 = r11986 - r11989;
        double r11991 = r11987 + r11985;
        double r11992 = r11990 / r11991;
        double r11993 = r11986 + r11989;
        double r11994 = r11992 / r11993;
        double r11995 = r11988 * r11994;
        return r11995;
}

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(\tan x + \sqrt{1}\right)} \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}\]
  8. Using strategy rm
  9. Applied flip--0.4

    \[\leadsto \left(\tan x + \sqrt{1}\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(\tan x + \sqrt{1}\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(\tan x + \sqrt{1}\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 
(FPCore (x)
  :name "Trigonometry B"
  :precision binary64
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))