Average Error: 0.3 → 0.4
Time: 4.0s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\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) \cdot \frac{1 - \tan x \cdot \tan x}{{1}^{3} + {\left(\tan x \cdot \tan x\right)}^{3}}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\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) \cdot \frac{1 - \tan x \cdot \tan x}{{1}^{3} + {\left(\tan x \cdot \tan x\right)}^{3}}
double code(double x) {
	return ((1.0 - (tan(x) * tan(x))) / (1.0 + (tan(x) * tan(x))));
}
double code(double x) {
	return (((1.0 * 1.0) + (((tan(x) * tan(x)) * (tan(x) * tan(x))) - (1.0 * (tan(x) * tan(x))))) * ((1.0 - (tan(x) * tan(x))) / (pow(1.0, 3.0) + pow((tan(x) * tan(x)), 3.0))));
}

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-log-exp0.4

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

    \[\leadsto \log \left(e^{\frac{1 - \tan x \cdot \tan x}{\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)}}}}\right)\]
  6. Applied associate-/r/0.5

    \[\leadsto \log \left(e^{\color{blue}{\frac{1 - \tan x \cdot \tan x}{{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 exp-prod1.6

    \[\leadsto \log \color{blue}{\left({\left(e^{\frac{1 - \tan x \cdot \tan x}{{1}^{3} + {\left(\tan x \cdot \tan x\right)}^{3}}}\right)}^{\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)}\]
  8. Applied log-pow1.5

    \[\leadsto \color{blue}{\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) \cdot \log \left(e^{\frac{1 - \tan x \cdot \tan x}{{1}^{3} + {\left(\tan x \cdot \tan x\right)}^{3}}}\right)}\]
  9. Simplified0.4

    \[\leadsto \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) \cdot \color{blue}{\frac{1 - \tan x \cdot \tan x}{{1}^{3} + {\left(\tan x \cdot \tan x\right)}^{3}}}\]
  10. Final simplification0.4

    \[\leadsto \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) \cdot \frac{1 - \tan x \cdot \tan x}{{1}^{3} + {\left(\tan x \cdot \tan x\right)}^{3}}\]

Reproduce

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