| Alternative 1 | |
|---|---|
| Accuracy | 52.6% |
| Cost | 7756 |
(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}
Results
if (/.f64 (cos.f64 (*.f64 2 x)) (*.f64 (pow.f64 c 2) (*.f64 (*.f64 x (pow.f64 s 2)) x))) < +inf.0Initial program 50.5%
Simplified50.7%
[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)}
\] |
Applied egg-rr60.8%
[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}}
\] |
Applied egg-rr72.4%
[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)}}
\] |
Applied egg-rr72.4%
[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)}
\] |
Applied egg-rr72.5%
[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))) Initial program 0.0%
Simplified0.5%
[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)}
\] |
Applied egg-rr37.2%
[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)}}
\] |
Simplified77.2%
[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}}
\] |
Final simplification73.5%
| Alternative 1 | |
|---|---|
| Accuracy | 52.6% |
| Cost | 7756 |
| Alternative 2 | |
|---|---|
| Accuracy | 57.3% |
| Cost | 7625 |
| Alternative 3 | |
|---|---|
| Accuracy | 65.3% |
| Cost | 7492 |
| Alternative 4 | |
|---|---|
| Accuracy | 65.1% |
| Cost | 7492 |
| Alternative 5 | |
|---|---|
| Accuracy | 63.1% |
| Cost | 7360 |
| Alternative 6 | |
|---|---|
| Accuracy | 65.3% |
| Cost | 7360 |
| Alternative 7 | |
|---|---|
| Accuracy | 49.8% |
| Cost | 6784 |
| Alternative 8 | |
|---|---|
| Accuracy | 43.5% |
| Cost | 832 |
| Alternative 9 | |
|---|---|
| Accuracy | 47.7% |
| Cost | 832 |
| Alternative 10 | |
|---|---|
| Accuracy | 48.1% |
| Cost | 832 |
| Alternative 11 | |
|---|---|
| Accuracy | 48.8% |
| Cost | 832 |
| Alternative 12 | |
|---|---|
| Accuracy | 49.8% |
| Cost | 832 |
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))))