Average Error: 0.3 → 0.3
Time: 19.0s
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 r891061 = 1.0;
        double r891062 = x;
        double r891063 = tan(r891062);
        double r891064 = r891063 * r891063;
        double r891065 = r891061 - r891064;
        double r891066 = r891061 + r891064;
        double r891067 = r891065 / r891066;
        return r891067;
}

double f(double x) {
        double r891068 = 1.0;
        double r891069 = x;
        double r891070 = tan(r891069);
        double r891071 = r891070 * r891070;
        double r891072 = -r891071;
        double r891073 = r891068 + r891072;
        double r891074 = r891071 + r891068;
        double r891075 = r891073 / r891074;
        return r891075;
}

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)))))