
(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 17 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}
(FPCore (x c s) :precision binary64 (/ (cos (* 2.0 x)) (pow (* (* s c) x) 2.0)))
double code(double x, double c, double s) {
return cos((2.0 * x)) / pow(((s * c) * x), 2.0);
}
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)) / (((s * c) * x) ** 2.0d0)
end function
public static double code(double x, double c, double s) {
return Math.cos((2.0 * x)) / Math.pow(((s * c) * x), 2.0);
}
def code(x, c, s): return math.cos((2.0 * x)) / math.pow(((s * c) * x), 2.0)
function code(x, c, s) return Float64(cos(Float64(2.0 * x)) / (Float64(Float64(s * c) * x) ^ 2.0)) end
function tmp = code(x, c, s) tmp = cos((2.0 * x)) / (((s * c) * x) ^ 2.0); end
code[x_, c_, s_] := N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[Power[N[(N[(s * c), $MachinePrecision] * x), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cos \left(2 \cdot x\right)}{{\left(\left(s \cdot c\right) \cdot x\right)}^{2}}
\end{array}
Initial program 66.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f6498.1
Applied rewrites98.1%
Final simplification98.1%
(FPCore (x c s) :precision binary64 (if (<= (/ (cos (* 2.0 x)) (* (* (* (pow s 2.0) x) x) (pow c 2.0))) -5e-121) (/ (fma -2.0 (* x x) 1.0) (* (* s x) (* (* (* s c) c) x))) (/ 1.0 (pow (* (* s c) x) 2.0))))
double code(double x, double c, double s) {
double tmp;
if ((cos((2.0 * x)) / (((pow(s, 2.0) * x) * x) * pow(c, 2.0))) <= -5e-121) {
tmp = fma(-2.0, (x * x), 1.0) / ((s * x) * (((s * c) * c) * x));
} else {
tmp = 1.0 / pow(((s * c) * x), 2.0);
}
return tmp;
}
function code(x, c, s) tmp = 0.0 if (Float64(cos(Float64(2.0 * x)) / Float64(Float64(Float64((s ^ 2.0) * x) * x) * (c ^ 2.0))) <= -5e-121) tmp = Float64(fma(-2.0, Float64(x * x), 1.0) / Float64(Float64(s * x) * Float64(Float64(Float64(s * c) * c) * x))); else tmp = Float64(1.0 / (Float64(Float64(s * c) * x) ^ 2.0)); end return tmp end
code[x_, c_, s_] := If[LessEqual[N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(N[Power[s, 2.0], $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-121], N[(N[(-2.0 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[(s * x), $MachinePrecision] * N[(N[(N[(s * c), $MachinePrecision] * c), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Power[N[(N[(s * c), $MachinePrecision] * x), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\cos \left(2 \cdot x\right)}{\left(\left({s}^{2} \cdot x\right) \cdot x\right) \cdot {c}^{2}} \leq -5 \cdot 10^{-121}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2, x \cdot x, 1\right)}{\left(s \cdot x\right) \cdot \left(\left(\left(s \cdot c\right) \cdot c\right) \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(\left(s \cdot c\right) \cdot x\right)}^{2}}\\
\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))) < -4.99999999999999989e-121Initial program 52.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.3
Applied rewrites85.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.6
Applied rewrites24.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6424.7
Applied rewrites24.7%
if -4.99999999999999989e-121 < (/.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 67.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f6498.4
Applied rewrites98.4%
Taylor expanded in x around 0
Applied rewrites85.9%
Final simplification81.2%
(FPCore (x c s) :precision binary64 (if (<= (/ (cos (* 2.0 x)) (* (* (* (pow s 2.0) x) x) (pow c 2.0))) -5e-121) (/ (fma -2.0 (* x x) 1.0) (* (* s x) (* (* (* s c) c) x))) (* (/ 1.0 (* (* c x) s)) (/ (/ 1.0 s) (* c x)))))
double code(double x, double c, double s) {
double tmp;
if ((cos((2.0 * x)) / (((pow(s, 2.0) * x) * x) * pow(c, 2.0))) <= -5e-121) {
tmp = fma(-2.0, (x * x), 1.0) / ((s * x) * (((s * c) * c) * x));
} else {
tmp = (1.0 / ((c * x) * s)) * ((1.0 / s) / (c * x));
}
return tmp;
}
function code(x, c, s) tmp = 0.0 if (Float64(cos(Float64(2.0 * x)) / Float64(Float64(Float64((s ^ 2.0) * x) * x) * (c ^ 2.0))) <= -5e-121) tmp = Float64(fma(-2.0, Float64(x * x), 1.0) / Float64(Float64(s * x) * Float64(Float64(Float64(s * c) * c) * x))); else tmp = Float64(Float64(1.0 / Float64(Float64(c * x) * s)) * Float64(Float64(1.0 / s) / Float64(c * x))); end return tmp end
code[x_, c_, s_] := If[LessEqual[N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(N[Power[s, 2.0], $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-121], N[(N[(-2.0 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[(s * x), $MachinePrecision] * N[(N[(N[(s * c), $MachinePrecision] * c), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(c * x), $MachinePrecision] * s), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / s), $MachinePrecision] / N[(c * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\cos \left(2 \cdot x\right)}{\left(\left({s}^{2} \cdot x\right) \cdot x\right) \cdot {c}^{2}} \leq -5 \cdot 10^{-121}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2, x \cdot x, 1\right)}{\left(s \cdot x\right) \cdot \left(\left(\left(s \cdot c\right) \cdot c\right) \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(c \cdot x\right) \cdot s} \cdot \frac{\frac{1}{s}}{c \cdot x}\\
\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))) < -4.99999999999999989e-121Initial program 52.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.3
Applied rewrites85.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.6
Applied rewrites24.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6424.7
Applied rewrites24.7%
if -4.99999999999999989e-121 < (/.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 67.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f6498.4
Applied rewrites98.4%
lift-pow.f64N/A
unpow2N/A
lower-*.f6498.4
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6496.5
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6497.7
Applied rewrites97.7%
Taylor expanded in x around 0
Applied rewrites85.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites85.6%
Final simplification80.8%
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* (* c x) s)))
(if (<= (/ (cos (* 2.0 x)) (* (* (* (pow s 2.0) x) x) (pow c 2.0))) -5e-121)
(/ (fma -2.0 (* x x) 1.0) (* (* s x) (* (* (* s c) c) x)))
(/ (/ 1.0 t_0) t_0))))
double code(double x, double c, double s) {
double t_0 = (c * x) * s;
double tmp;
if ((cos((2.0 * x)) / (((pow(s, 2.0) * x) * x) * pow(c, 2.0))) <= -5e-121) {
tmp = fma(-2.0, (x * x), 1.0) / ((s * x) * (((s * c) * c) * x));
} else {
tmp = (1.0 / t_0) / t_0;
}
return tmp;
}
function code(x, c, s) t_0 = Float64(Float64(c * x) * s) tmp = 0.0 if (Float64(cos(Float64(2.0 * x)) / Float64(Float64(Float64((s ^ 2.0) * x) * x) * (c ^ 2.0))) <= -5e-121) tmp = Float64(fma(-2.0, Float64(x * x), 1.0) / Float64(Float64(s * x) * Float64(Float64(Float64(s * c) * c) * x))); else tmp = Float64(Float64(1.0 / t_0) / t_0); end return tmp end
code[x_, c_, s_] := Block[{t$95$0 = N[(N[(c * x), $MachinePrecision] * s), $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(N[Power[s, 2.0], $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-121], N[(N[(-2.0 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[(s * x), $MachinePrecision] * N[(N[(N[(s * c), $MachinePrecision] * c), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(c \cdot x\right) \cdot s\\
\mathbf{if}\;\frac{\cos \left(2 \cdot x\right)}{\left(\left({s}^{2} \cdot x\right) \cdot x\right) \cdot {c}^{2}} \leq -5 \cdot 10^{-121}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2, x \cdot x, 1\right)}{\left(s \cdot x\right) \cdot \left(\left(\left(s \cdot c\right) \cdot c\right) \cdot x\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))) < -4.99999999999999989e-121Initial program 52.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.3
Applied rewrites85.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.6
Applied rewrites24.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6424.7
Applied rewrites24.7%
if -4.99999999999999989e-121 < (/.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 67.3%
Taylor expanded in x around 0
associate-*r*N/A
associate-/l/N/A
unpow2N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6473.9
Applied rewrites73.9%
Applied rewrites78.5%
Applied rewrites85.5%
Final simplification80.8%
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* (* c x) s)))
(if (<= (/ (cos (* 2.0 x)) (* (* (* (pow s 2.0) x) x) (pow c 2.0))) -5e-121)
(/ (fma -2.0 (* x x) 1.0) (* (* (* (* c c) x) s) (* s x)))
(/ (/ 1.0 t_0) t_0))))
double code(double x, double c, double s) {
double t_0 = (c * x) * s;
double tmp;
if ((cos((2.0 * x)) / (((pow(s, 2.0) * x) * x) * pow(c, 2.0))) <= -5e-121) {
tmp = fma(-2.0, (x * x), 1.0) / ((((c * c) * x) * s) * (s * x));
} else {
tmp = (1.0 / t_0) / t_0;
}
return tmp;
}
function code(x, c, s) t_0 = Float64(Float64(c * x) * s) tmp = 0.0 if (Float64(cos(Float64(2.0 * x)) / Float64(Float64(Float64((s ^ 2.0) * x) * x) * (c ^ 2.0))) <= -5e-121) tmp = Float64(fma(-2.0, Float64(x * x), 1.0) / Float64(Float64(Float64(Float64(c * c) * x) * s) * Float64(s * x))); else tmp = Float64(Float64(1.0 / t_0) / t_0); end return tmp end
code[x_, c_, s_] := Block[{t$95$0 = N[(N[(c * x), $MachinePrecision] * s), $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(N[Power[s, 2.0], $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-121], N[(N[(-2.0 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / N[(N[(N[(N[(c * c), $MachinePrecision] * x), $MachinePrecision] * s), $MachinePrecision] * N[(s * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(c \cdot x\right) \cdot s\\
\mathbf{if}\;\frac{\cos \left(2 \cdot x\right)}{\left(\left({s}^{2} \cdot x\right) \cdot x\right) \cdot {c}^{2}} \leq -5 \cdot 10^{-121}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2, x \cdot x, 1\right)}{\left(\left(\left(c \cdot c\right) \cdot x\right) \cdot s\right) \cdot \left(s \cdot x\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))) < -4.99999999999999989e-121Initial program 52.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.3
Applied rewrites85.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.6
Applied rewrites24.6%
if -4.99999999999999989e-121 < (/.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 67.3%
Taylor expanded in x around 0
associate-*r*N/A
associate-/l/N/A
unpow2N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6473.9
Applied rewrites73.9%
Applied rewrites78.5%
Applied rewrites85.5%
Final simplification80.8%
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* (* c x) s)))
(if (<= (/ (cos (* 2.0 x)) (* (* (* (pow s 2.0) x) x) (pow c 2.0))) -5e-121)
(/ (* -2.0 (* x x)) (* (* (* (* c c) x) s) (* s x)))
(/ (/ 1.0 t_0) t_0))))
double code(double x, double c, double s) {
double t_0 = (c * x) * s;
double tmp;
if ((cos((2.0 * x)) / (((pow(s, 2.0) * x) * x) * pow(c, 2.0))) <= -5e-121) {
tmp = (-2.0 * (x * x)) / ((((c * c) * x) * s) * (s * x));
} else {
tmp = (1.0 / t_0) / t_0;
}
return tmp;
}
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 = (c * x) * s
if ((cos((2.0d0 * x)) / ((((s ** 2.0d0) * x) * x) * (c ** 2.0d0))) <= (-5d-121)) then
tmp = ((-2.0d0) * (x * x)) / ((((c * c) * x) * s) * (s * x))
else
tmp = (1.0d0 / t_0) / t_0
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double t_0 = (c * x) * s;
double tmp;
if ((Math.cos((2.0 * x)) / (((Math.pow(s, 2.0) * x) * x) * Math.pow(c, 2.0))) <= -5e-121) {
tmp = (-2.0 * (x * x)) / ((((c * c) * x) * s) * (s * x));
} else {
tmp = (1.0 / t_0) / t_0;
}
return tmp;
}
def code(x, c, s): t_0 = (c * x) * s tmp = 0 if (math.cos((2.0 * x)) / (((math.pow(s, 2.0) * x) * x) * math.pow(c, 2.0))) <= -5e-121: tmp = (-2.0 * (x * x)) / ((((c * c) * x) * s) * (s * x)) else: tmp = (1.0 / t_0) / t_0 return tmp
function code(x, c, s) t_0 = Float64(Float64(c * x) * s) tmp = 0.0 if (Float64(cos(Float64(2.0 * x)) / Float64(Float64(Float64((s ^ 2.0) * x) * x) * (c ^ 2.0))) <= -5e-121) tmp = Float64(Float64(-2.0 * Float64(x * x)) / Float64(Float64(Float64(Float64(c * c) * x) * s) * Float64(s * x))); else tmp = Float64(Float64(1.0 / t_0) / t_0); end return tmp end
function tmp_2 = code(x, c, s) t_0 = (c * x) * s; tmp = 0.0; if ((cos((2.0 * x)) / ((((s ^ 2.0) * x) * x) * (c ^ 2.0))) <= -5e-121) tmp = (-2.0 * (x * x)) / ((((c * c) * x) * s) * (s * x)); else tmp = (1.0 / t_0) / t_0; end tmp_2 = tmp; end
code[x_, c_, s_] := Block[{t$95$0 = N[(N[(c * x), $MachinePrecision] * s), $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(N[Power[s, 2.0], $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-121], N[(N[(-2.0 * N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(c * c), $MachinePrecision] * x), $MachinePrecision] * s), $MachinePrecision] * N[(s * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(c \cdot x\right) \cdot s\\
\mathbf{if}\;\frac{\cos \left(2 \cdot x\right)}{\left(\left({s}^{2} \cdot x\right) \cdot x\right) \cdot {c}^{2}} \leq -5 \cdot 10^{-121}:\\
\;\;\;\;\frac{-2 \cdot \left(x \cdot x\right)}{\left(\left(\left(c \cdot c\right) \cdot x\right) \cdot s\right) \cdot \left(s \cdot x\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))) < -4.99999999999999989e-121Initial program 52.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.3
Applied rewrites85.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.6
Applied rewrites24.6%
Taylor expanded in x around inf
Applied rewrites24.6%
if -4.99999999999999989e-121 < (/.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 67.3%
Taylor expanded in x around 0
associate-*r*N/A
associate-/l/N/A
unpow2N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6473.9
Applied rewrites73.9%
Applied rewrites78.5%
Applied rewrites85.5%
Final simplification80.8%
(FPCore (x c s) :precision binary64 (if (<= (/ (cos (* 2.0 x)) (* (* (* (pow s 2.0) x) x) (pow c 2.0))) INFINITY) (/ 1.0 (* (* (* (* (* c c) x) x) s) s)) (/ 1.0 (* (* (* (* (* x x) c) c) s) s))))
double code(double x, double c, double s) {
double tmp;
if ((cos((2.0 * x)) / (((pow(s, 2.0) * x) * x) * pow(c, 2.0))) <= ((double) INFINITY)) {
tmp = 1.0 / (((((c * c) * x) * x) * s) * s);
} else {
tmp = 1.0 / (((((x * x) * c) * c) * s) * s);
}
return tmp;
}
public static double code(double x, double c, double s) {
double tmp;
if ((Math.cos((2.0 * x)) / (((Math.pow(s, 2.0) * x) * x) * Math.pow(c, 2.0))) <= Double.POSITIVE_INFINITY) {
tmp = 1.0 / (((((c * c) * x) * x) * s) * s);
} else {
tmp = 1.0 / (((((x * x) * c) * c) * s) * s);
}
return tmp;
}
def code(x, c, s): tmp = 0 if (math.cos((2.0 * x)) / (((math.pow(s, 2.0) * x) * x) * math.pow(c, 2.0))) <= math.inf: tmp = 1.0 / (((((c * c) * x) * x) * s) * s) else: tmp = 1.0 / (((((x * x) * c) * c) * s) * s) return tmp
function code(x, c, s) tmp = 0.0 if (Float64(cos(Float64(2.0 * x)) / Float64(Float64(Float64((s ^ 2.0) * x) * x) * (c ^ 2.0))) <= Inf) tmp = Float64(1.0 / Float64(Float64(Float64(Float64(Float64(c * c) * x) * x) * s) * s)); else tmp = Float64(1.0 / Float64(Float64(Float64(Float64(Float64(x * x) * c) * c) * s) * s)); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if ((cos((2.0 * x)) / ((((s ^ 2.0) * x) * x) * (c ^ 2.0))) <= Inf) tmp = 1.0 / (((((c * c) * x) * x) * s) * s); else tmp = 1.0 / (((((x * x) * c) * c) * s) * s); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(N[Power[s, 2.0], $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(1.0 / N[(N[(N[(N[(N[(c * c), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * s), $MachinePrecision] * s), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[(N[(N[(x * x), $MachinePrecision] * c), $MachinePrecision] * c), $MachinePrecision] * s), $MachinePrecision] * s), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\cos \left(2 \cdot x\right)}{\left(\left({s}^{2} \cdot x\right) \cdot x\right) \cdot {c}^{2}} \leq \infty:\\
\;\;\;\;\frac{1}{\left(\left(\left(\left(c \cdot c\right) \cdot x\right) \cdot x\right) \cdot s\right) \cdot s}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(\left(\left(\left(x \cdot x\right) \cdot c\right) \cdot c\right) \cdot s\right) \cdot s}\\
\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))) < +inf.0Initial program 81.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6485.7
Applied rewrites85.7%
Taylor expanded in x around 0
Applied rewrites74.2%
Taylor expanded in x around 0
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6473.9
Applied rewrites73.9%
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%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6479.2
Applied rewrites79.2%
Taylor expanded in x around 0
Applied rewrites64.8%
Taylor expanded in x around 0
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6421.5
Applied rewrites21.5%
Applied rewrites56.0%
Final simplification70.6%
(FPCore (x c s)
:precision binary64
(let* ((t_0 (cos (+ x x))))
(if (<= x 1.75e-131)
(/ 1.0 (* (* (pow (* s x) 2.0) c) c))
(if (<= x 3.3e+153)
(/ t_0 (* (* (* x x) (* s c)) (* s c)))
(/ t_0 (* (* (* s x) (* (* c x) s)) c))))))
double code(double x, double c, double s) {
double t_0 = cos((x + x));
double tmp;
if (x <= 1.75e-131) {
tmp = 1.0 / ((pow((s * x), 2.0) * c) * c);
} else if (x <= 3.3e+153) {
tmp = t_0 / (((x * x) * (s * c)) * (s * c));
} else {
tmp = t_0 / (((s * x) * ((c * x) * s)) * c);
}
return tmp;
}
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 = cos((x + x))
if (x <= 1.75d-131) then
tmp = 1.0d0 / ((((s * x) ** 2.0d0) * c) * c)
else if (x <= 3.3d+153) then
tmp = t_0 / (((x * x) * (s * c)) * (s * c))
else
tmp = t_0 / (((s * x) * ((c * x) * s)) * c)
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double t_0 = Math.cos((x + x));
double tmp;
if (x <= 1.75e-131) {
tmp = 1.0 / ((Math.pow((s * x), 2.0) * c) * c);
} else if (x <= 3.3e+153) {
tmp = t_0 / (((x * x) * (s * c)) * (s * c));
} else {
tmp = t_0 / (((s * x) * ((c * x) * s)) * c);
}
return tmp;
}
def code(x, c, s): t_0 = math.cos((x + x)) tmp = 0 if x <= 1.75e-131: tmp = 1.0 / ((math.pow((s * x), 2.0) * c) * c) elif x <= 3.3e+153: tmp = t_0 / (((x * x) * (s * c)) * (s * c)) else: tmp = t_0 / (((s * x) * ((c * x) * s)) * c) return tmp
function code(x, c, s) t_0 = cos(Float64(x + x)) tmp = 0.0 if (x <= 1.75e-131) tmp = Float64(1.0 / Float64(Float64((Float64(s * x) ^ 2.0) * c) * c)); elseif (x <= 3.3e+153) tmp = Float64(t_0 / Float64(Float64(Float64(x * x) * Float64(s * c)) * Float64(s * c))); else tmp = Float64(t_0 / Float64(Float64(Float64(s * x) * Float64(Float64(c * x) * s)) * c)); end return tmp end
function tmp_2 = code(x, c, s) t_0 = cos((x + x)); tmp = 0.0; if (x <= 1.75e-131) tmp = 1.0 / ((((s * x) ^ 2.0) * c) * c); elseif (x <= 3.3e+153) tmp = t_0 / (((x * x) * (s * c)) * (s * c)); else tmp = t_0 / (((s * x) * ((c * x) * s)) * c); end tmp_2 = tmp; end
code[x_, c_, s_] := Block[{t$95$0 = N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 1.75e-131], N[(1.0 / N[(N[(N[Power[N[(s * x), $MachinePrecision], 2.0], $MachinePrecision] * c), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+153], N[(t$95$0 / N[(N[(N[(x * x), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[(N[(s * x), $MachinePrecision] * N[(N[(c * x), $MachinePrecision] * s), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(x + x\right)\\
\mathbf{if}\;x \leq 1.75 \cdot 10^{-131}:\\
\;\;\;\;\frac{1}{\left({\left(s \cdot x\right)}^{2} \cdot c\right) \cdot c}\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+153}:\\
\;\;\;\;\frac{t\_0}{\left(\left(x \cdot x\right) \cdot \left(s \cdot c\right)\right) \cdot \left(s \cdot c\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{\left(\left(s \cdot x\right) \cdot \left(\left(c \cdot x\right) \cdot s\right)\right) \cdot c}\\
\end{array}
\end{array}
if x < 1.7500000000000001e-131Initial program 62.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6484.4
Applied rewrites84.4%
Taylor expanded in x around 0
Applied rewrites73.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-pow.f64N/A
pow2N/A
pow-prod-downN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.2%
if 1.7500000000000001e-131 < x < 3.29999999999999994e153Initial program 72.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6472.1
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f6499.5
Applied rewrites99.5%
lift-pow.f64N/A
unpow2N/A
lower-*.f6499.5
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6497.0
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6496.9
Applied rewrites96.9%
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lower-+.f6496.9
Applied rewrites96.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
unswap-sqrN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6499.7
Applied rewrites99.7%
if 3.29999999999999994e153 < x Initial program 69.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6469.6
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f6495.0
Applied rewrites95.0%
lift-pow.f64N/A
unpow2N/A
lower-*.f6495.0
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6495.0
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6499.6
Applied rewrites99.6%
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lower-+.f6499.6
Applied rewrites99.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6494.8
Applied rewrites94.8%
Final simplification85.4%
(FPCore (x c s) :precision binary64 (if (<= x 28.0) (/ (fma -2.0 (* x x) 1.0) (pow (* (* s c) x) 2.0)) (/ (cos (+ x x)) (* (* (* s x) (* (* c x) s)) c))))
double code(double x, double c, double s) {
double tmp;
if (x <= 28.0) {
tmp = fma(-2.0, (x * x), 1.0) / pow(((s * c) * x), 2.0);
} else {
tmp = cos((x + x)) / (((s * x) * ((c * x) * s)) * c);
}
return tmp;
}
function code(x, c, s) tmp = 0.0 if (x <= 28.0) tmp = Float64(fma(-2.0, Float64(x * x), 1.0) / (Float64(Float64(s * c) * x) ^ 2.0)); else tmp = Float64(cos(Float64(x + x)) / Float64(Float64(Float64(s * x) * Float64(Float64(c * x) * s)) * c)); end return tmp end
code[x_, c_, s_] := If[LessEqual[x, 28.0], N[(N[(-2.0 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] / N[Power[N[(N[(s * c), $MachinePrecision] * x), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(s * x), $MachinePrecision] * N[(N[(c * x), $MachinePrecision] * s), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 28:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2, x \cdot x, 1\right)}{{\left(\left(s \cdot c\right) \cdot x\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(x + x\right)}{\left(\left(s \cdot x\right) \cdot \left(\left(c \cdot x\right) \cdot s\right)\right) \cdot c}\\
\end{array}
\end{array}
if x < 28Initial program 63.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f6498.5
Applied rewrites98.5%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6471.3
Applied rewrites71.3%
if 28 < x Initial program 72.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6472.1
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f6497.1
Applied rewrites97.1%
lift-pow.f64N/A
unpow2N/A
lower-*.f6497.1
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6495.9
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6498.3
Applied rewrites98.3%
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lower-+.f6498.3
Applied rewrites98.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6492.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6492.3
Applied rewrites92.3%
Final simplification77.3%
(FPCore (x c s) :precision binary64 (if (<= (pow c 2.0) 4e-322) (/ 1.0 (* (* (* (* s c) (* s c)) x) x)) (/ 1.0 (* (* (* c c) (* s x)) (* s x)))))
double code(double x, double c, double s) {
double tmp;
if (pow(c, 2.0) <= 4e-322) {
tmp = 1.0 / ((((s * c) * (s * c)) * x) * x);
} else {
tmp = 1.0 / (((c * c) * (s * x)) * (s * x));
}
return tmp;
}
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 ((c ** 2.0d0) <= 4d-322) then
tmp = 1.0d0 / ((((s * c) * (s * c)) * x) * x)
else
tmp = 1.0d0 / (((c * c) * (s * x)) * (s * x))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (Math.pow(c, 2.0) <= 4e-322) {
tmp = 1.0 / ((((s * c) * (s * c)) * x) * x);
} else {
tmp = 1.0 / (((c * c) * (s * x)) * (s * x));
}
return tmp;
}
def code(x, c, s): tmp = 0 if math.pow(c, 2.0) <= 4e-322: tmp = 1.0 / ((((s * c) * (s * c)) * x) * x) else: tmp = 1.0 / (((c * c) * (s * x)) * (s * x)) return tmp
function code(x, c, s) tmp = 0.0 if ((c ^ 2.0) <= 4e-322) tmp = Float64(1.0 / Float64(Float64(Float64(Float64(s * c) * Float64(s * c)) * x) * x)); else tmp = Float64(1.0 / Float64(Float64(Float64(c * c) * Float64(s * x)) * Float64(s * x))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if ((c ^ 2.0) <= 4e-322) tmp = 1.0 / ((((s * c) * (s * c)) * x) * x); else tmp = 1.0 / (((c * c) * (s * x)) * (s * x)); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[N[Power[c, 2.0], $MachinePrecision], 4e-322], N[(1.0 / N[(N[(N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[(c * c), $MachinePrecision] * N[(s * x), $MachinePrecision]), $MachinePrecision] * N[(s * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{c}^{2} \leq 4 \cdot 10^{-322}:\\
\;\;\;\;\frac{1}{\left(\left(\left(s \cdot c\right) \cdot \left(s \cdot c\right)\right) \cdot x\right) \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(\left(c \cdot c\right) \cdot \left(s \cdot x\right)\right) \cdot \left(s \cdot x\right)}\\
\end{array}
\end{array}
if (pow.f64 c #s(literal 2 binary64)) < 4.00193e-322Initial program 55.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6485.5
Applied rewrites85.5%
Taylor expanded in x around 0
Applied rewrites77.7%
lift-pow.f64N/A
unpow2N/A
lower-*.f6477.7
Applied rewrites77.7%
if 4.00193e-322 < (pow.f64 c #s(literal 2 binary64)) Initial program 69.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6483.5
Applied rewrites83.5%
Taylor expanded in x around 0
Applied rewrites67.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6468.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.9
Applied rewrites68.9%
Final simplification70.9%
(FPCore (x c s) :precision binary64 (let* ((t_0 (* (* c x) s))) (/ (cos (+ x x)) (* t_0 t_0))))
double code(double x, double c, double s) {
double t_0 = (c * x) * s;
return cos((x + x)) / (t_0 * t_0);
}
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 = (c * x) * s
code = cos((x + x)) / (t_0 * t_0)
end function
public static double code(double x, double c, double s) {
double t_0 = (c * x) * s;
return Math.cos((x + x)) / (t_0 * t_0);
}
def code(x, c, s): t_0 = (c * x) * s return math.cos((x + x)) / (t_0 * t_0)
function code(x, c, s) t_0 = Float64(Float64(c * x) * s) return Float64(cos(Float64(x + x)) / Float64(t_0 * t_0)) end
function tmp = code(x, c, s) t_0 = (c * x) * s; tmp = cos((x + x)) / (t_0 * t_0); end
code[x_, c_, s_] := Block[{t$95$0 = N[(N[(c * x), $MachinePrecision] * s), $MachinePrecision]}, N[(N[Cos[N[(x + x), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(c \cdot x\right) \cdot s\\
\frac{\cos \left(x + x\right)}{t\_0 \cdot t\_0}
\end{array}
\end{array}
Initial program 66.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f6498.1
Applied rewrites98.1%
lift-pow.f64N/A
unpow2N/A
lower-*.f6498.1
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6496.4
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6497.8
Applied rewrites97.8%
lift-*.f64N/A
*-commutativeN/A
count-2N/A
lower-+.f6497.8
Applied rewrites97.8%
(FPCore (x c s) :precision binary64 (if (<= c 1.05e-160) (/ 1.0 (* (* (* s x) (* (* s c) c)) x)) (/ 1.0 (* (* (* c c) (* s x)) (* s x)))))
double code(double x, double c, double s) {
double tmp;
if (c <= 1.05e-160) {
tmp = 1.0 / (((s * x) * ((s * c) * c)) * x);
} else {
tmp = 1.0 / (((c * c) * (s * x)) * (s * x));
}
return tmp;
}
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 (c <= 1.05d-160) then
tmp = 1.0d0 / (((s * x) * ((s * c) * c)) * x)
else
tmp = 1.0d0 / (((c * c) * (s * x)) * (s * x))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (c <= 1.05e-160) {
tmp = 1.0 / (((s * x) * ((s * c) * c)) * x);
} else {
tmp = 1.0 / (((c * c) * (s * x)) * (s * x));
}
return tmp;
}
def code(x, c, s): tmp = 0 if c <= 1.05e-160: tmp = 1.0 / (((s * x) * ((s * c) * c)) * x) else: tmp = 1.0 / (((c * c) * (s * x)) * (s * x)) return tmp
function code(x, c, s) tmp = 0.0 if (c <= 1.05e-160) tmp = Float64(1.0 / Float64(Float64(Float64(s * x) * Float64(Float64(s * c) * c)) * x)); else tmp = Float64(1.0 / Float64(Float64(Float64(c * c) * Float64(s * x)) * Float64(s * x))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (c <= 1.05e-160) tmp = 1.0 / (((s * x) * ((s * c) * c)) * x); else tmp = 1.0 / (((c * c) * (s * x)) * (s * x)); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[c, 1.05e-160], N[(1.0 / N[(N[(N[(s * x), $MachinePrecision] * N[(N[(s * c), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[(c * c), $MachinePrecision] * N[(s * x), $MachinePrecision]), $MachinePrecision] * N[(s * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 1.05 \cdot 10^{-160}:\\
\;\;\;\;\frac{1}{\left(\left(s \cdot x\right) \cdot \left(\left(s \cdot c\right) \cdot c\right)\right) \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(\left(c \cdot c\right) \cdot \left(s \cdot x\right)\right) \cdot \left(s \cdot x\right)}\\
\end{array}
\end{array}
if c < 1.05e-160Initial program 63.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6485.4
Applied rewrites85.4%
Taylor expanded in x around 0
Applied rewrites72.1%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6474.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.0
Applied rewrites74.0%
if 1.05e-160 < c Initial program 71.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.1
Applied rewrites84.1%
Taylor expanded in x around 0
Applied rewrites68.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6469.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6469.4
Applied rewrites69.4%
Final simplification72.2%
(FPCore (x c s) :precision binary64 (let* ((t_0 (* (* c x) s))) (/ (/ 1.0 t_0) t_0)))
double code(double x, double c, double s) {
double t_0 = (c * x) * s;
return (1.0 / t_0) / t_0;
}
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 = (c * x) * s
code = (1.0d0 / t_0) / t_0
end function
public static double code(double x, double c, double s) {
double t_0 = (c * x) * s;
return (1.0 / t_0) / t_0;
}
def code(x, c, s): t_0 = (c * x) * s return (1.0 / t_0) / t_0
function code(x, c, s) t_0 = Float64(Float64(c * x) * s) return Float64(Float64(1.0 / t_0) / t_0) end
function tmp = code(x, c, s) t_0 = (c * x) * s; tmp = (1.0 / t_0) / t_0; end
code[x_, c_, s_] := Block[{t$95$0 = N[(N[(c * x), $MachinePrecision] * s), $MachinePrecision]}, N[(N[(1.0 / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(c \cdot x\right) \cdot s\\
\frac{\frac{1}{t\_0}}{t\_0}
\end{array}
\end{array}
Initial program 66.2%
Taylor expanded in x around 0
associate-*r*N/A
associate-/l/N/A
unpow2N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6468.2
Applied rewrites68.2%
Applied rewrites72.4%
Applied rewrites78.9%
Final simplification78.9%
(FPCore (x c s) :precision binary64 (let* ((t_0 (* (* c x) s))) (/ 1.0 (* t_0 t_0))))
double code(double x, double c, double s) {
double t_0 = (c * x) * s;
return 1.0 / (t_0 * t_0);
}
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 = (c * x) * s
code = 1.0d0 / (t_0 * t_0)
end function
public static double code(double x, double c, double s) {
double t_0 = (c * x) * s;
return 1.0 / (t_0 * t_0);
}
def code(x, c, s): t_0 = (c * x) * s return 1.0 / (t_0 * t_0)
function code(x, c, s) t_0 = Float64(Float64(c * x) * s) return Float64(1.0 / Float64(t_0 * t_0)) end
function tmp = code(x, c, s) t_0 = (c * x) * s; tmp = 1.0 / (t_0 * t_0); end
code[x_, c_, s_] := Block[{t$95$0 = N[(N[(c * x), $MachinePrecision] * s), $MachinePrecision]}, N[(1.0 / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(c \cdot x\right) \cdot s\\
\frac{1}{t\_0 \cdot t\_0}
\end{array}
\end{array}
Initial program 66.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.2
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
pow2N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f6498.1
Applied rewrites98.1%
lift-pow.f64N/A
unpow2N/A
lower-*.f6498.1
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6496.4
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6497.8
Applied rewrites97.8%
Taylor expanded in x around 0
Applied rewrites78.9%
(FPCore (x c s) :precision binary64 (/ 1.0 (* (* (* s c) (* c x)) (* s x))))
double code(double x, double c, double s) {
return 1.0 / (((s * c) * (c * x)) * (s * x));
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = 1.0d0 / (((s * c) * (c * x)) * (s * x))
end function
public static double code(double x, double c, double s) {
return 1.0 / (((s * c) * (c * x)) * (s * x));
}
def code(x, c, s): return 1.0 / (((s * c) * (c * x)) * (s * x))
function code(x, c, s) return Float64(1.0 / Float64(Float64(Float64(s * c) * Float64(c * x)) * Float64(s * x))) end
function tmp = code(x, c, s) tmp = 1.0 / (((s * c) * (c * x)) * (s * x)); end
code[x_, c_, s_] := N[(1.0 / N[(N[(N[(s * c), $MachinePrecision] * N[(c * x), $MachinePrecision]), $MachinePrecision] * N[(s * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\left(\left(s \cdot c\right) \cdot \left(c \cdot x\right)\right) \cdot \left(s \cdot x\right)}
\end{array}
Initial program 66.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.4
Applied rewrites79.4%
Taylor expanded in x around 0
Applied rewrites66.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6475.7
Applied rewrites75.7%
Final simplification75.7%
(FPCore (x c s) :precision binary64 (/ 1.0 (* (* (* (* (* c x) c) x) s) s)))
double code(double x, double c, double s) {
return 1.0 / (((((c * x) * c) * x) * s) * s);
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = 1.0d0 / (((((c * x) * c) * x) * s) * s)
end function
public static double code(double x, double c, double s) {
return 1.0 / (((((c * x) * c) * x) * s) * s);
}
def code(x, c, s): return 1.0 / (((((c * x) * c) * x) * s) * s)
function code(x, c, s) return Float64(1.0 / Float64(Float64(Float64(Float64(Float64(c * x) * c) * x) * s) * s)) end
function tmp = code(x, c, s) tmp = 1.0 / (((((c * x) * c) * x) * s) * s); end
code[x_, c_, s_] := N[(1.0 / N[(N[(N[(N[(N[(c * x), $MachinePrecision] * c), $MachinePrecision] * x), $MachinePrecision] * s), $MachinePrecision] * s), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\left(\left(\left(\left(c \cdot x\right) \cdot c\right) \cdot x\right) \cdot s\right) \cdot s}
\end{array}
Initial program 66.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6484.5
Applied rewrites84.5%
Taylor expanded in x around 0
Applied rewrites72.5%
Taylor expanded in x around 0
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.3
Applied rewrites64.3%
Applied rewrites73.3%
(FPCore (x c s) :precision binary64 (/ 1.0 (* (* (* (* (* x x) c) c) s) s)))
double code(double x, double c, double s) {
return 1.0 / (((((x * x) * c) * c) * s) * s);
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = 1.0d0 / (((((x * x) * c) * c) * s) * s)
end function
public static double code(double x, double c, double s) {
return 1.0 / (((((x * x) * c) * c) * s) * s);
}
def code(x, c, s): return 1.0 / (((((x * x) * c) * c) * s) * s)
function code(x, c, s) return Float64(1.0 / Float64(Float64(Float64(Float64(Float64(x * x) * c) * c) * s) * s)) end
function tmp = code(x, c, s) tmp = 1.0 / (((((x * x) * c) * c) * s) * s); end
code[x_, c_, s_] := N[(1.0 / N[(N[(N[(N[(N[(x * x), $MachinePrecision] * c), $MachinePrecision] * c), $MachinePrecision] * s), $MachinePrecision] * s), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\left(\left(\left(\left(x \cdot x\right) \cdot c\right) \cdot c\right) \cdot s\right) \cdot s}
\end{array}
Initial program 66.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-pow.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6484.5
Applied rewrites84.5%
Taylor expanded in x around 0
Applied rewrites72.5%
Taylor expanded in x around 0
*-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.3
Applied rewrites64.3%
Applied rewrites69.0%
Final simplification69.0%
herbie shell --seed 2024249
(FPCore (x c s)
:name "mixedcos"
:precision binary64
(/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))