Alternative 1 | |
---|---|
Error | 0.0 |
Cost | 6592 |
\[\frac{1}{\tan x}
\]
(FPCore (x) :precision binary64 (/ 1.0 (tan x)))
(FPCore (x) :precision binary64 (/ (cos x) (sin x)))
double code(double x) { return 1.0 / tan(x); }
double code(double x) { return cos(x) / sin(x); }
real(8) function code(x) real(8), intent (in) :: x code = 1.0d0 / tan(x) end function
real(8) function code(x) real(8), intent (in) :: x code = cos(x) / sin(x) end function
public static double code(double x) { return 1.0 / Math.tan(x); }
public static double code(double x) { return Math.cos(x) / Math.sin(x); }
def code(x): return 1.0 / math.tan(x)
def code(x): return math.cos(x) / math.sin(x)
function code(x) return Float64(1.0 / tan(x)) end
function code(x) return Float64(cos(x) / sin(x)) end
function tmp = code(x) tmp = 1.0 / tan(x); end
function tmp = code(x) tmp = cos(x) / sin(x); end
code[x_] := N[(1.0 / N[Tan[x], $MachinePrecision]), $MachinePrecision]
code[x_] := N[(N[Cos[x], $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]
\frac{1}{\tan x}
\frac{\cos x}{\sin x}
Results
Initial program 0.0
Taylor expanded in x around inf 0.0
Final simplification0.0
Alternative 1 | |
---|---|
Error | 0.0 |
Cost | 6592 |
Alternative 2 | |
---|---|
Error | 0.8 |
Cost | 1088 |
Alternative 3 | |
---|---|
Error | 1.0 |
Cost | 448 |
Alternative 4 | |
---|---|
Error | 63.0 |
Cost | 192 |
Alternative 5 | |
---|---|
Error | 1.3 |
Cost | 192 |
herbie shell --seed 1
(FPCore (x)
:name "1 / tan(x)"
:precision binary64
:pre (and (<= -1000.0 x) (<= x 1000.0))
(/ 1.0 (tan x)))