Average Error: 0.3 → 0.5
Time: 5.6s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\sqrt[3]{{\left(1 - \frac{\tan x \cdot \sin x}{\cos x}\right)}^{3}}}{1 + \tan x \cdot \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\sqrt[3]{{\left(1 - \frac{\tan x \cdot \sin x}{\cos x}\right)}^{3}}}{1 + \tan x \cdot \tan x}
double code(double x) {
	return ((1.0 - (tan(x) * tan(x))) / (1.0 + (tan(x) * tan(x))));
}
double code(double x) {
	return (cbrt(pow((1.0 - ((tan(x) * sin(x)) / cos(x))), 3.0)) / (1.0 + (tan(x) * tan(x))));
}

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 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 add-cbrt-cube0.5

    \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(1 - \frac{\tan x \cdot \sin x}{\cos x}\right) \cdot \left(1 - \frac{\tan x \cdot \sin x}{\cos x}\right)\right) \cdot \left(1 - \frac{\tan x \cdot \sin x}{\cos x}\right)}}}{1 + \tan x \cdot \tan x}\]
  7. Simplified0.5

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

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

Reproduce

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