
(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 14 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 (let* ((t_0 (/ 1.0 (* (* s c) x)))) (* (* t_0 t_0) (cos (* x 2.0)))))
double code(double x, double c, double s) {
double t_0 = 1.0 / ((s * c) * x);
return (t_0 * t_0) * cos((x * 2.0));
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
real(8) :: t_0
t_0 = 1.0d0 / ((s * c) * x)
code = (t_0 * t_0) * cos((x * 2.0d0))
end function
public static double code(double x, double c, double s) {
double t_0 = 1.0 / ((s * c) * x);
return (t_0 * t_0) * Math.cos((x * 2.0));
}
def code(x, c, s): t_0 = 1.0 / ((s * c) * x) return (t_0 * t_0) * math.cos((x * 2.0))
function code(x, c, s) t_0 = Float64(1.0 / Float64(Float64(s * c) * x)) return Float64(Float64(t_0 * t_0) * cos(Float64(x * 2.0))) end
function tmp = code(x, c, s) t_0 = 1.0 / ((s * c) * x); tmp = (t_0 * t_0) * cos((x * 2.0)); end
code[x_, c_, s_] := Block[{t$95$0 = N[(1.0 / N[(N[(s * c), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, N[(N[(t$95$0 * t$95$0), $MachinePrecision] * N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\left(s \cdot c\right) \cdot x}\\
\left(t_0 \cdot t_0\right) \cdot \cos \left(x \cdot 2\right)
\end{array}
\end{array}
Initial program 71.2%
*-commutative71.2%
associate-*l*66.8%
associate-*r*66.3%
*-commutative66.3%
unpow266.3%
associate-*r*71.8%
associate-*r*74.6%
*-commutative74.6%
unpow274.6%
Simplified74.6%
Taylor expanded in s around 0 66.8%
*-commutative66.8%
unpow266.8%
unpow266.8%
*-commutative66.8%
swap-sqr81.8%
unpow281.8%
swap-sqr98.2%
*-commutative98.2%
associate-*r*96.0%
*-commutative96.0%
associate-*r*97.3%
unpow297.3%
associate-*r*98.2%
*-commutative98.2%
Simplified98.2%
unpow298.2%
Applied egg-rr98.2%
Taylor expanded in x around inf 66.1%
*-commutative66.1%
associate-*r*66.3%
unpow266.3%
unpow266.3%
unswap-sqr80.0%
unpow280.0%
swap-sqr98.5%
associate-/r*98.5%
*-commutative98.5%
associate-*r*97.2%
*-lft-identity97.2%
times-frac95.2%
associate-/l/95.1%
times-frac94.9%
associate-*l/98.2%
associate-/r*98.1%
Simplified97.3%
metadata-eval97.3%
pow-prod-up97.3%
unpow-197.3%
associate-*r*96.3%
unpow-196.3%
associate-*r*98.5%
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (x c s)
:precision binary64
(let* ((t_0 (/ 1.0 (* (* s c) x))))
(if (<= c -1.4e+154)
(* t_0 t_0)
(if (or (<= c -1.7e-160) (not (<= c 5.3e-160)))
(/ (cos (* x 2.0)) (* x (* s (* (* s x) (* c c)))))
(pow (* s (* c x)) -2.0)))))
double code(double x, double c, double s) {
double t_0 = 1.0 / ((s * c) * x);
double tmp;
if (c <= -1.4e+154) {
tmp = t_0 * t_0;
} else if ((c <= -1.7e-160) || !(c <= 5.3e-160)) {
tmp = cos((x * 2.0)) / (x * (s * ((s * x) * (c * c))));
} else {
tmp = pow((s * (c * x)), -2.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 = 1.0d0 / ((s * c) * x)
if (c <= (-1.4d+154)) then
tmp = t_0 * t_0
else if ((c <= (-1.7d-160)) .or. (.not. (c <= 5.3d-160))) then
tmp = cos((x * 2.0d0)) / (x * (s * ((s * x) * (c * c))))
else
tmp = (s * (c * x)) ** (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double t_0 = 1.0 / ((s * c) * x);
double tmp;
if (c <= -1.4e+154) {
tmp = t_0 * t_0;
} else if ((c <= -1.7e-160) || !(c <= 5.3e-160)) {
tmp = Math.cos((x * 2.0)) / (x * (s * ((s * x) * (c * c))));
} else {
tmp = Math.pow((s * (c * x)), -2.0);
}
return tmp;
}
def code(x, c, s): t_0 = 1.0 / ((s * c) * x) tmp = 0 if c <= -1.4e+154: tmp = t_0 * t_0 elif (c <= -1.7e-160) or not (c <= 5.3e-160): tmp = math.cos((x * 2.0)) / (x * (s * ((s * x) * (c * c)))) else: tmp = math.pow((s * (c * x)), -2.0) return tmp
function code(x, c, s) t_0 = Float64(1.0 / Float64(Float64(s * c) * x)) tmp = 0.0 if (c <= -1.4e+154) tmp = Float64(t_0 * t_0); elseif ((c <= -1.7e-160) || !(c <= 5.3e-160)) tmp = Float64(cos(Float64(x * 2.0)) / Float64(x * Float64(s * Float64(Float64(s * x) * Float64(c * c))))); else tmp = Float64(s * Float64(c * x)) ^ -2.0; end return tmp end
function tmp_2 = code(x, c, s) t_0 = 1.0 / ((s * c) * x); tmp = 0.0; if (c <= -1.4e+154) tmp = t_0 * t_0; elseif ((c <= -1.7e-160) || ~((c <= 5.3e-160))) tmp = cos((x * 2.0)) / (x * (s * ((s * x) * (c * c)))); else tmp = (s * (c * x)) ^ -2.0; end tmp_2 = tmp; end
code[x_, c_, s_] := Block[{t$95$0 = N[(1.0 / N[(N[(s * c), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.4e+154], N[(t$95$0 * t$95$0), $MachinePrecision], If[Or[LessEqual[c, -1.7e-160], N[Not[LessEqual[c, 5.3e-160]], $MachinePrecision]], N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(x * N[(s * N[(N[(s * x), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(s * N[(c * x), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\left(s \cdot c\right) \cdot x}\\
\mathbf{if}\;c \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0 \cdot t_0\\
\mathbf{elif}\;c \leq -1.7 \cdot 10^{-160} \lor \neg \left(c \leq 5.3 \cdot 10^{-160}\right):\\
\;\;\;\;\frac{\cos \left(x \cdot 2\right)}{x \cdot \left(s \cdot \left(\left(s \cdot x\right) \cdot \left(c \cdot c\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(s \cdot \left(c \cdot x\right)\right)}^{-2}\\
\end{array}
\end{array}
if c < -1.4e154Initial program 43.8%
*-commutative43.8%
associate-*l*37.5%
associate-*r*37.5%
*-commutative37.5%
unpow237.5%
associate-*r*44.7%
associate-*r*44.7%
*-commutative44.7%
unpow244.7%
Simplified44.7%
Taylor expanded in s around 0 37.5%
*-commutative37.5%
unpow237.5%
unpow237.5%
*-commutative37.5%
swap-sqr50.8%
unpow250.8%
swap-sqr99.5%
*-commutative99.5%
associate-*r*87.9%
*-commutative87.9%
associate-*r*87.7%
unpow287.7%
associate-*r*99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x around 0 37.5%
unpow237.5%
associate-/r*37.5%
unpow237.5%
unpow237.5%
swap-sqr50.8%
unpow250.8%
associate-/l/50.8%
*-commutative50.8%
unpow250.8%
swap-sqr77.8%
unpow277.8%
/-rgt-identity77.8%
unpow277.8%
associate-/l*77.8%
associate-/l*77.8%
associate-*l/77.8%
unpow-177.8%
unpow-177.8%
pow-sqr77.8%
metadata-eval77.8%
Simplified76.3%
metadata-eval87.6%
pow-prod-up87.6%
unpow-187.6%
associate-*r*87.6%
unpow-187.6%
associate-*r*99.4%
Applied egg-rr77.8%
if -1.4e154 < c < -1.70000000000000011e-160 or 5.3000000000000001e-160 < c Initial program 79.5%
associate-*r*81.2%
*-commutative81.2%
associate-*r*80.2%
unpow280.2%
unpow280.2%
Simplified80.2%
Taylor expanded in c around 0 80.2%
unpow280.2%
associate-*l*82.4%
Simplified82.4%
Taylor expanded in c around 0 80.2%
*-commutative80.2%
associate-*r*81.2%
unpow281.2%
associate-*r*90.7%
associate-*l*94.0%
unpow294.0%
associate-*l*97.3%
*-commutative97.3%
*-commutative97.3%
associate-*r*94.0%
Simplified94.0%
if -1.70000000000000011e-160 < c < 5.3000000000000001e-160Initial program 54.9%
*-commutative54.9%
associate-*l*50.1%
associate-*r*50.2%
*-commutative50.2%
unpow250.2%
associate-*r*57.0%
associate-*r*57.0%
*-commutative57.0%
unpow257.0%
Simplified57.0%
Taylor expanded in s around 0 50.1%
*-commutative50.1%
unpow250.1%
unpow250.1%
*-commutative50.1%
swap-sqr61.4%
unpow261.4%
swap-sqr93.7%
*-commutative93.7%
associate-*r*92.0%
*-commutative92.0%
associate-*r*97.9%
unpow297.9%
associate-*r*93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in x around 0 48.1%
unpow248.1%
associate-/r*47.9%
unpow247.9%
unpow247.9%
swap-sqr55.9%
unpow255.9%
associate-/l/56.2%
*-commutative56.2%
unpow256.2%
swap-sqr69.2%
unpow269.2%
/-rgt-identity69.2%
unpow269.2%
associate-/l*69.2%
associate-/l*69.2%
associate-*l/69.2%
unpow-169.2%
unpow-169.2%
pow-sqr69.2%
metadata-eval69.2%
Simplified68.0%
Final simplification86.6%
(FPCore (x c s)
:precision binary64
(let* ((t_0 (cos (* x 2.0))) (t_1 (/ 1.0 (* (* s c) x))))
(if (<= c -1.4e+154)
(* t_1 t_1)
(if (or (<= c -9.5e-160) (not (<= c 2.2e-162)))
(/ t_0 (* x (* s (* (* s x) (* c c)))))
(/ t_0 (* x (* (* c (* c x)) (* s s))))))))
double code(double x, double c, double s) {
double t_0 = cos((x * 2.0));
double t_1 = 1.0 / ((s * c) * x);
double tmp;
if (c <= -1.4e+154) {
tmp = t_1 * t_1;
} else if ((c <= -9.5e-160) || !(c <= 2.2e-162)) {
tmp = t_0 / (x * (s * ((s * x) * (c * c))));
} else {
tmp = t_0 / (x * ((c * (c * x)) * (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = cos((x * 2.0d0))
t_1 = 1.0d0 / ((s * c) * x)
if (c <= (-1.4d+154)) then
tmp = t_1 * t_1
else if ((c <= (-9.5d-160)) .or. (.not. (c <= 2.2d-162))) then
tmp = t_0 / (x * (s * ((s * x) * (c * c))))
else
tmp = t_0 / (x * ((c * (c * x)) * (s * s)))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double t_0 = Math.cos((x * 2.0));
double t_1 = 1.0 / ((s * c) * x);
double tmp;
if (c <= -1.4e+154) {
tmp = t_1 * t_1;
} else if ((c <= -9.5e-160) || !(c <= 2.2e-162)) {
tmp = t_0 / (x * (s * ((s * x) * (c * c))));
} else {
tmp = t_0 / (x * ((c * (c * x)) * (s * s)));
}
return tmp;
}
def code(x, c, s): t_0 = math.cos((x * 2.0)) t_1 = 1.0 / ((s * c) * x) tmp = 0 if c <= -1.4e+154: tmp = t_1 * t_1 elif (c <= -9.5e-160) or not (c <= 2.2e-162): tmp = t_0 / (x * (s * ((s * x) * (c * c)))) else: tmp = t_0 / (x * ((c * (c * x)) * (s * s))) return tmp
function code(x, c, s) t_0 = cos(Float64(x * 2.0)) t_1 = Float64(1.0 / Float64(Float64(s * c) * x)) tmp = 0.0 if (c <= -1.4e+154) tmp = Float64(t_1 * t_1); elseif ((c <= -9.5e-160) || !(c <= 2.2e-162)) tmp = Float64(t_0 / Float64(x * Float64(s * Float64(Float64(s * x) * Float64(c * c))))); else tmp = Float64(t_0 / Float64(x * Float64(Float64(c * Float64(c * x)) * Float64(s * s)))); end return tmp end
function tmp_2 = code(x, c, s) t_0 = cos((x * 2.0)); t_1 = 1.0 / ((s * c) * x); tmp = 0.0; if (c <= -1.4e+154) tmp = t_1 * t_1; elseif ((c <= -9.5e-160) || ~((c <= 2.2e-162))) tmp = t_0 / (x * (s * ((s * x) * (c * c)))); else tmp = t_0 / (x * ((c * (c * x)) * (s * s))); end tmp_2 = tmp; end
code[x_, c_, s_] := Block[{t$95$0 = N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(N[(s * c), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.4e+154], N[(t$95$1 * t$95$1), $MachinePrecision], If[Or[LessEqual[c, -9.5e-160], N[Not[LessEqual[c, 2.2e-162]], $MachinePrecision]], N[(t$95$0 / N[(x * N[(s * N[(N[(s * x), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(x * N[(N[(c * N[(c * x), $MachinePrecision]), $MachinePrecision] * N[(s * s), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(x \cdot 2\right)\\
t_1 := \frac{1}{\left(s \cdot c\right) \cdot x}\\
\mathbf{if}\;c \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;t_1 \cdot t_1\\
\mathbf{elif}\;c \leq -9.5 \cdot 10^{-160} \lor \neg \left(c \leq 2.2 \cdot 10^{-162}\right):\\
\;\;\;\;\frac{t_0}{x \cdot \left(s \cdot \left(\left(s \cdot x\right) \cdot \left(c \cdot c\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{x \cdot \left(\left(c \cdot \left(c \cdot x\right)\right) \cdot \left(s \cdot s\right)\right)}\\
\end{array}
\end{array}
if c < -1.4e154Initial program 43.8%
*-commutative43.8%
associate-*l*37.5%
associate-*r*37.5%
*-commutative37.5%
unpow237.5%
associate-*r*44.7%
associate-*r*44.7%
*-commutative44.7%
unpow244.7%
Simplified44.7%
Taylor expanded in s around 0 37.5%
*-commutative37.5%
unpow237.5%
unpow237.5%
*-commutative37.5%
swap-sqr50.8%
unpow250.8%
swap-sqr99.5%
*-commutative99.5%
associate-*r*87.9%
*-commutative87.9%
associate-*r*87.7%
unpow287.7%
associate-*r*99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x around 0 37.5%
unpow237.5%
associate-/r*37.5%
unpow237.5%
unpow237.5%
swap-sqr50.8%
unpow250.8%
associate-/l/50.8%
*-commutative50.8%
unpow250.8%
swap-sqr77.8%
unpow277.8%
/-rgt-identity77.8%
unpow277.8%
associate-/l*77.8%
associate-/l*77.8%
associate-*l/77.8%
unpow-177.8%
unpow-177.8%
pow-sqr77.8%
metadata-eval77.8%
Simplified76.3%
metadata-eval87.6%
pow-prod-up87.6%
unpow-187.6%
associate-*r*87.6%
unpow-187.6%
associate-*r*99.4%
Applied egg-rr77.8%
if -1.4e154 < c < -9.5000000000000002e-160 or 2.1999999999999999e-162 < c Initial program 79.7%
associate-*r*81.2%
*-commutative81.2%
associate-*r*80.1%
unpow280.1%
unpow280.1%
Simplified80.1%
Taylor expanded in c around 0 80.1%
unpow280.1%
associate-*l*82.4%
Simplified82.4%
Taylor expanded in c around 0 80.1%
*-commutative80.1%
associate-*r*81.2%
unpow281.2%
associate-*r*90.7%
associate-*l*94.0%
unpow294.0%
associate-*l*97.3%
*-commutative97.3%
*-commutative97.3%
associate-*r*94.0%
Simplified94.0%
if -9.5000000000000002e-160 < c < 2.1999999999999999e-162Initial program 54.4%
associate-*r*55.5%
*-commutative55.5%
associate-*r*55.7%
unpow255.7%
unpow255.7%
Simplified55.7%
Taylor expanded in c around 0 55.7%
unpow255.7%
associate-*l*69.1%
Simplified69.1%
Final simplification86.8%
(FPCore (x c s)
:precision binary64
(if (<= c -1.25e+67)
(pow (* (* s c) x) -2.0)
(if (<= c -5.8e-143)
(/ (cos (* x 2.0)) (* s (* (* x x) (* s (* c c)))))
(* (/ (pow s -1.0) (* c x)) (/ 1.0 (* s (* c x)))))))
double code(double x, double c, double s) {
double tmp;
if (c <= -1.25e+67) {
tmp = pow(((s * c) * x), -2.0);
} else if (c <= -5.8e-143) {
tmp = cos((x * 2.0)) / (s * ((x * x) * (s * (c * c))));
} else {
tmp = (pow(s, -1.0) / (c * x)) * (1.0 / (s * (c * x)));
}
return tmp;
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
real(8) :: tmp
if (c <= (-1.25d+67)) then
tmp = ((s * c) * x) ** (-2.0d0)
else if (c <= (-5.8d-143)) then
tmp = cos((x * 2.0d0)) / (s * ((x * x) * (s * (c * c))))
else
tmp = ((s ** (-1.0d0)) / (c * x)) * (1.0d0 / (s * (c * x)))
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (c <= -1.25e+67) {
tmp = Math.pow(((s * c) * x), -2.0);
} else if (c <= -5.8e-143) {
tmp = Math.cos((x * 2.0)) / (s * ((x * x) * (s * (c * c))));
} else {
tmp = (Math.pow(s, -1.0) / (c * x)) * (1.0 / (s * (c * x)));
}
return tmp;
}
def code(x, c, s): tmp = 0 if c <= -1.25e+67: tmp = math.pow(((s * c) * x), -2.0) elif c <= -5.8e-143: tmp = math.cos((x * 2.0)) / (s * ((x * x) * (s * (c * c)))) else: tmp = (math.pow(s, -1.0) / (c * x)) * (1.0 / (s * (c * x))) return tmp
function code(x, c, s) tmp = 0.0 if (c <= -1.25e+67) tmp = Float64(Float64(s * c) * x) ^ -2.0; elseif (c <= -5.8e-143) tmp = Float64(cos(Float64(x * 2.0)) / Float64(s * Float64(Float64(x * x) * Float64(s * Float64(c * c))))); else tmp = Float64(Float64((s ^ -1.0) / Float64(c * x)) * Float64(1.0 / Float64(s * Float64(c * x)))); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (c <= -1.25e+67) tmp = ((s * c) * x) ^ -2.0; elseif (c <= -5.8e-143) tmp = cos((x * 2.0)) / (s * ((x * x) * (s * (c * c)))); else tmp = ((s ^ -1.0) / (c * x)) * (1.0 / (s * (c * x))); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[c, -1.25e+67], N[Power[N[(N[(s * c), $MachinePrecision] * x), $MachinePrecision], -2.0], $MachinePrecision], If[LessEqual[c, -5.8e-143], N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(s * N[(N[(x * x), $MachinePrecision] * N[(s * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[s, -1.0], $MachinePrecision] / N[(c * x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(s * N[(c * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.25 \cdot 10^{+67}:\\
\;\;\;\;{\left(\left(s \cdot c\right) \cdot x\right)}^{-2}\\
\mathbf{elif}\;c \leq -5.8 \cdot 10^{-143}:\\
\;\;\;\;\frac{\cos \left(x \cdot 2\right)}{s \cdot \left(\left(x \cdot x\right) \cdot \left(s \cdot \left(c \cdot c\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{{s}^{-1}}{c \cdot x} \cdot \frac{1}{s \cdot \left(c \cdot x\right)}\\
\end{array}
\end{array}
if c < -1.24999999999999994e67Initial program 71.6%
*-commutative71.6%
associate-*l*60.2%
associate-*r*57.5%
*-commutative57.5%
unpow257.5%
associate-*r*63.4%
associate-*r*66.0%
*-commutative66.0%
unpow266.0%
Simplified66.0%
Taylor expanded in s around 0 60.2%
*-commutative60.2%
unpow260.2%
unpow260.2%
*-commutative60.2%
swap-sqr74.7%
unpow274.7%
swap-sqr99.7%
*-commutative99.7%
associate-*r*94.3%
*-commutative94.3%
associate-*r*94.3%
unpow294.3%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 57.9%
unpow257.9%
associate-/r*57.9%
unpow257.9%
unpow257.9%
swap-sqr72.4%
unpow272.4%
associate-/l/72.4%
*-commutative72.4%
unpow272.4%
swap-sqr86.6%
unpow286.6%
/-rgt-identity86.6%
unpow286.6%
associate-/l*86.6%
associate-/l*86.6%
associate-*l/86.5%
unpow-186.5%
unpow-186.5%
pow-sqr86.6%
metadata-eval86.6%
Simplified85.9%
Taylor expanded in s around 0 86.6%
associate-*r*86.7%
*-commutative86.7%
*-commutative86.7%
Simplified86.7%
if -1.24999999999999994e67 < c < -5.8000000000000002e-143Initial program 84.9%
*-commutative84.9%
associate-*l*82.2%
associate-*r*82.1%
*-commutative82.1%
unpow282.1%
associate-*r*87.0%
associate-*r*87.3%
*-commutative87.3%
unpow287.3%
Simplified87.3%
if -5.8000000000000002e-143 < c Initial program 68.2%
*-commutative68.2%
associate-*l*64.7%
associate-*r*64.6%
*-commutative64.6%
unpow264.6%
associate-*r*70.2%
associate-*r*73.5%
*-commutative73.5%
unpow273.5%
Simplified73.5%
add-cube-cbrt73.5%
times-frac73.4%
associate-*r*72.6%
swap-sqr89.2%
associate-*r*94.4%
*-commutative94.4%
times-frac94.8%
associate-*l*97.3%
add-cube-cbrt97.5%
associate-/r*97.5%
Applied egg-rr97.5%
Taylor expanded in x around 0 79.6%
associate-/r*79.7%
unpow-179.7%
*-commutative79.7%
Simplified79.7%
Final simplification81.8%
(FPCore (x c s) :precision binary64 (let* ((t_0 (* c (* s x)))) (/ (cos (* x 2.0)) (* t_0 t_0))))
double code(double x, double c, double s) {
double t_0 = c * (s * x);
return cos((x * 2.0)) / (t_0 * t_0);
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
real(8) :: t_0
t_0 = c * (s * x)
code = cos((x * 2.0d0)) / (t_0 * t_0)
end function
public static double code(double x, double c, double s) {
double t_0 = c * (s * x);
return Math.cos((x * 2.0)) / (t_0 * t_0);
}
def code(x, c, s): t_0 = c * (s * x) return math.cos((x * 2.0)) / (t_0 * t_0)
function code(x, c, s) t_0 = Float64(c * Float64(s * x)) return Float64(cos(Float64(x * 2.0)) / Float64(t_0 * t_0)) end
function tmp = code(x, c, s) t_0 = c * (s * x); tmp = cos((x * 2.0)) / (t_0 * t_0); end
code[x_, c_, s_] := Block[{t$95$0 = N[(c * N[(s * x), $MachinePrecision]), $MachinePrecision]}, N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := c \cdot \left(s \cdot x\right)\\
\frac{\cos \left(x \cdot 2\right)}{t_0 \cdot t_0}
\end{array}
\end{array}
Initial program 71.2%
*-commutative71.2%
associate-*l*66.8%
associate-*r*66.3%
*-commutative66.3%
unpow266.3%
associate-*r*71.8%
associate-*r*74.6%
*-commutative74.6%
unpow274.6%
Simplified74.6%
Taylor expanded in s around 0 66.8%
*-commutative66.8%
unpow266.8%
unpow266.8%
*-commutative66.8%
swap-sqr81.8%
unpow281.8%
swap-sqr98.2%
*-commutative98.2%
associate-*r*96.0%
*-commutative96.0%
associate-*r*97.3%
unpow297.3%
associate-*r*98.2%
*-commutative98.2%
Simplified98.2%
unpow298.2%
Applied egg-rr98.2%
Final simplification98.2%
(FPCore (x c s) :precision binary64 (let* ((t_0 (* s (* c x)))) (/ (cos (* x 2.0)) (* t_0 t_0))))
double code(double x, double c, double s) {
double t_0 = s * (c * x);
return cos((x * 2.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 = s * (c * x)
code = cos((x * 2.0d0)) / (t_0 * t_0)
end function
public static double code(double x, double c, double s) {
double t_0 = s * (c * x);
return Math.cos((x * 2.0)) / (t_0 * t_0);
}
def code(x, c, s): t_0 = s * (c * x) return math.cos((x * 2.0)) / (t_0 * t_0)
function code(x, c, s) t_0 = Float64(s * Float64(c * x)) return Float64(cos(Float64(x * 2.0)) / Float64(t_0 * t_0)) end
function tmp = code(x, c, s) t_0 = s * (c * x); tmp = cos((x * 2.0)) / (t_0 * t_0); end
code[x_, c_, s_] := Block[{t$95$0 = N[(s * N[(c * x), $MachinePrecision]), $MachinePrecision]}, N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := s \cdot \left(c \cdot x\right)\\
\frac{\cos \left(x \cdot 2\right)}{t_0 \cdot t_0}
\end{array}
\end{array}
Initial program 71.2%
*-commutative71.2%
associate-*r*66.8%
associate-*r*66.1%
unpow266.1%
unswap-sqr80.4%
unpow280.4%
swap-sqr97.3%
*-commutative97.3%
*-commutative97.3%
*-commutative97.3%
*-commutative97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x c s) :precision binary64 (let* ((t_0 (* c (* s x)))) (/ (/ (cos (* x 2.0)) t_0) t_0)))
double code(double x, double c, double s) {
double t_0 = c * (s * x);
return (cos((x * 2.0)) / t_0) / t_0;
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
real(8) :: t_0
t_0 = c * (s * x)
code = (cos((x * 2.0d0)) / t_0) / t_0
end function
public static double code(double x, double c, double s) {
double t_0 = c * (s * x);
return (Math.cos((x * 2.0)) / t_0) / t_0;
}
def code(x, c, s): t_0 = c * (s * x) return (math.cos((x * 2.0)) / t_0) / t_0
function code(x, c, s) t_0 = Float64(c * Float64(s * x)) return Float64(Float64(cos(Float64(x * 2.0)) / t_0) / t_0) end
function tmp = code(x, c, s) t_0 = c * (s * x); tmp = (cos((x * 2.0)) / t_0) / t_0; end
code[x_, c_, s_] := Block[{t$95$0 = N[(c * N[(s * x), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Cos[N[(x * 2.0), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := c \cdot \left(s \cdot x\right)\\
\frac{\frac{\cos \left(x \cdot 2\right)}{t_0}}{t_0}
\end{array}
\end{array}
Initial program 71.2%
*-commutative71.2%
associate-*l*66.8%
associate-*r*66.3%
*-commutative66.3%
unpow266.3%
associate-*r*71.8%
associate-*r*74.6%
*-commutative74.6%
unpow274.6%
Simplified74.6%
add-cube-cbrt74.5%
times-frac74.5%
associate-*r*73.2%
swap-sqr88.4%
associate-*r*94.3%
*-commutative94.3%
times-frac94.6%
associate-*l*97.1%
add-cube-cbrt97.3%
associate-/r*97.4%
Applied egg-rr97.3%
un-div-inv97.4%
associate-*r*96.0%
associate-*r*98.2%
Applied egg-rr98.2%
Final simplification98.2%
(FPCore (x c s) :precision binary64 (pow (* (* s c) x) -2.0))
double code(double x, double c, double s) {
return pow(((s * c) * x), -2.0);
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = ((s * c) * x) ** (-2.0d0)
end function
public static double code(double x, double c, double s) {
return Math.pow(((s * c) * x), -2.0);
}
def code(x, c, s): return math.pow(((s * c) * x), -2.0)
function code(x, c, s) return Float64(Float64(s * c) * x) ^ -2.0 end
function tmp = code(x, c, s) tmp = ((s * c) * x) ^ -2.0; end
code[x_, c_, s_] := N[Power[N[(N[(s * c), $MachinePrecision] * x), $MachinePrecision], -2.0], $MachinePrecision]
\begin{array}{l}
\\
{\left(\left(s \cdot c\right) \cdot x\right)}^{-2}
\end{array}
Initial program 71.2%
*-commutative71.2%
associate-*l*66.8%
associate-*r*66.3%
*-commutative66.3%
unpow266.3%
associate-*r*71.8%
associate-*r*74.6%
*-commutative74.6%
unpow274.6%
Simplified74.6%
Taylor expanded in s around 0 66.8%
*-commutative66.8%
unpow266.8%
unpow266.8%
*-commutative66.8%
swap-sqr81.8%
unpow281.8%
swap-sqr98.2%
*-commutative98.2%
associate-*r*96.0%
*-commutative96.0%
associate-*r*97.3%
unpow297.3%
associate-*r*98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 61.2%
unpow261.2%
associate-/r*60.7%
unpow260.7%
unpow260.7%
swap-sqr70.9%
unpow270.9%
associate-/l/71.4%
*-commutative71.4%
unpow271.4%
swap-sqr79.6%
unpow279.6%
/-rgt-identity79.6%
unpow279.6%
associate-/l*79.6%
associate-/l*79.6%
associate-*l/79.6%
unpow-179.6%
unpow-179.6%
pow-sqr79.6%
metadata-eval79.6%
Simplified79.0%
Taylor expanded in s around 0 79.6%
associate-*r*79.7%
*-commutative79.7%
*-commutative79.7%
Simplified79.7%
Final simplification79.7%
(FPCore (x c s) :precision binary64 (if (<= s 4.6e+152) (/ 1.0 (* (* c c) (* (* s s) (* x x)))) (/ (/ -2.0 (* s s)) (* c c))))
double code(double x, double c, double s) {
double tmp;
if (s <= 4.6e+152) {
tmp = 1.0 / ((c * c) * ((s * s) * (x * x)));
} else {
tmp = (-2.0 / (s * s)) / (c * 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 (s <= 4.6d+152) then
tmp = 1.0d0 / ((c * c) * ((s * s) * (x * x)))
else
tmp = ((-2.0d0) / (s * s)) / (c * c)
end if
code = tmp
end function
public static double code(double x, double c, double s) {
double tmp;
if (s <= 4.6e+152) {
tmp = 1.0 / ((c * c) * ((s * s) * (x * x)));
} else {
tmp = (-2.0 / (s * s)) / (c * c);
}
return tmp;
}
def code(x, c, s): tmp = 0 if s <= 4.6e+152: tmp = 1.0 / ((c * c) * ((s * s) * (x * x))) else: tmp = (-2.0 / (s * s)) / (c * c) return tmp
function code(x, c, s) tmp = 0.0 if (s <= 4.6e+152) tmp = Float64(1.0 / Float64(Float64(c * c) * Float64(Float64(s * s) * Float64(x * x)))); else tmp = Float64(Float64(-2.0 / Float64(s * s)) / Float64(c * c)); end return tmp end
function tmp_2 = code(x, c, s) tmp = 0.0; if (s <= 4.6e+152) tmp = 1.0 / ((c * c) * ((s * s) * (x * x))); else tmp = (-2.0 / (s * s)) / (c * c); end tmp_2 = tmp; end
code[x_, c_, s_] := If[LessEqual[s, 4.6e+152], N[(1.0 / N[(N[(c * c), $MachinePrecision] * N[(N[(s * s), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 / N[(s * s), $MachinePrecision]), $MachinePrecision] / N[(c * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;s \leq 4.6 \cdot 10^{+152}:\\
\;\;\;\;\frac{1}{\left(c \cdot c\right) \cdot \left(\left(s \cdot s\right) \cdot \left(x \cdot x\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-2}{s \cdot s}}{c \cdot c}\\
\end{array}
\end{array}
if s < 4.5999999999999997e152Initial program 70.8%
*-commutative70.8%
associate-*l*68.0%
associate-*r*67.4%
*-commutative67.4%
unpow267.4%
associate-*r*72.9%
associate-*r*75.6%
*-commutative75.6%
unpow275.6%
Simplified75.6%
Taylor expanded in s around 0 67.9%
*-commutative67.9%
unpow267.9%
unpow268.0%
*-commutative68.0%
swap-sqr80.4%
unpow280.4%
swap-sqr97.9%
*-commutative97.9%
associate-*r*95.4%
*-commutative95.4%
associate-*r*97.0%
unpow297.0%
associate-*r*97.9%
*-commutative97.9%
Simplified97.9%
unpow297.9%
Applied egg-rr97.9%
Taylor expanded in x around inf 67.2%
*-commutative67.2%
associate-*r*67.4%
unpow267.4%
unpow267.4%
unswap-sqr80.9%
unpow280.9%
swap-sqr98.3%
associate-/r*98.3%
*-commutative98.3%
associate-*r*96.8%
*-lft-identity96.8%
times-frac94.9%
associate-/l/94.8%
times-frac94.2%
associate-*l/98.0%
associate-/r*97.9%
Simplified97.0%
Taylor expanded in x around 0 60.7%
unpow260.7%
associate-*r*61.0%
*-commutative61.0%
associate-*r*61.5%
unpow261.5%
unpow261.5%
unpow261.5%
*-commutative61.5%
unpow261.5%
Simplified61.5%
if 4.5999999999999997e152 < s Initial program 74.0%
*-commutative74.0%
associate-*l*59.1%
associate-*r*59.1%
*-commutative59.1%
unpow259.1%
associate-*r*65.2%
associate-*r*68.2%
*-commutative68.2%
unpow268.2%
Simplified68.2%
Taylor expanded in x around 0 59.1%
associate-/r*59.1%
unpow259.1%
unpow259.1%
unpow259.1%
*-commutative59.1%
associate-*r/59.1%
metadata-eval59.1%
unpow259.1%
*-commutative59.1%
unpow259.1%
Simplified59.1%
Taylor expanded in x around inf 74.0%
unpow274.0%
associate-/r*74.0%
unpow274.0%
Simplified74.0%
Final simplification63.2%
(FPCore (x c s) :precision binary64 (let* ((t_0 (/ 1.0 (* c (* s x))))) (* t_0 t_0)))
double code(double x, double c, double s) {
double t_0 = 1.0 / (c * (s * x));
return 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 = 1.0d0 / (c * (s * x))
code = t_0 * t_0
end function
public static double code(double x, double c, double s) {
double t_0 = 1.0 / (c * (s * x));
return t_0 * t_0;
}
def code(x, c, s): t_0 = 1.0 / (c * (s * x)) return t_0 * t_0
function code(x, c, s) t_0 = Float64(1.0 / Float64(c * Float64(s * x))) return Float64(t_0 * t_0) end
function tmp = code(x, c, s) t_0 = 1.0 / (c * (s * x)); tmp = t_0 * t_0; end
code[x_, c_, s_] := Block[{t$95$0 = N[(1.0 / N[(c * N[(s * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{c \cdot \left(s \cdot x\right)}\\
t_0 \cdot t_0
\end{array}
\end{array}
Initial program 71.2%
associate-/r*70.5%
unpow270.5%
*-commutative70.5%
unpow270.5%
Simplified70.5%
Taylor expanded in x around 0 63.7%
unpow263.7%
Simplified63.7%
associate-/l/64.2%
*-commutative64.2%
associate-*r*70.2%
associate-*r*71.4%
*-commutative71.4%
pow271.4%
pow271.4%
unpow-prod-down79.6%
*-commutative79.6%
add-sqr-sqrt79.5%
sqrt-div79.6%
metadata-eval79.6%
unpow279.6%
sqrt-prod51.3%
add-sqr-sqrt57.0%
sqrt-div57.0%
metadata-eval57.0%
Applied egg-rr79.6%
Final simplification79.6%
(FPCore (x c s) :precision binary64 (let* ((t_0 (/ 1.0 (* s (* c x))))) (* t_0 t_0)))
double code(double x, double c, double s) {
double t_0 = 1.0 / (s * (c * x));
return 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 = 1.0d0 / (s * (c * x))
code = t_0 * t_0
end function
public static double code(double x, double c, double s) {
double t_0 = 1.0 / (s * (c * x));
return t_0 * t_0;
}
def code(x, c, s): t_0 = 1.0 / (s * (c * x)) return t_0 * t_0
function code(x, c, s) t_0 = Float64(1.0 / Float64(s * Float64(c * x))) return Float64(t_0 * t_0) end
function tmp = code(x, c, s) t_0 = 1.0 / (s * (c * x)); tmp = t_0 * t_0; end
code[x_, c_, s_] := Block[{t$95$0 = N[(1.0 / N[(s * N[(c * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{s \cdot \left(c \cdot x\right)}\\
t_0 \cdot t_0
\end{array}
\end{array}
Initial program 71.2%
*-commutative71.2%
associate-*l*66.8%
associate-*r*66.3%
*-commutative66.3%
unpow266.3%
associate-*r*71.8%
associate-*r*74.6%
*-commutative74.6%
unpow274.6%
Simplified74.6%
add-cube-cbrt74.5%
times-frac74.5%
associate-*r*73.2%
swap-sqr88.4%
associate-*r*94.3%
*-commutative94.3%
times-frac94.6%
associate-*l*97.1%
add-cube-cbrt97.3%
associate-/r*97.4%
Applied egg-rr97.3%
Taylor expanded in x around 0 79.0%
*-commutative79.0%
Simplified79.0%
Final simplification79.0%
(FPCore (x c s) :precision binary64 (let* ((t_0 (/ 1.0 (* (* s c) x)))) (* t_0 t_0)))
double code(double x, double c, double s) {
double t_0 = 1.0 / ((s * c) * x);
return 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 = 1.0d0 / ((s * c) * x)
code = t_0 * t_0
end function
public static double code(double x, double c, double s) {
double t_0 = 1.0 / ((s * c) * x);
return t_0 * t_0;
}
def code(x, c, s): t_0 = 1.0 / ((s * c) * x) return t_0 * t_0
function code(x, c, s) t_0 = Float64(1.0 / Float64(Float64(s * c) * x)) return Float64(t_0 * t_0) end
function tmp = code(x, c, s) t_0 = 1.0 / ((s * c) * x); tmp = t_0 * t_0; end
code[x_, c_, s_] := Block[{t$95$0 = N[(1.0 / N[(N[(s * c), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\left(s \cdot c\right) \cdot x}\\
t_0 \cdot t_0
\end{array}
\end{array}
Initial program 71.2%
*-commutative71.2%
associate-*l*66.8%
associate-*r*66.3%
*-commutative66.3%
unpow266.3%
associate-*r*71.8%
associate-*r*74.6%
*-commutative74.6%
unpow274.6%
Simplified74.6%
Taylor expanded in s around 0 66.8%
*-commutative66.8%
unpow266.8%
unpow266.8%
*-commutative66.8%
swap-sqr81.8%
unpow281.8%
swap-sqr98.2%
*-commutative98.2%
associate-*r*96.0%
*-commutative96.0%
associate-*r*97.3%
unpow297.3%
associate-*r*98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 61.2%
unpow261.2%
associate-/r*60.7%
unpow260.7%
unpow260.7%
swap-sqr70.9%
unpow270.9%
associate-/l/71.4%
*-commutative71.4%
unpow271.4%
swap-sqr79.6%
unpow279.6%
/-rgt-identity79.6%
unpow279.6%
associate-/l*79.6%
associate-/l*79.6%
associate-*l/79.6%
unpow-179.6%
unpow-179.6%
pow-sqr79.6%
metadata-eval79.6%
Simplified79.0%
metadata-eval97.3%
pow-prod-up97.3%
unpow-197.3%
associate-*r*96.3%
unpow-196.3%
associate-*r*98.5%
Applied egg-rr79.7%
Final simplification79.7%
(FPCore (x c s) :precision binary64 (/ (/ 1.0 (* c c)) (* x (* s (* s x)))))
double code(double x, double c, double s) {
return (1.0 / (c * c)) / (x * (s * (s * x)));
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = (1.0d0 / (c * c)) / (x * (s * (s * x)))
end function
public static double code(double x, double c, double s) {
return (1.0 / (c * c)) / (x * (s * (s * x)));
}
def code(x, c, s): return (1.0 / (c * c)) / (x * (s * (s * x)))
function code(x, c, s) return Float64(Float64(1.0 / Float64(c * c)) / Float64(x * Float64(s * Float64(s * x)))) end
function tmp = code(x, c, s) tmp = (1.0 / (c * c)) / (x * (s * (s * x))); end
code[x_, c_, s_] := N[(N[(1.0 / N[(c * c), $MachinePrecision]), $MachinePrecision] / N[(x * N[(s * N[(s * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{c \cdot c}}{x \cdot \left(s \cdot \left(s \cdot x\right)\right)}
\end{array}
Initial program 71.2%
associate-/r*70.5%
unpow270.5%
*-commutative70.5%
unpow270.5%
Simplified70.5%
Taylor expanded in x around 0 63.7%
unpow263.7%
Simplified63.7%
Taylor expanded in x around 0 63.7%
unpow263.7%
associate-*l*69.7%
Simplified69.7%
Final simplification69.7%
(FPCore (x c s) :precision binary64 (/ (/ -2.0 (* s s)) (* c c)))
double code(double x, double c, double s) {
return (-2.0 / (s * s)) / (c * c);
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = ((-2.0d0) / (s * s)) / (c * c)
end function
public static double code(double x, double c, double s) {
return (-2.0 / (s * s)) / (c * c);
}
def code(x, c, s): return (-2.0 / (s * s)) / (c * c)
function code(x, c, s) return Float64(Float64(-2.0 / Float64(s * s)) / Float64(c * c)) end
function tmp = code(x, c, s) tmp = (-2.0 / (s * s)) / (c * c); end
code[x_, c_, s_] := N[(N[(-2.0 / N[(s * s), $MachinePrecision]), $MachinePrecision] / N[(c * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{-2}{s \cdot s}}{c \cdot c}
\end{array}
Initial program 71.2%
*-commutative71.2%
associate-*l*66.8%
associate-*r*66.3%
*-commutative66.3%
unpow266.3%
associate-*r*71.8%
associate-*r*74.6%
*-commutative74.6%
unpow274.6%
Simplified74.6%
Taylor expanded in x around 0 34.5%
associate-/r*34.2%
unpow234.2%
unpow234.2%
unpow234.2%
*-commutative34.2%
associate-*r/34.2%
metadata-eval34.2%
unpow234.2%
*-commutative34.2%
unpow234.2%
Simplified34.2%
Taylor expanded in x around inf 26.9%
unpow226.9%
associate-/r*26.9%
unpow226.9%
Simplified26.9%
Final simplification26.9%
herbie shell --seed 2023182
(FPCore (x c s)
:name "mixedcos"
:precision binary64
(/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))