?

Average Error: 44.58% → 3.16%
Time: 16.5s
Precision: binary64
Cost: 7753

?

\[ \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 := c \cdot \left(x \cdot s\right)\\ t_2 := \cos \left(x + x\right)\\ \mathbf{if}\;c \leq -1 \cdot 10^{+158} \lor \neg \left(c \leq -7.5 \cdot 10^{-269}\right):\\ \;\;\;\;t_2 \cdot \frac{\frac{1}{t_0}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t_2}{t_1}}{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 (* s (* c x))) (t_1 (* c (* x s))) (t_2 (cos (+ x x))))
   (if (or (<= c -1e+158) (not (<= c -7.5e-269)))
     (* t_2 (/ (/ 1.0 t_0) t_0))
     (/ (/ t_2 t_1) 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 = s * (c * x);
	double t_1 = c * (x * s);
	double t_2 = cos((x + x));
	double tmp;
	if ((c <= -1e+158) || !(c <= -7.5e-269)) {
		tmp = t_2 * ((1.0 / t_0) / t_0);
	} else {
		tmp = (t_2 / t_1) / 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) :: t_2
    real(8) :: tmp
    t_0 = s * (c * x)
    t_1 = c * (x * s)
    t_2 = cos((x + x))
    if ((c <= (-1d+158)) .or. (.not. (c <= (-7.5d-269)))) then
        tmp = t_2 * ((1.0d0 / t_0) / t_0)
    else
        tmp = (t_2 / t_1) / 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 = s * (c * x);
	double t_1 = c * (x * s);
	double t_2 = Math.cos((x + x));
	double tmp;
	if ((c <= -1e+158) || !(c <= -7.5e-269)) {
		tmp = t_2 * ((1.0 / t_0) / t_0);
	} else {
		tmp = (t_2 / t_1) / 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 = s * (c * x)
	t_1 = c * (x * s)
	t_2 = math.cos((x + x))
	tmp = 0
	if (c <= -1e+158) or not (c <= -7.5e-269):
		tmp = t_2 * ((1.0 / t_0) / t_0)
	else:
		tmp = (t_2 / t_1) / 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(s * Float64(c * x))
	t_1 = Float64(c * Float64(x * s))
	t_2 = cos(Float64(x + x))
	tmp = 0.0
	if ((c <= -1e+158) || !(c <= -7.5e-269))
		tmp = Float64(t_2 * Float64(Float64(1.0 / t_0) / t_0));
	else
		tmp = Float64(Float64(t_2 / t_1) / 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 = s * (c * x);
	t_1 = c * (x * s);
	t_2 = cos((x + x));
	tmp = 0.0;
	if ((c <= -1e+158) || ~((c <= -7.5e-269)))
		tmp = t_2 * ((1.0 / t_0) / t_0);
	else
		tmp = (t_2 / t_1) / 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[(s * N[(c * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c * N[(x * s), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[c, -1e+158], N[Not[LessEqual[c, -7.5e-269]], $MachinePrecision]], N[(t$95$2 * N[(N[(1.0 / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 / t$95$1), $MachinePrecision] / t$95$1), $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 := c \cdot \left(x \cdot s\right)\\
t_2 := \cos \left(x + x\right)\\
\mathbf{if}\;c \leq -1 \cdot 10^{+158} \lor \neg \left(c \leq -7.5 \cdot 10^{-269}\right):\\
\;\;\;\;t_2 \cdot \frac{\frac{1}{t_0}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{t_2}{t_1}}{t_1}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. if c < -9.99999999999999953e157 or -7.4999999999999993e-269 < c

    1. Initial program 46.33

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

      \[\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]46.33

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

      *-commutative [=>]46.33

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

      associate-*l* [=>]51.32

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

      associate-*r* [=>]51.09

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

      *-commutative [=>]51.09

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

      unpow2 [=>]51.09

      \[ \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 [=>]51.09

      \[ \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 [=>]28.06

      \[ \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 [=>]4.7

      \[ \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. Taylor expanded in x around inf 51.32

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

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

      [Start]51.32

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

      count-2 [<=]51.32

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

      associate-*r* [=>]51.09

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

      unpow2 [=>]51.09

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

      associate-/r* [=>]51.15

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

      unpow2 [=>]51.15

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

      unpow2 [=>]51.15

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

      swap-sqr [<=]28.09

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

      unpow2 [<=]28.09

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

      *-lft-identity [<=]28.09

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

      associate-*l/ [<=]28.68

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

      unpow2 [=>]28.68

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

      associate-/r* [=>]28.53

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

      times-frac [<=]23.07

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

      *-commutative [<=]23.07

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

      associate-*r* [=>]9.08

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

      *-commutative [<=]9.08

      \[ \frac{1 \cdot \frac{\cos \left(x + x\right)}{c \cdot s}}{\color{blue}{\left(x \cdot \left(c \cdot s\right)\right)} \cdot x} \]
    5. Applied egg-rr7.76

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

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

    if -9.99999999999999953e157 < c < -7.4999999999999993e-269

    1. Initial program 42.21

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

      \[\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]42.21

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

      *-commutative [=>]42.21

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

      associate-*l* [=>]48.57

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

      associate-*r* [=>]48.13

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

      *-commutative [=>]48.13

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

      unpow2 [=>]48.13

      \[ \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 [=>]48.13

      \[ \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 [=>]35.65

      \[ \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 [=>]4.65

      \[ \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. Taylor expanded in x around inf 48.57

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

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

      [Start]48.57

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

      count-2 [<=]48.57

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

      associate-*r* [=>]48.13

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

      unpow2 [=>]48.13

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

      associate-/r* [=>]48.21

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

      unpow2 [=>]48.21

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

      unpow2 [=>]48.21

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

      swap-sqr [<=]35.95

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

      unpow2 [<=]35.95

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

      *-lft-identity [<=]35.95

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

      associate-*l/ [<=]36.44

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

      unpow2 [=>]36.44

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

      associate-/r* [=>]36.27

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

      times-frac [<=]27.97

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

      *-commutative [<=]27.97

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

      associate-*r* [=>]12.91

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

      *-commutative [<=]12.91

      \[ \frac{1 \cdot \frac{\cos \left(x + x\right)}{c \cdot s}}{\color{blue}{\left(x \cdot \left(c \cdot s\right)\right)} \cdot x} \]
    5. Applied egg-rr7.37

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1 \cdot 10^{+158} \lor \neg \left(c \leq -7.5 \cdot 10^{-269}\right):\\ \;\;\;\;\cos \left(x + x\right) \cdot \frac{\frac{1}{s \cdot \left(c \cdot x\right)}}{s \cdot \left(c \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\cos \left(x + x\right)}{c \cdot \left(x \cdot s\right)}}{c \cdot \left(x \cdot s\right)}\\ \end{array} \]

Alternatives

Alternative 1
Error19.75%
Cost7888
\[\begin{array}{l} t_0 := x \cdot \left(s \cdot s\right)\\ t_1 := \frac{\cos \left(x \cdot 2\right)}{x \cdot \left(c \cdot \left(c \cdot t_0\right)\right)}\\ \mathbf{if}\;s \leq -5 \cdot 10^{-61}:\\ \;\;\;\;\frac{\frac{\frac{1}{c}}{t_0}}{c \cdot x}\\ \mathbf{elif}\;s \leq -1.45 \cdot 10^{-157}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;s \leq 4.3 \cdot 10^{-134}:\\ \;\;\;\;\frac{1}{{\left(s \cdot \left(c \cdot x\right)\right)}^{2}}\\ \mathbf{elif}\;s \leq 3.2 \cdot 10^{+67}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \end{array} \]
Alternative 2
Error12.03%
Cost7756
\[\begin{array}{l} t_0 := \cos \left(x \cdot 2\right)\\ t_1 := \frac{\frac{1}{c}}{x \cdot s}\\ \mathbf{if}\;s \leq -5.2 \cdot 10^{-61}:\\ \;\;\;\;\frac{\frac{\frac{1}{c}}{x \cdot \left(s \cdot s\right)}}{c \cdot x}\\ \mathbf{elif}\;s \leq 8.8 \cdot 10^{-178}:\\ \;\;\;\;\frac{t_0}{x \cdot \left(x \cdot \left(\left(c \cdot s\right) \cdot \left(c \cdot s\right)\right)\right)}\\ \mathbf{elif}\;s \leq 2 \cdot 10^{+216}:\\ \;\;\;\;\frac{t_0}{x \cdot \left(c \cdot \left(s \cdot \left(s \cdot \left(c \cdot x\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot t_1\\ \end{array} \]
Alternative 3
Error10.53%
Cost7625
\[\begin{array}{l} t_0 := s \cdot \left(c \cdot x\right)\\ \mathbf{if}\;x \leq -175000000000 \lor \neg \left(x \leq 2.1 \cdot 10^{-6}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{x \cdot \left(c \cdot \left(s \cdot t_0\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{t_0}^{-2}\\ \end{array} \]
Alternative 4
Error3.99%
Cost7625
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ \mathbf{if}\;x \leq -4.4 \cdot 10^{-271} \lor \neg \left(x \leq 2.05 \cdot 10^{-6}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{t_0 \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;{\left(s \cdot \left(c \cdot x\right)\right)}^{-2}\\ \end{array} \]
Alternative 5
Error7.17%
Cost7624
\[\begin{array}{l} t_0 := \frac{\frac{1}{c}}{x \cdot s}\\ \mathbf{if}\;s \leq -6.6 \cdot 10^{-15}:\\ \;\;\;\;\frac{1}{c} \cdot \frac{1}{\left(c \cdot x\right) \cdot \left(x \cdot \left(s \cdot s\right)\right)}\\ \mathbf{elif}\;s \leq 3.2 \cdot 10^{+215}:\\ \;\;\;\;\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}:\\ \;\;\;\;t_0 \cdot t_0\\ \end{array} \]
Alternative 6
Error4.72%
Cost7624
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ t_1 := c \cdot \left(x \cdot s\right)\\ \mathbf{if}\;c \leq -1.35 \cdot 10^{+234}:\\ \;\;\;\;{\left(s \cdot \left(c \cdot x\right)\right)}^{-2}\\ \mathbf{elif}\;c \leq 4 \cdot 10^{-271}:\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{t_0 \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\cos \left(x + x\right)}{t_1}}{t_1}\\ \end{array} \]
Alternative 7
Error25.02%
Cost7048
\[\begin{array}{l} t_0 := \frac{1}{x \cdot \left(c \cdot s\right)}\\ \mathbf{if}\;s \leq -6.6 \cdot 10^{-57}:\\ \;\;\;\;\frac{\frac{\frac{1}{c}}{x \cdot \left(s \cdot s\right)}}{c \cdot x}\\ \mathbf{elif}\;s \leq 4.5 \cdot 10^{-137}:\\ \;\;\;\;t_0 \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2}\\ \end{array} \]
Alternative 8
Error24.88%
Cost6916
\[\begin{array}{l} t_0 := \frac{\frac{1}{c}}{x \cdot s}\\ \mathbf{if}\;s \leq 5 \cdot 10^{+231}:\\ \;\;\;\;{\left(s \cdot \left(c \cdot x\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot t_0\\ \end{array} \]
Alternative 9
Error26.11%
Cost1225
\[\begin{array}{l} t_0 := \frac{1}{x \cdot \left(c \cdot s\right)}\\ \mathbf{if}\;x \leq -1.45 \cdot 10^{-269} \lor \neg \left(x \leq 8.5 \cdot 10^{-240}\right):\\ \;\;\;\;t_0 \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{c \cdot \left(\left(c \cdot \left(x \cdot s\right)\right) \cdot \left(x \cdot s\right)\right)}\\ \end{array} \]
Alternative 10
Error25.05%
Cost1224
\[\begin{array}{l} t_0 := \frac{1}{x \cdot \left(c \cdot s\right)}\\ t_1 := \frac{\frac{1}{c}}{x \cdot s}\\ \mathbf{if}\;s \leq -1.65 \cdot 10^{-56}:\\ \;\;\;\;\frac{\frac{\frac{1}{c}}{x \cdot \left(s \cdot s\right)}}{c \cdot x}\\ \mathbf{elif}\;s \leq 7.8 \cdot 10^{-140}:\\ \;\;\;\;t_0 \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot t_1\\ \end{array} \]
Alternative 11
Error28.01%
Cost1097
\[\begin{array}{l} \mathbf{if}\;c \leq -1.38 \cdot 10^{+206} \lor \neg \left(c \leq -1.5 \cdot 10^{+19}\right):\\ \;\;\;\;\frac{1}{c \cdot \left(\left(c \cdot \left(x \cdot s\right)\right) \cdot \left(x \cdot s\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(x \cdot s\right) \cdot \left(c \cdot \left(x \cdot \left(c \cdot s\right)\right)\right)}\\ \end{array} \]
Alternative 12
Error27.09%
Cost1097
\[\begin{array}{l} \mathbf{if}\;s \leq -3.4 \cdot 10^{-19} \lor \neg \left(s \leq 4.1 \cdot 10^{-141}\right):\\ \;\;\;\;\frac{1}{c \cdot \left(\left(c \cdot \left(x \cdot s\right)\right) \cdot \left(x \cdot s\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{s \cdot \left(x \cdot \left(c \cdot \left(x \cdot \left(c \cdot s\right)\right)\right)\right)}\\ \end{array} \]
Alternative 13
Error27.14%
Cost1096
\[\begin{array}{l} \mathbf{if}\;s \leq -1.2 \cdot 10^{-17}:\\ \;\;\;\;\frac{\frac{1}{c}}{x \cdot \left(c \cdot \left(x \cdot \left(s \cdot s\right)\right)\right)}\\ \mathbf{elif}\;s \leq 1.45 \cdot 10^{-138}:\\ \;\;\;\;\frac{1}{s \cdot \left(x \cdot \left(c \cdot \left(x \cdot \left(c \cdot s\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{c \cdot \left(\left(c \cdot \left(x \cdot s\right)\right) \cdot \left(x \cdot s\right)\right)}\\ \end{array} \]
Alternative 14
Error27.1%
Cost1096
\[\begin{array}{l} \mathbf{if}\;s \leq -8.5 \cdot 10^{-97}:\\ \;\;\;\;\frac{\frac{\frac{1}{c}}{x \cdot \left(s \cdot s\right)}}{c \cdot x}\\ \mathbf{elif}\;s \leq 2.75 \cdot 10^{-136}:\\ \;\;\;\;\frac{1}{s \cdot \left(x \cdot \left(c \cdot \left(x \cdot \left(c \cdot s\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{c \cdot \left(\left(c \cdot \left(x \cdot s\right)\right) \cdot \left(x \cdot s\right)\right)}\\ \end{array} \]
Alternative 15
Error28.9%
Cost832
\[\frac{1}{c \cdot \left(\left(c \cdot \left(x \cdot s\right)\right) \cdot \left(x \cdot s\right)\right)} \]

Error

Reproduce?

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