Average Error: 0.3 → 0.3
Time: 17.1s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 + \left(-\tan x \cdot \tan x\right)}{\tan x \cdot \tan x + 1}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 + \left(-\tan x \cdot \tan x\right)}{\tan x \cdot \tan x + 1}
double f(double x) {
        double r800882 = 1.0;
        double r800883 = x;
        double r800884 = tan(r800883);
        double r800885 = r800884 * r800884;
        double r800886 = r800882 - r800885;
        double r800887 = r800882 + r800885;
        double r800888 = r800886 / r800887;
        return r800888;
}

double f(double x) {
        double r800889 = 1.0;
        double r800890 = x;
        double r800891 = tan(r800890);
        double r800892 = r800891 * r800891;
        double r800893 = -r800892;
        double r800894 = r800889 + r800893;
        double r800895 = r800892 + r800889;
        double r800896 = r800894 / r800895;
        return r800896;
}

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

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

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

Reproduce

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