Average Error: 28.5 → 1.8
Time: 18.0s
Precision: binary64
Cost: 39880
\[ \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 := x \cdot \left(s \cdot c\right)\\ t_1 := {t_0}^{2}\\ \mathbf{if}\;s \leq 2.6 \cdot 10^{-147}:\\ \;\;\;\;\frac{\frac{\frac{1}{x}}{s \cdot c}}{t_0} \cdot \cos \left(x + x\right)\\ \mathbf{elif}\;s \leq 2.4 \cdot 10^{+213}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2} \cdot \frac{1}{\frac{1}{\cos \left(x \cdot 2\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\cos x}^{2}}{t_1} - \frac{{\sin x}^{2}}{t_1}\\ \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 (* x (* s c))) (t_1 (pow t_0 2.0)))
   (if (<= s 2.6e-147)
     (* (/ (/ (/ 1.0 x) (* s c)) t_0) (cos (+ x x)))
     (if (<= s 2.4e+213)
       (* (pow (* s (* x c)) -2.0) (/ 1.0 (/ 1.0 (cos (* x 2.0)))))
       (- (/ (pow (cos x) 2.0) t_1) (/ (pow (sin x) 2.0) t_1))))))
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 = x * (s * c);
	double t_1 = pow(t_0, 2.0);
	double tmp;
	if (s <= 2.6e-147) {
		tmp = (((1.0 / x) / (s * c)) / t_0) * cos((x + x));
	} else if (s <= 2.4e+213) {
		tmp = pow((s * (x * c)), -2.0) * (1.0 / (1.0 / cos((x * 2.0))));
	} else {
		tmp = (pow(cos(x), 2.0) / t_1) - (pow(sin(x), 2.0) / t_1);
	}
	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 = x * (s * c)
    t_1 = t_0 ** 2.0d0
    if (s <= 2.6d-147) then
        tmp = (((1.0d0 / x) / (s * c)) / t_0) * cos((x + x))
    else if (s <= 2.4d+213) then
        tmp = ((s * (x * c)) ** (-2.0d0)) * (1.0d0 / (1.0d0 / cos((x * 2.0d0))))
    else
        tmp = ((cos(x) ** 2.0d0) / t_1) - ((sin(x) ** 2.0d0) / t_1)
    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 = x * (s * c);
	double t_1 = Math.pow(t_0, 2.0);
	double tmp;
	if (s <= 2.6e-147) {
		tmp = (((1.0 / x) / (s * c)) / t_0) * Math.cos((x + x));
	} else if (s <= 2.4e+213) {
		tmp = Math.pow((s * (x * c)), -2.0) * (1.0 / (1.0 / Math.cos((x * 2.0))));
	} else {
		tmp = (Math.pow(Math.cos(x), 2.0) / t_1) - (Math.pow(Math.sin(x), 2.0) / t_1);
	}
	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 = x * (s * c)
	t_1 = math.pow(t_0, 2.0)
	tmp = 0
	if s <= 2.6e-147:
		tmp = (((1.0 / x) / (s * c)) / t_0) * math.cos((x + x))
	elif s <= 2.4e+213:
		tmp = math.pow((s * (x * c)), -2.0) * (1.0 / (1.0 / math.cos((x * 2.0))))
	else:
		tmp = (math.pow(math.cos(x), 2.0) / t_1) - (math.pow(math.sin(x), 2.0) / t_1)
	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 = Float64(x * Float64(s * c))
	t_1 = t_0 ^ 2.0
	tmp = 0.0
	if (s <= 2.6e-147)
		tmp = Float64(Float64(Float64(Float64(1.0 / x) / Float64(s * c)) / t_0) * cos(Float64(x + x)));
	elseif (s <= 2.4e+213)
		tmp = Float64((Float64(s * Float64(x * c)) ^ -2.0) * Float64(1.0 / Float64(1.0 / cos(Float64(x * 2.0)))));
	else
		tmp = Float64(Float64((cos(x) ^ 2.0) / t_1) - Float64((sin(x) ^ 2.0) / t_1));
	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 = x * (s * c);
	t_1 = t_0 ^ 2.0;
	tmp = 0.0;
	if (s <= 2.6e-147)
		tmp = (((1.0 / x) / (s * c)) / t_0) * cos((x + x));
	elseif (s <= 2.4e+213)
		tmp = ((s * (x * c)) ^ -2.0) * (1.0 / (1.0 / cos((x * 2.0))));
	else
		tmp = ((cos(x) ^ 2.0) / t_1) - ((sin(x) ^ 2.0) / t_1);
	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[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 2.0], $MachinePrecision]}, If[LessEqual[s, 2.6e-147], N[(N[(N[(N[(1.0 / x), $MachinePrecision] / N[(s * c), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] * N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[s, 2.4e+213], N[(N[Power[N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] * N[(1.0 / N[(1.0 / N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Cos[x], $MachinePrecision], 2.0], $MachinePrecision] / t$95$1), $MachinePrecision] - N[(N[Power[N[Sin[x], $MachinePrecision], 2.0], $MachinePrecision] / t$95$1), $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 := x \cdot \left(s \cdot c\right)\\
t_1 := {t_0}^{2}\\
\mathbf{if}\;s \leq 2.6 \cdot 10^{-147}:\\
\;\;\;\;\frac{\frac{\frac{1}{x}}{s \cdot c}}{t_0} \cdot \cos \left(x + x\right)\\

\mathbf{elif}\;s \leq 2.4 \cdot 10^{+213}:\\
\;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2} \cdot \frac{1}{\frac{1}{\cos \left(x \cdot 2\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\cos x}^{2}}{t_1} - \frac{{\sin x}^{2}}{t_1}\\


\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 s < 2.5999999999999999e-147

    1. Initial program 35.5

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

      \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{\left(x \cdot \left(c \cdot s\right)\right) \cdot \left(x \cdot \left(c \cdot s\right)\right)}} \]
      Proof

      [Start]35.5

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

      *-commutative [=>]35.5

      \[ \frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\color{blue}{\left({s}^{2} \cdot x\right)} \cdot x\right)} \]

      associate-*l* [=>]38.2

      \[ \frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \color{blue}{\left({s}^{2} \cdot \left(x \cdot x\right)\right)}} \]

      associate-*r* [=>]38.2

      \[ \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left({c}^{2} \cdot {s}^{2}\right) \cdot \left(x \cdot x\right)}} \]

      *-commutative [=>]38.2

      \[ \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left(x \cdot x\right) \cdot \left({c}^{2} \cdot {s}^{2}\right)}} \]

      unpow2 [=>]38.2

      \[ \frac{\cos \left(2 \cdot x\right)}{\left(x \cdot x\right) \cdot \left(\color{blue}{\left(c \cdot c\right)} \cdot {s}^{2}\right)} \]

      unpow2 [=>]38.2

      \[ \frac{\cos \left(2 \cdot x\right)}{\left(x \cdot x\right) \cdot \left(\left(c \cdot c\right) \cdot \color{blue}{\left(s \cdot s\right)}\right)} \]

      unswap-sqr [=>]21.3

      \[ \frac{\cos \left(2 \cdot x\right)}{\left(x \cdot x\right) \cdot \color{blue}{\left(\left(c \cdot s\right) \cdot \left(c \cdot s\right)\right)}} \]

      unswap-sqr [=>]3.3

      \[ \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left(x \cdot \left(c \cdot s\right)\right) \cdot \left(x \cdot \left(c \cdot s\right)\right)}} \]
    3. Applied egg-rr3.1

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{x}}{c \cdot s}}{x \cdot \left(c \cdot s\right)}} \cdot \cos \left(x + x\right) \]

    if 2.5999999999999999e-147 < s < 2.4e213

    1. Initial program 25.3

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

      \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{\left(x \cdot \left(c \cdot s\right)\right) \cdot \left(x \cdot \left(c \cdot s\right)\right)}} \]
      Proof

      [Start]25.3

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

      *-commutative [=>]25.3

      \[ \frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\color{blue}{\left({s}^{2} \cdot x\right)} \cdot x\right)} \]

      associate-*l* [=>]28.6

      \[ \frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \color{blue}{\left({s}^{2} \cdot \left(x \cdot x\right)\right)}} \]

      associate-*r* [=>]28.4

      \[ \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left({c}^{2} \cdot {s}^{2}\right) \cdot \left(x \cdot x\right)}} \]

      *-commutative [=>]28.4

      \[ \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left(x \cdot x\right) \cdot \left({c}^{2} \cdot {s}^{2}\right)}} \]

      unpow2 [=>]28.4

      \[ \frac{\cos \left(2 \cdot x\right)}{\left(x \cdot x\right) \cdot \left(\color{blue}{\left(c \cdot c\right)} \cdot {s}^{2}\right)} \]

      unpow2 [=>]28.4

      \[ \frac{\cos \left(2 \cdot x\right)}{\left(x \cdot x\right) \cdot \left(\left(c \cdot c\right) \cdot \color{blue}{\left(s \cdot s\right)}\right)} \]

      unswap-sqr [=>]20.8

      \[ \frac{\cos \left(2 \cdot x\right)}{\left(x \cdot x\right) \cdot \color{blue}{\left(\left(c \cdot s\right) \cdot \left(c \cdot s\right)\right)}} \]

      unswap-sqr [=>]2.8

      \[ \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left(x \cdot \left(c \cdot s\right)\right) \cdot \left(x \cdot \left(c \cdot s\right)\right)}} \]
    3. Applied egg-rr2.6

      \[\leadsto \color{blue}{{\left(x \cdot \left(c \cdot s\right)\right)}^{-2} \cdot {\cos x}^{2} + {\left(x \cdot \left(c \cdot s\right)\right)}^{-2} \cdot \left(-{\sin x}^{2}\right)} \]
    4. Simplified0.8

      \[\leadsto \color{blue}{{\left(s \cdot \left(c \cdot x\right)\right)}^{-2} \cdot \left({\cos x}^{2} - {\sin x}^{2}\right)} \]
      Proof

      [Start]2.6

      \[ {\left(x \cdot \left(c \cdot s\right)\right)}^{-2} \cdot {\cos x}^{2} + {\left(x \cdot \left(c \cdot s\right)\right)}^{-2} \cdot \left(-{\sin x}^{2}\right) \]

      distribute-lft-out [=>]2.5

      \[ \color{blue}{{\left(x \cdot \left(c \cdot s\right)\right)}^{-2} \cdot \left({\cos x}^{2} + \left(-{\sin x}^{2}\right)\right)} \]

      associate-*r* [=>]0.8

      \[ {\color{blue}{\left(\left(x \cdot c\right) \cdot s\right)}}^{-2} \cdot \left({\cos x}^{2} + \left(-{\sin x}^{2}\right)\right) \]

      *-commutative [<=]0.8

      \[ {\left(\color{blue}{\left(c \cdot x\right)} \cdot s\right)}^{-2} \cdot \left({\cos x}^{2} + \left(-{\sin x}^{2}\right)\right) \]

      *-commutative [<=]0.8

      \[ {\color{blue}{\left(s \cdot \left(c \cdot x\right)\right)}}^{-2} \cdot \left({\cos x}^{2} + \left(-{\sin x}^{2}\right)\right) \]

      unsub-neg [=>]0.8

      \[ {\left(s \cdot \left(c \cdot x\right)\right)}^{-2} \cdot \color{blue}{\left({\cos x}^{2} - {\sin x}^{2}\right)} \]
    5. Applied egg-rr0.7

      \[\leadsto {\left(s \cdot \left(c \cdot x\right)\right)}^{-2} \cdot \color{blue}{\frac{1}{\frac{1}{\cos \left(2 \cdot x\right)}}} \]

    if 2.4e213 < s

    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. Simplified24.3

      \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(x \cdot \left(\left(c \cdot c\right) \cdot \left(s \cdot s\right)\right)\right)}} \]
      Proof

      [Start]24.3

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

      associate-*r* [=>]24.3

      \[ \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left({c}^{2} \cdot \left(x \cdot {s}^{2}\right)\right) \cdot x}} \]

      *-commutative [=>]24.3

      \[ \frac{\cos \left(2 \cdot x\right)}{\color{blue}{x \cdot \left({c}^{2} \cdot \left(x \cdot {s}^{2}\right)\right)}} \]

      *-commutative [=>]24.3

      \[ \frac{\cos \left(2 \cdot x\right)}{x \cdot \left({c}^{2} \cdot \color{blue}{\left({s}^{2} \cdot x\right)}\right)} \]

      associate-*r* [=>]24.3

      \[ \frac{\cos \left(2 \cdot x\right)}{x \cdot \color{blue}{\left(\left({c}^{2} \cdot {s}^{2}\right) \cdot x\right)}} \]

      *-commutative [=>]24.3

      \[ \frac{\cos \left(2 \cdot x\right)}{x \cdot \color{blue}{\left(x \cdot \left({c}^{2} \cdot {s}^{2}\right)\right)}} \]

      unpow2 [=>]24.3

      \[ \frac{\cos \left(2 \cdot x\right)}{x \cdot \left(x \cdot \left(\color{blue}{\left(c \cdot c\right)} \cdot {s}^{2}\right)\right)} \]

      unpow2 [=>]24.3

      \[ \frac{\cos \left(2 \cdot x\right)}{x \cdot \left(x \cdot \left(\left(c \cdot c\right) \cdot \color{blue}{\left(s \cdot s\right)}\right)\right)} \]
    3. Applied egg-rr2.5

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

      \[\leadsto \color{blue}{\frac{{\cos x}^{2}}{{\left(x \cdot \left(s \cdot c\right)\right)}^{2}} - \frac{{\sin x}^{2}}{{\left(x \cdot \left(s \cdot c\right)\right)}^{2}}} \]
      Proof

      [Start]2.5

      \[ \frac{{\cos x}^{2}}{{\left(x \cdot \left(c \cdot s\right)\right)}^{2}} - \frac{{\sin x}^{2}}{{\left(x \cdot \left(c \cdot s\right)\right)}^{2}} \]

      *-commutative [=>]2.5

      \[ \frac{{\cos x}^{2}}{{\left(x \cdot \color{blue}{\left(s \cdot c\right)}\right)}^{2}} - \frac{{\sin x}^{2}}{{\left(x \cdot \left(c \cdot s\right)\right)}^{2}} \]

      *-commutative [=>]2.5

      \[ \frac{{\cos x}^{2}}{{\left(x \cdot \left(s \cdot c\right)\right)}^{2}} - \frac{{\sin x}^{2}}{{\left(x \cdot \color{blue}{\left(s \cdot c\right)}\right)}^{2}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.8

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

Alternatives

Alternative 1
Error1.8
Cost13960
\[\begin{array}{l} t_0 := \cos \left(x \cdot 2\right)\\ t_1 := x \cdot \left(s \cdot c\right)\\ \mathbf{if}\;s \leq 2.9 \cdot 10^{-147}:\\ \;\;\;\;\frac{\frac{\frac{1}{x}}{s \cdot c}}{t_1} \cdot \cos \left(x + x\right)\\ \mathbf{elif}\;s \leq 2.6 \cdot 10^{+214}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2} \cdot \frac{1}{\frac{1}{t_0}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{t_1 \cdot t_1}\\ \end{array} \]
Alternative 2
Error1.8
Cost13704
\[\begin{array}{l} t_0 := \cos \left(x + x\right)\\ t_1 := x \cdot \left(s \cdot c\right)\\ \mathbf{if}\;s \leq 2.45 \cdot 10^{-147}:\\ \;\;\;\;\frac{\frac{\frac{1}{x}}{s \cdot c}}{t_1} \cdot t_0\\ \mathbf{elif}\;s \leq 10^{+213}:\\ \;\;\;\;t_0 \cdot {\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{t_1 \cdot t_1}\\ \end{array} \]
Alternative 3
Error9.7
Cost7625
\[\begin{array}{l} t_0 := \frac{-1}{x \cdot \left(s \cdot c\right)}\\ \mathbf{if}\;x \leq -12 \lor \neg \left(x \leq 5.1 \cdot 10^{-6}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{x \cdot \left(c \cdot \left(c \cdot \left(s \cdot \left(s \cdot x\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot t_0\\ \end{array} \]
Alternative 4
Error6.8
Cost7625
\[\begin{array}{l} t_0 := \frac{-1}{x \cdot \left(s \cdot c\right)}\\ \mathbf{if}\;x \leq -1.32 \cdot 10^{-56} \lor \neg \left(x \leq 1.68 \cdot 10^{-15}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{x \cdot \left(c \cdot \left(s \cdot \left(s \cdot \left(x \cdot c\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot t_0\\ \end{array} \]
Alternative 5
Error4.3
Cost7625
\[\begin{array}{l} t_0 := x \cdot \left(s \cdot c\right)\\ t_1 := \frac{-1}{t_0}\\ \mathbf{if}\;x \leq -1.65 \cdot 10^{-71} \lor \neg \left(x \leq 6.2 \cdot 10^{-181}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{t_0 \cdot \left(c \cdot \left(s \cdot x\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot t_1\\ \end{array} \]
Alternative 6
Error4.1
Cost7624
\[\begin{array}{l} t_0 := \cos \left(x \cdot 2\right)\\ t_1 := x \cdot \left(s \cdot c\right)\\ t_2 := \frac{-1}{t_1}\\ \mathbf{if}\;x \leq -1.4 \cdot 10^{-65}:\\ \;\;\;\;\frac{t_0}{t_1 \cdot \left(c \cdot \left(s \cdot x\right)\right)}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-17}:\\ \;\;\;\;t_2 \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{t_1 \cdot \left(s \cdot \left(x \cdot c\right)\right)}\\ \end{array} \]
Alternative 7
Error2.7
Cost7488
\[\begin{array}{l} t_0 := x \cdot \left(s \cdot c\right)\\ \frac{\cos \left(x + x\right)}{t_0} \cdot \frac{1}{t_0} \end{array} \]
Alternative 8
Error2.6
Cost7488
\[\frac{\frac{\frac{1}{x}}{s \cdot c}}{x \cdot \left(s \cdot c\right)} \cdot \cos \left(x + x\right) \]
Alternative 9
Error2.9
Cost7360
\[\begin{array}{l} t_0 := x \cdot \left(s \cdot c\right)\\ \frac{\cos \left(x \cdot 2\right)}{t_0 \cdot t_0} \end{array} \]
Alternative 10
Error19.3
Cost964
\[\begin{array}{l} t_0 := c \cdot \left(x \cdot \left(s \cdot c\right)\right)\\ \mathbf{if}\;c \leq -1.5 \cdot 10^{+14}:\\ \;\;\;\;\frac{1}{s \cdot \left(x \cdot t_0\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot \left(s \cdot t_0\right)}\\ \end{array} \]
Alternative 11
Error16.9
Cost960
\[\begin{array}{l} t_0 := \frac{-1}{x \cdot \left(s \cdot c\right)}\\ t_0 \cdot t_0 \end{array} \]
Alternative 12
Error20.5
Cost832
\[\frac{1}{s \cdot \left(x \cdot \left(c \cdot \left(x \cdot \left(s \cdot c\right)\right)\right)\right)} \]
Alternative 13
Error16.9
Cost832
\[\begin{array}{l} t_0 := x \cdot \left(s \cdot c\right)\\ \frac{1}{t_0 \cdot t_0} \end{array} \]

Error

Reproduce

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