# ?

Average Error: 0.0 → 0.0
Time: 5.3s
Precision: binary64
Cost: 12992

# ?

$-1 \leq x \land x \leq 1000000000$
$\sin x + \cos x$
$\sin x + \cos x$
(FPCore (x) :precision binary64 (+ (sin x) (cos x)))
(FPCore (x) :precision binary64 (+ (sin x) (cos x)))
double code(double x) {
return sin(x) + cos(x);
}

double code(double x) {
return sin(x) + cos(x);
}

real(8) function code(x)
real(8), intent (in) :: x
code = sin(x) + cos(x)
end function

real(8) function code(x)
real(8), intent (in) :: x
code = sin(x) + cos(x)
end function

public static double code(double x) {
return Math.sin(x) + Math.cos(x);
}

public static double code(double x) {
return Math.sin(x) + Math.cos(x);
}

def code(x):
return math.sin(x) + math.cos(x)

def code(x):
return math.sin(x) + math.cos(x)

function code(x)
return Float64(sin(x) + cos(x))
end

function code(x)
return Float64(sin(x) + cos(x))
end

function tmp = code(x)
tmp = sin(x) + cos(x);
end

function tmp = code(x)
tmp = sin(x) + cos(x);
end

code[x_] := N[(N[Sin[x], $MachinePrecision] + N[Cos[x],$MachinePrecision]), $MachinePrecision]  code[x_] := N[(N[Sin[x],$MachinePrecision] + N[Cos[x], $MachinePrecision]),$MachinePrecision]

\sin x + \cos x

\sin x + \cos x


# Try it out?

Results

 In Out
Enter valid numbers for all inputs

# Derivation?

1. Initial program 0.0

$\sin x + \cos x$
2. Final simplification0.0

$\leadsto \sin x + \cos x$

# Alternatives

Alternative 1
Error1.3
Cost6848
$1 + \mathsf{fma}\left(x, x \cdot -0.5, x\right)$
Alternative 2
Error1.5
Cost192
$x + 1$
Alternative 3
Error2.2
Cost64
$1$

# Reproduce?

herbie shell --seed 1
(FPCore (x)
:name "sin(x)+cos(x)"
:precision binary64
:pre (and (<= -1.0 x) (<= x 1000000000.0))
(+ (sin x) (cos x)))