Average Error: 0.3 → 0.4
Time: 23.9s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \tan x \cdot \tan x}{1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)} \cdot \left(1 - \tan x \cdot \tan x\right)\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 - \tan x \cdot \tan x}{1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)} \cdot \left(1 - \tan x \cdot \tan x\right)
double f(double x) {
        double r450983 = 1.0;
        double r450984 = x;
        double r450985 = tan(r450984);
        double r450986 = r450985 * r450985;
        double r450987 = r450983 - r450986;
        double r450988 = r450983 + r450986;
        double r450989 = r450987 / r450988;
        return r450989;
}

double f(double x) {
        double r450990 = 1.0;
        double r450991 = x;
        double r450992 = tan(r450991);
        double r450993 = r450992 * r450992;
        double r450994 = r450990 - r450993;
        double r450995 = r450993 * r450993;
        double r450996 = r450990 - r450995;
        double r450997 = r450994 / r450996;
        double r450998 = r450997 * r450994;
        return r450998;
}

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 flip-+0.4

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{\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}}}\]
  4. Applied associate-/r/0.4

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

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

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

Reproduce

herbie shell --seed 2019135 +o rules:numerics
(FPCore (x)
  :name "Trigonometry B"
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))