Average Error: 0.6 → 0.6
Time: 4.1s
Precision: binary64
\[\frac{3 \cdot \tan x - {\left(\tan x\right)}^{3}}{1 - 3 \cdot {\left(\tan x\right)}^{2}}\]
\[\frac{3 \cdot \tan x - {\left(\tan x\right)}^{3}}{1 - 3 \cdot {\left(\tan x\right)}^{2}}\]
\frac{3 \cdot \tan x - {\left(\tan x\right)}^{3}}{1 - 3 \cdot {\left(\tan x\right)}^{2}}
\frac{3 \cdot \tan x - {\left(\tan x\right)}^{3}}{1 - 3 \cdot {\left(\tan x\right)}^{2}}
double code(double x) {
	return ((double) (((double) (((double) (3.0 * ((double) tan(x)))) - ((double) pow(((double) tan(x)), 3.0)))) / ((double) (1.0 - ((double) (3.0 * ((double) pow(((double) tan(x)), 2.0))))))));
}
double code(double x) {
	return ((double) (((double) (((double) (3.0 * ((double) tan(x)))) - ((double) pow(((double) tan(x)), 3.0)))) / ((double) (1.0 - ((double) (3.0 * ((double) pow(((double) tan(x)), 2.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.6

    \[\frac{3 \cdot \tan x - {\left(\tan x\right)}^{3}}{1 - 3 \cdot {\left(\tan x\right)}^{2}}\]
  2. Final simplification0.6

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

Reproduce

herbie shell --seed 2020153 
(FPCore (x)
  :name "(/ (- (* 3 (tan x)) (pow (tan x) 3)) (- 1 (* 3 (pow (tan x) 2))))"
  :precision binary64
  (/ (- (* 3.0 (tan x)) (pow (tan x) 3.0)) (- 1.0 (* 3.0 (pow (tan x) 2.0)))))