Average Error: 0.3 → 0.3
Time: 6.6s
Precision: binary64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - {\tan x}^{2}}{1 + {\tan x}^{2}} \cdot \log e\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 - {\tan x}^{2}}{1 + {\tan x}^{2}} \cdot \log e
(FPCore (x)
 :precision binary64
 (/ (- 1.0 (* (tan x) (tan x))) (+ 1.0 (* (tan x) (tan x)))))
(FPCore (x)
 :precision binary64
 (* (/ (- 1.0 (pow (tan x) 2.0)) (+ 1.0 (pow (tan x) 2.0))) (log E)))
double code(double x) {
	return (1.0 - (tan(x) * tan(x))) / (1.0 + (tan(x) * tan(x)));
}
double code(double x) {
	return ((1.0 - pow(tan(x), 2.0)) / (1.0 + pow(tan(x), 2.0))) * log((double) M_E);
}

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-exp_binary640.4

    \[\leadsto \color{blue}{\log \left(e^{\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}}\right)}\]
  4. Simplified0.4

    \[\leadsto \log \color{blue}{\left(e^{\frac{1 - {\tan x}^{2}}{1 + {\tan x}^{2}}}\right)}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity_binary640.4

    \[\leadsto \log \left(e^{\color{blue}{1 \cdot \frac{1 - {\tan x}^{2}}{1 + {\tan x}^{2}}}}\right)\]
  7. Applied exp-prod_binary640.5

    \[\leadsto \log \color{blue}{\left({\left(e^{1}\right)}^{\left(\frac{1 - {\tan x}^{2}}{1 + {\tan x}^{2}}\right)}\right)}\]
  8. Applied log-pow_binary640.3

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

    \[\leadsto \frac{1 - {\tan x}^{2}}{1 + {\tan x}^{2}} \cdot \log e\]

Reproduce

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