Average Error: 28.2 → 3.0
Time: 16.0s
Precision: binary64
Cost: 7752
\[ \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 := s \cdot \left(c \cdot x\right)\\ t_1 := \cos \left(x + x\right)\\ \mathbf{if}\;c \leq -6.6 \cdot 10^{-207}:\\ \;\;\;\;\frac{\frac{1}{c}}{s \cdot x} \cdot \frac{t_1}{c \cdot \left(s \cdot x\right)}\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-111}:\\ \;\;\;\;\frac{1}{t_0} \cdot \frac{t_1}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{c \cdot c} \cdot \frac{1}{x \cdot \left(s \cdot \left(s \cdot x\right)\right)}\\ \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 (* s (* c x))) (t_1 (cos (+ x x))))
   (if (<= c -6.6e-207)
     (* (/ (/ 1.0 c) (* s x)) (/ t_1 (* c (* s x))))
     (if (<= c 1.22e-111)
       (* (/ 1.0 t_0) (/ t_1 t_0))
       (* (/ (cos (* x 2.0)) (* c c)) (/ 1.0 (* x (* s (* s x)))))))))
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 = s * (c * x);
	double t_1 = cos((x + x));
	double tmp;
	if (c <= -6.6e-207) {
		tmp = ((1.0 / c) / (s * x)) * (t_1 / (c * (s * x)));
	} else if (c <= 1.22e-111) {
		tmp = (1.0 / t_0) * (t_1 / t_0);
	} else {
		tmp = (cos((x * 2.0)) / (c * c)) * (1.0 / (x * (s * (s * x))));
	}
	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 = s * (c * x)
    t_1 = cos((x + x))
    if (c <= (-6.6d-207)) then
        tmp = ((1.0d0 / c) / (s * x)) * (t_1 / (c * (s * x)))
    else if (c <= 1.22d-111) then
        tmp = (1.0d0 / t_0) * (t_1 / t_0)
    else
        tmp = (cos((x * 2.0d0)) / (c * c)) * (1.0d0 / (x * (s * (s * x))))
    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 = s * (c * x);
	double t_1 = Math.cos((x + x));
	double tmp;
	if (c <= -6.6e-207) {
		tmp = ((1.0 / c) / (s * x)) * (t_1 / (c * (s * x)));
	} else if (c <= 1.22e-111) {
		tmp = (1.0 / t_0) * (t_1 / t_0);
	} else {
		tmp = (Math.cos((x * 2.0)) / (c * c)) * (1.0 / (x * (s * (s * x))));
	}
	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 = s * (c * x)
	t_1 = math.cos((x + x))
	tmp = 0
	if c <= -6.6e-207:
		tmp = ((1.0 / c) / (s * x)) * (t_1 / (c * (s * x)))
	elif c <= 1.22e-111:
		tmp = (1.0 / t_0) * (t_1 / t_0)
	else:
		tmp = (math.cos((x * 2.0)) / (c * c)) * (1.0 / (x * (s * (s * x))))
	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(s * Float64(c * x))
	t_1 = cos(Float64(x + x))
	tmp = 0.0
	if (c <= -6.6e-207)
		tmp = Float64(Float64(Float64(1.0 / c) / Float64(s * x)) * Float64(t_1 / Float64(c * Float64(s * x))));
	elseif (c <= 1.22e-111)
		tmp = Float64(Float64(1.0 / t_0) * Float64(t_1 / t_0));
	else
		tmp = Float64(Float64(cos(Float64(x * 2.0)) / Float64(c * c)) * Float64(1.0 / Float64(x * Float64(s * Float64(s * x)))));
	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 = s * (c * x);
	t_1 = cos((x + x));
	tmp = 0.0;
	if (c <= -6.6e-207)
		tmp = ((1.0 / c) / (s * x)) * (t_1 / (c * (s * x)));
	elseif (c <= 1.22e-111)
		tmp = (1.0 / t_0) * (t_1 / t_0);
	else
		tmp = (cos((x * 2.0)) / (c * c)) * (1.0 / (x * (s * (s * x))));
	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[(s * N[(c * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[c, -6.6e-207], N[(N[(N[(1.0 / c), $MachinePrecision] / N[(s * x), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / N[(c * N[(s * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.22e-111], N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(c * c), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x * N[(s * N[(s * x), $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 := s \cdot \left(c \cdot x\right)\\
t_1 := \cos \left(x + x\right)\\
\mathbf{if}\;c \leq -6.6 \cdot 10^{-207}:\\
\;\;\;\;\frac{\frac{1}{c}}{s \cdot x} \cdot \frac{t_1}{c \cdot \left(s \cdot x\right)}\\

\mathbf{elif}\;c \leq 1.22 \cdot 10^{-111}:\\
\;\;\;\;\frac{1}{t_0} \cdot \frac{t_1}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(x \cdot 2\right)}{c \cdot c} \cdot \frac{1}{x \cdot \left(s \cdot \left(s \cdot x\right)\right)}\\


\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 c < -6.5999999999999996e-207

    1. Initial program 26.1

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

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

      [Start]26.1

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

      associate-*r* [=>]24.5

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

      *-commutative [=>]24.5

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

      unpow2 [=>]24.5

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

      associate-*l* [=>]20.8

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

      unpow2 [=>]20.8

      \[ \frac{\cos \left(2 \cdot x\right)}{x \cdot \left(c \cdot \left(c \cdot \left(x \cdot \color{blue}{\left(s \cdot s\right)}\right)\right)\right)} \]
    3. Taylor expanded in x around 0 29.6

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

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

      [Start]29.6

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

      *-commutative [=>]29.6

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

      associate-*r* [<=]29.7

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

      unpow2 [=>]29.7

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

      unpow2 [=>]29.7

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

      unpow2 [=>]29.7

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

      swap-sqr [<=]16.9

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

      sqr-abs [<=]16.9

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

      rem-sqrt-square [<=]16.9

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

      unpow2 [<=]16.9

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

      rem-sqrt-square [<=]16.9

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

      unpow2 [<=]16.9

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

      swap-sqr [<=]12.3

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

      unpow2 [<=]12.3

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

      unpow2 [=>]12.3

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

      rem-sqrt-square [=>]2.2

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

      unpow1 [<=]2.2

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

      sqr-pow [=>]28.8

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

      fabs-sqr [=>]28.8

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

      sqr-pow [<=]2.2

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

      unpow1 [=>]2.2

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

      *-commutative [=>]2.2

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

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

    if -6.5999999999999996e-207 < c < 1.22e-111

    1. Initial program 57.0

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

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

      [Start]57.0

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

      associate-*r* [=>]55.6

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

      *-commutative [=>]55.6

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

      unpow2 [=>]55.6

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

      associate-*l* [=>]37.4

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

      unpow2 [=>]37.4

      \[ \frac{\cos \left(2 \cdot x\right)}{x \cdot \left(c \cdot \left(c \cdot \left(x \cdot \color{blue}{\left(s \cdot s\right)}\right)\right)\right)} \]
    3. Taylor expanded in x around 0 57.6

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

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

      [Start]57.6

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

      unpow2 [=>]57.6

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

      unpow2 [=>]57.6

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

      unpow2 [=>]57.6

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

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

    if 1.22e-111 < c

    1. Initial program 13.0

      \[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)} \]
    2. Applied egg-rr6.4

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

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

Alternatives

Alternative 1
Error2.1
Cost7752
\[\begin{array}{l} t_0 := s \cdot \left(c \cdot x\right)\\ t_1 := \cos \left(x + x\right)\\ t_2 := c \cdot \left(s \cdot x\right)\\ \mathbf{if}\;c \leq -2.2 \cdot 10^{-207}:\\ \;\;\;\;\frac{\frac{t_1}{t_2}}{t_2}\\ \mathbf{elif}\;c \leq 8.5 \cdot 10^{-189}:\\ \;\;\;\;\frac{1}{t_0} \cdot \frac{t_1}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{\left(s \cdot x\right) \cdot \left(c \cdot t_2\right)}\\ \end{array} \]
Alternative 2
Error3.1
Cost7752
\[\begin{array}{l} t_0 := s \cdot \left(c \cdot x\right)\\ t_1 := \cos \left(x + x\right)\\ t_2 := c \cdot \left(s \cdot x\right)\\ \mathbf{if}\;c \leq -1.5 \cdot 10^{-215}:\\ \;\;\;\;\frac{\frac{t_1}{t_2}}{t_2}\\ \mathbf{elif}\;c \leq 5.2 \cdot 10^{-118}:\\ \;\;\;\;\frac{1}{t_0} \cdot \frac{t_1}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{c \cdot c} \cdot \frac{1}{x \cdot \left(s \cdot \left(s \cdot x\right)\right)}\\ \end{array} \]
Alternative 3
Error10.3
Cost7625
\[\begin{array}{l} \mathbf{if}\;x \leq -920000000000 \lor \neg \left(x \leq 1.85 \cdot 10^{-40}\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}:\\ \;\;\;\;{\left(c \cdot \left(s \cdot x\right)\right)}^{-2}\\ \end{array} \]
Alternative 4
Error8.2
Cost7625
\[\begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{-27} \lor \neg \left(x \leq 1.75 \cdot 10^{-66}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{x \cdot \left(x \cdot \left(\left(c \cdot s\right) \cdot \left(c \cdot s\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(c \cdot \left(s \cdot x\right)\right)}^{-2}\\ \end{array} \]
Alternative 5
Error3.8
Cost7625
\[\begin{array}{l} t_0 := c \cdot \left(s \cdot x\right)\\ \mathbf{if}\;x \leq -1.5 \cdot 10^{-46} \lor \neg \left(x \leq 4.5 \cdot 10^{-213}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{t_0 \cdot \left(x \cdot \left(c \cdot s\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{t_0}^{-2}\\ \end{array} \]
Alternative 6
Error3.6
Cost7625
\[\begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{-122} \lor \neg \left(x \leq 3.6 \cdot 10^{-122}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{\left(s \cdot \left(c \cdot x\right)\right) \cdot \left(x \cdot \left(c \cdot s\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(c \cdot \left(s \cdot x\right)\right)}^{-2}\\ \end{array} \]
Alternative 7
Error2.3
Cost7625
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ \mathbf{if}\;x \leq -2 \cdot 10^{-137} \lor \neg \left(x \leq 5.5 \cdot 10^{-193}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{t_0 \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;{\left(c \cdot \left(s \cdot x\right)\right)}^{-2}\\ \end{array} \]
Alternative 8
Error2.5
Cost7624
\[\begin{array}{l} t_0 := s \cdot \left(c \cdot x\right)\\ t_1 := x \cdot \left(c \cdot s\right)\\ \mathbf{if}\;x \leq -2 \cdot 10^{-129}:\\ \;\;\;\;\frac{\cos \left(x + x\right)}{t_0 \cdot t_0}\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-180}:\\ \;\;\;\;{\left(c \cdot \left(s \cdot x\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{t_1 \cdot t_1}\\ \end{array} \]
Alternative 9
Error2.2
Cost7624
\[\begin{array}{l} t_0 := s \cdot \left(c \cdot x\right)\\ t_1 := \cos \left(x + x\right)\\ t_2 := c \cdot \left(s \cdot x\right)\\ \mathbf{if}\;c \leq -2.2 \cdot 10^{-223}:\\ \;\;\;\;\frac{\frac{t_1}{t_2}}{t_2}\\ \mathbf{elif}\;c \leq 2.05 \cdot 10^{-197}:\\ \;\;\;\;\frac{t_1}{t_0 \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{\left(s \cdot x\right) \cdot \left(c \cdot t_2\right)}\\ \end{array} \]
Alternative 10
Error17.5
Cost1225
\[\begin{array}{l} t_0 := \frac{1}{x \cdot \left(c \cdot s\right)}\\ \mathbf{if}\;s \leq 1.85 \lor \neg \left(s \leq 5 \cdot 10^{+265}\right):\\ \;\;\;\;t_0 \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{c \cdot \left(s \cdot \left(\left(s \cdot x\right) \cdot \left(c \cdot x\right)\right)\right)}\\ \end{array} \]
Alternative 11
Error20.2
Cost1097
\[\begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{-286} \lor \neg \left(x \leq 1.45 \cdot 10^{-282}\right):\\ \;\;\;\;\frac{1}{c \cdot \left(s \cdot \left(\left(s \cdot x\right) \cdot \left(c \cdot x\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(c \cdot c\right) \cdot \left(\left(s \cdot x\right) \cdot \left(s \cdot x\right)\right)}\\ \end{array} \]
Alternative 12
Error19.4
Cost1097
\[\begin{array}{l} \mathbf{if}\;c \leq -4.1 \cdot 10^{+151} \lor \neg \left(c \leq -1.02 \cdot 10^{-49}\right):\\ \;\;\;\;\frac{1}{c \cdot \left(s \cdot \left(\left(s \cdot x\right) \cdot \left(c \cdot x\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(s \cdot x\right) \cdot \left(s \cdot \left(x \cdot \left(c \cdot c\right)\right)\right)}\\ \end{array} \]
Alternative 13
Error16.7
Cost960
\[\begin{array}{l} t_0 := \frac{\frac{1}{c}}{s \cdot x}\\ t_0 \cdot t_0 \end{array} \]
Alternative 14
Error17.0
Cost960
\[\frac{1}{\frac{c \cdot \left(s \cdot x\right)}{\frac{\frac{1}{s \cdot x}}{c}}} \]
Alternative 15
Error20.1
Cost832
\[\frac{1}{c \cdot \left(s \cdot \left(\left(s \cdot x\right) \cdot \left(c \cdot x\right)\right)\right)} \]

Error

Reproduce

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