
(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 13 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)) x) (* s c)) (* x (* s c))))
double code(double x, double c, double s) {
return ((cos((2.0 * x)) / x) / (s * c)) / (x * (s * c));
}
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)) / x) / (s * c)) / (x * (s * c))
end function
public static double code(double x, double c, double s) {
return ((Math.cos((2.0 * x)) / x) / (s * c)) / (x * (s * c));
}
def code(x, c, s): return ((math.cos((2.0 * x)) / x) / (s * c)) / (x * (s * c))
function code(x, c, s) return Float64(Float64(Float64(cos(Float64(2.0 * x)) / x) / Float64(s * c)) / Float64(x * Float64(s * c))) end
function tmp = code(x, c, s) tmp = ((cos((2.0 * x)) / x) / (s * c)) / (x * (s * c)); end
code[x_, c_, s_] := N[(N[(N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] / N[(s * c), $MachinePrecision]), $MachinePrecision] / N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{\cos \left(2 \cdot x\right)}{x}}{s \cdot c}}{x \cdot \left(s \cdot c\right)}
\end{array}
Initial program 65.0%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.9%
Simplified79.9%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.7%
Applied egg-rr97.7%
(FPCore (x c s) :precision binary64 (if (<= x 3e-46) (/ (/ (/ 1.0 (* c (* x s))) (* x s)) c) (/ (cos (* 2.0 x)) (* x (* x (* s (* c (* s c))))))))
double code(double x, double c, double s) {
double tmp;
if (x <= 3e-46) {
tmp = ((1.0 / (c * (x * s))) / (x * s)) / c;
} else {
tmp = cos((2.0 * x)) / (x * (x * (s * (c * (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) :: tmp
if (x <= 3d-46) then
tmp = ((1.0d0 / (c * (x * s))) / (x * s)) / c
else
tmp = cos((2.0d0 * x)) / (x * (x * (s * (c * (s * c)))))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (x <= 3e-46) {
tmp = ((1.0 / (c * (x * s))) / (x * s)) / c;
} else {
tmp = Math.cos((2.0 * x)) / (x * (x * (s * (c * (s * c)))));
}
return tmp;
}
def code(x, c, s): tmp = 0 if x <= 3e-46: tmp = ((1.0 / (c * (x * s))) / (x * s)) / c else: tmp = math.cos((2.0 * x)) / (x * (x * (s * (c * (s * c))))) return tmp
function code(x, c, s) tmp = 0.0 if (x <= 3e-46) tmp = Float64(Float64(Float64(1.0 / Float64(c * Float64(x * s))) / Float64(x * s)) / c); else tmp = Float64(cos(Float64(2.0 * x)) / Float64(x * Float64(x * Float64(s * Float64(c * Float64(s * c)))))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (x <= 3e-46) tmp = ((1.0 / (c * (x * s))) / (x * s)) / c; else tmp = cos((2.0 * x)) / (x * (x * (s * (c * (s * c))))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[x, 3e-46], N[(N[(N[(1.0 / N[(c * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * s), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(x * N[(x * N[(s * N[(c * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3 \cdot 10^{-46}:\\
\;\;\;\;\frac{\frac{\frac{1}{c \cdot \left(x \cdot s\right)}}{x \cdot s}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(x \cdot \left(s \cdot \left(c \cdot \left(s \cdot c\right)\right)\right)\right)}\\
\end{array}
\end{array}
if x < 2.99999999999999987e-46Initial program 63.0%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.4%
Simplified79.4%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6496.8%
Applied egg-rr96.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-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
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.4%
Simplified66.4%
inv-powN/A
*-commutativeN/A
unpow-prod-downN/A
Applied egg-rr78.5%
associate-/r*N/A
/-lowering-/.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.9%
Applied egg-rr80.9%
if 2.99999999999999987e-46 < x Initial program 69.5%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.0%
Simplified81.0%
Final simplification81.0%
(FPCore (x c s) :precision binary64 (let* ((t_0 (* x (* s c)))) (/ (cos (* 2.0 x)) (* t_0 t_0))))
double code(double x, double c, double s) {
double t_0 = x * (s * c);
return cos((2.0 * 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 = x * (s * c)
code = cos((2.0d0 * x)) / (t_0 * t_0)
end function
public static double code(double x, double c, double s) {
double t_0 = x * (s * c);
return Math.cos((2.0 * x)) / (t_0 * t_0);
}
def code(x, c, s): t_0 = x * (s * c) return math.cos((2.0 * x)) / (t_0 * t_0)
function code(x, c, s) t_0 = Float64(x * Float64(s * c)) return Float64(cos(Float64(2.0 * x)) / Float64(t_0 * t_0)) end
function tmp = code(x, c, s) t_0 = x * (s * c); tmp = cos((2.0 * x)) / (t_0 * t_0); end
code[x_, c_, s_] := Block[{t$95$0 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(s \cdot c\right)\\
\frac{\cos \left(2 \cdot x\right)}{t\_0 \cdot t\_0}
\end{array}
\end{array}
Initial program 65.0%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.9%
Simplified79.9%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.5%
Applied egg-rr97.5%
(FPCore (x c s) :precision binary64 (if (<= c 5.2e-87) (/ 1.0 (* x (* x (* (* s c) (* s c))))) (/ 1.0 (* c (* s (* x (* s (* x c))))))))
double code(double x, double c, double s) {
double tmp;
if (c <= 5.2e-87) {
tmp = 1.0 / (x * (x * ((s * c) * (s * c))));
} else {
tmp = 1.0 / (c * (s * (x * (s * (x * 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) :: tmp
if (c <= 5.2d-87) then
tmp = 1.0d0 / (x * (x * ((s * c) * (s * c))))
else
tmp = 1.0d0 / (c * (s * (x * (s * (x * c)))))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (c <= 5.2e-87) {
tmp = 1.0 / (x * (x * ((s * c) * (s * c))));
} else {
tmp = 1.0 / (c * (s * (x * (s * (x * c)))));
}
return tmp;
}
def code(x, c, s): tmp = 0 if c <= 5.2e-87: tmp = 1.0 / (x * (x * ((s * c) * (s * c)))) else: tmp = 1.0 / (c * (s * (x * (s * (x * c))))) return tmp
function code(x, c, s) tmp = 0.0 if (c <= 5.2e-87) tmp = Float64(1.0 / Float64(x * Float64(x * Float64(Float64(s * c) * Float64(s * c))))); else tmp = Float64(1.0 / Float64(c * Float64(s * Float64(x * Float64(s * Float64(x * c)))))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (c <= 5.2e-87) tmp = 1.0 / (x * (x * ((s * c) * (s * c)))); else tmp = 1.0 / (c * (s * (x * (s * (x * c))))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[c, 5.2e-87], N[(1.0 / N[(x * N[(x * N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(c * N[(s * N[(x * N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 5.2 \cdot 10^{-87}:\\
\;\;\;\;\frac{1}{x \cdot \left(x \cdot \left(\left(s \cdot c\right) \cdot \left(s \cdot c\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{c \cdot \left(s \cdot \left(x \cdot \left(s \cdot \left(x \cdot c\right)\right)\right)\right)}\\
\end{array}
\end{array}
if c < 5.20000000000000005e-87Initial program 60.9%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.4%
Simplified79.4%
Taylor expanded in x around 0
Simplified69.5%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6471.7%
Applied egg-rr71.7%
if 5.20000000000000005e-87 < c Initial program 73.9%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.0%
Simplified81.0%
Taylor expanded in x around 0
Simplified71.4%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6480.7%
Applied egg-rr80.7%
Final simplification74.5%
(FPCore (x c s) :precision binary64 (if (<= c 7e-67) (/ 1.0 (* x (* x (* (* s c) (* s c))))) (/ 1.0 (* s (* x (* c (* c (* x s))))))))
double code(double x, double c, double s) {
double tmp;
if (c <= 7e-67) {
tmp = 1.0 / (x * (x * ((s * c) * (s * c))));
} else {
tmp = 1.0 / (s * (x * (c * (c * (x * s)))));
}
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 <= 7d-67) then
tmp = 1.0d0 / (x * (x * ((s * c) * (s * c))))
else
tmp = 1.0d0 / (s * (x * (c * (c * (x * s)))))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (c <= 7e-67) {
tmp = 1.0 / (x * (x * ((s * c) * (s * c))));
} else {
tmp = 1.0 / (s * (x * (c * (c * (x * s)))));
}
return tmp;
}
def code(x, c, s): tmp = 0 if c <= 7e-67: tmp = 1.0 / (x * (x * ((s * c) * (s * c)))) else: tmp = 1.0 / (s * (x * (c * (c * (x * s))))) return tmp
function code(x, c, s) tmp = 0.0 if (c <= 7e-67) tmp = Float64(1.0 / Float64(x * Float64(x * Float64(Float64(s * c) * Float64(s * c))))); else tmp = Float64(1.0 / Float64(s * Float64(x * Float64(c * Float64(c * Float64(x * s)))))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (c <= 7e-67) tmp = 1.0 / (x * (x * ((s * c) * (s * c)))); else tmp = 1.0 / (s * (x * (c * (c * (x * s))))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[c, 7e-67], N[(1.0 / N[(x * N[(x * N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(s * N[(x * N[(c * N[(c * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 7 \cdot 10^{-67}:\\
\;\;\;\;\frac{1}{x \cdot \left(x \cdot \left(\left(s \cdot c\right) \cdot \left(s \cdot c\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{s \cdot \left(x \cdot \left(c \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)\right)}\\
\end{array}
\end{array}
if c < 7.0000000000000001e-67Initial program 61.3%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.1%
Simplified79.1%
Taylor expanded in x around 0
Simplified69.6%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6471.7%
Applied egg-rr71.7%
if 7.0000000000000001e-67 < c Initial program 74.0%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.8%
Simplified81.8%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.3%
Applied egg-rr97.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-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
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6468.7%
Simplified68.7%
Taylor expanded in c around 0
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.9%
Simplified78.9%
Final simplification73.8%
(FPCore (x c s) :precision binary64 (if (<= c 1.3e-66) (/ 1.0 (* x (* x (* s (* c (* s c)))))) (/ 1.0 (* s (* x (* c (* c (* x s))))))))
double code(double x, double c, double s) {
double tmp;
if (c <= 1.3e-66) {
tmp = 1.0 / (x * (x * (s * (c * (s * c)))));
} else {
tmp = 1.0 / (s * (x * (c * (c * (x * s)))));
}
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.3d-66) then
tmp = 1.0d0 / (x * (x * (s * (c * (s * c)))))
else
tmp = 1.0d0 / (s * (x * (c * (c * (x * s)))))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (c <= 1.3e-66) {
tmp = 1.0 / (x * (x * (s * (c * (s * c)))));
} else {
tmp = 1.0 / (s * (x * (c * (c * (x * s)))));
}
return tmp;
}
def code(x, c, s): tmp = 0 if c <= 1.3e-66: tmp = 1.0 / (x * (x * (s * (c * (s * c))))) else: tmp = 1.0 / (s * (x * (c * (c * (x * s))))) return tmp
function code(x, c, s) tmp = 0.0 if (c <= 1.3e-66) tmp = Float64(1.0 / Float64(x * Float64(x * Float64(s * Float64(c * Float64(s * c)))))); else tmp = Float64(1.0 / Float64(s * Float64(x * Float64(c * Float64(c * Float64(x * s)))))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (c <= 1.3e-66) tmp = 1.0 / (x * (x * (s * (c * (s * c))))); else tmp = 1.0 / (s * (x * (c * (c * (x * s))))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[c, 1.3e-66], N[(1.0 / N[(x * N[(x * N[(s * N[(c * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(s * N[(x * N[(c * N[(c * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 1.3 \cdot 10^{-66}:\\
\;\;\;\;\frac{1}{x \cdot \left(x \cdot \left(s \cdot \left(c \cdot \left(s \cdot c\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{s \cdot \left(x \cdot \left(c \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)\right)}\\
\end{array}
\end{array}
if c < 1.2999999999999999e-66Initial program 61.3%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.1%
Simplified79.1%
Taylor expanded in x around 0
Simplified69.6%
if 1.2999999999999999e-66 < c Initial program 74.0%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6481.8%
Simplified81.8%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.3%
Applied egg-rr97.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-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
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6468.7%
Simplified68.7%
Taylor expanded in c around 0
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.9%
Simplified78.9%
Final simplification72.3%
(FPCore (x c s) :precision binary64 (if (<= c 8.5e+69) (/ 1.0 (* s (* c (* s (* c (* x x)))))) (/ -2.0 (* (* s c) (* s c)))))
double code(double x, double c, double s) {
double tmp;
if (c <= 8.5e+69) {
tmp = 1.0 / (s * (c * (s * (c * (x * x)))));
} else {
tmp = -2.0 / ((s * c) * (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) :: tmp
if (c <= 8.5d+69) then
tmp = 1.0d0 / (s * (c * (s * (c * (x * x)))))
else
tmp = (-2.0d0) / ((s * c) * (s * c))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (c <= 8.5e+69) {
tmp = 1.0 / (s * (c * (s * (c * (x * x)))));
} else {
tmp = -2.0 / ((s * c) * (s * c));
}
return tmp;
}
def code(x, c, s): tmp = 0 if c <= 8.5e+69: tmp = 1.0 / (s * (c * (s * (c * (x * x))))) else: tmp = -2.0 / ((s * c) * (s * c)) return tmp
function code(x, c, s) tmp = 0.0 if (c <= 8.5e+69) tmp = Float64(1.0 / Float64(s * Float64(c * Float64(s * Float64(c * Float64(x * x)))))); else tmp = Float64(-2.0 / Float64(Float64(s * c) * Float64(s * c))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (c <= 8.5e+69) tmp = 1.0 / (s * (c * (s * (c * (x * x))))); else tmp = -2.0 / ((s * c) * (s * c)); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[c, 8.5e+69], N[(1.0 / N[(s * N[(c * N[(s * N[(c * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 / N[(N[(s * c), $MachinePrecision] * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq 8.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{1}{s \cdot \left(c \cdot \left(s \cdot \left(c \cdot \left(x \cdot x\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{\left(s \cdot c\right) \cdot \left(s \cdot c\right)}\\
\end{array}
\end{array}
if c < 8.5000000000000002e69Initial program 62.6%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.2%
Simplified78.2%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6498.0%
Applied egg-rr98.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-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
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6462.5%
Simplified62.5%
if 8.5000000000000002e69 < c Initial program 74.6%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.9%
Simplified86.9%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6496.3%
Applied egg-rr96.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.7%
Simplified59.7%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6450.4%
Simplified50.4%
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6450.5%
Applied egg-rr50.5%
Final simplification60.1%
(FPCore (x c s) :precision binary64 (if (<= s 3e-36) (/ (/ 2.0 c) (* s (- 0.0 (* s c)))) (/ -2.0 (* c (* c (* s s))))))
double code(double x, double c, double s) {
double tmp;
if (s <= 3e-36) {
tmp = (2.0 / c) / (s * (0.0 - (s * c)));
} else {
tmp = -2.0 / (c * (c * (s * s)));
}
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 (s <= 3d-36) then
tmp = (2.0d0 / c) / (s * (0.0d0 - (s * c)))
else
tmp = (-2.0d0) / (c * (c * (s * s)))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (s <= 3e-36) {
tmp = (2.0 / c) / (s * (0.0 - (s * c)));
} else {
tmp = -2.0 / (c * (c * (s * s)));
}
return tmp;
}
def code(x, c, s): tmp = 0 if s <= 3e-36: tmp = (2.0 / c) / (s * (0.0 - (s * c))) else: tmp = -2.0 / (c * (c * (s * s))) return tmp
function code(x, c, s) tmp = 0.0 if (s <= 3e-36) tmp = Float64(Float64(2.0 / c) / Float64(s * Float64(0.0 - Float64(s * c)))); else tmp = Float64(-2.0 / Float64(c * Float64(c * Float64(s * s)))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (s <= 3e-36) tmp = (2.0 / c) / (s * (0.0 - (s * c))); else tmp = -2.0 / (c * (c * (s * s))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[s, 3e-36], N[(N[(2.0 / c), $MachinePrecision] / N[(s * N[(0.0 - N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 / N[(c * N[(c * N[(s * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;s \leq 3 \cdot 10^{-36}:\\
\;\;\;\;\frac{\frac{2}{c}}{s \cdot \left(0 - s \cdot c\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{c \cdot \left(c \cdot \left(s \cdot s\right)\right)}\\
\end{array}
\end{array}
if s < 3.0000000000000002e-36Initial program 65.8%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6482.0%
Simplified82.0%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6498.7%
Applied egg-rr98.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6454.1%
Simplified54.1%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6418.0%
Simplified18.0%
associate-/r*N/A
frac-2negN/A
/-lowering-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6425.4%
Applied egg-rr25.4%
if 3.0000000000000002e-36 < s Initial program 62.5%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.6%
Simplified73.6%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6494.7%
Applied egg-rr94.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.5%
Simplified59.5%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6452.4%
Simplified52.4%
Final simplification29.5%
(FPCore (x c s) :precision binary64 (if (<= s 1.95e+142) (/ -2.0 (* (* c c) (* s s))) (/ -2.0 (* c (* c (* s s))))))
double code(double x, double c, double s) {
double tmp;
if (s <= 1.95e+142) {
tmp = -2.0 / ((c * c) * (s * s));
} else {
tmp = -2.0 / (c * (c * (s * s)));
}
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 (s <= 1.95d+142) then
tmp = (-2.0d0) / ((c * c) * (s * s))
else
tmp = (-2.0d0) / (c * (c * (s * s)))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (s <= 1.95e+142) {
tmp = -2.0 / ((c * c) * (s * s));
} else {
tmp = -2.0 / (c * (c * (s * s)));
}
return tmp;
}
def code(x, c, s): tmp = 0 if s <= 1.95e+142: tmp = -2.0 / ((c * c) * (s * s)) else: tmp = -2.0 / (c * (c * (s * s))) return tmp
function code(x, c, s) tmp = 0.0 if (s <= 1.95e+142) tmp = Float64(-2.0 / Float64(Float64(c * c) * Float64(s * s))); else tmp = Float64(-2.0 / Float64(c * Float64(c * Float64(s * s)))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (s <= 1.95e+142) tmp = -2.0 / ((c * c) * (s * s)); else tmp = -2.0 / (c * (c * (s * s))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[s, 1.95e+142], N[(-2.0 / N[(N[(c * c), $MachinePrecision] * N[(s * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 / N[(c * N[(c * N[(s * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;s \leq 1.95 \cdot 10^{+142}:\\
\;\;\;\;\frac{-2}{\left(c \cdot c\right) \cdot \left(s \cdot s\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{c \cdot \left(c \cdot \left(s \cdot s\right)\right)}\\
\end{array}
\end{array}
if s < 1.95e142Initial program 65.7%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.2%
Simplified80.2%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6498.6%
Applied egg-rr98.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.5%
Simplified53.5%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6419.8%
Simplified19.8%
remove-double-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
distribute-lft-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6427.0%
Applied egg-rr27.0%
if 1.95e142 < s Initial program 61.0%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6478.1%
Simplified78.1%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6492.8%
Applied egg-rr92.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6465.9%
Simplified65.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.7%
Simplified63.7%
Final simplification25.7%
(FPCore (x c s) :precision binary64 (/ (/ (/ 1.0 (* c (* x s))) (* x s)) c))
double code(double x, double c, double s) {
return ((1.0 / (c * (x * s))) / (x * s)) / c;
}
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 * s))) / (x * s)) / c
end function
public static double code(double x, double c, double s) {
return ((1.0 / (c * (x * s))) / (x * s)) / c;
}
def code(x, c, s): return ((1.0 / (c * (x * s))) / (x * s)) / c
function code(x, c, s) return Float64(Float64(Float64(1.0 / Float64(c * Float64(x * s))) / Float64(x * s)) / c) end
function tmp = code(x, c, s) tmp = ((1.0 / (c * (x * s))) / (x * s)) / c; end
code[x_, c_, s_] := N[(N[(N[(1.0 / N[(c * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * s), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{1}{c \cdot \left(x \cdot s\right)}}{x \cdot s}}{c}
\end{array}
Initial program 65.0%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.9%
Simplified79.9%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.7%
Applied egg-rr97.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-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
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.9%
Simplified64.9%
inv-powN/A
*-commutativeN/A
unpow-prod-downN/A
Applied egg-rr75.6%
associate-/r*N/A
/-lowering-/.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6477.2%
Applied egg-rr77.2%
Final simplification77.2%
(FPCore (x c s) :precision binary64 (let* ((t_0 (* x (* s c)))) (/ 1.0 (* t_0 t_0))))
double code(double x, double c, double s) {
double t_0 = x * (s * c);
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 = x * (s * c)
code = 1.0d0 / (t_0 * t_0)
end function
public static double code(double x, double c, double s) {
double t_0 = x * (s * c);
return 1.0 / (t_0 * t_0);
}
def code(x, c, s): t_0 = x * (s * c) return 1.0 / (t_0 * t_0)
function code(x, c, s) t_0 = Float64(x * Float64(s * c)) return Float64(1.0 / Float64(t_0 * t_0)) end
function tmp = code(x, c, s) t_0 = x * (s * c); tmp = 1.0 / (t_0 * t_0); end
code[x_, c_, s_] := Block[{t$95$0 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, N[(1.0 / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(s \cdot c\right)\\
\frac{1}{t\_0 \cdot t\_0}
\end{array}
\end{array}
Initial program 65.0%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.9%
Simplified79.9%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.5%
Applied egg-rr97.5%
Taylor expanded in x around 0
Simplified78.5%
(FPCore (x c s) :precision binary64 (/ 1.0 (* s (* x (* c (* c (* x s)))))))
double code(double x, double c, double s) {
return 1.0 / (s * (x * (c * (c * (x * 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 / (s * (x * (c * (c * (x * s)))))
end function
public static double code(double x, double c, double s) {
return 1.0 / (s * (x * (c * (c * (x * s)))));
}
def code(x, c, s): return 1.0 / (s * (x * (c * (c * (x * s)))))
function code(x, c, s) return Float64(1.0 / Float64(s * Float64(x * Float64(c * Float64(c * Float64(x * s)))))) end
function tmp = code(x, c, s) tmp = 1.0 / (s * (x * (c * (c * (x * s))))); end
code[x_, c_, s_] := N[(1.0 / N[(s * N[(x * N[(c * N[(c * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{s \cdot \left(x \cdot \left(c \cdot \left(c \cdot \left(x \cdot s\right)\right)\right)\right)}
\end{array}
Initial program 65.0%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.9%
Simplified79.9%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.7%
Applied egg-rr97.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-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
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.9%
Simplified64.9%
Taylor expanded in c around 0
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6473.7%
Simplified73.7%
Final simplification73.7%
(FPCore (x c s) :precision binary64 (/ -2.0 (* c (* c (* s s)))))
double code(double x, double c, double s) {
return -2.0 / (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 = (-2.0d0) / (c * (c * (s * s)))
end function
public static double code(double x, double c, double s) {
return -2.0 / (c * (c * (s * s)));
}
def code(x, c, s): return -2.0 / (c * (c * (s * s)))
function code(x, c, s) return Float64(-2.0 / Float64(c * Float64(c * Float64(s * s)))) end
function tmp = code(x, c, s) tmp = -2.0 / (c * (c * (s * s))); end
code[x_, c_, s_] := N[(-2.0 / N[(c * N[(c * N[(s * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-2}{c \cdot \left(c \cdot \left(s \cdot s\right)\right)}
\end{array}
Initial program 65.0%
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.9%
Simplified79.9%
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
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.7%
Applied egg-rr97.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6455.4%
Simplified55.4%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6426.6%
Simplified26.6%
herbie shell --seed 2024160
(FPCore (x c s)
:name "mixedcos"
:precision binary64
(/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))