Average Error: 0.3 → 0.5
Time: 43.2s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left((\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right) + 1)_* - \tan x \cdot \tan x\right) \cdot \left(\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{{\left(\tan x \cdot \tan x\right)}^{3} + 1}\right)\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\left((\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right) + 1)_* - \tan x \cdot \tan x\right) \cdot \left(\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{{\left(\tan x \cdot \tan x\right)}^{3} + 1}\right)
double f(double x) {
        double r1529374 = 1.0;
        double r1529375 = x;
        double r1529376 = tan(r1529375);
        double r1529377 = r1529376 * r1529376;
        double r1529378 = r1529374 - r1529377;
        double r1529379 = r1529374 + r1529377;
        double r1529380 = r1529378 / r1529379;
        return r1529380;
}

double f(double x) {
        double r1529381 = x;
        double r1529382 = tan(r1529381);
        double r1529383 = r1529382 * r1529382;
        double r1529384 = 1.0;
        double r1529385 = fma(r1529383, r1529383, r1529384);
        double r1529386 = r1529385 - r1529383;
        double r1529387 = r1529384 - r1529383;
        double r1529388 = 3.0;
        double r1529389 = pow(r1529383, r1529388);
        double r1529390 = r1529389 + r1529384;
        double r1529391 = r1529384 / r1529390;
        double r1529392 = r1529387 * r1529391;
        double r1529393 = r1529386 * r1529392;
        return r1529393;
}

Error

Bits error versus x

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 div-inv0.4

    \[\leadsto \color{blue}{\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{1 + \tan x \cdot \tan x}}\]
  4. Using strategy rm
  5. Applied flip3-+0.4

    \[\leadsto \left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{\color{blue}{\frac{{1}^{3} + {\left(\tan x \cdot \tan x\right)}^{3}}{1 \cdot 1 + \left(\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right) - 1 \cdot \left(\tan x \cdot \tan x\right)\right)}}}\]
  6. Applied associate-/r/0.4

    \[\leadsto \left(1 - \tan x \cdot \tan x\right) \cdot \color{blue}{\left(\frac{1}{{1}^{3} + {\left(\tan x \cdot \tan x\right)}^{3}} \cdot \left(1 \cdot 1 + \left(\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right) - 1 \cdot \left(\tan x \cdot \tan x\right)\right)\right)\right)}\]
  7. Applied associate-*r*0.4

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

    \[\leadsto \left(\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{{1}^{3} + {\left(\tan x \cdot \tan x\right)}^{3}}\right) \cdot \color{blue}{\left((\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right) + 1)_* - \tan x \cdot \tan x\right)}\]
  9. Final simplification0.5

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

Reproduce

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