?

Average Error: 28.0 → 1.0
Time: 16.9s
Precision: binary64
Cost: 40004

?

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

\mathbf{else}:\\
\;\;\;\;{\left(\frac{{\left(x \cdot \left(c \cdot s\right)\right)}^{2}}{t_0}\right)}^{-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 18.3

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

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

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

      *-commutative [=>]18.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* [=>]22.9

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

      associate-*r* [=>]23.0

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

      *-commutative [=>]23.0

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

      unpow2 [=>]23.0

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

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

      \[ \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.0

      \[ \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.7

      \[\leadsto \color{blue}{{\left(x \cdot \left(c \cdot s\right)\right)}^{-2} \cdot \cos \left(x + x\right)} \]
    4. Taylor expanded in x around 0 22.9

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

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

      [Start]22.9

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

      associate-*r* [=>]23.0

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

      unpow2 [=>]23.0

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

      associate-*r* [=>]18.7

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

      associate-/r* [=>]18.6

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

      associate-/l/ [<=]18.6

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

      unpow-1 [<=]18.6

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

      associate-/l/ [=>]18.6

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

      *-commutative [<=]18.6

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

      unpow2 [=>]18.6

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

      unpow2 [=>]18.6

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

      unswap-sqr [=>]13.0

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

      associate-*l* [<=]6.5

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

      unpow-1 [=>]6.5

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

      associate-/l/ [<=]2.7

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

      *-rgt-identity [<=]2.7

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

      associate-*r/ [<=]2.7

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

      associate-/r* [<=]2.8

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

      unpow-1 [<=]2.8

      \[ \left(\color{blue}{{\left(x \cdot \left(c \cdot s\right)\right)}^{-1}} \cdot \frac{1}{x \cdot \left(c \cdot s\right)}\right) \cdot \cos \left(x + x\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 64.0

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

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

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

      *-commutative [=>]64.0

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

      associate-*l* [=>]64.0

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

      associate-*r* [=>]63.9

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

      *-commutative [=>]63.9

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

      unpow2 [=>]63.9

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

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

      \[ \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.4

      \[ \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.4

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

    \[\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:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2} \cdot \cos \left(x + x\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{{\left(x \cdot \left(c \cdot s\right)\right)}^{2}}{\cos \left(x + x\right)}\right)}^{-1}\\ \end{array} \]

Alternatives

Alternative 1
Error2.1
Cost13705
\[\begin{array}{l} t_0 := \cos \left(x + x\right)\\ \mathbf{if}\;s \leq 6.5 \cdot 10^{-162} \lor \neg \left(s \leq 2 \cdot 10^{+275}\right):\\ \;\;\;\;t_0 \cdot \frac{\frac{\frac{1}{x}}{c \cdot s}}{x \cdot \left(c \cdot s\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot {\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \end{array} \]
Alternative 2
Error1.7
Cost13704
\[\begin{array}{l} t_0 := \cos \left(x + x\right)\\ t_1 := x \cdot \left(c \cdot s\right)\\ \mathbf{if}\;c \leq -2.2 \cdot 10^{+220}:\\ \;\;\;\;\frac{\cos \left(2 \cdot x\right)}{t_1 \cdot t_1}\\ \mathbf{elif}\;c \leq -5 \cdot 10^{-167}:\\ \;\;\;\;{\left(c \cdot \left(x \cdot s\right)\right)}^{-2} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot {\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \end{array} \]
Alternative 3
Error2.2
Cost7753
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ \mathbf{if}\;x \leq -5 \cdot 10^{-128} \lor \neg \left(x \leq 2.8 \cdot 10^{-205}\right):\\ \;\;\;\;\frac{\cos \left(x + x\right)}{t_0} \cdot \frac{1}{t_0}\\ \mathbf{else}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \end{array} \]
Alternative 4
Error2.2
Cost7753
\[\begin{array}{l} \mathbf{if}\;x \leq -7.4 \cdot 10^{-137} \lor \neg \left(x \leq 7 \cdot 10^{-132}\right):\\ \;\;\;\;\cos \left(x + x\right) \cdot \frac{\frac{\frac{1}{x}}{c \cdot s}}{x \cdot \left(c \cdot s\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \end{array} \]
Alternative 5
Error7.5
Cost7625
\[\begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{+16} \lor \neg \left(x \leq 7.5 \cdot 10^{-127}\right):\\ \;\;\;\;\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(c \cdot \left(s \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \end{array} \]
Alternative 6
Error3.9
Cost7625
\[\begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-12} \lor \neg \left(x \leq 4.6 \cdot 10^{-209}\right):\\ \;\;\;\;\frac{\cos \left(2 \cdot x\right)}{\left(x \cdot \left(c \cdot s\right)\right) \cdot \left(c \cdot \left(x \cdot s\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \end{array} \]
Alternative 7
Error2.5
Cost7625
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ \mathbf{if}\;x \leq -1.8 \cdot 10^{-134} \lor \neg \left(x \leq 2.1 \cdot 10^{-132}\right):\\ \;\;\;\;\frac{\cos \left(2 \cdot x\right)}{t_0 \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \end{array} \]
Alternative 8
Error13.8
Cost7624
\[\begin{array}{l} \mathbf{if}\;s \leq 4.5 \cdot 10^{-64}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \mathbf{elif}\;s \leq 1.75 \cdot 10^{+77}:\\ \;\;\;\;\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)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{\left(c \cdot \left(x \cdot s\right)\right)}^{2}}\\ \end{array} \]
Alternative 9
Error8.1
Cost7624
\[\begin{array}{l} t_0 := \cos \left(2 \cdot x\right)\\ \mathbf{if}\;x \leq -3.3 \cdot 10^{-52}:\\ \;\;\;\;\frac{t_0}{x \cdot \left(x \cdot \left(\left(c \cdot s\right) \cdot \left(c \cdot s\right)\right)\right)}\\ \mathbf{elif}\;x \leq 1.12 \cdot 10^{-125}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{x \cdot \left(c \cdot \left(s \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)\right)}\\ \end{array} \]
Alternative 10
Error4.1
Cost7624
\[\begin{array}{l} t_0 := s \cdot \left(x \cdot c\right)\\ t_1 := \cos \left(2 \cdot x\right)\\ t_2 := x \cdot \left(c \cdot s\right)\\ \mathbf{if}\;x \leq -2.9 \cdot 10^{-50}:\\ \;\;\;\;\frac{t_1}{t_2 \cdot t_0}\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-208}:\\ \;\;\;\;{t_0}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{t_2 \cdot \left(c \cdot \left(x \cdot s\right)\right)}\\ \end{array} \]
Alternative 11
Error16.4
Cost7044
\[\begin{array}{l} \mathbf{if}\;s \leq 1.15 \cdot 10^{+150}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{\left(c \cdot \left(x \cdot s\right)\right)}^{2}}\\ \end{array} \]
Alternative 12
Error16.3
Cost6916
\[\begin{array}{l} t_0 := \frac{1}{c \cdot \left(x \cdot s\right)}\\ \mathbf{if}\;s \leq 5 \cdot 10^{+152}:\\ \;\;\;\;{\left(s \cdot \left(x \cdot c\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot t_0\\ \end{array} \]
Alternative 13
Error22.4
Cost1097
\[\begin{array}{l} \mathbf{if}\;x \leq -3.7 \cdot 10^{-138} \lor \neg \left(x \leq 2.7 \cdot 10^{-187}\right):\\ \;\;\;\;\frac{1}{\left(c \cdot s\right) \cdot \left(c \cdot \left(x \cdot \left(x \cdot s\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(c \cdot c\right) \cdot \left(x \cdot \left(s \cdot \left(x \cdot s\right)\right)\right)}\\ \end{array} \]
Alternative 14
Error16.8
Cost1092
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ t_1 := \frac{1}{c \cdot \left(x \cdot s\right)}\\ \mathbf{if}\;s \leq 5 \cdot 10^{+77}:\\ \;\;\;\;\frac{\frac{1}{t_0}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot t_1\\ \end{array} \]
Alternative 15
Error16.4
Cost1092
\[\begin{array}{l} t_0 := \frac{1}{s \cdot \left(x \cdot c\right)}\\ t_1 := \frac{1}{c \cdot \left(x \cdot s\right)}\\ \mathbf{if}\;s \leq 2 \cdot 10^{+151}:\\ \;\;\;\;t_0 \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot t_1\\ \end{array} \]
Alternative 16
Error19.0
Cost964
\[\begin{array}{l} \mathbf{if}\;s \leq 5 \cdot 10^{+152}:\\ \;\;\;\;\frac{1}{\left(x \cdot c\right) \cdot \left(s \cdot \left(x \cdot \left(c \cdot s\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(c \cdot s\right) \cdot \left(x \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)}\\ \end{array} \]
Alternative 17
Error17.1
Cost964
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ \mathbf{if}\;s \leq 5 \cdot 10^{+86}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{c \cdot \left(\left(x \cdot s\right) \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)}\\ \end{array} \]
Alternative 18
Error17.1
Cost964
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ \mathbf{if}\;s \leq 8 \cdot 10^{+85}:\\ \;\;\;\;\frac{\frac{1}{t_0}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{c \cdot \left(\left(x \cdot s\right) \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)}\\ \end{array} \]
Alternative 19
Error28.7
Cost832
\[\frac{1}{\left(c \cdot c\right) \cdot \left(x \cdot \left(s \cdot \left(x \cdot s\right)\right)\right)} \]
Alternative 20
Error20.2
Cost832
\[\frac{1}{\left(c \cdot s\right) \cdot \left(x \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)} \]
Alternative 21
Error17.6
Cost832
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ \frac{1}{t_0 \cdot t_0} \end{array} \]

Error

Reproduce?

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