Average Error: 0.3 → 0.4
Time: 14.6s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1}{\tan x \cdot \tan x + 1} - \frac{\tan x \cdot \tan x}{\tan x \cdot \tan x + 1}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1}{\tan x \cdot \tan x + 1} - \frac{\tan x \cdot \tan x}{\tan x \cdot \tan x + 1}
double f(double x) {
        double r20487 = 1.0;
        double r20488 = x;
        double r20489 = tan(r20488);
        double r20490 = r20489 * r20489;
        double r20491 = r20487 - r20490;
        double r20492 = r20487 + r20490;
        double r20493 = r20491 / r20492;
        return r20493;
}

double f(double x) {
        double r20494 = 1.0;
        double r20495 = x;
        double r20496 = tan(r20495);
        double r20497 = r20496 * r20496;
        double r20498 = r20497 + r20494;
        double r20499 = r20494 / r20498;
        double r20500 = r20497 / r20498;
        double r20501 = r20499 - r20500;
        return r20501;
}

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. Simplified0.3

    \[\leadsto \color{blue}{\frac{1 - \tan x \cdot \tan x}{\tan x \cdot \tan x + 1}}\]
  3. Using strategy rm
  4. Applied div-sub0.4

    \[\leadsto \color{blue}{\frac{1}{\tan x \cdot \tan x + 1} - \frac{\tan x \cdot \tan x}{\tan x \cdot \tan x + 1}}\]
  5. Final simplification0.4

    \[\leadsto \frac{1}{\tan x \cdot \tan x + 1} - \frac{\tan x \cdot \tan x}{\tan x \cdot \tan x + 1}\]

Reproduce

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