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

\mathbf{elif}\;c \leq 1.26 \cdot 10^{-232}:\\
\;\;\;\;\frac{t_0}{{\left(c \cdot \left(x \cdot s\right)\right)}^{2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_0}{t_1} \cdot \frac{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 3 regimes
  2. if c < -1.50000000000000001e66

    1. Initial program 25.4

      \[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)} \]
    2. Simplified2.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
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x (*.f64 c s)) (*.f64 x (*.f64 c s)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 x x) (*.f64 (*.f64 c s) (*.f64 c s))))): 0 points increase in error, 9 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x x) (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 c c) (*.f64 s s))))): 7 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x x) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 c 2)) (*.f64 s s)))): 2 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x x) (*.f64 (pow.f64 c 2) (Rewrite<= unpow2_binary64 (pow.f64 s 2))))): 1 points increase in error, 8 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 (pow.f64 c 2) (pow.f64 s 2)) (*.f64 x x)))): 8 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= associate-*r*_binary64 (*.f64 (pow.f64 c 2) (*.f64 (pow.f64 s 2) (*.f64 x x))))): 0 points increase in error, 9 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (pow.f64 c 2) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (pow.f64 s 2) x) x)))): 9 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (pow.f64 c 2) (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 x (pow.f64 s 2))) x))): 0 points increase in error, 9 points decrease in error
    3. Applied egg-rr2.1

      \[\leadsto \color{blue}{{\left(x \cdot \left(c \cdot s\right)\right)}^{-2} \cdot \cos \left(x + x\right)} \]
    4. Applied egg-rr2.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 -1.50000000000000001e66 < c < 1.25999999999999991e-232

    1. Initial program 34.6

      \[\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(x \cdot \left(\left(c \cdot s\right) \cdot \left(c \cdot s\right)\right)\right)}} \]
      Proof
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x (*.f64 c s)) (*.f64 x (*.f64 c s)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 x x) (*.f64 (*.f64 c s) (*.f64 c s))))): 0 points increase in error, 9 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x x) (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 c c) (*.f64 s s))))): 7 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x x) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 c 2)) (*.f64 s s)))): 2 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x x) (*.f64 (pow.f64 c 2) (Rewrite<= unpow2_binary64 (pow.f64 s 2))))): 1 points increase in error, 8 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 (pow.f64 c 2) (pow.f64 s 2)) (*.f64 x x)))): 8 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= associate-*r*_binary64 (*.f64 (pow.f64 c 2) (*.f64 (pow.f64 s 2) (*.f64 x x))))): 0 points increase in error, 9 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (pow.f64 c 2) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (pow.f64 s 2) x) x)))): 9 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (pow.f64 c 2) (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 x (pow.f64 s 2))) x))): 0 points increase in error, 9 points decrease in error
    3. Taylor expanded in x around inf 38.4

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

      \[\leadsto \color{blue}{\frac{\cos \left(x + x\right)}{{\left(c \cdot \left(s \cdot x\right)\right)}^{2}}} \]
      Proof
      (/.f64 (cos.f64 (+.f64 x x)) (pow.f64 (*.f64 c (*.f64 s x)) 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (+.f64 x x)) (pow.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 c s) x)) 2)): 0 points increase in error, 17 points decrease in error
      (/.f64 (cos.f64 (+.f64 x x)) (pow.f64 (Rewrite<= *-commutative_binary64 (*.f64 x (*.f64 c s))) 2)): 8 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (+.f64 x x)) (Rewrite=> unpow2_binary64 (*.f64 (*.f64 x (*.f64 c s)) (*.f64 x (*.f64 c s))))): 10 points increase in error, 1 points decrease in error
      (/.f64 (cos.f64 (+.f64 x x)) (Rewrite=> swap-sqr_binary64 (*.f64 (*.f64 x x) (*.f64 (*.f64 c s) (*.f64 c s))))): 4 points increase in error, 14 points decrease in error
      (/.f64 (cos.f64 (+.f64 x x)) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 x 2)) (*.f64 (*.f64 c s) (*.f64 c s)))): 14 points increase in error, 1 points decrease in error
      (/.f64 (cos.f64 (+.f64 x x)) (*.f64 (pow.f64 x 2) (Rewrite<= unpow2_binary64 (pow.f64 (*.f64 c s) 2)))): 0 points increase in error, 17 points decrease in error
      (Rewrite<= associate-/l/_binary64 (/.f64 (/.f64 (cos.f64 (+.f64 x x)) (pow.f64 (*.f64 c s) 2)) (pow.f64 x 2))): 18 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (/.f64 (cos.f64 (+.f64 x x)) (pow.f64 (*.f64 c s) 2)))) (pow.f64 x 2)): 0 points increase in error, 18 points decrease in error
      (/.f64 (Rewrite=> *-lft-identity_binary64 (/.f64 (cos.f64 (+.f64 x x)) (pow.f64 (*.f64 c s) 2))) (pow.f64 x 2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (/.f64 (cos.f64 (+.f64 x x)) (Rewrite=> unpow2_binary64 (*.f64 (*.f64 c s) (*.f64 c s)))) (pow.f64 x 2)): 14 points increase in error, 0 points decrease in error
      (/.f64 (/.f64 (cos.f64 (+.f64 x x)) (Rewrite=> swap-sqr_binary64 (*.f64 (*.f64 c c) (*.f64 s s)))) (pow.f64 x 2)): 4 points increase in error, 0 points decrease in error
      (/.f64 (/.f64 (cos.f64 (+.f64 x x)) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 c 2)) (*.f64 s s))) (pow.f64 x 2)): 4 points increase in error, 11 points decrease in error
      (/.f64 (/.f64 (cos.f64 (+.f64 x x)) (*.f64 (pow.f64 c 2) (Rewrite<= unpow2_binary64 (pow.f64 s 2)))) (pow.f64 x 2)): 0 points increase in error, 15 points decrease in error
      (/.f64 (/.f64 (cos.f64 (+.f64 x x)) (Rewrite=> *-commutative_binary64 (*.f64 (pow.f64 s 2) (pow.f64 c 2)))) (pow.f64 x 2)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r*_binary64 (/.f64 (cos.f64 (+.f64 x x)) (*.f64 (*.f64 (pow.f64 s 2) (pow.f64 c 2)) (pow.f64 x 2)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (Rewrite=> count-2_binary64 (*.f64 2 x))) (*.f64 (*.f64 (pow.f64 s 2) (pow.f64 c 2)) (pow.f64 x 2))): 14 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= associate-*r*_binary64 (*.f64 (pow.f64 s 2) (*.f64 (pow.f64 c 2) (pow.f64 x 2))))): 4 points increase in error, 0 points decrease in error

    if 1.25999999999999991e-232 < c

    1. Initial program 22.1

      \[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)} \]
    2. Simplified2.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
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x (*.f64 c s)) (*.f64 x (*.f64 c s)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 x x) (*.f64 (*.f64 c s) (*.f64 c s))))): 0 points increase in error, 9 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x x) (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 c c) (*.f64 s s))))): 7 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x x) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 c 2)) (*.f64 s s)))): 2 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (*.f64 x x) (*.f64 (pow.f64 c 2) (Rewrite<= unpow2_binary64 (pow.f64 s 2))))): 1 points increase in error, 8 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 (pow.f64 c 2) (pow.f64 s 2)) (*.f64 x x)))): 8 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (Rewrite<= associate-*r*_binary64 (*.f64 (pow.f64 c 2) (*.f64 (pow.f64 s 2) (*.f64 x x))))): 0 points increase in error, 9 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (pow.f64 c 2) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (pow.f64 s 2) x) x)))): 9 points increase in error, 0 points decrease in error
      (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (pow.f64 c 2) (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 x (pow.f64 s 2))) x))): 0 points increase in error, 9 points decrease in error
    3. Applied egg-rr2.2

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

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

