Average Error: 28.2 → 2.6
Time: 14.3s
Precision: binary64
Cost: 13572
\[ \begin{array}{c}[c, s] = \mathsf{sort}([c, s])\\ \end{array} \]
\[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)} \]
\[\begin{array}{l} t_0 := \cos \left(x + x\right)\\ t_1 := s \cdot \left(x \cdot c\right)\\ \mathbf{if}\;x \leq -1.2 \cdot 10^{-136}:\\ \;\;\;\;\frac{t_0}{{t_1}^{2}}\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-34}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_1} \cdot \frac{t_0}{\frac{s}{\frac{1}{x \cdot c}}}\\ \end{array} \]
(FPCore (x c s)
 :precision binary64
 (/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))
(FPCore (x c s)
 :precision binary64
 (let* ((t_0 (cos (+ x x))) (t_1 (* s (* x c))))
   (if (<= x -1.2e-136)
     (/ t_0 (pow t_1 2.0))
     (if (<= x 2e-34)
       (pow (* c (* x s)) -2.0)
       (* (/ 1.0 t_1) (/ t_0 (/ s (/ 1.0 (* x c)))))))))
double code(double x, double c, double s) {
	return cos((2.0 * x)) / (pow(c, 2.0) * ((x * pow(s, 2.0)) * x));
}
double code(double x, double c, double s) {
	double t_0 = cos((x + x));
	double t_1 = s * (x * c);
	double tmp;
	if (x <= -1.2e-136) {
		tmp = t_0 / pow(t_1, 2.0);
	} else if (x <= 2e-34) {
		tmp = pow((c * (x * s)), -2.0);
	} else {
		tmp = (1.0 / t_1) * (t_0 / (s / (1.0 / (x * c))));
	}
	return tmp;
}
real(8) function code(x, c, s)
    real(8), intent (in) :: x
    real(8), intent (in) :: c
    real(8), intent (in) :: s
    code = cos((2.0d0 * x)) / ((c ** 2.0d0) * ((x * (s ** 2.0d0)) * x))
end function
real(8) function code(x, c, s)
    real(8), intent (in) :: x
    real(8), intent (in) :: c
    real(8), intent (in) :: s
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = cos((x + x))
    t_1 = s * (x * c)
    if (x <= (-1.2d-136)) then
        tmp = t_0 / (t_1 ** 2.0d0)
    else if (x <= 2d-34) then
        tmp = (c * (x * s)) ** (-2.0d0)
    else
        tmp = (1.0d0 / t_1) * (t_0 / (s / (1.0d0 / (x * c))))
    end if
    code = tmp
end function
public static double code(double x, double c, double s) {
	return Math.cos((2.0 * x)) / (Math.pow(c, 2.0) * ((x * Math.pow(s, 2.0)) * x));
}
public static double code(double x, double c, double s) {
	double t_0 = Math.cos((x + x));
	double t_1 = s * (x * c);
	double tmp;
	if (x <= -1.2e-136) {
		tmp = t_0 / Math.pow(t_1, 2.0);
	} else if (x <= 2e-34) {
		tmp = Math.pow((c * (x * s)), -2.0);
	} else {
		tmp = (1.0 / t_1) * (t_0 / (s / (1.0 / (x * c))));
	}
	return tmp;
}
def code(x, c, s):
	return math.cos((2.0 * x)) / (math.pow(c, 2.0) * ((x * math.pow(s, 2.0)) * x))
def code(x, c, s):
	t_0 = math.cos((x + x))
	t_1 = s * (x * c)
	tmp = 0
	if x <= -1.2e-136:
		tmp = t_0 / math.pow(t_1, 2.0)
	elif x <= 2e-34:
		tmp = math.pow((c * (x * s)), -2.0)
	else:
		tmp = (1.0 / t_1) * (t_0 / (s / (1.0 / (x * c))))
	return tmp
function code(x, c, s)
	return Float64(cos(Float64(2.0 * x)) / Float64((c ^ 2.0) * Float64(Float64(x * (s ^ 2.0)) * x)))
end
function code(x, c, s)
	t_0 = cos(Float64(x + x))
	t_1 = Float64(s * Float64(x * c))
	tmp = 0.0
	if (x <= -1.2e-136)
		tmp = Float64(t_0 / (t_1 ^ 2.0));
	elseif (x <= 2e-34)
		tmp = Float64(c * Float64(x * s)) ^ -2.0;
	else
		tmp = Float64(Float64(1.0 / t_1) * Float64(t_0 / Float64(s / Float64(1.0 / Float64(x * c)))));
	end
	return tmp
