Average Error: 0.3 → 0.4
Time: 25.8s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\left(1 + \tan x \cdot \tan x\right) \cdot \left(1 - \frac{\sin x \cdot \tan x}{\cos x}\right)}{\left(1 + \tan x \cdot \tan x\right) \cdot 1 + \left(1 + \tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\left(1 + \tan x \cdot \tan x\right) \cdot \left(1 - \frac{\sin x \cdot \tan x}{\cos x}\right)}{\left(1 + \tan x \cdot \tan x\right) \cdot 1 + \left(1 + \tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)}
double f(double x) {
        double r743967 = 1.0;
        double r743968 = x;
        double r743969 = tan(r743968);
        double r743970 = r743969 * r743969;
        double r743971 = r743967 - r743970;
        double r743972 = r743967 + r743970;
        double r743973 = r743971 / r743972;
        return r743973;
}

double f(double x) {
        double r743974 = 1.0;
        double r743975 = x;
        double r743976 = tan(r743975);
        double r743977 = r743976 * r743976;
        double r743978 = r743974 + r743977;
        double r743979 = sin(r743975);
        double r743980 = r743979 * r743976;
        double r743981 = cos(r743975);
        double r743982 = r743980 / r743981;
        double r743983 = r743974 - r743982;
        double r743984 = r743978 * r743983;
        double r743985 = r743978 * r743974;
        double r743986 = r743978 * r743977;
        double r743987 = r743985 + r743986;
        double r743988 = r743984 / r743987;
        return r743988;
}

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 div-inv0.4

    \[\leadsto \color{blue}{\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{1 + \tan x \cdot \tan x}}\]
  4. Using strategy rm
  5. Applied flip--0.4

    \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)}{1 + \tan x \cdot \tan x}} \cdot \frac{1}{1 + \tan x \cdot \tan x}\]
  6. Applied frac-times0.4

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

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

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

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

    \[\leadsto \frac{\left(1 - \color{blue}{\frac{\sin x \cdot \tan x}{\cos x}}\right) \cdot \left(\tan x \cdot \tan x + 1\right)}{\left(\tan x \cdot \tan x + 1\right) \cdot \left(\tan x \cdot \tan x + 1\right)}\]
  12. Using strategy rm
  13. Applied distribute-lft-in0.4

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

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

Reproduce

herbie shell --seed 2019174 
(FPCore (x)
  :name "Trigonometry B"
  (/ (- 1.0 (* (tan x) (tan x))) (+ 1.0 (* (tan x) (tan x)))))