?

Average Accuracy: 38.1% → 67.6%
Time: 17.2s
Precision: binary64
Cost: 27588

?

\[ \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 := x \cdot \left(c \cdot s\right)\\ \mathbf{if}\;\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(x \cdot \left(x \cdot {s}^{2}\right)\right)} \leq \infty:\\ \;\;\;\;\frac{\frac{\frac{\frac{1}{x}}{s}}{\frac{c}{t_0}}}{c \cdot \left(x \cdot s\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t_0}{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 (cos (+ x x))) (t_1 (* x (* c s))))
   (if (<=
        (/ (cos (* 2.0 x)) (* (pow c 2.0) (* x (* x (pow s 2.0)))))
        INFINITY)
     (/ (/ (/ (/ 1.0 x) s) (/ c t_0)) (* c (* x s)))
     (/ (/ t_0 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 = cos((x + x));
	double t_1 = x * (c * s);
	double tmp;
	if ((cos((2.0 * x)) / (pow(c, 2.0) * (x * (x * pow(s, 2.0))))) <= ((double) INFINITY)) {
		tmp = (((1.0 / x) / s) / (c / t_0)) / (c * (x * s));
	} else {
		tmp = (t_0 / t_1) / t_1;
	}
	return tmp;
}
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 = x * (c * s);
	double tmp;
	if ((Math.cos((2.0 * x)) / (Math.pow(c, 2.0) * (x * (x * Math.pow(s, 2.0))))) <= Double.POSITIVE_INFINITY) {
		tmp = (((1.0 / x) / s) / (c / t_0)) / (c * (x * s));
	} else {
		tmp = (t_0 / 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 = math.cos((x + x))
	t_1 = x * (c * s)
	tmp = 0
	if (math.cos((2.0 * x)) / (math.pow(c, 2.0) * (x * (x * math.pow(s, 2.0))))) <= math.inf:
		tmp = (((1.0 / x) / s) / (c / t_0)) / (c * (x * s))
	else:
		tmp = (t_0 / 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 = cos(Float64(x + x))
	t_1 = Float64(x * Float64(c * s))
	tmp = 0.0
	if (Float64(cos(Float64(2.0 * x)) / Float64((c ^ 2.0) * Float64(x * Float64(x * (s ^ 2.0))))) <= Inf)
		tmp = Float64(Float64(Float64(Float64(1.0 / x) / s) / Float64(c / t_0)) / Float64(c * Float64(x * s)));
	else
		tmp = Float64(Float64(t_0 / 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 = cos((x + x));
	t_1 = x * (c * s);
	tmp = 0.0;
	if ((cos((2.0 * x)) / ((c ^ 2.0) * (x * (x * (s ^ 2.0))))) <= Inf)
		tmp = (((1.0 / x) / s) / (c / t_0)) / (c * (x * s));
	else
		tmp = (t_0 / 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[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(c * s), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(x * N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(1.0 / x), $MachinePrecision] / s), $MachinePrecision] / N[(c / t$95$0), $MachinePrecision]), $MachinePrecision] / N[(c * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / 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 := \cos \left(x + x\right)\\
t_1 := x \cdot \left(c \cdot s\right)\\
\mathbf{if}\;\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(x \cdot \left(x \cdot {s}^{2}\right)\right)} \leq \infty:\\
\;\;\;\;\frac{\frac{\frac{\frac{1}{x}}{s}}{\frac{c}{t_0}}}{c \cdot \left(x \cdot s\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{t_0}{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 (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (pow.f64 c 2) (*.f64 (*.f64 x (pow.f64 s 2)) x))) < +inf.0

    1. Initial program 50.5%

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

      \[\leadsto \color{blue}{\frac{\frac{\cos \left(2 \cdot x\right)}{c \cdot c}}{x \cdot \left(x \cdot \left(s \cdot s\right)\right)}} \]
      Step-by-step derivation

      [Start]50.5

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

      associate-/r* [=>]50.7

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

      unpow2 [=>]50.7

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

      *-commutative [=>]50.7

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

      unpow2 [=>]50.7

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

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

      [Start]50.7

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

      associate-/l/ [=>]50.5

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

      div-inv [=>]50.5

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

      cos-2 [=>]50.5

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

      cos-sum [<=]50.5

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

      *-commutative [=>]50.5

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

      add-sqr-sqrt [=>]50.5

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

      pow2 [=>]50.5

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

      associate-*r* [=>]45.4

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

      sqrt-prod [=>]45.5

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

      sqrt-unprod [<=]24.5

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

      sqrt-prod [=>]14.8

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

      add-sqr-sqrt [<=]29.1

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

      add-sqr-sqrt [<=]60.8

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

      \[\leadsto \color{blue}{\frac{\frac{\cos \left(x + x\right)}{c \cdot \left(x \cdot s\right)}}{c \cdot \left(x \cdot s\right)}} \]
      Step-by-step derivation

      [Start]60.8

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

      un-div-inv [=>]60.8

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

      add-sqr-sqrt [=>]60.7

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

      associate-/r* [=>]60.7

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

      sqrt-prod [=>]60.8

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

      sqrt-prod [=>]36.7

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

      add-sqr-sqrt [<=]52.9

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

      unpow2 [=>]52.9

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

      sqrt-prod [=>]27.0

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

      add-sqr-sqrt [<=]52.7

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

      sqrt-prod [=>]52.8

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

      sqrt-prod [=>]33.3

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

      add-sqr-sqrt [<=]52.3

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

      unpow2 [=>]52.3

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

      sqrt-prod [=>]34.5

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

      add-sqr-sqrt [<=]72.4

      \[ \frac{\frac{\cos \left(x + x\right)}{c \cdot \left(x \cdot s\right)}}{c \cdot \color{blue}{\left(x \cdot s\right)}} \]
    5. Applied egg-rr72.4%

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

      [Start]72.4

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

      associate-/r* [=>]72.4

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

      div-inv [=>]72.4

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

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

      [Start]72.4

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

      *-commutative [=>]72.4

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

      clear-num [=>]72.4

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

      un-div-inv [=>]72.4

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

      associate-/r* [=>]72.5

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

    if +inf.0 < (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (pow.f64 c 2) (*.f64 (*.f64 x (pow.f64 s 2)) x)))

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(\left(\left(c \cdot c\right) \cdot x\right) \cdot \left(s \cdot s\right)\right)}} \]
      Step-by-step derivation

      [Start]0.0

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

      associate-*r* [=>]0.4

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

      *-commutative [=>]0.4

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

      associate-*r* [=>]0.5

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

      unpow2 [=>]0.5

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

      unpow2 [=>]0.5

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

      \[\leadsto \color{blue}{\frac{1}{\left(s \cdot \left(c \cdot \sqrt{x}\right)\right) \cdot \sqrt{x}} \cdot \frac{\cos \left(x + x\right)}{\left(s \cdot \left(c \cdot \sqrt{x}\right)\right) \cdot \sqrt{x}}} \]
      Step-by-step derivation

      [Start]0.5

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

      *-un-lft-identity [=>]0.5

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

      add-sqr-sqrt [=>]0.5

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

      times-frac [=>]0.5

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

      *-commutative [=>]0.5

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

      sqrt-prod [=>]0.2

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

      *-commutative [=>]0.2

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

      sqrt-prod [=>]0.2

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

      sqrt-prod [=>]0.2

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

      add-sqr-sqrt [<=]0.2

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

      sqrt-prod [=>]0.2

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

      sqrt-prod [=>]0.0

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

      add-sqr-sqrt [<=]0.2

      \[ \frac{1}{\left(s \cdot \left(\color{blue}{c} \cdot \sqrt{x}\right)\right) \cdot \sqrt{x}} \cdot \frac{\cos \left(2 \cdot x\right)}{\sqrt{x \cdot \left(\left(\left(c \cdot c\right) \cdot x\right) \cdot \left(s \cdot s\right)\right)}} \]
    4. Simplified77.2%

      \[\leadsto \color{blue}{\frac{\frac{\cos \left(x + x\right)}{\left(s \cdot c\right) \cdot x}}{\left(s \cdot c\right) \cdot x}} \]
      Step-by-step derivation

      [Start]37.2

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

      associate-*l/ [=>]37.2

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

      *-lft-identity [=>]37.2

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

      associate-*r* [=>]33.5

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

      associate-*l* [=>]33.6

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

      rem-square-sqrt [=>]33.7

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

      associate-*r* [=>]40.5

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

      associate-*l* [=>]40.4

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

      rem-square-sqrt [=>]77.2

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

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

Alternatives

Alternative 1
Accuracy52.6%
Cost7756
\[\begin{array}{l} t_0 := s \cdot \left(x \cdot c\right)\\ t_1 := \frac{\cos \left(2 \cdot x\right)}{s \cdot \left(\left(x \cdot x\right) \cdot \left(s \cdot \left(c \cdot c\right)\right)\right)}\\ \mathbf{if}\;x \leq -0.00055:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.08 \cdot 10^{-11}:\\ \;\;\;\;{t_0}^{-2}\\ \mathbf{elif}\;x \leq 5.9 \cdot 10^{+88}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{t_0}}{t_0}\\ \end{array} \]
Alternative 2
Accuracy57.3%
Cost7625
\[\begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{-5} \lor \neg \left(x \leq 1.08 \cdot 10^{-11}\right):\\ \;\;\;\;\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(s \cdot \left(s \cdot \left(c \cdot \left(x \cdot c\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \end{array} \]
Alternative 3
Accuracy65.3%
Cost7492
\[\begin{array}{l} t_0 := s \cdot \left(x \cdot c\right)\\ t_1 := c \cdot \left(x \cdot s\right)\\ \mathbf{if}\;s \leq 2.7 \cdot 10^{+262}:\\ \;\;\;\;\frac{\frac{\cos \left(x + x\right)}{t_1}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(2 \cdot x\right)}{t_0 \cdot t_0}\\ \end{array} \]
Alternative 4
Accuracy65.1%
Cost7492
\[\begin{array}{l} t_0 := s \cdot \left(x \cdot c\right)\\ \mathbf{if}\;s \leq 2.8 \cdot 10^{+262}:\\ \;\;\;\;\frac{\frac{\frac{\cos \left(x + x\right)}{x \cdot s}}{c}}{c \cdot \left(x \cdot s\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(2 \cdot x\right)}{t_0 \cdot t_0}\\ \end{array} \]
Alternative 5
Accuracy63.1%
Cost7360
\[\frac{\cos \left(2 \cdot x\right)}{\left(c \cdot \left(x \cdot s\right)\right) \cdot \left(s \cdot \left(x \cdot c\right)\right)} \]
Alternative 6
Accuracy65.3%
Cost7360
\[\begin{array}{l} t_0 := s \cdot \left(x \cdot c\right)\\ \frac{\cos \left(2 \cdot x\right)}{t_0 \cdot t_0} \end{array} \]
Alternative 7
Accuracy49.8%
Cost6784
\[{\left(s \cdot \left(x \cdot c\right)\right)}^{-2} \]
Alternative 8
Accuracy43.5%
Cost832
\[\frac{1}{c \cdot \left(c \cdot \left(\left(x \cdot s\right) \cdot \left(x \cdot s\right)\right)\right)} \]
Alternative 9
Accuracy47.7%
Cost832
\[\frac{1}{\left(x \cdot s\right) \cdot \left(c \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)} \]
Alternative 10
Accuracy48.1%
Cost832
\[\frac{\frac{1}{s}}{\left(x \cdot c\right) \cdot \left(s \cdot \left(x \cdot c\right)\right)} \]
Alternative 11
Accuracy48.8%
Cost832
\[\frac{\frac{1}{s \cdot \left(x \cdot c\right)}}{c \cdot \left(x \cdot s\right)} \]
Alternative 12
Accuracy49.8%
Cost832
\[\begin{array}{l} t_0 := s \cdot \left(x \cdot c\right)\\ \frac{\frac{1}{t_0}}{t_0} \end{array} \]

Error

Reproduce?

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