end
function tmp = code(x, c, s)
	tmp = cos((2.0 * x)) / ((c ^ 2.0) * ((x * (s ^ 2.0)) * x));
end
function tmp_2 = code(x, c, s)
	t_0 = cos((x + x));
	t_1 = s * (x * c);
	tmp = 0.0;
	if (x <= -1.2e-136)
		tmp = t_0 / (t_1 ^ 2.0);
	elseif (x <= 2e-34)
		tmp = (c * (x * s)) ^ -2.0;
	else
		tmp = (1.0 / t_1) * (t_0 / (s / (1.0 / (x * c))));
	end
	tmp_2 = tmp;
end
code[x_, c_, s_] := N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, c_, s_] := Block[{t$95$0 = N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e-136], N[(t$95$0 / N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2e-34], N[Power[N[(c * N[(x * s), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision], N[(N[(1.0 / t$95$1), $MachinePrecision] * N[(t$95$0 / N[(s / N[(1.0 / N[(x * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}
\begin{array}{l}
t_0 := \cos \left(x + x\right)\\
t_1 := s \cdot \left(x \cdot c\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{-136}:\\
\;\;\;\;\frac{t_0}{{t_1}^{2}}\\

\mathbf{elif}\;x \leq 2 \cdot 10^{-34}:\\
\;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1} \cdot \frac{t_0}{\frac{s}{\frac{1}{x \cdot c}}}\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if x < -1.1999999999999999e-136

    1. Initial program 25.5

      \[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)} \]
    2. Simplified10.0

      \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(x \cdot \left(\left(c \cdot s\right) \cdot \left(c \cdot s\right)\right)\right)}} \]
      Proof
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (*.f64 (*.f64 c s) (*.f64 c s))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 c c) (*.f64 s s)))))): 60 points increase in error, 9 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 c 2)) (*.f64 s s))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (*.f64 (pow.f64 c 2) (Rewrite<= unpow2_binary64 (pow.f64 s 2)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (Rewrite=> *-commutative_binary64 (*.f64 (pow.f64 s 2) (pow.f64 c 2)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 x (pow.f64 s 2)) (pow.f64 c 2))))): 11 points increase in error, 7 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 c 2) (*.f64 x (pow.f64 s 2)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 (pow.f64 c 2) (*.f64 x (pow.f64 s 2))) x))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= associate-*r*_binary64 (*.f64 (pow.f64 c 2) (*.f64 (*.f64 x (pow.f64 s 2)) x)))): 19 points increase in error, 6 points decrease in error
    3. Taylor expanded in x around inf 26.8

      \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{{s}^{2} \cdot \left({c}^{2} \cdot {x}^{2}\right)}} \]
    4. Simplified2.3

      \[\leadsto \color{blue}{\frac{\cos \left(x + x\right)}{{\left(s \cdot \left(c \cdot x\right)\right)}^{2}}} \]
      Proof
      (/.f64 (cos.f64 (+.f64 x x)) (pow.f64 (*.f64 s (*.f64 c x)) 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (+.f64 x x)) (pow.f64 (*.f64 s (Rewrite<= *-commutative_binary64 (*.f64 x c))) 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (+.f64 x x)) (pow.f64 (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 x c) s)) 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (Rewrite=> count-2_binary64 (*.f64 2 x))) (pow.f64 (*.f64 (*.f64 x c) s) 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite=> unpow2_binary64 (*.f64 (*.f64 (*.f64 x c) s) (*.f64 (*.f64 x c) s)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite=> swap-sqr_binary64 (*.f64 (*.f64 (*.f64 x c) (*.f64 x c)) (*.f64 s s)))): 76 points increase in error, 9 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 x x) (*.f64 c c))) (*.f64 s s))): 57 points increase in error, 11 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 (*.f64 x x) (Rewrite<= unpow2_binary64 (pow.f64 c 2))) (*.f64 s s))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 c 2) (*.f64 x x))) (*.f64 s s))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 (pow.f64 c 2) (Rewrite<= unpow2_binary64 (pow.f64 x 2))) (*.f64 s s))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 (pow.f64 c 2) (pow.f64 x 2)) (Rewrite<= unpow2_binary64 (pow.f64 s 2)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 s 2) (*.f64 (pow.f64 c 2) (pow.f64 x 2))))): 0 points increase in error, 0 points decrease in error

    if -1.1999999999999999e-136 < x < 1.99999999999999986e-34

    1. Initial program 38.4

      \[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)} \]
    2. Simplified25.4

      \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(x \cdot \left(\left(c \cdot s\right) \cdot \left(c \cdot s\right)\right)\right)}} \]
      Proof
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (*.f64 (*.f64 c s) (*.f64 c s))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 c c) (*.f64 s s)))))): 60 points increase in error, 9 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 c 2)) (*.f64 s s))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (*.f64 (pow.f64 c 2) (Rewrite<= unpow2_binary64 (pow.f64 s 2)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (Rewrite=> *-commutative_binary64 (*.f64 (pow.f64 s 2) (pow.f64 c 2)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 x (pow.f64 s 2)) (pow.f64 c 2))))): 11 points increase in error, 7 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 c 2) (*.f64 x (pow.f64 s 2)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 (pow.f64 c 2) (*.f64 x (pow.f64 s 2))) x))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= associate-*r*_binary64 (*.f64 (pow.f64 c 2) (*.f64 (*.f64 x (pow.f64 s 2)) x)))): 19 points increase in error, 6 points decrease in error
    3. Applied egg-rr3.7

      \[\leadsto \color{blue}{\frac{1}{\left(x \cdot c\right) \cdot s} \cdot \frac{\cos \left(x + x\right)}{\left(x \cdot c\right) \cdot s}} \]
    4. Taylor expanded in x around 0 49.0

      \[\leadsto \color{blue}{\frac{1}{{s}^{2} \cdot \left({c}^{2} \cdot {x}^{2}\right)}} \]
    5. Simplified4.0

      \[\leadsto \color{blue}{{\left(c \cdot \left(s \cdot x\right)\right)}^{-2}} \]
      Proof
      (pow.f64 (*.f64 c (*.f64 s x)) -2): 0 points increase in error, 0 points decrease in error
      (pow.f64 (*.f64 c (Rewrite=> *-commutative_binary64 (*.f64 x s))) -2): 0 points increase in error, 0 points decrease in error
      (pow.f64 (*.f64 c (*.f64 x s)) (Rewrite<= metadata-eval (*.f64 2 -1))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= pow-sqr_binary64 (*.f64 (pow.f64 (*.f64 c (*.f64 x s)) -1) (pow.f64 (*.f64 c (*.f64 x s)) -1))): 32 points increase in error, 25 points decrease in error
      (*.f64 (Rewrite=> unpow-1_binary64 (/.f64 1 (*.f64 c (*.f64 x s)))) (pow.f64 (*.f64 c (*.f64 x s)) -1)): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 1 (*.f64 c (*.f64 x s))) (Rewrite=> unpow-1_binary64 (/.f64 1 (*.f64 c (*.f64 x s))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/_binary64 (/.f64 1 (/.f64 (*.f64 c (*.f64 x s)) (/.f64 1 (*.f64 c (*.f64 x s)))))): 22 points increase in error, 23 points decrease in error
      (/.f64 1 (Rewrite=> associate-/r/_binary64 (*.f64 (/.f64 (*.f64 c (*.f64 x s)) 1) (*.f64 c (*.f64 x s))))): 11 points increase in error, 17 points decrease in error
      (/.f64 1 (*.f64 (Rewrite=> /-rgt-identity_binary64 (*.f64 c (*.f64 x s))) (*.f64 c (*.f64 x s)))): 0 points increase in error, 0 points decrease in error
      (/.f64 1 (Rewrite=> swap-sqr_binary64 (*.f64 (*.f64 c c) (*.f64 (*.f64 x s) (*.f64 x s))))): 83 points increase in error, 15 points decrease in error
      (/.f64 1 (*.f64 (*.f64 c c) (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 x x) (*.f64 s s))))): 51 points increase in error, 5 points decrease in error
      (/.f64 1 (*.f64 (*.f64 c c) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 x 2)) (*.f64 s s)))): 0 points increase in error, 0 points decrease in error
      (/.f64 1 (*.f64 (*.f64 c c) (*.f64 (pow.f64 x 2) (Rewrite<= unpow2_binary64 (pow.f64 s 2))))): 0 points increase in error, 0 points decrease in error
      (/.f64 1 (*.f64 (*.f64 c c) (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 s 2) (pow.f64 x 2))))): 0 points increase in error, 0 points decrease in error
      (/.f64 1 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 c 2)) (*.f64 (pow.f64 s 2) (pow.f64 x 2)))): 0 points increase in error, 0 points decrease in error
      (/.f64 1 (Rewrite=> *-commutative_binary64 (*.f64 (*.f64 (pow.f64 s 2) (pow.f64 x 2)) (pow.f64 c 2)))): 0 points increase in error, 0 points decrease in error
      (/.f64 1 (Rewrite=> associate-*l*_binary64 (*.f64 (pow.f64 s 2) (*.f64 (pow.f64 x 2) (pow.f64 c 2))))): 5 points increase in error, 14 points decrease in error
      (/.f64 1 (*.f64 (pow.f64 s 2) (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 c 2) (pow.f64 x 2))))): 0 points increase in error, 0 points decrease in error

    if 1.99999999999999986e-34 < x

    1. Initial program 24.3

      \[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)} \]
    2. Simplified10.7

      \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(x \cdot \left(\left(c \cdot s\right) \cdot \left(c \cdot s\right)\right)\right)}} \]
      Proof
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (*.f64 (*.f64 c s) (*.f64 c s))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 c c) (*.f64 s s)))))): 60 points increase in error, 9 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 c 2)) (*.f64 s s))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (*.f64 (pow.f64 c 2) (Rewrite<= unpow2_binary64 (pow.f64 s 2)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (*.f64 x (Rewrite=> *-commutative_binary64 (*.f64 (pow.f64 s 2) (pow.f64 c 2)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 x (pow.f64 s 2)) (pow.f64 c 2))))): 11 points increase in error, 7 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 x (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 c 2) (*.f64 x (pow.f64 s 2)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 (pow.f64 c 2) (*.f64 x (pow.f64 s 2))) x))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= associate-*r*_binary64 (*.f64 (pow.f64 c 2) (*.f64 (*.f64 x (pow.f64 s 2)) x)))): 19 points increase in error, 6 points decrease in error
    3. Applied egg-rr2.1

      \[\leadsto \color{blue}{\frac{1}{\left(x \cdot c\right) \cdot s} \cdot \frac{\cos \left(x + x\right)}{\left(x \cdot c\right) \cdot s}} \]
    4. Applied egg-rr2.1

      \[\leadsto \frac{1}{\left(x \cdot c\right) \cdot s} \cdot \frac{\cos \left(x + x\right)}{\color{blue}{\frac{s}{\frac{1}{x \cdot c}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-136}:\\ \;\;\;\;\frac{\cos \left(x + x\right)}{{\left(s \cdot \left(x \cdot c\right)\right)}^{2}}\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-34}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{s \cdot \left(x \cdot c\right)} \cdot \frac{\cos \left(x + x\right)}{\frac{s}{\frac{1}{x \cdot c}}}\\ \end{array} \]

Alternatives

Alternative 1
Error11.9
Cost8020
\[\begin{array}{l} t_0 := \cos \left(x \cdot 2\right)\\ t_1 := \frac{t_0}{x \cdot \left(x \cdot \left(\left(s \cdot c\right) \cdot \left(s \cdot c\right)\right)\right)}\\ t_2 := s \cdot \left(x \cdot c\right)\\ t_3 := c \cdot \left(x \cdot s\right)\\ \mathbf{if}\;c \leq -3.45 \cdot 10^{+239}:\\ \;\;\;\;\frac{1}{{t_2}^{2}}\\ \mathbf{elif}\;c \leq -7.4 \cdot 10^{+133}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -1.15 \cdot 10^{+17}:\\ \;\;\;\;\frac{1}{\frac{t_2}{\frac{1}{t_3}}}\\ \mathbf{elif}\;c \leq -1.4 \cdot 10^{-76}:\\ \;\;\;\;\frac{t_0}{c \cdot \left(c \cdot \left(x \cdot \left(s \cdot \left(x \cdot s\right)\right)\right)\right)}\\ \mathbf{elif}\;c \leq 7.5 \cdot 10^{-102}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{c \cdot \left(\left(x \cdot s\right) \cdot t_3\right)}\\ \end{array} \]
Alternative 2
Error2.5
Cost7880
\[\begin{array}{l} t_0 := s \cdot \left(x \cdot c\right)\\ t_1 := \frac{1}{t_0}\\ t_2 := \cos \left(x + x\right)\\ \mathbf{if}\;x \leq -1.95 \cdot 10^{-140}:\\ \;\;\;\;t_1 \cdot \frac{t_2}{t_0}\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-33}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \frac{t_2}{\frac{s}{\frac{1}{x \cdot c}}}\\ \end{array} \]
Alternative 3
Error7.6
Cost7756
\[\begin{array}{l} t_0 := \frac{\cos \left(x \cdot 2\right)}{x \cdot \left(x \cdot \left(\left(s \cdot c\right) \cdot \left(s \cdot c\right)\right)\right)}\\ \mathbf{if}\;x \leq -1.45 \cdot 10^{-103}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-23}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+102}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\cos \left(x + x\right)}{x \cdot c}}{c \cdot \left(s \cdot \left(x \cdot s\right)\right)}\\ \end{array} \]
Alternative 4
Error2.5
Cost7752
\[\begin{array}{l} t_0 := s \cdot \left(x \cdot c\right)\\ t_1 := \frac{1}{t_0} \cdot \frac{\cos \left(x + x\right)}{t_0}\\ \mathbf{if}\;x \leq -2 \cdot 10^{-142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-34}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error9.9
Cost7624
\[\begin{array}{l} t_0 := \frac{\cos \left(x \cdot 2\right)}{c \cdot \left(c \cdot \left(x \cdot \left(s \cdot \left(x \cdot s\right)\right)\right)\right)}\\ \mathbf{if}\;x \leq -9 \cdot 10^{-5}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-6}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error7.3
Cost7624
\[\begin{array}{l} \mathbf{if}\;s \leq 1.16 \cdot 10^{-164}:\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{x \cdot \left(x \cdot \left(\left(s \cdot c\right) \cdot \left(s \cdot c\right)\right)\right)}\\ \mathbf{elif}\;s \leq 2.2 \cdot 10^{+141}:\\ \;\;\;\;\frac{\frac{\cos \left(x \cdot -2\right)}{\left(x \cdot c\right) \cdot \left(s \cdot s\right)}}{x \cdot c}\\ \mathbf{else}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \end{array} \]
Alternative 7
Error3.4
Cost7624
\[\begin{array}{l} t_0 := \frac{\frac{\cos \left(x + x\right)}{s \cdot \left(x \cdot c\right)}}{x \cdot \left(s \cdot c\right)}\\ \mathbf{if}\;x \leq -5 \cdot 10^{-146}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-35}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error3.4
Cost7624
\[\begin{array}{l} t_0 := \frac{\frac{\cos \left(x + x\right)}{x \cdot \left(s \cdot c\right)}}{s \cdot \left(x \cdot c\right)}\\ \mathbf{if}\;x \leq -3 \cdot 10^{-148}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-34}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error2.1
Cost7624
\[\begin{array}{l} t_0 := c \cdot \left(x \cdot s\right)\\ t_1 := x \cdot \left(s \cdot c\right)\\ t_2 := \frac{\frac{\cos \left(x + x\right)}{t_1}}{t_1}\\ \mathbf{if}\;x \leq -1.1 \cdot 10^{-150}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-244}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error16.9
Cost6784
\[{\left(c \cdot \left(x \cdot s\right)\right)}^{-2} \]
Alternative 11
Error19.0
Cost1096
\[\begin{array}{l} t_0 := \frac{1}{\left(s \cdot c\right) \cdot \left(x \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)}\\ \mathbf{if}\;x \leq -2.05 \cdot 10^{-199}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.22 \cdot 10^{-234}:\\ \;\;\;\;\frac{1}{c \cdot \left(c \cdot \left(\left(x \cdot s\right) \cdot \left(x \cdot s\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 12
Error22.8
Cost832
\[\frac{1}{c \cdot \left(c \cdot \left(\left(x \cdot s\right) \cdot \left(x \cdot s\right)\right)\right)} \]
Alternative 13
Error17.0
Cost832
\[\begin{array}{l} t_0 := c \cdot \left(x \cdot s\right)\\ \frac{1}{t_0 \cdot t_0} \end{array} \]
Alternative 14
Error41.0
Cost576
\[\frac{-2}{\left(s \cdot s\right) \cdot \left(c \cdot c\right)} \]

Error

Reproduce

herbie shell --seed 2022337 
(FPCore (x c s)
  :name "mixedcos"
  :precision binary64
  (/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))