Average Error: 0.3 → 0.4
Time: 1.4m
Precision: 64
Internal Precision: 128
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\frac{1 - {\left(\frac{\tan x \cdot \sin x}{\cos x}\right)}^{3}}{\left(\frac{\tan x \cdot \sin x}{\cos x} \cdot \frac{\tan x \cdot \sin x}{\cos x} + \frac{\tan x \cdot \sin x}{\cos x}\right) + 1}}{1 + \frac{\tan x \cdot \sin x}{\cos x}}\]

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 tan-quot0.4

    \[\leadsto \frac{1 - \tan x \cdot \color{blue}{\frac{\sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  4. Applied associate-*r/0.4

    \[\leadsto \frac{1 - \color{blue}{\frac{\tan x \cdot \sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  5. Using strategy rm
  6. Applied tan-quot0.4

    \[\leadsto \frac{1 - \frac{\tan x \cdot \sin x}{\cos x}}{1 + \color{blue}{\frac{\sin x}{\cos x}} \cdot \tan x}\]
  7. Applied associate-*l/0.3

    \[\leadsto \frac{1 - \frac{\tan x \cdot \sin x}{\cos x}}{1 + \color{blue}{\frac{\sin x \cdot \tan x}{\cos x}}}\]
  8. Simplified0.3

    \[\leadsto \frac{1 - \frac{\tan x \cdot \sin x}{\cos x}}{1 + \frac{\color{blue}{\tan x \cdot \sin x}}{\cos x}}\]
  9. Using strategy rm
  10. Applied flip3--0.4

    \[\leadsto \frac{\color{blue}{\frac{{1}^{3} - {\left(\frac{\tan x \cdot \sin x}{\cos x}\right)}^{3}}{1 \cdot 1 + \left(\frac{\tan x \cdot \sin x}{\cos x} \cdot \frac{\tan x \cdot \sin x}{\cos x} + 1 \cdot \frac{\tan x \cdot \sin x}{\cos x}\right)}}}{1 + \frac{\tan x \cdot \sin x}{\cos x}}\]
  11. Final simplification0.4

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

Reproduce

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