
(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 21 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-*.f6482.3%
Simplified82.3%
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.8%
Applied egg-rr97.8%
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* x (* s c))))
(if (<= x 9.5e-6)
(/ (/ (* (+ 1.0 (* (* x x) -2.0)) (/ (/ 1.0 c) s)) x) t_0)
(if (<= x 3.9e+130)
(/ (cos (* 2.0 x)) (* c (* c (* s (* s (* x x))))))
(/ (/ 1.0 (* s t_0)) (* x c))))))
double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if (x <= 9.5e-6) {
tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0;
} else if (x <= 3.9e+130) {
tmp = cos((2.0 * x)) / (c * (c * (s * (s * (x * x)))));
} else {
tmp = (1.0 / (s * t_0)) / (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) :: t_0
real(8) :: tmp
t_0 = x * (s * c)
if (x <= 9.5d-6) then
tmp = (((1.0d0 + ((x * x) * (-2.0d0))) * ((1.0d0 / c) / s)) / x) / t_0
else if (x <= 3.9d+130) then
tmp = cos((2.0d0 * x)) / (c * (c * (s * (s * (x * x)))))
else
tmp = (1.0d0 / (s * t_0)) / (x * c)
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if (x <= 9.5e-6) {
tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0;
} else if (x <= 3.9e+130) {
tmp = Math.cos((2.0 * x)) / (c * (c * (s * (s * (x * x)))));
} else {
tmp = (1.0 / (s * t_0)) / (x * c);
}
return tmp;
}
def code(x, c, s): t_0 = x * (s * c) tmp = 0 if x <= 9.5e-6: tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0 elif x <= 3.9e+130: tmp = math.cos((2.0 * x)) / (c * (c * (s * (s * (x * x))))) else: tmp = (1.0 / (s * t_0)) / (x * c) return tmp
function code(x, c, s) t_0 = Float64(x * Float64(s * c)) tmp = 0.0 if (x <= 9.5e-6) tmp = Float64(Float64(Float64(Float64(1.0 + Float64(Float64(x * x) * -2.0)) * Float64(Float64(1.0 / c) / s)) / x) / t_0); elseif (x <= 3.9e+130) tmp = Float64(cos(Float64(2.0 * x)) / Float64(c * Float64(c * Float64(s * Float64(s * Float64(x * x)))))); else tmp = Float64(Float64(1.0 / Float64(s * t_0)) / Float64(x * c)); end return tmp end
function tmp_2 = code(x, c, s) t_0 = x * (s * c); tmp = 0.0; if (x <= 9.5e-6) tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0; elseif (x <= 3.9e+130) tmp = cos((2.0 * x)) / (c * (c * (s * (s * (x * x))))); else tmp = (1.0 / (s * t_0)) / (x * c); end tmp_2 = tmp; end
code[x_, c_, s_] := Block[{t$95$0 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 9.5e-6], N[(N[(N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / c), $MachinePrecision] / s), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x, 3.9e+130], N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(c * N[(c * N[(s * N[(s * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(s * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(x * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(s \cdot c\right)\\
\mathbf{if}\;x \leq 9.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{\left(1 + \left(x \cdot x\right) \cdot -2\right) \cdot \frac{\frac{1}{c}}{s}}{x}}{t\_0}\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+130}:\\
\;\;\;\;\frac{\cos \left(2 \cdot x\right)}{c \cdot \left(c \cdot \left(s \cdot \left(s \cdot \left(x \cdot x\right)\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{s \cdot t\_0}}{x \cdot c}\\
\end{array}
\end{array}
if x < 9.5000000000000005e-6Initial program 62.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.4%
Simplified81.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-*.f6498.1%
Applied egg-rr98.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified67.8%
if 9.5000000000000005e-6 < x < 3.9000000000000002e130Initial program 79.1%
/-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-*.f6489.9%
Simplified89.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6483.7%
Simplified83.7%
if 3.9000000000000002e130 < x Initial program 61.1%
/-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.5%
Simplified79.5%
Taylor expanded in x around 0
Simplified76.2%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-/r*N/A
associate-/l/N/A
associate-/l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6479.9%
Applied egg-rr79.9%
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* x (* s c))))
(if (<= x 0.00041)
(/ (/ (* (+ 1.0 (* (* x x) -2.0)) (/ (/ 1.0 c) s)) x) t_0)
(/ (/ (cos (* 2.0 x)) s) (* x (* c t_0))))))
double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if (x <= 0.00041) {
tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0;
} else {
tmp = (cos((2.0 * x)) / s) / (x * (c * 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 = x * (s * c)
if (x <= 0.00041d0) then
tmp = (((1.0d0 + ((x * x) * (-2.0d0))) * ((1.0d0 / c) / s)) / x) / t_0
else
tmp = (cos((2.0d0 * x)) / s) / (x * (c * t_0))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if (x <= 0.00041) {
tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0;
} else {
tmp = (Math.cos((2.0 * x)) / s) / (x * (c * t_0));
}
return tmp;
}
def code(x, c, s): t_0 = x * (s * c) tmp = 0 if x <= 0.00041: tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0 else: tmp = (math.cos((2.0 * x)) / s) / (x * (c * t_0)) return tmp
function code(x, c, s) t_0 = Float64(x * Float64(s * c)) tmp = 0.0 if (x <= 0.00041) tmp = Float64(Float64(Float64(Float64(1.0 + Float64(Float64(x * x) * -2.0)) * Float64(Float64(1.0 / c) / s)) / x) / t_0); else tmp = Float64(Float64(cos(Float64(2.0 * x)) / s) / Float64(x * Float64(c * t_0))); end return tmp end
function tmp_2 = code(x, c, s) t_0 = x * (s * c); tmp = 0.0; if (x <= 0.00041) tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0; else tmp = (cos((2.0 * x)) / s) / (x * (c * t_0)); end tmp_2 = tmp; end
code[x_, c_, s_] := Block[{t$95$0 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.00041], N[(N[(N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / c), $MachinePrecision] / s), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / s), $MachinePrecision] / N[(x * N[(c * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(s \cdot c\right)\\
\mathbf{if}\;x \leq 0.00041:\\
\;\;\;\;\frac{\frac{\left(1 + \left(x \cdot x\right) \cdot -2\right) \cdot \frac{\frac{1}{c}}{s}}{x}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cos \left(2 \cdot x\right)}{s}}{x \cdot \left(c \cdot t\_0\right)}\\
\end{array}
\end{array}
if x < 4.0999999999999999e-4Initial 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-*.f6481.4%
Simplified81.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-*.f6498.2%
Applied egg-rr98.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified67.9%
if 4.0999999999999999e-4 < x Initial program 71.4%
/-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-*.f6484.8%
Simplified84.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-*.f6496.9%
Applied egg-rr96.9%
associate-*r*N/A
div-invN/A
times-fracN/A
associate-*l/N/A
associate-/r*N/A
associate-/l/N/A
associate-/l*N/A
associate-*l/N/A
associate-/r*N/A
associate-*l/N/A
div-invN/A
associate-/l/N/A
associate-*r*N/A
Applied egg-rr94.2%
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* x (* s c))))
(if (<= x 0.00038)
(/ (/ (* (+ 1.0 (* (* x x) -2.0)) (/ (/ 1.0 c) s)) x) t_0)
(/ (cos (* 2.0 x)) (* s (* x (* c t_0)))))))
double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if (x <= 0.00038) {
tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0;
} else {
tmp = cos((2.0 * x)) / (s * (x * (c * 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 = x * (s * c)
if (x <= 0.00038d0) then
tmp = (((1.0d0 + ((x * x) * (-2.0d0))) * ((1.0d0 / c) / s)) / x) / t_0
else
tmp = cos((2.0d0 * x)) / (s * (x * (c * t_0)))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if (x <= 0.00038) {
tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0;
} else {
tmp = Math.cos((2.0 * x)) / (s * (x * (c * t_0)));
}
return tmp;
}
def code(x, c, s): t_0 = x * (s * c) tmp = 0 if x <= 0.00038: tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0 else: tmp = math.cos((2.0 * x)) / (s * (x * (c * t_0))) return tmp
function code(x, c, s) t_0 = Float64(x * Float64(s * c)) tmp = 0.0 if (x <= 0.00038) tmp = Float64(Float64(Float64(Float64(1.0 + Float64(Float64(x * x) * -2.0)) * Float64(Float64(1.0 / c) / s)) / x) / t_0); else tmp = Float64(cos(Float64(2.0 * x)) / Float64(s * Float64(x * Float64(c * t_0)))); end return tmp end
function tmp_2 = code(x, c, s) t_0 = x * (s * c); tmp = 0.0; if (x <= 0.00038) tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0; else tmp = cos((2.0 * x)) / (s * (x * (c * t_0))); end tmp_2 = tmp; end
code[x_, c_, s_] := Block[{t$95$0 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.00038], N[(N[(N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / c), $MachinePrecision] / s), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(s * N[(x * N[(c * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(s \cdot c\right)\\
\mathbf{if}\;x \leq 0.00038:\\
\;\;\;\;\frac{\frac{\left(1 + \left(x \cdot x\right) \cdot -2\right) \cdot \frac{\frac{1}{c}}{s}}{x}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(2 \cdot x\right)}{s \cdot \left(x \cdot \left(c \cdot t\_0\right)\right)}\\
\end{array}
\end{array}
if x < 3.8000000000000002e-4Initial 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-*.f6481.4%
Simplified81.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-*.f6498.2%
Applied egg-rr98.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified67.9%
if 3.8000000000000002e-4 < x Initial program 71.4%
/-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-*.f6484.8%
Simplified84.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.8%
Simplified79.8%
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6493.1%
Applied egg-rr93.1%
Final simplification74.6%
(FPCore (x c s) :precision binary64 (if (<= x 4.6e-47) (/ (/ 1.0 (* x s)) (* (* x s) (* c c))) (/ (cos (* 2.0 x)) (* x (* (* x c) (* s (* s c)))))))
double code(double x, double c, double s) {
double tmp;
if (x <= 4.6e-47) {
tmp = (1.0 / (x * s)) / ((x * s) * (c * c));
} else {
tmp = cos((2.0 * x)) / (x * ((x * c) * (s * (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 <= 4.6d-47) then
tmp = (1.0d0 / (x * s)) / ((x * s) * (c * c))
else
tmp = cos((2.0d0 * x)) / (x * ((x * c) * (s * (s * c))))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (x <= 4.6e-47) {
tmp = (1.0 / (x * s)) / ((x * s) * (c * c));
} else {
tmp = Math.cos((2.0 * x)) / (x * ((x * c) * (s * (s * c))));
}
return tmp;
}
def code(x, c, s): tmp = 0 if x <= 4.6e-47: tmp = (1.0 / (x * s)) / ((x * s) * (c * c)) else: tmp = math.cos((2.0 * x)) / (x * ((x * c) * (s * (s * c)))) return tmp
function code(x, c, s) tmp = 0.0 if (x <= 4.6e-47) tmp = Float64(Float64(1.0 / Float64(x * s)) / Float64(Float64(x * s) * Float64(c * c))); else tmp = Float64(cos(Float64(2.0 * x)) / Float64(x * Float64(Float64(x * c) * Float64(s * Float64(s * c))))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (x <= 4.6e-47) tmp = (1.0 / (x * s)) / ((x * s) * (c * c)); else tmp = cos((2.0 * x)) / (x * ((x * c) * (s * (s * c)))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[x, 4.6e-47], N[(N[(1.0 / N[(x * s), $MachinePrecision]), $MachinePrecision] / N[(N[(x * s), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(x * N[(N[(x * c), $MachinePrecision] * N[(s * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.6 \cdot 10^{-47}:\\
\;\;\;\;\frac{\frac{1}{x \cdot s}}{\left(x \cdot s\right) \cdot \left(c \cdot c\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(\left(x \cdot c\right) \cdot \left(s \cdot \left(s \cdot c\right)\right)\right)}\\
\end{array}
\end{array}
if x < 4.59999999999999964e-47Initial 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-*.f6480.9%
Simplified80.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-*.f6498.1%
Applied egg-rr98.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.1%
Simplified66.1%
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-/l/N/A
div-invN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
div-invN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.8%
Applied egg-rr70.8%
if 4.59999999999999964e-47 < x Initial program 71.1%
/-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-*.f6485.9%
Simplified85.9%
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6488.1%
Applied egg-rr88.1%
Final simplification75.8%
(FPCore (x c s) :precision binary64 (if (<= x 7.5e-48) (/ (/ 1.0 (* x s)) (* (* x s) (* c c))) (/ (cos (* 2.0 x)) (* x (* c (* s (* x (* s c))))))))
double code(double x, double c, double s) {
double tmp;
if (x <= 7.5e-48) {
tmp = (1.0 / (x * s)) / ((x * s) * (c * c));
} else {
tmp = cos((2.0 * x)) / (x * (c * (s * (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) :: tmp
if (x <= 7.5d-48) then
tmp = (1.0d0 / (x * s)) / ((x * s) * (c * c))
else
tmp = cos((2.0d0 * x)) / (x * (c * (s * (x * (s * c)))))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (x <= 7.5e-48) {
tmp = (1.0 / (x * s)) / ((x * s) * (c * c));
} else {
tmp = Math.cos((2.0 * x)) / (x * (c * (s * (x * (s * c)))));
}
return tmp;
}
def code(x, c, s): tmp = 0 if x <= 7.5e-48: tmp = (1.0 / (x * s)) / ((x * s) * (c * c)) else: tmp = math.cos((2.0 * x)) / (x * (c * (s * (x * (s * c))))) return tmp
function code(x, c, s) tmp = 0.0 if (x <= 7.5e-48) tmp = Float64(Float64(1.0 / Float64(x * s)) / Float64(Float64(x * s) * Float64(c * c))); else tmp = Float64(cos(Float64(2.0 * x)) / Float64(x * Float64(c * Float64(s * Float64(x * Float64(s * c)))))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (x <= 7.5e-48) tmp = (1.0 / (x * s)) / ((x * s) * (c * c)); else tmp = cos((2.0 * x)) / (x * (c * (s * (x * (s * c))))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[x, 7.5e-48], N[(N[(1.0 / N[(x * s), $MachinePrecision]), $MachinePrecision] / N[(N[(x * s), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(x * N[(c * N[(s * N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7.5 \cdot 10^{-48}:\\
\;\;\;\;\frac{\frac{1}{x \cdot s}}{\left(x \cdot s\right) \cdot \left(c \cdot c\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(c \cdot \left(s \cdot \left(x \cdot \left(s \cdot c\right)\right)\right)\right)}\\
\end{array}
\end{array}
if x < 7.50000000000000042e-48Initial 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-*.f6480.9%
Simplified80.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-*.f6498.1%
Applied egg-rr98.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6466.1%
Simplified66.1%
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-/l/N/A
div-invN/A
associate-/r*N/A
associate-/r*N/A
frac-timesN/A
div-invN/A
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.8%
Applied egg-rr70.8%
if 7.50000000000000042e-48 < x Initial program 71.1%
/-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-*.f6485.9%
Simplified85.9%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6492.8%
Applied egg-rr92.8%
Final simplification77.1%
(FPCore (x c s) :precision binary64 (if (<= x 7e-5) (/ (/ (* (+ 1.0 (* (* x x) -2.0)) (/ (/ 1.0 c) s)) x) (* 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 <= 7e-5) {
tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / (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 <= 7d-5) then
tmp = (((1.0d0 + ((x * x) * (-2.0d0))) * ((1.0d0 / c) / s)) / x) / (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 <= 7e-5) {
tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / (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 <= 7e-5: tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / (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 <= 7e-5) tmp = Float64(Float64(Float64(Float64(1.0 + Float64(Float64(x * x) * -2.0)) * Float64(Float64(1.0 / c) / s)) / x) / Float64(x * Float64(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 <= 7e-5) tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / (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, 7e-5], N[(N[(N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / c), $MachinePrecision] / s), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]), $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 7 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{\left(1 + \left(x \cdot x\right) \cdot -2\right) \cdot \frac{\frac{1}{c}}{s}}{x}}{x \cdot \left(s \cdot c\right)}\\
\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 < 6.9999999999999994e-5Initial 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-*.f6481.4%
Simplified81.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-*.f6498.2%
Applied egg-rr98.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified67.9%
if 6.9999999999999994e-5 < x Initial program 71.4%
/-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-*.f6484.8%
Simplified84.8%
Final simplification72.4%
(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(Float64(cos(Float64(2.0 * x)) / 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[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(s \cdot c\right)\\
\frac{\frac{\cos \left(2 \cdot x\right)}{t\_0}}{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-*.f6482.3%
Simplified82.3%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
unswap-sqrN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
count-2N/A
cos-lowering-cos.f64N/A
count-2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.8%
Applied egg-rr97.8%
(FPCore (x c s)
:precision binary64
(let* ((t_0 (* x (* s c))))
(if (<= x 1.85e+77)
(/ (/ (* (+ 1.0 (* (* x x) -2.0)) (/ (/ 1.0 c) s)) x) t_0)
(/ (/ 1.0 (* s (* x c))) t_0))))
double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if (x <= 1.85e+77) {
tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0;
} else {
tmp = (1.0 / (s * (x * c))) / 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 = x * (s * c)
if (x <= 1.85d+77) then
tmp = (((1.0d0 + ((x * x) * (-2.0d0))) * ((1.0d0 / c) / s)) / x) / t_0
else
tmp = (1.0d0 / (s * (x * c))) / t_0
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double t_0 = x * (s * c);
double tmp;
if (x <= 1.85e+77) {
tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0;
} else {
tmp = (1.0 / (s * (x * c))) / t_0;
}
return tmp;
}
def code(x, c, s): t_0 = x * (s * c) tmp = 0 if x <= 1.85e+77: tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0 else: tmp = (1.0 / (s * (x * c))) / t_0 return tmp
function code(x, c, s) t_0 = Float64(x * Float64(s * c)) tmp = 0.0 if (x <= 1.85e+77) tmp = Float64(Float64(Float64(Float64(1.0 + Float64(Float64(x * x) * -2.0)) * Float64(Float64(1.0 / c) / s)) / x) / t_0); else tmp = Float64(Float64(1.0 / Float64(s * Float64(x * c))) / t_0); end return tmp end
function tmp_2 = code(x, c, s) t_0 = x * (s * c); tmp = 0.0; if (x <= 1.85e+77) tmp = (((1.0 + ((x * x) * -2.0)) * ((1.0 / c) / s)) / x) / t_0; else tmp = (1.0 / (s * (x * c))) / t_0; end tmp_2 = tmp; end
code[x_, c_, s_] := Block[{t$95$0 = N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.85e+77], N[(N[(N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / c), $MachinePrecision] / s), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(1.0 / N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(s \cdot c\right)\\
\mathbf{if}\;x \leq 1.85 \cdot 10^{+77}:\\
\;\;\;\;\frac{\frac{\left(1 + \left(x \cdot x\right) \cdot -2\right) \cdot \frac{\frac{1}{c}}{s}}{x}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{s \cdot \left(x \cdot c\right)}}{t\_0}\\
\end{array}
\end{array}
if x < 1.84999999999999997e77Initial program 64.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-*.f6482.1%
Simplified82.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-*.f6498.3%
Applied egg-rr98.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified67.9%
if 1.84999999999999997e77 < x Initial program 65.1%
/-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-*.f6483.1%
Simplified83.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-*.f6496.0%
Applied egg-rr96.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6475.8%
Simplified75.8%
Final simplification69.5%
(FPCore (x c s) :precision binary64 (if (<= x 1.2e+76) (/ (/ 1.0 (/ (* x s) (/ (+ 1.0 (* (* x x) -2.0)) (* c c)))) (* x s)) (/ (/ 1.0 (* s (* x c))) (* x (* s c)))))
double code(double x, double c, double s) {
double tmp;
if (x <= 1.2e+76) {
tmp = (1.0 / ((x * s) / ((1.0 + ((x * x) * -2.0)) / (c * c)))) / (x * s);
} else {
tmp = (1.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) :: tmp
if (x <= 1.2d+76) then
tmp = (1.0d0 / ((x * s) / ((1.0d0 + ((x * x) * (-2.0d0))) / (c * c)))) / (x * s)
else
tmp = (1.0d0 / (s * (x * c))) / (x * (s * c))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (x <= 1.2e+76) {
tmp = (1.0 / ((x * s) / ((1.0 + ((x * x) * -2.0)) / (c * c)))) / (x * s);
} else {
tmp = (1.0 / (s * (x * c))) / (x * (s * c));
}
return tmp;
}
def code(x, c, s): tmp = 0 if x <= 1.2e+76: tmp = (1.0 / ((x * s) / ((1.0 + ((x * x) * -2.0)) / (c * c)))) / (x * s) else: tmp = (1.0 / (s * (x * c))) / (x * (s * c)) return tmp
function code(x, c, s) tmp = 0.0 if (x <= 1.2e+76) tmp = Float64(Float64(1.0 / Float64(Float64(x * s) / Float64(Float64(1.0 + Float64(Float64(x * x) * -2.0)) / Float64(c * c)))) / Float64(x * s)); else tmp = Float64(Float64(1.0 / Float64(s * Float64(x * c))) / Float64(x * Float64(s * c))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (x <= 1.2e+76) tmp = (1.0 / ((x * s) / ((1.0 + ((x * x) * -2.0)) / (c * c)))) / (x * s); else tmp = (1.0 / (s * (x * c))) / (x * (s * c)); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[x, 1.2e+76], N[(N[(1.0 / N[(N[(x * s), $MachinePrecision] / N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] / N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * s), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.2 \cdot 10^{+76}:\\
\;\;\;\;\frac{\frac{1}{\frac{x \cdot s}{\frac{1 + \left(x \cdot x\right) \cdot -2}{c \cdot c}}}}{x \cdot s}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{s \cdot \left(x \cdot c\right)}}{x \cdot \left(s \cdot c\right)}\\
\end{array}
\end{array}
if x < 1.2e76Initial program 64.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-*.f6482.1%
Simplified82.1%
associate-/l/N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr77.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified55.7%
*-commutativeN/A
associate-/l/N/A
associate-*l/N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6455.4%
Applied egg-rr55.4%
times-fracN/A
*-commutativeN/A
associate-/l/N/A
div-invN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6457.5%
Applied egg-rr57.5%
if 1.2e76 < x Initial program 65.1%
/-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-*.f6483.1%
Simplified83.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-*.f6496.0%
Applied egg-rr96.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6475.8%
Simplified75.8%
Final simplification61.1%
(FPCore (x c s) :precision binary64 (if (<= x 1.2e+76) (/ (* (/ 1.0 (* x s)) (/ (+ 1.0 (* (* x x) -2.0)) (* c c))) (* x s)) (/ (/ 1.0 (* s (* x c))) (* x (* s c)))))
double code(double x, double c, double s) {
double tmp;
if (x <= 1.2e+76) {
tmp = ((1.0 / (x * s)) * ((1.0 + ((x * x) * -2.0)) / (c * c))) / (x * s);
} else {
tmp = (1.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) :: tmp
if (x <= 1.2d+76) then
tmp = ((1.0d0 / (x * s)) * ((1.0d0 + ((x * x) * (-2.0d0))) / (c * c))) / (x * s)
else
tmp = (1.0d0 / (s * (x * c))) / (x * (s * c))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (x <= 1.2e+76) {
tmp = ((1.0 / (x * s)) * ((1.0 + ((x * x) * -2.0)) / (c * c))) / (x * s);
} else {
tmp = (1.0 / (s * (x * c))) / (x * (s * c));
}
return tmp;
}
def code(x, c, s): tmp = 0 if x <= 1.2e+76: tmp = ((1.0 / (x * s)) * ((1.0 + ((x * x) * -2.0)) / (c * c))) / (x * s) else: tmp = (1.0 / (s * (x * c))) / (x * (s * c)) return tmp
function code(x, c, s) tmp = 0.0 if (x <= 1.2e+76) tmp = Float64(Float64(Float64(1.0 / Float64(x * s)) * Float64(Float64(1.0 + Float64(Float64(x * x) * -2.0)) / Float64(c * c))) / Float64(x * s)); else tmp = Float64(Float64(1.0 / Float64(s * Float64(x * c))) / Float64(x * Float64(s * c))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (x <= 1.2e+76) tmp = ((1.0 / (x * s)) * ((1.0 + ((x * x) * -2.0)) / (c * c))) / (x * s); else tmp = (1.0 / (s * (x * c))) / (x * (s * c)); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[x, 1.2e+76], N[(N[(N[(1.0 / N[(x * s), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(x * x), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] / N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * s), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.2 \cdot 10^{+76}:\\
\;\;\;\;\frac{\frac{1}{x \cdot s} \cdot \frac{1 + \left(x \cdot x\right) \cdot -2}{c \cdot c}}{x \cdot s}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{s \cdot \left(x \cdot c\right)}}{x \cdot \left(s \cdot c\right)}\\
\end{array}
\end{array}
if x < 1.2e76Initial program 64.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-*.f6482.1%
Simplified82.1%
associate-/l/N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr77.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified55.7%
associate-*r/N/A
times-fracN/A
associate-/l*N/A
associate-/l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6457.5%
Applied egg-rr57.5%
if 1.2e76 < x Initial program 65.1%
/-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-*.f6483.1%
Simplified83.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-*.f6496.0%
Applied egg-rr96.0%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6475.8%
Simplified75.8%
Final simplification61.0%
(FPCore (x c s)
:precision binary64
(if (<= x 2.7e+16)
(/ 1.0 (* c (* c (* (* x s) (* x s)))))
(if (<= x 1.65e+87)
(/ -2.0 (* c (* c (* s s))))
(/ 1.0 (* s (* (* x (* s c)) (* x c)))))))
double code(double x, double c, double s) {
double tmp;
if (x <= 2.7e+16) {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
} else if (x <= 1.65e+87) {
tmp = -2.0 / (c * (c * (s * s)));
} else {
tmp = 1.0 / (s * ((x * (s * c)) * (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 (x <= 2.7d+16) then
tmp = 1.0d0 / (c * (c * ((x * s) * (x * s))))
else if (x <= 1.65d+87) then
tmp = (-2.0d0) / (c * (c * (s * s)))
else
tmp = 1.0d0 / (s * ((x * (s * c)) * (x * c)))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (x <= 2.7e+16) {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
} else if (x <= 1.65e+87) {
tmp = -2.0 / (c * (c * (s * s)));
} else {
tmp = 1.0 / (s * ((x * (s * c)) * (x * c)));
}
return tmp;
}
def code(x, c, s): tmp = 0 if x <= 2.7e+16: tmp = 1.0 / (c * (c * ((x * s) * (x * s)))) elif x <= 1.65e+87: tmp = -2.0 / (c * (c * (s * s))) else: tmp = 1.0 / (s * ((x * (s * c)) * (x * c))) return tmp
function code(x, c, s) tmp = 0.0 if (x <= 2.7e+16) tmp = Float64(1.0 / Float64(c * Float64(c * Float64(Float64(x * s) * Float64(x * s))))); elseif (x <= 1.65e+87) tmp = Float64(-2.0 / Float64(c * Float64(c * Float64(s * s)))); else tmp = Float64(1.0 / Float64(s * Float64(Float64(x * Float64(s * c)) * Float64(x * c)))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (x <= 2.7e+16) tmp = 1.0 / (c * (c * ((x * s) * (x * s)))); elseif (x <= 1.65e+87) tmp = -2.0 / (c * (c * (s * s))); else tmp = 1.0 / (s * ((x * (s * c)) * (x * c))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[x, 2.7e+16], N[(1.0 / N[(c * N[(c * N[(N[(x * s), $MachinePrecision] * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e+87], N[(-2.0 / N[(c * N[(c * N[(s * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(s * N[(N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision] * N[(x * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7 \cdot 10^{+16}:\\
\;\;\;\;\frac{1}{c \cdot \left(c \cdot \left(\left(x \cdot s\right) \cdot \left(x \cdot s\right)\right)\right)}\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+87}:\\
\;\;\;\;\frac{-2}{c \cdot \left(c \cdot \left(s \cdot s\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{s \cdot \left(\left(x \cdot \left(s \cdot c\right)\right) \cdot \left(x \cdot c\right)\right)}\\
\end{array}
\end{array}
if x < 2.7e16Initial program 63.4%
/-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-*.f6498.2%
Applied egg-rr98.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6465.9%
Simplified65.9%
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6474.5%
Applied egg-rr74.5%
if 2.7e16 < x < 1.6500000000000001e87Initial program 81.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-*.f6488.2%
Simplified88.2%
associate-/l/N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr87.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified70.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.2%
Simplified70.2%
Taylor expanded in s around 0
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6469.9%
Simplified69.9%
if 1.6500000000000001e87 < x Initial 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-*.f6482.4%
Simplified82.4%
Taylor expanded in x around 0
Simplified74.4%
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
unswap-sqrN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6476.9%
Applied egg-rr76.9%
Final simplification74.7%
(FPCore (x c s)
:precision binary64
(if (<= x 2.7e+16)
(/ 1.0 (* c (* c (* (* x s) (* x s)))))
(if (<= x 1.35e+87)
(/ -2.0 (* c (* c (* s s))))
(/ 1.0 (* (* s s) (* c (* x (* x c))))))))
double code(double x, double c, double s) {
double tmp;
if (x <= 2.7e+16) {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
} else if (x <= 1.35e+87) {
tmp = -2.0 / (c * (c * (s * s)));
} else {
tmp = 1.0 / ((s * s) * (c * (x * (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 (x <= 2.7d+16) then
tmp = 1.0d0 / (c * (c * ((x * s) * (x * s))))
else if (x <= 1.35d+87) then
tmp = (-2.0d0) / (c * (c * (s * s)))
else
tmp = 1.0d0 / ((s * s) * (c * (x * (x * c))))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (x <= 2.7e+16) {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
} else if (x <= 1.35e+87) {
tmp = -2.0 / (c * (c * (s * s)));
} else {
tmp = 1.0 / ((s * s) * (c * (x * (x * c))));
}
return tmp;
}
def code(x, c, s): tmp = 0 if x <= 2.7e+16: tmp = 1.0 / (c * (c * ((x * s) * (x * s)))) elif x <= 1.35e+87: tmp = -2.0 / (c * (c * (s * s))) else: tmp = 1.0 / ((s * s) * (c * (x * (x * c)))) return tmp
function code(x, c, s) tmp = 0.0 if (x <= 2.7e+16) tmp = Float64(1.0 / Float64(c * Float64(c * Float64(Float64(x * s) * Float64(x * s))))); elseif (x <= 1.35e+87) tmp = Float64(-2.0 / Float64(c * Float64(c * Float64(s * s)))); else tmp = Float64(1.0 / Float64(Float64(s * s) * Float64(c * Float64(x * Float64(x * c))))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (x <= 2.7e+16) tmp = 1.0 / (c * (c * ((x * s) * (x * s)))); elseif (x <= 1.35e+87) tmp = -2.0 / (c * (c * (s * s))); else tmp = 1.0 / ((s * s) * (c * (x * (x * c)))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[x, 2.7e+16], N[(1.0 / N[(c * N[(c * N[(N[(x * s), $MachinePrecision] * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+87], N[(-2.0 / N[(c * N[(c * N[(s * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(s * s), $MachinePrecision] * N[(c * N[(x * N[(x * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7 \cdot 10^{+16}:\\
\;\;\;\;\frac{1}{c \cdot \left(c \cdot \left(\left(x \cdot s\right) \cdot \left(x \cdot s\right)\right)\right)}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+87}:\\
\;\;\;\;\frac{-2}{c \cdot \left(c \cdot \left(s \cdot s\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\left(s \cdot s\right) \cdot \left(c \cdot \left(x \cdot \left(x \cdot c\right)\right)\right)}\\
\end{array}
\end{array}
if x < 2.7e16Initial program 63.4%
/-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-*.f6498.2%
Applied egg-rr98.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6465.9%
Simplified65.9%
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6474.5%
Applied egg-rr74.5%
if 2.7e16 < x < 1.35000000000000003e87Initial program 81.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-*.f6488.2%
Simplified88.2%
associate-/l/N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr87.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified70.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.2%
Simplified70.2%
Taylor expanded in s around 0
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6469.9%
Simplified69.9%
if 1.35000000000000003e87 < x Initial 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-*.f6482.4%
Simplified82.4%
Taylor expanded in x around 0
Simplified74.4%
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6469.6%
Applied egg-rr69.6%
Final simplification73.3%
(FPCore (x c s)
:precision binary64
(if (<= x 2.7e+16)
(/ 1.0 (* c (* c (* (* x s) (* x s)))))
(if (<= x 1.65e+87)
(/ -2.0 (* c (* c (* s s))))
(/ 1.0 (* x (* c (* s (* s (* x c)))))))))
double code(double x, double c, double s) {
double tmp;
if (x <= 2.7e+16) {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
} else if (x <= 1.65e+87) {
tmp = -2.0 / (c * (c * (s * s)));
} else {
tmp = 1.0 / (x * (c * (s * (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 (x <= 2.7d+16) then
tmp = 1.0d0 / (c * (c * ((x * s) * (x * s))))
else if (x <= 1.65d+87) then
tmp = (-2.0d0) / (c * (c * (s * s)))
else
tmp = 1.0d0 / (x * (c * (s * (s * (x * c)))))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (x <= 2.7e+16) {
tmp = 1.0 / (c * (c * ((x * s) * (x * s))));
} else if (x <= 1.65e+87) {
tmp = -2.0 / (c * (c * (s * s)));
} else {
tmp = 1.0 / (x * (c * (s * (s * (x * c)))));
}
return tmp;
}
def code(x, c, s): tmp = 0 if x <= 2.7e+16: tmp = 1.0 / (c * (c * ((x * s) * (x * s)))) elif x <= 1.65e+87: tmp = -2.0 / (c * (c * (s * s))) else: tmp = 1.0 / (x * (c * (s * (s * (x * c))))) return tmp
function code(x, c, s) tmp = 0.0 if (x <= 2.7e+16) tmp = Float64(1.0 / Float64(c * Float64(c * Float64(Float64(x * s) * Float64(x * s))))); elseif (x <= 1.65e+87) tmp = Float64(-2.0 / Float64(c * Float64(c * Float64(s * s)))); else tmp = Float64(1.0 / Float64(x * Float64(c * Float64(s * Float64(s * Float64(x * c)))))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (x <= 2.7e+16) tmp = 1.0 / (c * (c * ((x * s) * (x * s)))); elseif (x <= 1.65e+87) tmp = -2.0 / (c * (c * (s * s))); else tmp = 1.0 / (x * (c * (s * (s * (x * c))))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[x, 2.7e+16], N[(1.0 / N[(c * N[(c * N[(N[(x * s), $MachinePrecision] * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e+87], N[(-2.0 / N[(c * N[(c * N[(s * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(x * N[(c * N[(s * N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.7 \cdot 10^{+16}:\\
\;\;\;\;\frac{1}{c \cdot \left(c \cdot \left(\left(x \cdot s\right) \cdot \left(x \cdot s\right)\right)\right)}\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+87}:\\
\;\;\;\;\frac{-2}{c \cdot \left(c \cdot \left(s \cdot s\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \left(c \cdot \left(s \cdot \left(s \cdot \left(x \cdot c\right)\right)\right)\right)}\\
\end{array}
\end{array}
if x < 2.7e16Initial program 63.4%
/-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-*.f6498.2%
Applied egg-rr98.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6465.9%
Simplified65.9%
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6474.5%
Applied egg-rr74.5%
if 2.7e16 < x < 1.6500000000000001e87Initial program 81.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-*.f6488.2%
Simplified88.2%
associate-/l/N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr87.6%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified70.0%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6470.2%
Simplified70.2%
Taylor expanded in s around 0
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6469.9%
Simplified69.9%
if 1.6500000000000001e87 < x Initial 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-*.f6482.4%
Simplified82.4%
Taylor expanded in x around 0
Simplified74.4%
Taylor expanded in x around 0
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6476.9%
Simplified76.9%
Final simplification74.7%
(FPCore (x c s) :precision binary64 (if (<= s 9.2e-29) (/ (- 0.0 2.0) (* s (* c (* s c)))) (/ 1.0 (* c (* c (* s (* s (* x x))))))))
double code(double x, double c, double s) {
double tmp;
if (s <= 9.2e-29) {
tmp = (0.0 - 2.0) / (s * (c * (s * c)));
} else {
tmp = 1.0 / (c * (c * (s * (s * (x * 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 (s <= 9.2d-29) then
tmp = (0.0d0 - 2.0d0) / (s * (c * (s * c)))
else
tmp = 1.0d0 / (c * (c * (s * (s * (x * x)))))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (s <= 9.2e-29) {
tmp = (0.0 - 2.0) / (s * (c * (s * c)));
} else {
tmp = 1.0 / (c * (c * (s * (s * (x * x)))));
}
return tmp;
}
def code(x, c, s): tmp = 0 if s <= 9.2e-29: tmp = (0.0 - 2.0) / (s * (c * (s * c))) else: tmp = 1.0 / (c * (c * (s * (s * (x * x))))) return tmp
function code(x, c, s) tmp = 0.0 if (s <= 9.2e-29) tmp = Float64(Float64(0.0 - 2.0) / Float64(s * Float64(c * Float64(s * c)))); else tmp = Float64(1.0 / Float64(c * Float64(c * Float64(s * Float64(s * Float64(x * x)))))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (s <= 9.2e-29) tmp = (0.0 - 2.0) / (s * (c * (s * c))); else tmp = 1.0 / (c * (c * (s * (s * (x * x))))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[s, 9.2e-29], N[(N[(0.0 - 2.0), $MachinePrecision] / N[(s * N[(c * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(c * N[(c * N[(s * N[(s * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;s \leq 9.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{0 - 2}{s \cdot \left(c \cdot \left(s \cdot c\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{c \cdot \left(c \cdot \left(s \cdot \left(s \cdot \left(x \cdot x\right)\right)\right)\right)}\\
\end{array}
\end{array}
if s < 9.19999999999999965e-29Initial program 62.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-*.f6480.1%
Simplified80.1%
associate-/l/N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr77.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified48.6%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6424.2%
Simplified24.2%
frac-2negN/A
metadata-evalN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6440.7%
Applied egg-rr40.7%
if 9.19999999999999965e-29 < s Initial program 70.4%
/-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-*.f6488.0%
Simplified88.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.5%
Applied egg-rr98.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.4%
Simplified76.4%
Final simplification39.1%
(FPCore (x c s) :precision binary64 (if (<= x 0.78) (/ (- 0.0 2.0) (* s (* c (* s c)))) (/ -2.0 (* c (* c (* s s))))))
double code(double x, double c, double s) {
double tmp;
if (x <= 0.78) {
tmp = (0.0 - 2.0) / (s * (c * (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 (x <= 0.78d0) then
tmp = (0.0d0 - 2.0d0) / (s * (c * (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 (x <= 0.78) {
tmp = (0.0 - 2.0) / (s * (c * (s * c)));
} else {
tmp = -2.0 / (c * (c * (s * s)));
}
return tmp;
}
def code(x, c, s): tmp = 0 if x <= 0.78: tmp = (0.0 - 2.0) / (s * (c * (s * c))) else: tmp = -2.0 / (c * (c * (s * s))) return tmp
function code(x, c, s) tmp = 0.0 if (x <= 0.78) tmp = Float64(Float64(0.0 - 2.0) / Float64(s * Float64(c * 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 (x <= 0.78) tmp = (0.0 - 2.0) / (s * (c * (s * c))); else tmp = -2.0 / (c * (c * (s * s))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[x, 0.78], N[(N[(0.0 - 2.0), $MachinePrecision] / N[(s * N[(c * 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}\;x \leq 0.78:\\
\;\;\;\;\frac{0 - 2}{s \cdot \left(c \cdot \left(s \cdot c\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{c \cdot \left(c \cdot \left(s \cdot s\right)\right)}\\
\end{array}
\end{array}
if x < 0.78000000000000003Initial 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-*.f6481.4%
Simplified81.4%
associate-/l/N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr75.7%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified54.5%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6423.2%
Simplified23.2%
frac-2negN/A
metadata-evalN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6442.5%
Applied egg-rr42.5%
if 0.78000000000000003 < x Initial program 71.4%
/-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-*.f6484.8%
Simplified84.8%
associate-/l/N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr84.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified30.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6439.1%
Simplified39.1%
Taylor expanded in s around 0
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6441.7%
Simplified41.7%
Final simplification28.1%
(FPCore (x c s) :precision binary64 (/ 1.0 (* (* x (* s c)) (/ x (/ 1.0 (* s c))))))
double code(double x, double c, double s) {
return 1.0 / ((x * (s * c)) * (x / (1.0 / (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 / ((x * (s * c)) * (x / (1.0d0 / (s * c))))
end function
public static double code(double x, double c, double s) {
return 1.0 / ((x * (s * c)) * (x / (1.0 / (s * c))));
}
def code(x, c, s): return 1.0 / ((x * (s * c)) * (x / (1.0 / (s * c))))
function code(x, c, s) return Float64(1.0 / Float64(Float64(x * Float64(s * c)) * Float64(x / Float64(1.0 / Float64(s * c))))) end
function tmp = code(x, c, s) tmp = 1.0 / ((x * (s * c)) * (x / (1.0 / (s * c)))); end
code[x_, c_, s_] := N[(1.0 / N[(N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision] * N[(x / N[(1.0 / N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\left(x \cdot \left(s \cdot c\right)\right) \cdot \frac{x}{\frac{1}{s \cdot 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-*.f6482.3%
Simplified82.3%
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.8%
Applied egg-rr97.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.6%
Simplified64.6%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
swap-sqrN/A
associate-*r*N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
/-rgt-identityN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
inv-powN/A
associate-/r/N/A
*-lowering-*.f64N/A
Applied egg-rr78.2%
Final simplification78.2%
(FPCore (x c s) :precision binary64 (/ 1.0 (* (* x (* s c)) (/ (* s c) (/ 1.0 x)))))
double code(double x, double c, double s) {
return 1.0 / ((x * (s * c)) * ((s * c) / (1.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 = 1.0d0 / ((x * (s * c)) * ((s * c) / (1.0d0 / x)))
end function
public static double code(double x, double c, double s) {
return 1.0 / ((x * (s * c)) * ((s * c) / (1.0 / x)));
}
def code(x, c, s): return 1.0 / ((x * (s * c)) * ((s * c) / (1.0 / x)))
function code(x, c, s) return Float64(1.0 / Float64(Float64(x * Float64(s * c)) * Float64(Float64(s * c) / Float64(1.0 / x)))) end
function tmp = code(x, c, s) tmp = 1.0 / ((x * (s * c)) * ((s * c) / (1.0 / x))); end
code[x_, c_, s_] := N[(1.0 / N[(N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision] * N[(N[(s * c), $MachinePrecision] / N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\left(x \cdot \left(s \cdot c\right)\right) \cdot \frac{s \cdot c}{\frac{1}{x}}}
\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-*.f6482.3%
Simplified82.3%
Taylor expanded in x around 0
Simplified69.1%
remove-double-divN/A
associate-/r*N/A
clear-numN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-/l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f6478.2%
Applied egg-rr78.2%
(FPCore (x c s) :precision binary64 (/ (/ 1.0 (* s (* x c))) (* x (* s c))))
double code(double x, double c, double s) {
return (1.0 / (s * (x * 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 = (1.0d0 / (s * (x * c))) / (x * (s * c))
end function
public static double code(double x, double c, double s) {
return (1.0 / (s * (x * c))) / (x * (s * c));
}
def code(x, c, s): return (1.0 / (s * (x * c))) / (x * (s * c))
function code(x, c, s) return Float64(Float64(1.0 / Float64(s * Float64(x * c))) / Float64(x * Float64(s * c))) end
function tmp = code(x, c, s) tmp = (1.0 / (s * (x * c))) / (x * (s * c)); end
code[x_, c_, s_] := N[(N[(1.0 / N[(s * N[(x * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * N[(s * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{s \cdot \left(x \cdot c\right)}}{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-*.f6482.3%
Simplified82.3%
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.8%
Applied egg-rr97.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6477.5%
Simplified77.5%
Final simplification77.5%
(FPCore (x c s) :precision binary64 (/ 1.0 (* c (* c (* (* x s) (* x s))))))
double code(double x, double c, double s) {
return 1.0 / (c * (c * ((x * s) * (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 / (c * (c * ((x * s) * (x * s))))
end function
public static double code(double x, double c, double s) {
return 1.0 / (c * (c * ((x * s) * (x * s))));
}
def code(x, c, s): return 1.0 / (c * (c * ((x * s) * (x * s))))
function code(x, c, s) return Float64(1.0 / Float64(c * Float64(c * Float64(Float64(x * s) * Float64(x * s))))) end
function tmp = code(x, c, s) tmp = 1.0 / (c * (c * ((x * s) * (x * s)))); end
code[x_, c_, s_] := N[(1.0 / N[(c * N[(c * N[(N[(x * s), $MachinePrecision] * N[(x * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{c \cdot \left(c \cdot \left(\left(x \cdot s\right) \cdot \left(x \cdot s\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-*.f6482.3%
Simplified82.3%
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.8%
Applied egg-rr97.8%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.6%
Simplified64.6%
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6472.0%
Applied egg-rr72.0%
(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-*.f6482.3%
Simplified82.3%
associate-/l/N/A
associate-*r*N/A
*-commutativeN/A
swap-sqrN/A
unpow2N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
associate-/r*N/A
associate-/r*N/A
associate-/r*N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr77.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified48.2%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6427.4%
Simplified27.4%
Taylor expanded in s around 0
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6431.1%
Simplified31.1%
herbie shell --seed 2024163
(FPCore (x c s)
:name "mixedcos"
:precision binary64
(/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))