
(FPCore (x c s) :precision binary64 (/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))
double code(double x, double c, double s) {
return cos((2.0 * x)) / (pow(c, 2.0) * ((x * pow(s, 2.0)) * x));
}
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
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));
}
def code(x, c, s): return math.cos((2.0 * x)) / (math.pow(c, 2.0) * ((x * math.pow(s, 2.0)) * x))
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 tmp = code(x, c, s) tmp = cos((2.0 * x)) / ((c ^ 2.0) * ((x * (s ^ 2.0)) * x)); 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]
\begin{array}{l}
\\
\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x c s) :precision binary64 (/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))
double code(double x, double c, double s) {
return cos((2.0 * x)) / (pow(c, 2.0) * ((x * pow(s, 2.0)) * x));
}
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
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));
}
def code(x, c, s): return math.cos((2.0 * x)) / (math.pow(c, 2.0) * ((x * math.pow(s, 2.0)) * x))
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 tmp = code(x, c, s) tmp = cos((2.0 * x)) / ((c ^ 2.0) * ((x * (s ^ 2.0)) * x)); 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]
\begin{array}{l}
\\
\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}
\end{array}
NOTE: x, c, and s should be sorted in increasing order before calling this function. (FPCore (x c s) :precision binary64 (let* ((t_0 (* s (* x c)))) (/ (/ (cos (+ x x)) t_0) t_0)))
assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = s * (x * c);
return (cos((x + x)) / t_0) / t_0;
}
NOTE: x, c, and s should be sorted in increasing order before calling this 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
t_0 = s * (x * c)
code = (cos((x + x)) / t_0) / t_0
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
double t_0 = s * (x * c);
return (Math.cos((x + x)) / t_0) / t_0;
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): t_0 = s * (x * c) return (math.cos((x + x)) / t_0) / t_0
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = Float64(s * Float64(x * c)) return Float64(Float64(cos(Float64(x + x)) / t_0) / t_0) end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp = code(x, c, s)
t_0 = s * (x * c);
tmp = (cos((x + x)) / t_0) / t_0;
end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := s \cdot \left(x \cdot c\right)\\
\frac{\frac{\cos \left(x + x\right)}{t\_0}}{t\_0}
\end{array}
\end{array}
Initial program 63.8%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.8
Applied egg-rr96.8%
unpow2N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.4
Applied egg-rr97.4%
Final simplification97.4%
NOTE: x, c, and s should be sorted in increasing order before calling this function.
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* (* s c) (* s c)))
(t_1 (/ (cos (* x 2.0)) (* (pow c 2.0) (* x (* x (pow s 2.0)))))))
(if (<= t_1 -1e-149)
(/ -2.0 t_0)
(if (<= t_1 INFINITY)
(/ 1.0 (* (* x s) (* c (* s (* x c)))))
(/ 1.0 (* x (* x t_0)))))))assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = (s * c) * (s * c);
double t_1 = cos((x * 2.0)) / (pow(c, 2.0) * (x * (x * pow(s, 2.0))));
double tmp;
if (t_1 <= -1e-149) {
tmp = -2.0 / t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = 1.0 / ((x * s) * (c * (s * (x * c))));
} else {
tmp = 1.0 / (x * (x * t_0));
}
return tmp;
}
assert x < c && c < s;
public static double code(double x, double c, double s) {
double t_0 = (s * c) * (s * c);
double t_1 = Math.cos((x * 2.0)) / (Math.pow(c, 2.0) * (x * (x * Math.pow(s, 2.0))));
double tmp;
if (t_1 <= -1e-149) {
tmp = -2.0 / t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 1.0 / ((x * s) * (c * (s * (x * c))));
} else {
tmp = 1.0 / (x * (x * t_0));
}
return tmp;
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): t_0 = (s * c) * (s * c) t_1 = math.cos((x * 2.0)) / (math.pow(c, 2.0) * (x * (x * math.pow(s, 2.0)))) tmp = 0 if t_1 <= -1e-149: tmp = -2.0 / t_0 elif t_1 <= math.inf: tmp = 1.0 / ((x * s) * (c * (s * (x * c)))) else: tmp = 1.0 / (x * (x * t_0)) return tmp
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = Float64(Float64(s * c) * Float64(s * c)) t_1 = Float64(cos(Float64(x * 2.0)) / Float64((c ^ 2.0) * Float64(x * Float64(x * (s ^ 2.0))))) tmp = 0.0 if (t_1 <= -1e-149) tmp = Float64(-2.0 / t_0); elseif (t_1 <= Inf) tmp = Float64(1.0 / Float64(Float64(x * s) * Float64(c * Float64(s * Float64(x * c))))); else tmp = Float64(1.0 / Float64(x * Float64(x * t_0))); end return tmp end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp_2 = code(x, c, s)
t_0 = (s * c) * (s * c);
t_1 = cos((x * 2.0)) / ((c ^ 2.0) * (x * (x * (s ^ 2.0))));
tmp = 0.0;
if (t_1 <= -1e-149)
tmp = -2.0 / t_0;
elseif (t_1 <= Inf)
tmp = 1.0 / ((x * s) * (c * (s * (x * c))));
else
tmp = 1.0 / (x * (x * t_0));
end
tmp_2 = tmp;
end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(x * N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-149], N[(-2.0 / t$95$0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(1.0 / N[(N[(x * s), $MachinePrecision] * N[(c * N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := \left(s \cdot c\right) \cdot \left(s \cdot c\right)\\
t_1 := \frac{\cos \left(x \cdot 2\right)}{{c}^{2} \cdot \left(x \cdot \left(x \cdot {s}^{2}\right)\right)}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\frac{-2}{t\_0}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{1}{\left(x \cdot s\right) \cdot \left(c \cdot \left(s \cdot \left(x \cdot c\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(x \cdot t\_0\right)}\\
\end{array}
\end{array}
if (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < -9.99999999999999979e-150Initial program 61.9%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.0
Applied egg-rr93.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified11.7%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.8
Simplified36.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.9
Applied egg-rr36.9%
if -9.99999999999999979e-150 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < +inf.0Initial program 82.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6481.5
Simplified81.5%
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6489.6
Applied egg-rr89.6%
if +inf.0 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) Initial program 0.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6454.4
Simplified54.4%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6465.9
Applied egg-rr65.9%
Final simplification80.3%
NOTE: x, c, and s should be sorted in increasing order before calling this function.
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* (* s c) (* s c)))
(t_1 (/ (cos (* x 2.0)) (* (pow c 2.0) (* x (* x (pow s 2.0)))))))
(if (<= t_1 -1e-149)
(/ -2.0 t_0)
(if (<= t_1 INFINITY)
(/ 1.0 (* c (* c (* (* x s) (* x s)))))
(/ 1.0 (* x (* x t_0)))))))assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = (s * c) * (s * c);
double t_1 = cos((x * 2.0)) / (pow(c, 2.0) * (x * (x * pow(s, 2.0))));
double tmp;
if (t_1 <= -1e-149) {
tmp = -2.0 / t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
} else {
tmp = 1.0 / (x * (x * t_0));
}
return tmp;
}
assert x < c && c < s;
public static double code(double x, double c, double s) {
double t_0 = (s * c) * (s * c);
double t_1 = Math.cos((x * 2.0)) / (Math.pow(c, 2.0) * (x * (x * Math.pow(s, 2.0))));
double tmp;
if (t_1 <= -1e-149) {
tmp = -2.0 / t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
} else {
tmp = 1.0 / (x * (x * t_0));
}
return tmp;
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): t_0 = (s * c) * (s * c) t_1 = math.cos((x * 2.0)) / (math.pow(c, 2.0) * (x * (x * math.pow(s, 2.0)))) tmp = 0 if t_1 <= -1e-149: tmp = -2.0 / t_0 elif t_1 <= math.inf: tmp = 1.0 / (c * (c * ((x * s) * (x * s)))) else: tmp = 1.0 / (x * (x * t_0)) return tmp
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = Float64(Float64(s * c) * Float64(s * c)) t_1 = Float64(cos(Float64(x * 2.0)) / Float64((c ^ 2.0) * Float64(x * Float64(x * (s ^ 2.0))))) tmp = 0.0 if (t_1 <= -1e-149) tmp = Float64(-2.0 / t_0); elseif (t_1 <= Inf) tmp = Float64(1.0 / Float64(c * Float64(c * Float64(Float64(x * s) * Float64(x * s))))); else tmp = Float64(1.0 / Float64(x * Float64(x * t_0))); end return tmp end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp_2 = code(x, c, s)
t_0 = (s * c) * (s * c);
t_1 = cos((x * 2.0)) / ((c ^ 2.0) * (x * (x * (s ^ 2.0))));
tmp = 0.0;
if (t_1 <= -1e-149)
tmp = -2.0 / t_0;
elseif (t_1 <= Inf)
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
else
tmp = 1.0 / (x * (x * t_0));
end
tmp_2 = tmp;
end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(x * N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-149], N[(-2.0 / t$95$0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(1.0 / N[(c * N[(c * N[(N[(x * s), $MachinePrecision] * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * N[(x * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := \left(s \cdot c\right) \cdot \left(s \cdot c\right)\\
t_1 := \frac{\cos \left(x \cdot 2\right)}{{c}^{2} \cdot \left(x \cdot \left(x \cdot {s}^{2}\right)\right)}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\frac{-2}{t\_0}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{1}{c \cdot \left(c \cdot \left(\left(x \cdot s\right) \cdot \left(x \cdot s\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(x \cdot t\_0\right)}\\
\end{array}
\end{array}
if (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < -9.99999999999999979e-150Initial program 61.9%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.0
Applied egg-rr93.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified11.7%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.8
Simplified36.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.9
Applied egg-rr36.9%
if -9.99999999999999979e-150 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < +inf.0Initial program 82.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6481.5
Simplified81.5%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
pow2N/A
associate-*r*N/A
pow2N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.7
Applied egg-rr86.7%
if +inf.0 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) Initial program 0.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6454.4
Simplified54.4%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6465.9
Applied egg-rr65.9%
Final simplification78.3%
NOTE: x, c, and s should be sorted in increasing order before calling this function.
(FPCore (x c s)
:precision binary64
(let* ((t_0 (/ (cos (* x 2.0)) (* (pow c 2.0) (* x (* x (pow s 2.0)))))))
(if (<= t_0 -1e-149)
(/ -2.0 (* (* s c) (* s c)))
(if (<= t_0 INFINITY)
(/ 1.0 (* c (* c (* (* x s) (* x s)))))
(/ 1.0 (* c (* s (* c (* s (* x x))))))))))assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = cos((x * 2.0)) / (pow(c, 2.0) * (x * (x * pow(s, 2.0))));
double tmp;
if (t_0 <= -1e-149) {
tmp = -2.0 / ((s * c) * (s * c));
} else if (t_0 <= ((double) INFINITY)) {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
} else {
tmp = 1.0 / (c * (s * (c * (s * (x * x)))));
}
return tmp;
}
assert x < c && c < s;
public static double code(double x, double c, double s) {
double t_0 = Math.cos((x * 2.0)) / (Math.pow(c, 2.0) * (x * (x * Math.pow(s, 2.0))));
double tmp;
if (t_0 <= -1e-149) {
tmp = -2.0 / ((s * c) * (s * c));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
} else {
tmp = 1.0 / (c * (s * (c * (s * (x * x)))));
}
return tmp;
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): t_0 = math.cos((x * 2.0)) / (math.pow(c, 2.0) * (x * (x * math.pow(s, 2.0)))) tmp = 0 if t_0 <= -1e-149: tmp = -2.0 / ((s * c) * (s * c)) elif t_0 <= math.inf: tmp = 1.0 / (c * (c * ((x * s) * (x * s)))) else: tmp = 1.0 / (c * (s * (c * (s * (x * x))))) return tmp
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = Float64(cos(Float64(x * 2.0)) / Float64((c ^ 2.0) * Float64(x * Float64(x * (s ^ 2.0))))) tmp = 0.0 if (t_0 <= -1e-149) tmp = Float64(-2.0 / Float64(Float64(s * c) * Float64(s * c))); elseif (t_0 <= Inf) tmp = Float64(1.0 / Float64(c * Float64(c * Float64(Float64(x * s) * Float64(x * s))))); else tmp = Float64(1.0 / Float64(c * Float64(s * Float64(c * Float64(s * Float64(x * x)))))); end return tmp end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp_2 = code(x, c, s)
t_0 = cos((x * 2.0)) / ((c ^ 2.0) * (x * (x * (s ^ 2.0))));
tmp = 0.0;
if (t_0 <= -1e-149)
tmp = -2.0 / ((s * c) * (s * c));
elseif (t_0 <= Inf)
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
else
tmp = 1.0 / (c * (s * (c * (s * (x * x)))));
end
tmp_2 = tmp;
end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(x * N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-149], N[(-2.0 / N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(1.0 / N[(c * N[(c * N[(N[(x * s), $MachinePrecision] * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(c * N[(s * N[(c * N[(s * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := \frac{\cos \left(x \cdot 2\right)}{{c}^{2} \cdot \left(x \cdot \left(x \cdot {s}^{2}\right)\right)}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\frac{-2}{\left(s \cdot c\right) \cdot \left(s \cdot c\right)}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{1}{c \cdot \left(c \cdot \left(\left(x \cdot s\right) \cdot \left(x \cdot s\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{c \cdot \left(s \cdot \left(c \cdot \left(s \cdot \left(x \cdot x\right)\right)\right)\right)}\\
\end{array}
\end{array}
if (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < -9.99999999999999979e-150Initial program 61.9%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.0
Applied egg-rr93.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified11.7%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.8
Simplified36.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.9
Applied egg-rr36.9%
if -9.99999999999999979e-150 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < +inf.0Initial program 82.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6481.5
Simplified81.5%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
pow2N/A
associate-*r*N/A
pow2N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.7
Applied egg-rr86.7%
if +inf.0 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) Initial program 0.0%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6495.6
Applied egg-rr95.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6456.5
Simplified56.5%
Final simplification76.4%
NOTE: x, c, and s should be sorted in increasing order before calling this function.
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* s (* x c))) (t_1 (* x (* s c))))
(if (<= (/ (cos (* x 2.0)) (* (pow c 2.0) (* x (* x (pow s 2.0))))) -1e-149)
(/ (fma x (* x -2.0) 1.0) (* t_0 t_0))
(/ (/ 1.0 t_1) t_1))))assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = s * (x * c);
double t_1 = x * (s * c);
double tmp;
if ((cos((x * 2.0)) / (pow(c, 2.0) * (x * (x * pow(s, 2.0))))) <= -1e-149) {
tmp = fma(x, (x * -2.0), 1.0) / (t_0 * t_0);
} else {
tmp = (1.0 / t_1) / t_1;
}
return tmp;
}
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = Float64(s * Float64(x * c)) t_1 = Float64(x * Float64(s * c)) tmp = 0.0 if (Float64(cos(Float64(x * 2.0)) / Float64((c ^ 2.0) * Float64(x * Float64(x * (s ^ 2.0))))) <= -1e-149) tmp = Float64(fma(x, Float64(x * -2.0), 1.0) / Float64(t_0 * t_0)); else tmp = Float64(Float64(1.0 / t_1) / t_1); end return tmp end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(x * N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-149], N[(N[(x * N[(x * -2.0), $MachinePrecision] + 1.0), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := s \cdot \left(x \cdot c\right)\\
t_1 := x \cdot \left(s \cdot c\right)\\
\mathbf{if}\;\frac{\cos \left(x \cdot 2\right)}{{c}^{2} \cdot \left(x \cdot \left(x \cdot {s}^{2}\right)\right)} \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, x \cdot -2, 1\right)}{t\_0 \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t\_1}}{t\_1}\\
\end{array}
\end{array}
if (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < -9.99999999999999979e-150Initial program 61.9%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.0
Applied egg-rr93.0%
unpow2N/A
swap-sqrN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
Applied egg-rr99.3%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
*-lowering-*.f6436.8
Simplified36.8%
if -9.99999999999999979e-150 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) Initial program 64.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6475.4
Simplified75.4%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
pow2N/A
associate-*r*N/A
pow2N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.7
Applied egg-rr78.7%
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6477.2
Applied egg-rr77.2%
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6486.2
Applied egg-rr86.2%
Final simplification82.1%
NOTE: x, c, and s should be sorted in increasing order before calling this function.
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* x (* s c))))
(if (<= (/ (cos (* x 2.0)) (* (pow c 2.0) (* x (* x (pow s 2.0))))) -1e-149)
(/ -2.0 (* (* s c) (* s c)))
(/ (/ 1.0 t_0) t_0))))assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if ((cos((x * 2.0)) / (pow(c, 2.0) * (x * (x * pow(s, 2.0))))) <= -1e-149) {
tmp = -2.0 / ((s * c) * (s * c));
} else {
tmp = (1.0 / t_0) / t_0;
}
return tmp;
}
NOTE: x, c, and s should be sorted in increasing order before calling this 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) :: tmp
t_0 = x * (s * c)
if ((cos((x * 2.0d0)) / ((c ** 2.0d0) * (x * (x * (s ** 2.0d0))))) <= (-1d-149)) then
tmp = (-2.0d0) / ((s * c) * (s * c))
else
tmp = (1.0d0 / t_0) / t_0
end if
code = tmp
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if ((Math.cos((x * 2.0)) / (Math.pow(c, 2.0) * (x * (x * Math.pow(s, 2.0))))) <= -1e-149) {
tmp = -2.0 / ((s * c) * (s * c));
} else {
tmp = (1.0 / t_0) / t_0;
}
return tmp;
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): t_0 = x * (s * c) tmp = 0 if (math.cos((x * 2.0)) / (math.pow(c, 2.0) * (x * (x * math.pow(s, 2.0))))) <= -1e-149: tmp = -2.0 / ((s * c) * (s * c)) else: tmp = (1.0 / t_0) / t_0 return tmp
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = Float64(x * Float64(s * c)) tmp = 0.0 if (Float64(cos(Float64(x * 2.0)) / Float64((c ^ 2.0) * Float64(x * Float64(x * (s ^ 2.0))))) <= -1e-149) tmp = Float64(-2.0 / Float64(Float64(s * c) * Float64(s * c))); else tmp = Float64(Float64(1.0 / t_0) / t_0); end return tmp end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp_2 = code(x, c, s)
t_0 = x * (s * c);
tmp = 0.0;
if ((cos((x * 2.0)) / ((c ^ 2.0) * (x * (x * (s ^ 2.0))))) <= -1e-149)
tmp = -2.0 / ((s * c) * (s * c));
else
tmp = (1.0 / t_0) / t_0;
end
tmp_2 = tmp;
end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(x * N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-149], N[(-2.0 / N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := x \cdot \left(s \cdot c\right)\\
\mathbf{if}\;\frac{\cos \left(x \cdot 2\right)}{{c}^{2} \cdot \left(x \cdot \left(x \cdot {s}^{2}\right)\right)} \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\frac{-2}{\left(s \cdot c\right) \cdot \left(s \cdot c\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t\_0}}{t\_0}\\
\end{array}
\end{array}
if (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < -9.99999999999999979e-150Initial program 61.9%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.0
Applied egg-rr93.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified11.7%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.8
Simplified36.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.9
Applied egg-rr36.9%
if -9.99999999999999979e-150 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) Initial program 64.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6475.4
Simplified75.4%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
pow2N/A
associate-*r*N/A
pow2N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.7
Applied egg-rr78.7%
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6477.2
Applied egg-rr77.2%
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6486.2
Applied egg-rr86.2%
Final simplification82.1%
NOTE: x, c, and s should be sorted in increasing order before calling this function.
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* x (* s c))))
(if (<= (/ (cos (* x 2.0)) (* (pow c 2.0) (* x (* x (pow s 2.0))))) -1e-149)
(/ -2.0 (* (* s c) (* s c)))
(/ 1.0 (* t_0 t_0)))))assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if ((cos((x * 2.0)) / (pow(c, 2.0) * (x * (x * pow(s, 2.0))))) <= -1e-149) {
tmp = -2.0 / ((s * c) * (s * c));
} else {
tmp = 1.0 / (t_0 * t_0);
}
return tmp;
}
NOTE: x, c, and s should be sorted in increasing order before calling this 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) :: tmp
t_0 = x * (s * c)
if ((cos((x * 2.0d0)) / ((c ** 2.0d0) * (x * (x * (s ** 2.0d0))))) <= (-1d-149)) then
tmp = (-2.0d0) / ((s * c) * (s * c))
else
tmp = 1.0d0 / (t_0 * t_0)
end if
code = tmp
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if ((Math.cos((x * 2.0)) / (Math.pow(c, 2.0) * (x * (x * Math.pow(s, 2.0))))) <= -1e-149) {
tmp = -2.0 / ((s * c) * (s * c));
} else {
tmp = 1.0 / (t_0 * t_0);
}
return tmp;
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): t_0 = x * (s * c) tmp = 0 if (math.cos((x * 2.0)) / (math.pow(c, 2.0) * (x * (x * math.pow(s, 2.0))))) <= -1e-149: tmp = -2.0 / ((s * c) * (s * c)) else: tmp = 1.0 / (t_0 * t_0) return tmp
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = Float64(x * Float64(s * c)) tmp = 0.0 if (Float64(cos(Float64(x * 2.0)) / Float64((c ^ 2.0) * Float64(x * Float64(x * (s ^ 2.0))))) <= -1e-149) tmp = Float64(-2.0 / Float64(Float64(s * c) * Float64(s * c))); else tmp = Float64(1.0 / Float64(t_0 * t_0)); end return tmp end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp_2 = code(x, c, s)
t_0 = x * (s * c);
tmp = 0.0;
if ((cos((x * 2.0)) / ((c ^ 2.0) * (x * (x * (s ^ 2.0))))) <= -1e-149)
tmp = -2.0 / ((s * c) * (s * c));
else
tmp = 1.0 / (t_0 * t_0);
end
tmp_2 = tmp;
end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(x * N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-149], N[(-2.0 / N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := x \cdot \left(s \cdot c\right)\\
\mathbf{if}\;\frac{\cos \left(x \cdot 2\right)}{{c}^{2} \cdot \left(x \cdot \left(x \cdot {s}^{2}\right)\right)} \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\frac{-2}{\left(s \cdot c\right) \cdot \left(s \cdot c\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_0 \cdot t\_0}\\
\end{array}
\end{array}
if (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < -9.99999999999999979e-150Initial program 61.9%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.0
Applied egg-rr93.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified11.7%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.8
Simplified36.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.9
Applied egg-rr36.9%
if -9.99999999999999979e-150 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) Initial program 64.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6475.4
Simplified75.4%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
pow2N/A
associate-*r*N/A
pow2N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.7
Applied egg-rr78.7%
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6486.1
Applied egg-rr86.1%
Final simplification82.1%
NOTE: x, c, and s should be sorted in increasing order before calling this function.
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* s (* x c))))
(if (<= (/ (cos (* x 2.0)) (* (pow c 2.0) (* x (* x (pow s 2.0))))) -1e-149)
(/ -2.0 (* (* s c) (* s c)))
(/ 1.0 (* t_0 t_0)))))assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = s * (x * c);
double tmp;
if ((cos((x * 2.0)) / (pow(c, 2.0) * (x * (x * pow(s, 2.0))))) <= -1e-149) {
tmp = -2.0 / ((s * c) * (s * c));
} else {
tmp = 1.0 / (t_0 * t_0);
}
return tmp;
}
NOTE: x, c, and s should be sorted in increasing order before calling this 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) :: tmp
t_0 = s * (x * c)
if ((cos((x * 2.0d0)) / ((c ** 2.0d0) * (x * (x * (s ** 2.0d0))))) <= (-1d-149)) then
tmp = (-2.0d0) / ((s * c) * (s * c))
else
tmp = 1.0d0 / (t_0 * t_0)
end if
code = tmp
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
double t_0 = s * (x * c);
double tmp;
if ((Math.cos((x * 2.0)) / (Math.pow(c, 2.0) * (x * (x * Math.pow(s, 2.0))))) <= -1e-149) {
tmp = -2.0 / ((s * c) * (s * c));
} else {
tmp = 1.0 / (t_0 * t_0);
}
return tmp;
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): t_0 = s * (x * c) tmp = 0 if (math.cos((x * 2.0)) / (math.pow(c, 2.0) * (x * (x * math.pow(s, 2.0))))) <= -1e-149: tmp = -2.0 / ((s * c) * (s * c)) else: tmp = 1.0 / (t_0 * t_0) return tmp
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = Float64(s * Float64(x * c)) tmp = 0.0 if (Float64(cos(Float64(x * 2.0)) / Float64((c ^ 2.0) * Float64(x * Float64(x * (s ^ 2.0))))) <= -1e-149) tmp = Float64(-2.0 / Float64(Float64(s * c) * Float64(s * c))); else tmp = Float64(1.0 / Float64(t_0 * t_0)); end return tmp end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp_2 = code(x, c, s)
t_0 = s * (x * c);
tmp = 0.0;
if ((cos((x * 2.0)) / ((c ^ 2.0) * (x * (x * (s ^ 2.0))))) <= -1e-149)
tmp = -2.0 / ((s * c) * (s * c));
else
tmp = 1.0 / (t_0 * t_0);
end
tmp_2 = tmp;
end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(x * N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-149], N[(-2.0 / N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := s \cdot \left(x \cdot c\right)\\
\mathbf{if}\;\frac{\cos \left(x \cdot 2\right)}{{c}^{2} \cdot \left(x \cdot \left(x \cdot {s}^{2}\right)\right)} \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\frac{-2}{\left(s \cdot c\right) \cdot \left(s \cdot c\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_0 \cdot t\_0}\\
\end{array}
\end{array}
if (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < -9.99999999999999979e-150Initial program 61.9%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.0
Applied egg-rr93.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified11.7%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.8
Simplified36.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.9
Applied egg-rr36.9%
if -9.99999999999999979e-150 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) Initial program 64.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6475.4
Simplified75.4%
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6486.3
Applied egg-rr86.3%
Final simplification82.3%
NOTE: x, c, and s should be sorted in increasing order before calling this function. (FPCore (x c s) :precision binary64 (if (<= (/ (cos (* x 2.0)) (* (pow c 2.0) (* x (* x (pow s 2.0))))) -1e-149) (/ -2.0 (* (* s c) (* s c))) (/ 1.0 (* c (* c (* (* x s) (* x s)))))))
assert(x < c && c < s);
double code(double x, double c, double s) {
double tmp;
if ((cos((x * 2.0)) / (pow(c, 2.0) * (x * (x * pow(s, 2.0))))) <= -1e-149) {
tmp = -2.0 / ((s * c) * (s * c));
} else {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
}
return tmp;
}
NOTE: x, c, and s should be sorted in increasing order before calling this 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) :: tmp
if ((cos((x * 2.0d0)) / ((c ** 2.0d0) * (x * (x * (s ** 2.0d0))))) <= (-1d-149)) then
tmp = (-2.0d0) / ((s * c) * (s * c))
else
tmp = 1.0d0 / (c * (c * ((x * s) * (x * s))))
end if
code = tmp
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
double tmp;
if ((Math.cos((x * 2.0)) / (Math.pow(c, 2.0) * (x * (x * Math.pow(s, 2.0))))) <= -1e-149) {
tmp = -2.0 / ((s * c) * (s * c));
} else {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
}
return tmp;
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): tmp = 0 if (math.cos((x * 2.0)) / (math.pow(c, 2.0) * (x * (x * math.pow(s, 2.0))))) <= -1e-149: tmp = -2.0 / ((s * c) * (s * c)) else: tmp = 1.0 / (c * (c * ((x * s) * (x * s)))) return tmp
x, c, s = sort([x, c, s]) function code(x, c, s) tmp = 0.0 if (Float64(cos(Float64(x * 2.0)) / Float64((c ^ 2.0) * Float64(x * Float64(x * (s ^ 2.0))))) <= -1e-149) tmp = Float64(-2.0 / Float64(Float64(s * c) * Float64(s * c))); else tmp = Float64(1.0 / Float64(c * Float64(c * Float64(Float64(x * s) * Float64(x * s))))); end return tmp end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp_2 = code(x, c, s)
tmp = 0.0;
if ((cos((x * 2.0)) / ((c ^ 2.0) * (x * (x * (s ^ 2.0))))) <= -1e-149)
tmp = -2.0 / ((s * c) * (s * c));
else
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
end
tmp_2 = tmp;
end
NOTE: x, c, and s should be sorted in increasing order before calling this function. code[x_, c_, s_] := If[LessEqual[N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(x * N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-149], N[(-2.0 / N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(c * N[(c * N[(N[(x * s), $MachinePrecision] * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{\cos \left(x \cdot 2\right)}{{c}^{2} \cdot \left(x \cdot \left(x \cdot {s}^{2}\right)\right)} \leq -1 \cdot 10^{-149}:\\
\;\;\;\;\frac{-2}{\left(s \cdot c\right) \cdot \left(s \cdot c\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{c \cdot \left(c \cdot \left(\left(x \cdot s\right) \cdot \left(x \cdot s\right)\right)\right)}\\
\end{array}
\end{array}
if (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) < -9.99999999999999979e-150Initial program 61.9%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.0
Applied egg-rr93.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified11.7%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.8
Simplified36.8%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6436.9
Applied egg-rr36.9%
if -9.99999999999999979e-150 < (/.f64 (cos.f64 (*.f64 #s(literal 2 binary64) x)) (*.f64 (pow.f64 c #s(literal 2 binary64)) (*.f64 (*.f64 x (pow.f64 s #s(literal 2 binary64))) x))) Initial program 64.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6475.4
Simplified75.4%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
pow2N/A
associate-*r*N/A
pow2N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.7
Applied egg-rr78.7%
Final simplification75.3%
NOTE: x, c, and s should be sorted in increasing order before calling this function.
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* x (* s c))))
(if (<= (pow s 2.0) 2e+248)
(/ (cos (+ x x)) (* c (* (* x c) (* x (* s s)))))
(/ (/ 1.0 t_0) t_0))))assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if (pow(s, 2.0) <= 2e+248) {
tmp = cos((x + x)) / (c * ((x * c) * (x * (s * s))));
} else {
tmp = (1.0 / t_0) / t_0;
}
return tmp;
}
NOTE: x, c, and s should be sorted in increasing order before calling this 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) :: tmp
t_0 = x * (s * c)
if ((s ** 2.0d0) <= 2d+248) then
tmp = cos((x + x)) / (c * ((x * c) * (x * (s * s))))
else
tmp = (1.0d0 / t_0) / t_0
end if
code = tmp
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if (Math.pow(s, 2.0) <= 2e+248) {
tmp = Math.cos((x + x)) / (c * ((x * c) * (x * (s * s))));
} else {
tmp = (1.0 / t_0) / t_0;
}
return tmp;
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): t_0 = x * (s * c) tmp = 0 if math.pow(s, 2.0) <= 2e+248: tmp = math.cos((x + x)) / (c * ((x * c) * (x * (s * s)))) else: tmp = (1.0 / t_0) / t_0 return tmp
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = Float64(x * Float64(s * c)) tmp = 0.0 if ((s ^ 2.0) <= 2e+248) tmp = Float64(cos(Float64(x + x)) / Float64(c * Float64(Float64(x * c) * Float64(x * Float64(s * s))))); else tmp = Float64(Float64(1.0 / t_0) / t_0); end return tmp end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp_2 = code(x, c, s)
t_0 = x * (s * c);
tmp = 0.0;
if ((s ^ 2.0) <= 2e+248)
tmp = cos((x + x)) / (c * ((x * c) * (x * (s * s))));
else
tmp = (1.0 / t_0) / t_0;
end
tmp_2 = tmp;
end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[s, 2.0], $MachinePrecision], 2e+248], N[(N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision] / N[(c * N[(N[(x * c), $MachinePrecision] * N[(x * N[(s * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := x \cdot \left(s \cdot c\right)\\
\mathbf{if}\;{s}^{2} \leq 2 \cdot 10^{+248}:\\
\;\;\;\;\frac{\cos \left(x + x\right)}{c \cdot \left(\left(x \cdot c\right) \cdot \left(x \cdot \left(s \cdot s\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t\_0}}{t\_0}\\
\end{array}
\end{array}
if (pow.f64 s #s(literal 2 binary64)) < 2.00000000000000009e248Initial program 66.9%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6495.9
Applied egg-rr95.9%
unpow2N/A
swap-sqrN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
Applied egg-rr97.3%
swap-sqrN/A
pow2N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.3
Applied egg-rr81.3%
if 2.00000000000000009e248 < (pow.f64 s #s(literal 2 binary64)) Initial program 58.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6482.8
Simplified82.8%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
pow2N/A
associate-*r*N/A
pow2N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.1
Applied egg-rr90.1%
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6473.4
Applied egg-rr73.4%
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6493.8
Applied egg-rr93.8%
NOTE: x, c, and s should be sorted in increasing order before calling this function.
(FPCore (x c s)
:precision binary64
(let* ((t_0 (cos (+ x x))) (t_1 (* x (* s c))))
(if (<= x 3.9e-7)
(/ (/ 1.0 t_1) t_1)
(if (<= x 3.9e+114)
(/ t_0 (* s (* c (* s (* c (* x x))))))
(/ t_0 (* c (* (* x c) (* x (* s s)))))))))assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = cos((x + x));
double t_1 = x * (s * c);
double tmp;
if (x <= 3.9e-7) {
tmp = (1.0 / t_1) / t_1;
} else if (x <= 3.9e+114) {
tmp = t_0 / (s * (c * (s * (c * (x * x)))));
} else {
tmp = t_0 / (c * ((x * c) * (x * (s * s))));
}
return tmp;
}
NOTE: x, c, and s should be sorted in increasing order before calling this 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 * (s * c)
if (x <= 3.9d-7) then
tmp = (1.0d0 / t_1) / t_1
else if (x <= 3.9d+114) then
tmp = t_0 / (s * (c * (s * (c * (x * x)))))
else
tmp = t_0 / (c * ((x * c) * (x * (s * s))))
end if
code = tmp
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
double t_0 = Math.cos((x + x));
double t_1 = x * (s * c);
double tmp;
if (x <= 3.9e-7) {
tmp = (1.0 / t_1) / t_1;
} else if (x <= 3.9e+114) {
tmp = t_0 / (s * (c * (s * (c * (x * x)))));
} else {
tmp = t_0 / (c * ((x * c) * (x * (s * s))));
}
return tmp;
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): t_0 = math.cos((x + x)) t_1 = x * (s * c) tmp = 0 if x <= 3.9e-7: tmp = (1.0 / t_1) / t_1 elif x <= 3.9e+114: tmp = t_0 / (s * (c * (s * (c * (x * x))))) else: tmp = t_0 / (c * ((x * c) * (x * (s * s)))) return tmp
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = cos(Float64(x + x)) t_1 = Float64(x * Float64(s * c)) tmp = 0.0 if (x <= 3.9e-7) tmp = Float64(Float64(1.0 / t_1) / t_1); elseif (x <= 3.9e+114) tmp = Float64(t_0 / Float64(s * Float64(c * Float64(s * Float64(c * Float64(x * x)))))); else tmp = Float64(t_0 / Float64(c * Float64(Float64(x * c) * Float64(x * Float64(s * s))))); end return tmp end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp_2 = code(x, c, s)
t_0 = cos((x + x));
t_1 = x * (s * c);
tmp = 0.0;
if (x <= 3.9e-7)
tmp = (1.0 / t_1) / t_1;
elseif (x <= 3.9e+114)
tmp = t_0 / (s * (c * (s * (c * (x * x)))));
else
tmp = t_0 / (c * ((x * c) * (x * (s * s))));
end
tmp_2 = tmp;
end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 3.9e-7], N[(N[(1.0 / t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[x, 3.9e+114], N[(t$95$0 / N[(s * N[(c * N[(s * N[(c * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(c * N[(N[(x * c), $MachinePrecision] * N[(x * N[(s * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := \cos \left(x + x\right)\\
t_1 := x \cdot \left(s \cdot c\right)\\
\mathbf{if}\;x \leq 3.9 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{1}{t\_1}}{t\_1}\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+114}:\\
\;\;\;\;\frac{t\_0}{s \cdot \left(c \cdot \left(s \cdot \left(c \cdot \left(x \cdot x\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{c \cdot \left(\left(x \cdot c\right) \cdot \left(x \cdot \left(s \cdot s\right)\right)\right)}\\
\end{array}
\end{array}
if x < 3.90000000000000025e-7Initial program 64.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6471.6
Simplified71.6%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
pow2N/A
associate-*r*N/A
pow2N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6475.6
Applied egg-rr75.6%
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6473.9
Applied egg-rr73.9%
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6484.5
Applied egg-rr84.5%
if 3.90000000000000025e-7 < x < 3.9000000000000001e114Initial program 62.0%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6499.7
Applied egg-rr99.7%
unpow2N/A
swap-sqrN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
Applied egg-rr95.2%
Taylor expanded in s around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.4
Simplified91.4%
if 3.9000000000000001e114 < x Initial program 63.0%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.7
Applied egg-rr93.7%
unpow2N/A
swap-sqrN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
Applied egg-rr95.0%
swap-sqrN/A
pow2N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.3
Applied egg-rr78.3%
NOTE: x, c, and s should be sorted in increasing order before calling this function. (FPCore (x c s) :precision binary64 (let* ((t_0 (* s (* x c)))) (/ (cos (+ x x)) (* t_0 t_0))))
assert(x < c && c < s);
double code(double x, double c, double s) {
double t_0 = s * (x * c);
return cos((x + x)) / (t_0 * t_0);
}
NOTE: x, c, and s should be sorted in increasing order before calling this 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
t_0 = s * (x * c)
code = cos((x + x)) / (t_0 * t_0)
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
double t_0 = s * (x * c);
return Math.cos((x + x)) / (t_0 * t_0);
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): t_0 = s * (x * c) return math.cos((x + x)) / (t_0 * t_0)
x, c, s = sort([x, c, s]) function code(x, c, s) t_0 = Float64(s * Float64(x * c)) return Float64(cos(Float64(x + x)) / Float64(t_0 * t_0)) end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp = code(x, c, s)
t_0 = s * (x * c);
tmp = cos((x + x)) / (t_0 * t_0);
end
NOTE: x, c, and s should be sorted in increasing order before calling this function.
code[x_, c_, s_] := Block[{t$95$0 = N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]}, N[(N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\begin{array}{l}
t_0 := s \cdot \left(x \cdot c\right)\\
\frac{\cos \left(x + x\right)}{t\_0 \cdot t\_0}
\end{array}
\end{array}
Initial program 63.8%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.8
Applied egg-rr96.8%
unpow2N/A
swap-sqrN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
+-lowering-+.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
Applied egg-rr97.3%
Final simplification97.3%
NOTE: x, c, and s should be sorted in increasing order before calling this function. (FPCore (x c s) :precision binary64 (/ -2.0 (* c (* s (* s c)))))
assert(x < c && c < s);
double code(double x, double c, double s) {
return -2.0 / (c * (s * (s * c)));
}
NOTE: x, c, and s should be sorted in increasing order before calling this function.
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = (-2.0d0) / (c * (s * (s * c)))
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
return -2.0 / (c * (s * (s * c)));
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): return -2.0 / (c * (s * (s * c)))
x, c, s = sort([x, c, s]) function code(x, c, s) return Float64(-2.0 / Float64(c * Float64(s * Float64(s * c)))) end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp = code(x, c, s)
tmp = -2.0 / (c * (s * (s * c)));
end
NOTE: x, c, and s should be sorted in increasing order before calling this function. code[x_, c_, s_] := N[(-2.0 / N[(c * N[(s * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\frac{-2}{c \cdot \left(s \cdot \left(s \cdot c\right)\right)}
\end{array}
Initial program 63.8%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.8
Applied egg-rr96.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified38.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6428.9
Simplified28.9%
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6428.6
Applied egg-rr28.6%
Final simplification28.6%
NOTE: x, c, and s should be sorted in increasing order before calling this function. (FPCore (x c s) :precision binary64 (/ -2.0 (* (* s s) (* c c))))
assert(x < c && c < s);
double code(double x, double c, double s) {
return -2.0 / ((s * s) * (c * c));
}
NOTE: x, c, and s should be sorted in increasing order before calling this function.
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = (-2.0d0) / ((s * s) * (c * c))
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
return -2.0 / ((s * s) * (c * c));
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): return -2.0 / ((s * s) * (c * c))
x, c, s = sort([x, c, s]) function code(x, c, s) return Float64(-2.0 / Float64(Float64(s * s) * Float64(c * c))) end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp = code(x, c, s)
tmp = -2.0 / ((s * s) * (c * c));
end
NOTE: x, c, and s should be sorted in increasing order before calling this function. code[x_, c_, s_] := N[(-2.0 / N[(N[(s * s), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\frac{-2}{\left(s \cdot s\right) \cdot \left(c \cdot c\right)}
\end{array}
Initial program 63.8%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.8
Applied egg-rr96.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified38.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6428.9
Simplified28.9%
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6430.0
Applied egg-rr30.0%
NOTE: x, c, and s should be sorted in increasing order before calling this function. (FPCore (x c s) :precision binary64 (/ -2.0 (* (* s c) (* s c))))
assert(x < c && c < s);
double code(double x, double c, double s) {
return -2.0 / ((s * c) * (s * c));
}
NOTE: x, c, and s should be sorted in increasing order before calling this function.
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = (-2.0d0) / ((s * c) * (s * c))
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
return -2.0 / ((s * c) * (s * c));
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): return -2.0 / ((s * c) * (s * c))
x, c, s = sort([x, c, s]) function code(x, c, s) return Float64(-2.0 / Float64(Float64(s * c) * Float64(s * c))) end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp = code(x, c, s)
tmp = -2.0 / ((s * c) * (s * c));
end
NOTE: x, c, and s should be sorted in increasing order before calling this function. code[x_, c_, s_] := N[(-2.0 / N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\frac{-2}{\left(s \cdot c\right) \cdot \left(s \cdot c\right)}
\end{array}
Initial program 63.8%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.8
Applied egg-rr96.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified38.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6428.9
Simplified28.9%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6427.5
Applied egg-rr27.5%
NOTE: x, c, and s should be sorted in increasing order before calling this function. (FPCore (x c s) :precision binary64 (/ -2.0 (* s (* c (* s c)))))
assert(x < c && c < s);
double code(double x, double c, double s) {
return -2.0 / (s * (c * (s * c)));
}
NOTE: x, c, and s should be sorted in increasing order before calling this function.
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = (-2.0d0) / (s * (c * (s * c)))
end function
assert x < c && c < s;
public static double code(double x, double c, double s) {
return -2.0 / (s * (c * (s * c)));
}
[x, c, s] = sort([x, c, s]) def code(x, c, s): return -2.0 / (s * (c * (s * c)))
x, c, s = sort([x, c, s]) function code(x, c, s) return Float64(-2.0 / Float64(s * Float64(c * Float64(s * c)))) end
x, c, s = num2cell(sort([x, c, s])){:}
function tmp = code(x, c, s)
tmp = -2.0 / (s * (c * (s * c)));
end
NOTE: x, c, and s should be sorted in increasing order before calling this function. code[x_, c_, s_] := N[(-2.0 / N[(s * N[(c * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, c, s] = \mathsf{sort}([x, c, s])\\
\\
\frac{-2}{s \cdot \left(c \cdot \left(s \cdot c\right)\right)}
\end{array}
Initial program 63.8%
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
pow-prod-downN/A
pow2N/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.8
Applied egg-rr96.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified38.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6428.9
Simplified28.9%
Final simplification28.9%
herbie shell --seed 2024205
(FPCore (x c s)
:name "mixedcos"
:precision binary64
(/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))