Average Error: 0.3 → 0.4
Time: 4.4s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\sqrt{1} + \tan x}{\frac{1 + \tan x \cdot \tan x}{\sqrt{1} - \tan x}}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\sqrt{1} + \tan x}{\frac{1 + \tan x \cdot \tan x}{\sqrt{1} - \tan x}}
double f(double x) {
        double r9353 = 1.0;
        double r9354 = x;
        double r9355 = tan(r9354);
        double r9356 = r9355 * r9355;
        double r9357 = r9353 - r9356;
        double r9358 = r9353 + r9356;
        double r9359 = r9357 / r9358;
        return r9359;
}

double f(double x) {
        double r9360 = 1.0;
        double r9361 = sqrt(r9360);
        double r9362 = x;
        double r9363 = tan(r9362);
        double r9364 = r9361 + r9363;
        double r9365 = r9363 * r9363;
        double r9366 = r9360 + r9365;
        double r9367 = r9361 - r9363;
        double r9368 = r9366 / r9367;
        double r9369 = r9364 / r9368;
        return r9369;
}

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 add-sqr-sqrt0.3

    \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}} - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
  4. Applied difference-of-squares0.4

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

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

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

Reproduce

herbie shell --seed 2020024 
(FPCore (x)
  :name "Trigonometry B"
  :precision binary64
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))