Alternatives

Alternative 1
Error2.9
Cost7757
\[\begin{array}{l} t_0 := s \cdot \left(c \cdot x\right)\\ t_1 := \cos \left(x \cdot 2\right)\\ \mathbf{if}\;s \leq -2.9 \cdot 10^{-232} \lor \neg \left(s \leq 2.5 \cdot 10^{-264}\right) \land s \leq 3.7 \cdot 10^{+121}:\\ \;\;\;\;\frac{t_1}{t_0 \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{\left(x \cdot \left(c \cdot s\right)\right) \cdot \left(c \cdot \left(x \cdot s\right)\right)}\\ \end{array} \]
Alternative 2
Error10.1
Cost7625
\[\begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+23} \lor \neg \left(x \leq 1.22 \cdot 10^{-25}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{x \cdot \left(c \cdot \left(c \cdot \left(s \cdot \left(x \cdot s\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\frac{\frac{1}{c}}{s}}{x}\right)}^{2}\\ \end{array} \]
Alternative 3
Error6.7
Cost7625
\[\begin{array}{l} \mathbf{if}\;x \leq -126 \lor \neg \left(x \leq 1.22 \cdot 10^{-25}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{x \cdot \left(c \cdot \left(s \cdot \left(s \cdot \left(c \cdot x\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\frac{\frac{1}{c}}{s}}{x}\right)}^{2}\\ \end{array} \]
Alternative 4
Error2.9
Cost7625
\[\begin{array}{l} t_0 := s \cdot \left(c \cdot x\right)\\ \mathbf{if}\;x \leq -5.6 \cdot 10^{-21} \lor \neg \left(x \leq 3.8 \cdot 10^{-122}\right):\\ \;\;\;\;\frac{\cos \left(x \cdot 2\right)}{t_0 \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\frac{\frac{1}{c}}{s}}{x}\right)}^{2}\\ \end{array} \]
Alternative 5
Error2.7
Cost7488
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ \frac{\cos \left(x + x\right)}{t_0} \cdot \frac{1}{t_0} \end{array} \]
Alternative 6
Error3.0
Cost7360
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ \frac{\cos \left(x \cdot 2\right)}{t_0 \cdot t_0} \end{array} \]
Alternative 7
Error16.7
Cost6912
\[{\left(\frac{\frac{\frac{1}{c}}{s}}{x}\right)}^{2} \]
Alternative 8
Error30.6
Cost1097
\[\begin{array}{l} \mathbf{if}\;x \leq -1.55 \cdot 10^{-124} \lor \neg \left(x \leq 1.6 \cdot 10^{-162}\right):\\ \;\;\;\;\frac{1}{\left(c \cdot c\right) \cdot \left(s \cdot \left(s \cdot \left(x \cdot x\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-2}{c \cdot c}}{s \cdot s}\\ \end{array} \]
Alternative 9
Error20.2
Cost964
\[\begin{array}{l} \mathbf{if}\;s \leq 4 \cdot 10^{+152}:\\ \;\;\;\;\frac{1}{\left(c \cdot s\right) \cdot \left(s \cdot \left(x \cdot \left(c \cdot x\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(c \cdot s\right) \cdot \left(c \cdot \left(x \cdot \left(x \cdot s\right)\right)\right)}\\ \end{array} \]
Alternative 10
Error19.1
Cost964
\[\begin{array}{l} \mathbf{if}\;c \leq -5 \cdot 10^{+198}:\\ \;\;\;\;\frac{1}{\left(c \cdot s\right) \cdot \left(s \cdot \left(x \cdot \left(c \cdot x\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 11
Error16.9
Cost964
\[\begin{array}{l} t_0 := c \cdot \left(x \cdot s\right)\\ \mathbf{if}\;c \leq -1 \cdot 10^{+199}:\\ \;\;\;\;\frac{1}{\left(c \cdot s\right) \cdot \left(s \cdot \left(x \cdot \left(c \cdot x\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_0}\\ \end{array} \]
Alternative 12
Error15.8
Cost964
\[\begin{array}{l} t_0 := c \cdot \left(x \cdot s\right)\\ t_1 := s \cdot \left(c \cdot x\right)\\ \mathbf{if}\;c \leq -2 \cdot 10^{+199}:\\ \;\;\;\;\frac{1}{t_1 \cdot t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_0}\\ \end{array} \]
Alternative 13
Error16.3
Cost964
\[\begin{array}{l} t_0 := c \cdot \left(x \cdot s\right)\\ \mathbf{if}\;c \leq -8 \cdot 10^{+198}:\\ \;\;\;\;\frac{1}{\left(x \cdot \left(c \cdot s\right)\right) \cdot \left(s \cdot \left(c \cdot x\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_0 \cdot t_0}\\ \end{array} \]
Alternative 14
Error22.6
Cost832
\[\frac{1}{\left(c \cdot s\right) \cdot \left(c \cdot \left(x \cdot \left(x \cdot s\right)\right)\right)} \]
Alternative 15
Error16.9
Cost832
\[\begin{array}{l} t_0 := x \cdot \left(c \cdot s\right)\\ \frac{1}{t_0 \cdot t_0} \end{array} \]
Alternative 16
Error16.8
Cost832
\[\frac{\frac{\frac{1}{x}}{c \cdot s}}{x \cdot \left(c \cdot s\right)} \]
Alternative 17
Error40.9
Cost576
\[\frac{\frac{-2}{c \cdot c}}{s \cdot s} \]

Error

Reproduce

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