
(FPCore (x c s) :precision binary64 (/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))
double code(double x, double c, double s) {
return cos((2.0 * x)) / (pow(c, 2.0) * ((x * pow(s, 2.0)) * x));
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = cos((2.0d0 * x)) / ((c ** 2.0d0) * ((x * (s ** 2.0d0)) * x))
end function
public static double code(double x, double c, double s) {
return Math.cos((2.0 * x)) / (Math.pow(c, 2.0) * ((x * Math.pow(s, 2.0)) * x));
}
def code(x, c, s): return math.cos((2.0 * x)) / (math.pow(c, 2.0) * ((x * math.pow(s, 2.0)) * x))
function code(x, c, s) return Float64(cos(Float64(2.0 * x)) / Float64((c ^ 2.0) * Float64(Float64(x * (s ^ 2.0)) * x))) end
function tmp = code(x, c, s) tmp = cos((2.0 * x)) / ((c ^ 2.0) * ((x * (s ^ 2.0)) * x)); end
code[x_, c_, s_] := N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x c s) :precision binary64 (/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))
double code(double x, double c, double s) {
return cos((2.0 * x)) / (pow(c, 2.0) * ((x * pow(s, 2.0)) * x));
}
real(8) function code(x, c, s)
real(8), intent (in) :: x
real(8), intent (in) :: c
real(8), intent (in) :: s
code = cos((2.0d0 * x)) / ((c ** 2.0d0) * ((x * (s ** 2.0d0)) * x))
end function
public static double code(double x, double c, double s) {
return Math.cos((2.0 * x)) / (Math.pow(c, 2.0) * ((x * Math.pow(s, 2.0)) * x));
}
def code(x, c, s): return math.cos((2.0 * x)) / (math.pow(c, 2.0) * ((x * math.pow(s, 2.0)) * x))
function code(x, c, s) return Float64(cos(Float64(2.0 * x)) / Float64((c ^ 2.0) * Float64(Float64(x * (s ^ 2.0)) * x))) end
function tmp = code(x, c, s) tmp = cos((2.0 * x)) / ((c ^ 2.0) * ((x * (s ^ 2.0)) * x)); end
code[x_, c_, s_] := N[(N[Cos[N[(2.0 * x), $MachinePrecision]], $MachinePrecision] / N[(N[Power[c, 2.0], $MachinePrecision] * N[(N[(x * N[Power[s, 2.0], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}
\end{array}
x_m = (fabs.f64 x)
c_m = (fabs.f64 c)
s_m = (fabs.f64 s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
(FPCore (x_m c_m s_m)
:precision binary64
(let* ((t_0 (* s_m (* x_m c_m))))
(if (<= x_m 7e-9)
(pow (* c_m (* x_m s_m)) -2.0)
(* (/ 1.0 t_0) (/ (cos (* x_m -2.0)) t_0)))))x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
double t_0 = s_m * (x_m * c_m);
double tmp;
if (x_m <= 7e-9) {
tmp = pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = (1.0 / t_0) * (cos((x_m * -2.0)) / t_0);
}
return tmp;
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
real(8) :: t_0
real(8) :: tmp
t_0 = s_m * (x_m * c_m)
if (x_m <= 7d-9) then
tmp = (c_m * (x_m * s_m)) ** (-2.0d0)
else
tmp = (1.0d0 / t_0) * (cos((x_m * (-2.0d0))) / t_0)
end if
code = tmp
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
double t_0 = s_m * (x_m * c_m);
double tmp;
if (x_m <= 7e-9) {
tmp = Math.pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = (1.0 / t_0) * (Math.cos((x_m * -2.0)) / t_0);
}
return tmp;
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): t_0 = s_m * (x_m * c_m) tmp = 0 if x_m <= 7e-9: tmp = math.pow((c_m * (x_m * s_m)), -2.0) else: tmp = (1.0 / t_0) * (math.cos((x_m * -2.0)) / t_0) return tmp
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) t_0 = Float64(s_m * Float64(x_m * c_m)) tmp = 0.0 if (x_m <= 7e-9) tmp = Float64(c_m * Float64(x_m * s_m)) ^ -2.0; else tmp = Float64(Float64(1.0 / t_0) * Float64(cos(Float64(x_m * -2.0)) / t_0)); end return tmp end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp_2 = code(x_m, c_m, s_m)
t_0 = s_m * (x_m * c_m);
tmp = 0.0;
if (x_m <= 7e-9)
tmp = (c_m * (x_m * s_m)) ^ -2.0;
else
tmp = (1.0 / t_0) * (cos((x_m * -2.0)) / t_0);
end
tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision]
c_m = N[Abs[c], $MachinePrecision]
s_m = N[Abs[s], $MachinePrecision]
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
code[x$95$m_, c$95$m_, s$95$m_] := Block[{t$95$0 = N[(s$95$m * N[(x$95$m * c$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$95$m, 7e-9], N[Power[N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision], N[(N[(1.0 / t$95$0), $MachinePrecision] * N[(N[Cos[N[(x$95$m * -2.0), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\begin{array}{l}
t_0 := s\_m \cdot \left(x\_m \cdot c\_m\right)\\
\mathbf{if}\;x\_m \leq 7 \cdot 10^{-9}:\\
\;\;\;\;{\left(c\_m \cdot \left(x\_m \cdot s\_m\right)\right)}^{-2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_0} \cdot \frac{\cos \left(x\_m \cdot -2\right)}{t\_0}\\
\end{array}
\end{array}
if x < 6.9999999999999998e-9Initial program 64.3%
associate-/r*64.3%
unpow264.3%
sqr-neg64.3%
unpow264.3%
unpow264.3%
cos-neg64.3%
distribute-rgt-neg-out64.3%
sqr-neg64.3%
unpow264.3%
distribute-rgt-neg-out64.3%
*-commutative64.3%
distribute-rgt-neg-in64.3%
metadata-eval64.3%
*-commutative64.3%
associate-*l*56.5%
unpow256.5%
Simplified56.5%
Taylor expanded in x around 0 52.6%
associate-/r*52.6%
*-commutative52.6%
unpow252.6%
unpow252.6%
swap-sqr70.6%
unpow270.6%
associate-/r*70.6%
unpow270.6%
unpow270.6%
swap-sqr84.2%
unpow284.2%
associate-*r*83.7%
*-commutative83.7%
Simplified83.7%
*-un-lft-identity83.7%
pow-flip84.0%
metadata-eval84.0%
Applied egg-rr84.0%
*-lft-identity84.0%
associate-*r*84.3%
*-commutative84.3%
associate-*r*84.5%
Simplified84.5%
if 6.9999999999999998e-9 < x Initial program 68.6%
associate-/r*68.6%
unpow268.6%
sqr-neg68.6%
unpow268.6%
unpow268.6%
cos-neg68.6%
distribute-rgt-neg-out68.6%
sqr-neg68.6%
unpow268.6%
distribute-rgt-neg-out68.6%
*-commutative68.6%
distribute-rgt-neg-in68.6%
metadata-eval68.6%
*-commutative68.6%
associate-*l*63.1%
unpow263.1%
Simplified63.1%
Taylor expanded in x around inf 63.1%
associate-/r*63.1%
*-commutative63.1%
unpow263.1%
unpow263.1%
swap-sqr77.6%
unpow277.6%
associate-/r*77.7%
*-commutative77.7%
unpow277.7%
unpow277.7%
swap-sqr95.2%
unpow295.2%
associate-*r*91.6%
*-commutative91.6%
Simplified91.6%
*-un-lft-identity91.6%
unpow291.6%
times-frac92.2%
Applied egg-rr92.2%
Final simplification86.8%
x_m = (fabs.f64 x) c_m = (fabs.f64 c) s_m = (fabs.f64 s) NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. (FPCore (x_m c_m s_m) :precision binary64 (if (<= x_m 9.2e-60) (pow (* c_m (* x_m s_m)) -2.0) (/ (cos (* x_m -2.0)) (* (* c_m s_m) (* x_m (* s_m (* x_m c_m)))))))
x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
double tmp;
if (x_m <= 9.2e-60) {
tmp = pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = cos((x_m * -2.0)) / ((c_m * s_m) * (x_m * (s_m * (x_m * c_m))));
}
return tmp;
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
real(8) :: tmp
if (x_m <= 9.2d-60) then
tmp = (c_m * (x_m * s_m)) ** (-2.0d0)
else
tmp = cos((x_m * (-2.0d0))) / ((c_m * s_m) * (x_m * (s_m * (x_m * c_m))))
end if
code = tmp
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
double tmp;
if (x_m <= 9.2e-60) {
tmp = Math.pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = Math.cos((x_m * -2.0)) / ((c_m * s_m) * (x_m * (s_m * (x_m * c_m))));
}
return tmp;
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): tmp = 0 if x_m <= 9.2e-60: tmp = math.pow((c_m * (x_m * s_m)), -2.0) else: tmp = math.cos((x_m * -2.0)) / ((c_m * s_m) * (x_m * (s_m * (x_m * c_m)))) return tmp
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) tmp = 0.0 if (x_m <= 9.2e-60) tmp = Float64(c_m * Float64(x_m * s_m)) ^ -2.0; else tmp = Float64(cos(Float64(x_m * -2.0)) / Float64(Float64(c_m * s_m) * Float64(x_m * Float64(s_m * Float64(x_m * c_m))))); end return tmp end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp_2 = code(x_m, c_m, s_m)
tmp = 0.0;
if (x_m <= 9.2e-60)
tmp = (c_m * (x_m * s_m)) ^ -2.0;
else
tmp = cos((x_m * -2.0)) / ((c_m * s_m) * (x_m * (s_m * (x_m * c_m))));
end
tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision] c_m = N[Abs[c], $MachinePrecision] s_m = N[Abs[s], $MachinePrecision] NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. code[x$95$m_, c$95$m_, s$95$m_] := If[LessEqual[x$95$m, 9.2e-60], N[Power[N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision], N[(N[Cos[N[(x$95$m * -2.0), $MachinePrecision]], $MachinePrecision] / N[(N[(c$95$m * s$95$m), $MachinePrecision] * N[(x$95$m * N[(s$95$m * N[(x$95$m * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 9.2 \cdot 10^{-60}:\\
\;\;\;\;{\left(c\_m \cdot \left(x\_m \cdot s\_m\right)\right)}^{-2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(x\_m \cdot -2\right)}{\left(c\_m \cdot s\_m\right) \cdot \left(x\_m \cdot \left(s\_m \cdot \left(x\_m \cdot c\_m\right)\right)\right)}\\
\end{array}
\end{array}
if x < 9.2000000000000005e-60Initial program 64.4%
associate-/r*64.3%
unpow264.3%
sqr-neg64.3%
unpow264.3%
unpow264.3%
cos-neg64.3%
distribute-rgt-neg-out64.3%
sqr-neg64.3%
unpow264.3%
distribute-rgt-neg-out64.3%
*-commutative64.3%
distribute-rgt-neg-in64.3%
metadata-eval64.3%
*-commutative64.3%
associate-*l*56.2%
unpow256.2%
Simplified56.2%
Taylor expanded in x around 0 52.1%
associate-/r*52.1%
*-commutative52.1%
unpow252.1%
unpow252.1%
swap-sqr71.0%
unpow271.0%
associate-/r*71.0%
unpow271.0%
unpow271.0%
swap-sqr83.4%
unpow283.4%
associate-*r*82.9%
*-commutative82.9%
Simplified82.9%
*-un-lft-identity82.9%
pow-flip83.3%
metadata-eval83.3%
Applied egg-rr83.3%
*-lft-identity83.3%
associate-*r*83.6%
*-commutative83.6%
associate-*r*83.8%
Simplified83.8%
if 9.2000000000000005e-60 < x Initial program 68.1%
associate-/r*68.1%
unpow268.1%
sqr-neg68.1%
unpow268.1%
unpow268.1%
cos-neg68.1%
distribute-rgt-neg-out68.1%
sqr-neg68.1%
unpow268.1%
distribute-rgt-neg-out68.1%
*-commutative68.1%
distribute-rgt-neg-in68.1%
metadata-eval68.1%
*-commutative68.1%
associate-*l*63.1%
unpow263.1%
Simplified63.1%
Taylor expanded in x around inf 63.1%
associate-/r*63.1%
*-commutative63.1%
unpow263.1%
unpow263.1%
swap-sqr76.3%
unpow276.3%
associate-/r*76.3%
*-commutative76.3%
unpow276.3%
unpow276.3%
swap-sqr95.6%
unpow295.6%
associate-*r*92.4%
*-commutative92.4%
Simplified92.4%
unpow261.4%
associate-*r*60.9%
associate-*l*60.5%
Applied egg-rr86.9%
Final simplification84.9%
x_m = (fabs.f64 x) c_m = (fabs.f64 c) s_m = (fabs.f64 s) NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. (FPCore (x_m c_m s_m) :precision binary64 (if (<= x_m 2.4e-26) (pow (* c_m (* x_m s_m)) -2.0) (/ (cos (* x_m -2.0)) (* (* x_m c_m) (* s_m (* s_m (* x_m c_m)))))))
x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
double tmp;
if (x_m <= 2.4e-26) {
tmp = pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = cos((x_m * -2.0)) / ((x_m * c_m) * (s_m * (s_m * (x_m * c_m))));
}
return tmp;
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
real(8) :: tmp
if (x_m <= 2.4d-26) then
tmp = (c_m * (x_m * s_m)) ** (-2.0d0)
else
tmp = cos((x_m * (-2.0d0))) / ((x_m * c_m) * (s_m * (s_m * (x_m * c_m))))
end if
code = tmp
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
double tmp;
if (x_m <= 2.4e-26) {
tmp = Math.pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = Math.cos((x_m * -2.0)) / ((x_m * c_m) * (s_m * (s_m * (x_m * c_m))));
}
return tmp;
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): tmp = 0 if x_m <= 2.4e-26: tmp = math.pow((c_m * (x_m * s_m)), -2.0) else: tmp = math.cos((x_m * -2.0)) / ((x_m * c_m) * (s_m * (s_m * (x_m * c_m)))) return tmp
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) tmp = 0.0 if (x_m <= 2.4e-26) tmp = Float64(c_m * Float64(x_m * s_m)) ^ -2.0; else tmp = Float64(cos(Float64(x_m * -2.0)) / Float64(Float64(x_m * c_m) * Float64(s_m * Float64(s_m * Float64(x_m * c_m))))); end return tmp end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp_2 = code(x_m, c_m, s_m)
tmp = 0.0;
if (x_m <= 2.4e-26)
tmp = (c_m * (x_m * s_m)) ^ -2.0;
else
tmp = cos((x_m * -2.0)) / ((x_m * c_m) * (s_m * (s_m * (x_m * c_m))));
end
tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision] c_m = N[Abs[c], $MachinePrecision] s_m = N[Abs[s], $MachinePrecision] NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. code[x$95$m_, c$95$m_, s$95$m_] := If[LessEqual[x$95$m, 2.4e-26], N[Power[N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision], N[(N[Cos[N[(x$95$m * -2.0), $MachinePrecision]], $MachinePrecision] / N[(N[(x$95$m * c$95$m), $MachinePrecision] * N[(s$95$m * N[(s$95$m * N[(x$95$m * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 2.4 \cdot 10^{-26}:\\
\;\;\;\;{\left(c\_m \cdot \left(x\_m \cdot s\_m\right)\right)}^{-2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(x\_m \cdot -2\right)}{\left(x\_m \cdot c\_m\right) \cdot \left(s\_m \cdot \left(s\_m \cdot \left(x\_m \cdot c\_m\right)\right)\right)}\\
\end{array}
\end{array}
if x < 2.4000000000000001e-26Initial program 64.1%
associate-/r*64.1%
unpow264.1%
sqr-neg64.1%
unpow264.1%
unpow264.1%
cos-neg64.1%
distribute-rgt-neg-out64.1%
sqr-neg64.1%
unpow264.1%
distribute-rgt-neg-out64.1%
*-commutative64.1%
distribute-rgt-neg-in64.1%
metadata-eval64.1%
*-commutative64.1%
associate-*l*56.3%
unpow256.3%
Simplified56.3%
Taylor expanded in x around 0 52.4%
associate-/r*52.3%
*-commutative52.3%
unpow252.3%
unpow252.3%
swap-sqr70.5%
unpow270.5%
associate-/r*70.5%
unpow270.5%
unpow270.5%
swap-sqr84.1%
unpow284.1%
associate-*r*83.6%
*-commutative83.6%
Simplified83.6%
*-un-lft-identity83.6%
pow-flip83.9%
metadata-eval83.9%
Applied egg-rr83.9%
*-lft-identity83.9%
associate-*r*84.3%
*-commutative84.3%
associate-*r*84.4%
Simplified84.4%
if 2.4000000000000001e-26 < x Initial program 69.0%
associate-/r*69.0%
unpow269.0%
sqr-neg69.0%
unpow269.0%
unpow269.0%
cos-neg69.0%
distribute-rgt-neg-out69.0%
sqr-neg69.0%
unpow269.0%
distribute-rgt-neg-out69.0%
*-commutative69.0%
distribute-rgt-neg-in69.0%
metadata-eval69.0%
*-commutative69.0%
associate-*l*63.6%
unpow263.6%
Simplified63.6%
Taylor expanded in x around inf 63.6%
associate-/r*63.6%
*-commutative63.6%
unpow263.6%
unpow263.6%
swap-sqr77.9%
unpow277.9%
associate-/r*77.9%
*-commutative77.9%
unpow277.9%
unpow277.9%
swap-sqr95.3%
unpow295.3%
associate-*r*91.7%
*-commutative91.7%
Simplified91.7%
unpow291.7%
associate-*r*89.4%
Applied egg-rr89.4%
Final simplification85.9%
x_m = (fabs.f64 x) c_m = (fabs.f64 c) s_m = (fabs.f64 s) NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. (FPCore (x_m c_m s_m) :precision binary64 (if (<= x_m 1.1e-25) (pow (* c_m (* x_m s_m)) -2.0) (/ (cos (* x_m -2.0)) (* s_m (* (* x_m c_m) (* s_m (* x_m c_m)))))))
x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
double tmp;
if (x_m <= 1.1e-25) {
tmp = pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = cos((x_m * -2.0)) / (s_m * ((x_m * c_m) * (s_m * (x_m * c_m))));
}
return tmp;
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
real(8) :: tmp
if (x_m <= 1.1d-25) then
tmp = (c_m * (x_m * s_m)) ** (-2.0d0)
else
tmp = cos((x_m * (-2.0d0))) / (s_m * ((x_m * c_m) * (s_m * (x_m * c_m))))
end if
code = tmp
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
double tmp;
if (x_m <= 1.1e-25) {
tmp = Math.pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = Math.cos((x_m * -2.0)) / (s_m * ((x_m * c_m) * (s_m * (x_m * c_m))));
}
return tmp;
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): tmp = 0 if x_m <= 1.1e-25: tmp = math.pow((c_m * (x_m * s_m)), -2.0) else: tmp = math.cos((x_m * -2.0)) / (s_m * ((x_m * c_m) * (s_m * (x_m * c_m)))) return tmp
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) tmp = 0.0 if (x_m <= 1.1e-25) tmp = Float64(c_m * Float64(x_m * s_m)) ^ -2.0; else tmp = Float64(cos(Float64(x_m * -2.0)) / Float64(s_m * Float64(Float64(x_m * c_m) * Float64(s_m * Float64(x_m * c_m))))); end return tmp end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp_2 = code(x_m, c_m, s_m)
tmp = 0.0;
if (x_m <= 1.1e-25)
tmp = (c_m * (x_m * s_m)) ^ -2.0;
else
tmp = cos((x_m * -2.0)) / (s_m * ((x_m * c_m) * (s_m * (x_m * c_m))));
end
tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision] c_m = N[Abs[c], $MachinePrecision] s_m = N[Abs[s], $MachinePrecision] NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. code[x$95$m_, c$95$m_, s$95$m_] := If[LessEqual[x$95$m, 1.1e-25], N[Power[N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision], N[(N[Cos[N[(x$95$m * -2.0), $MachinePrecision]], $MachinePrecision] / N[(s$95$m * N[(N[(x$95$m * c$95$m), $MachinePrecision] * N[(s$95$m * N[(x$95$m * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 1.1 \cdot 10^{-25}:\\
\;\;\;\;{\left(c\_m \cdot \left(x\_m \cdot s\_m\right)\right)}^{-2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(x\_m \cdot -2\right)}{s\_m \cdot \left(\left(x\_m \cdot c\_m\right) \cdot \left(s\_m \cdot \left(x\_m \cdot c\_m\right)\right)\right)}\\
\end{array}
\end{array}
if x < 1.1000000000000001e-25Initial program 64.1%
associate-/r*64.1%
unpow264.1%
sqr-neg64.1%
unpow264.1%
unpow264.1%
cos-neg64.1%
distribute-rgt-neg-out64.1%
sqr-neg64.1%
unpow264.1%
distribute-rgt-neg-out64.1%
*-commutative64.1%
distribute-rgt-neg-in64.1%
metadata-eval64.1%
*-commutative64.1%
associate-*l*56.3%
unpow256.3%
Simplified56.3%
Taylor expanded in x around 0 52.4%
associate-/r*52.3%
*-commutative52.3%
unpow252.3%
unpow252.3%
swap-sqr70.5%
unpow270.5%
associate-/r*70.5%
unpow270.5%
unpow270.5%
swap-sqr84.1%
unpow284.1%
associate-*r*83.6%
*-commutative83.6%
Simplified83.6%
*-un-lft-identity83.6%
pow-flip83.9%
metadata-eval83.9%
Applied egg-rr83.9%
*-lft-identity83.9%
associate-*r*84.3%
*-commutative84.3%
associate-*r*84.4%
Simplified84.4%
if 1.1000000000000001e-25 < x Initial program 69.0%
associate-/r*69.0%
unpow269.0%
sqr-neg69.0%
unpow269.0%
unpow269.0%
cos-neg69.0%
distribute-rgt-neg-out69.0%
sqr-neg69.0%
unpow269.0%
distribute-rgt-neg-out69.0%
*-commutative69.0%
distribute-rgt-neg-in69.0%
metadata-eval69.0%
*-commutative69.0%
associate-*l*63.6%
unpow263.6%
Simplified63.6%
Taylor expanded in x around inf 63.6%
associate-/r*63.6%
*-commutative63.6%
unpow263.6%
unpow263.6%
swap-sqr77.9%
unpow277.9%
associate-/r*77.9%
*-commutative77.9%
unpow277.9%
unpow277.9%
swap-sqr95.3%
unpow295.3%
associate-*r*91.7%
*-commutative91.7%
Simplified91.7%
unpow291.7%
*-commutative91.7%
associate-*r*89.3%
Applied egg-rr89.3%
Final simplification85.9%
x_m = (fabs.f64 x) c_m = (fabs.f64 c) s_m = (fabs.f64 s) NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. (FPCore (x_m c_m s_m) :precision binary64 (if (<= x_m 8.2e+30) (pow (* c_m (* x_m s_m)) -2.0) (- (pow (/ 1.0 (* s_m (* x_m c_m))) 2.0))))
x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
double tmp;
if (x_m <= 8.2e+30) {
tmp = pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = -pow((1.0 / (s_m * (x_m * c_m))), 2.0);
}
return tmp;
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
real(8) :: tmp
if (x_m <= 8.2d+30) then
tmp = (c_m * (x_m * s_m)) ** (-2.0d0)
else
tmp = -((1.0d0 / (s_m * (x_m * c_m))) ** 2.0d0)
end if
code = tmp
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
double tmp;
if (x_m <= 8.2e+30) {
tmp = Math.pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = -Math.pow((1.0 / (s_m * (x_m * c_m))), 2.0);
}
return tmp;
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): tmp = 0 if x_m <= 8.2e+30: tmp = math.pow((c_m * (x_m * s_m)), -2.0) else: tmp = -math.pow((1.0 / (s_m * (x_m * c_m))), 2.0) return tmp
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) tmp = 0.0 if (x_m <= 8.2e+30) tmp = Float64(c_m * Float64(x_m * s_m)) ^ -2.0; else tmp = Float64(-(Float64(1.0 / Float64(s_m * Float64(x_m * c_m))) ^ 2.0)); end return tmp end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp_2 = code(x_m, c_m, s_m)
tmp = 0.0;
if (x_m <= 8.2e+30)
tmp = (c_m * (x_m * s_m)) ^ -2.0;
else
tmp = -((1.0 / (s_m * (x_m * c_m))) ^ 2.0);
end
tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision] c_m = N[Abs[c], $MachinePrecision] s_m = N[Abs[s], $MachinePrecision] NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. code[x$95$m_, c$95$m_, s$95$m_] := If[LessEqual[x$95$m, 8.2e+30], N[Power[N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision], (-N[Power[N[(1.0 / N[(s$95$m * N[(x$95$m * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision])]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 8.2 \cdot 10^{+30}:\\
\;\;\;\;{\left(c\_m \cdot \left(x\_m \cdot s\_m\right)\right)}^{-2}\\
\mathbf{else}:\\
\;\;\;\;-{\left(\frac{1}{s\_m \cdot \left(x\_m \cdot c\_m\right)}\right)}^{2}\\
\end{array}
\end{array}
if x < 8.20000000000000011e30Initial program 66.7%
associate-/r*66.7%
unpow266.7%
sqr-neg66.7%
unpow266.7%
unpow266.7%
cos-neg66.7%
distribute-rgt-neg-out66.7%
sqr-neg66.7%
unpow266.7%
distribute-rgt-neg-out66.7%
*-commutative66.7%
distribute-rgt-neg-in66.7%
metadata-eval66.7%
*-commutative66.7%
associate-*l*59.4%
unpow259.4%
Simplified59.4%
Taylor expanded in x around 0 53.2%
associate-/r*53.2%
*-commutative53.2%
unpow253.2%
unpow253.2%
swap-sqr70.0%
unpow270.0%
associate-/r*69.9%
unpow269.9%
unpow269.9%
swap-sqr82.6%
unpow282.6%
associate-*r*82.1%
*-commutative82.1%
Simplified82.1%
*-un-lft-identity82.1%
pow-flip82.5%
metadata-eval82.5%
Applied egg-rr82.5%
*-lft-identity82.5%
associate-*r*82.7%
*-commutative82.7%
associate-*r*82.9%
Simplified82.9%
if 8.20000000000000011e30 < x Initial program 62.3%
associate-/r*62.3%
unpow262.3%
sqr-neg62.3%
unpow262.3%
unpow262.3%
cos-neg62.3%
distribute-rgt-neg-out62.3%
sqr-neg62.3%
unpow262.3%
distribute-rgt-neg-out62.3%
*-commutative62.3%
distribute-rgt-neg-in62.3%
metadata-eval62.3%
*-commutative62.3%
associate-*l*55.8%
unpow255.8%
Simplified55.8%
Taylor expanded in x around 0 46.6%
associate-/r*46.6%
*-commutative46.6%
unpow246.6%
unpow246.6%
swap-sqr52.4%
unpow252.4%
associate-/r*52.4%
unpow252.4%
unpow252.4%
swap-sqr57.3%
unpow257.3%
associate-*r*56.7%
*-commutative56.7%
Simplified56.7%
unpow256.7%
associate-*r*56.1%
associate-*l*55.6%
Applied egg-rr55.6%
Taylor expanded in s around 0 56.0%
Applied egg-rr64.5%
neg-mul-164.5%
associate-/l/64.5%
*-commutative64.5%
Simplified64.5%
Final simplification78.3%
x_m = (fabs.f64 x) c_m = (fabs.f64 c) s_m = (fabs.f64 s) NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. (FPCore (x_m c_m s_m) :precision binary64 (if (<= x_m 8.2e+30) (pow (* c_m (* x_m s_m)) -2.0) (/ (/ (/ -1.0 s_m) (* x_m c_m)) (* x_m (* c_m s_m)))))
x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
double tmp;
if (x_m <= 8.2e+30) {
tmp = pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = ((-1.0 / s_m) / (x_m * c_m)) / (x_m * (c_m * s_m));
}
return tmp;
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
real(8) :: tmp
if (x_m <= 8.2d+30) then
tmp = (c_m * (x_m * s_m)) ** (-2.0d0)
else
tmp = (((-1.0d0) / s_m) / (x_m * c_m)) / (x_m * (c_m * s_m))
end if
code = tmp
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
double tmp;
if (x_m <= 8.2e+30) {
tmp = Math.pow((c_m * (x_m * s_m)), -2.0);
} else {
tmp = ((-1.0 / s_m) / (x_m * c_m)) / (x_m * (c_m * s_m));
}
return tmp;
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): tmp = 0 if x_m <= 8.2e+30: tmp = math.pow((c_m * (x_m * s_m)), -2.0) else: tmp = ((-1.0 / s_m) / (x_m * c_m)) / (x_m * (c_m * s_m)) return tmp
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) tmp = 0.0 if (x_m <= 8.2e+30) tmp = Float64(c_m * Float64(x_m * s_m)) ^ -2.0; else tmp = Float64(Float64(Float64(-1.0 / s_m) / Float64(x_m * c_m)) / Float64(x_m * Float64(c_m * s_m))); end return tmp end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp_2 = code(x_m, c_m, s_m)
tmp = 0.0;
if (x_m <= 8.2e+30)
tmp = (c_m * (x_m * s_m)) ^ -2.0;
else
tmp = ((-1.0 / s_m) / (x_m * c_m)) / (x_m * (c_m * s_m));
end
tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision] c_m = N[Abs[c], $MachinePrecision] s_m = N[Abs[s], $MachinePrecision] NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. code[x$95$m_, c$95$m_, s$95$m_] := If[LessEqual[x$95$m, 8.2e+30], N[Power[N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision], N[(N[(N[(-1.0 / s$95$m), $MachinePrecision] / N[(x$95$m * c$95$m), $MachinePrecision]), $MachinePrecision] / N[(x$95$m * N[(c$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\begin{array}{l}
\mathbf{if}\;x\_m \leq 8.2 \cdot 10^{+30}:\\
\;\;\;\;{\left(c\_m \cdot \left(x\_m \cdot s\_m\right)\right)}^{-2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{-1}{s\_m}}{x\_m \cdot c\_m}}{x\_m \cdot \left(c\_m \cdot s\_m\right)}\\
\end{array}
\end{array}
if x < 8.20000000000000011e30Initial program 66.7%
associate-/r*66.7%
unpow266.7%
sqr-neg66.7%
unpow266.7%
unpow266.7%
cos-neg66.7%
distribute-rgt-neg-out66.7%
sqr-neg66.7%
unpow266.7%
distribute-rgt-neg-out66.7%
*-commutative66.7%
distribute-rgt-neg-in66.7%
metadata-eval66.7%
*-commutative66.7%
associate-*l*59.4%
unpow259.4%
Simplified59.4%
Taylor expanded in x around 0 53.2%
associate-/r*53.2%
*-commutative53.2%
unpow253.2%
unpow253.2%
swap-sqr70.0%
unpow270.0%
associate-/r*69.9%
unpow269.9%
unpow269.9%
swap-sqr82.6%
unpow282.6%
associate-*r*82.1%
*-commutative82.1%
Simplified82.1%
*-un-lft-identity82.1%
pow-flip82.5%
metadata-eval82.5%
Applied egg-rr82.5%
*-lft-identity82.5%
associate-*r*82.7%
*-commutative82.7%
associate-*r*82.9%
Simplified82.9%
if 8.20000000000000011e30 < x Initial program 62.3%
associate-/r*62.3%
unpow262.3%
sqr-neg62.3%
unpow262.3%
unpow262.3%
cos-neg62.3%
distribute-rgt-neg-out62.3%
sqr-neg62.3%
unpow262.3%
distribute-rgt-neg-out62.3%
*-commutative62.3%
distribute-rgt-neg-in62.3%
metadata-eval62.3%
*-commutative62.3%
associate-*l*55.8%
unpow255.8%
Simplified55.8%
Taylor expanded in x around 0 46.6%
associate-/r*46.6%
*-commutative46.6%
unpow246.6%
unpow246.6%
swap-sqr52.4%
unpow252.4%
associate-/r*52.4%
unpow252.4%
unpow252.4%
swap-sqr57.3%
unpow257.3%
associate-*r*56.7%
*-commutative56.7%
Simplified56.7%
unpow256.7%
associate-*r*56.1%
associate-*l*55.6%
Applied egg-rr55.6%
associate-*r*56.1%
associate-*r*56.7%
pow256.7%
associate-*r*56.8%
*-commutative56.8%
associate-*r*57.3%
pow-flip57.4%
associate-*r*56.9%
*-commutative56.9%
metadata-eval56.9%
pow-prod-down53.6%
*-commutative53.6%
sqr-pow53.6%
associate-*l*56.3%
metadata-eval56.3%
unpow-156.3%
metadata-eval56.3%
unpow-156.3%
Applied egg-rr56.3%
Applied egg-rr64.5%
Final simplification78.3%
x_m = (fabs.f64 x) c_m = (fabs.f64 c) s_m = (fabs.f64 s) NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. (FPCore (x_m c_m s_m) :precision binary64 (if (<= c_m 2e-43) (/ (/ (/ (/ 1.0 s_m) c_m) x_m) (* x_m (* c_m s_m))) (* (/ 1.0 (* s_m (* x_m c_m))) (/ 1.0 (* c_m (* x_m s_m))))))
x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
double tmp;
if (c_m <= 2e-43) {
tmp = (((1.0 / s_m) / c_m) / x_m) / (x_m * (c_m * s_m));
} else {
tmp = (1.0 / (s_m * (x_m * c_m))) * (1.0 / (c_m * (x_m * s_m)));
}
return tmp;
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
real(8) :: tmp
if (c_m <= 2d-43) then
tmp = (((1.0d0 / s_m) / c_m) / x_m) / (x_m * (c_m * s_m))
else
tmp = (1.0d0 / (s_m * (x_m * c_m))) * (1.0d0 / (c_m * (x_m * s_m)))
end if
code = tmp
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
double tmp;
if (c_m <= 2e-43) {
tmp = (((1.0 / s_m) / c_m) / x_m) / (x_m * (c_m * s_m));
} else {
tmp = (1.0 / (s_m * (x_m * c_m))) * (1.0 / (c_m * (x_m * s_m)));
}
return tmp;
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): tmp = 0 if c_m <= 2e-43: tmp = (((1.0 / s_m) / c_m) / x_m) / (x_m * (c_m * s_m)) else: tmp = (1.0 / (s_m * (x_m * c_m))) * (1.0 / (c_m * (x_m * s_m))) return tmp
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) tmp = 0.0 if (c_m <= 2e-43) tmp = Float64(Float64(Float64(Float64(1.0 / s_m) / c_m) / x_m) / Float64(x_m * Float64(c_m * s_m))); else tmp = Float64(Float64(1.0 / Float64(s_m * Float64(x_m * c_m))) * Float64(1.0 / Float64(c_m * Float64(x_m * s_m)))); end return tmp end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp_2 = code(x_m, c_m, s_m)
tmp = 0.0;
if (c_m <= 2e-43)
tmp = (((1.0 / s_m) / c_m) / x_m) / (x_m * (c_m * s_m));
else
tmp = (1.0 / (s_m * (x_m * c_m))) * (1.0 / (c_m * (x_m * s_m)));
end
tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision] c_m = N[Abs[c], $MachinePrecision] s_m = N[Abs[s], $MachinePrecision] NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. code[x$95$m_, c$95$m_, s$95$m_] := If[LessEqual[c$95$m, 2e-43], N[(N[(N[(N[(1.0 / s$95$m), $MachinePrecision] / c$95$m), $MachinePrecision] / x$95$m), $MachinePrecision] / N[(x$95$m * N[(c$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(s$95$m * N[(x$95$m * c$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\begin{array}{l}
\mathbf{if}\;c\_m \leq 2 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{\frac{\frac{1}{s\_m}}{c\_m}}{x\_m}}{x\_m \cdot \left(c\_m \cdot s\_m\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{s\_m \cdot \left(x\_m \cdot c\_m\right)} \cdot \frac{1}{c\_m \cdot \left(x\_m \cdot s\_m\right)}\\
\end{array}
\end{array}
if c < 2.00000000000000015e-43Initial program 66.1%
associate-/r*66.0%
unpow266.0%
sqr-neg66.0%
unpow266.0%
unpow266.0%
cos-neg66.0%
distribute-rgt-neg-out66.0%
sqr-neg66.0%
unpow266.0%
distribute-rgt-neg-out66.0%
*-commutative66.0%
distribute-rgt-neg-in66.0%
metadata-eval66.0%
*-commutative66.0%
associate-*l*58.0%
unpow258.0%
Simplified58.0%
Taylor expanded in x around 0 49.2%
associate-/r*49.2%
*-commutative49.2%
unpow249.2%
unpow249.2%
swap-sqr62.5%
unpow262.5%
associate-/r*62.5%
unpow262.5%
unpow262.5%
swap-sqr74.6%
unpow274.6%
associate-*r*72.7%
*-commutative72.7%
Simplified72.7%
pow-flip73.0%
associate-*r*74.5%
metadata-eval74.5%
unpow-prod-down64.0%
Applied egg-rr64.0%
pow-prod-down74.5%
associate-*r*73.0%
metadata-eval73.0%
pow-prod-up72.9%
inv-pow72.9%
inv-pow72.9%
un-div-inv72.9%
associate-/r*72.9%
associate-/r*72.3%
associate-*r*74.5%
*-commutative74.5%
Applied egg-rr74.5%
if 2.00000000000000015e-43 < c Initial program 64.5%
associate-/r*64.5%
unpow264.5%
sqr-neg64.5%
unpow264.5%
unpow264.5%
cos-neg64.5%
distribute-rgt-neg-out64.5%
sqr-neg64.5%
unpow264.5%
distribute-rgt-neg-out64.5%
*-commutative64.5%
distribute-rgt-neg-in64.5%
metadata-eval64.5%
*-commutative64.5%
associate-*l*59.9%
unpow259.9%
Simplified59.9%
Taylor expanded in x around inf 59.9%
associate-/r*59.9%
*-commutative59.9%
unpow259.9%
unpow259.9%
swap-sqr81.9%
unpow281.9%
associate-/r*81.9%
*-commutative81.9%
unpow281.9%
unpow281.9%
swap-sqr93.5%
unpow293.5%
associate-*r*89.6%
*-commutative89.6%
Simplified89.6%
*-un-lft-identity89.6%
unpow289.6%
times-frac90.6%
Applied egg-rr90.6%
Taylor expanded in x around 0 80.2%
Final simplification76.1%
x_m = (fabs.f64 x)
c_m = (fabs.f64 c)
s_m = (fabs.f64 s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
(FPCore (x_m c_m s_m)
:precision binary64
(let* ((t_0 (/ (/ (/ 1.0 s_m) c_m) x_m)))
(if (<= x_m 8.2e+30)
(* t_0 t_0)
(/ (/ (/ -1.0 s_m) (* x_m c_m)) (* x_m (* c_m s_m))))))x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
double t_0 = ((1.0 / s_m) / c_m) / x_m;
double tmp;
if (x_m <= 8.2e+30) {
tmp = t_0 * t_0;
} else {
tmp = ((-1.0 / s_m) / (x_m * c_m)) / (x_m * (c_m * s_m));
}
return tmp;
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
real(8) :: t_0
real(8) :: tmp
t_0 = ((1.0d0 / s_m) / c_m) / x_m
if (x_m <= 8.2d+30) then
tmp = t_0 * t_0
else
tmp = (((-1.0d0) / s_m) / (x_m * c_m)) / (x_m * (c_m * s_m))
end if
code = tmp
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
double t_0 = ((1.0 / s_m) / c_m) / x_m;
double tmp;
if (x_m <= 8.2e+30) {
tmp = t_0 * t_0;
} else {
tmp = ((-1.0 / s_m) / (x_m * c_m)) / (x_m * (c_m * s_m));
}
return tmp;
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): t_0 = ((1.0 / s_m) / c_m) / x_m tmp = 0 if x_m <= 8.2e+30: tmp = t_0 * t_0 else: tmp = ((-1.0 / s_m) / (x_m * c_m)) / (x_m * (c_m * s_m)) return tmp
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) t_0 = Float64(Float64(Float64(1.0 / s_m) / c_m) / x_m) tmp = 0.0 if (x_m <= 8.2e+30) tmp = Float64(t_0 * t_0); else tmp = Float64(Float64(Float64(-1.0 / s_m) / Float64(x_m * c_m)) / Float64(x_m * Float64(c_m * s_m))); end return tmp end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp_2 = code(x_m, c_m, s_m)
t_0 = ((1.0 / s_m) / c_m) / x_m;
tmp = 0.0;
if (x_m <= 8.2e+30)
tmp = t_0 * t_0;
else
tmp = ((-1.0 / s_m) / (x_m * c_m)) / (x_m * (c_m * s_m));
end
tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision]
c_m = N[Abs[c], $MachinePrecision]
s_m = N[Abs[s], $MachinePrecision]
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
code[x$95$m_, c$95$m_, s$95$m_] := Block[{t$95$0 = N[(N[(N[(1.0 / s$95$m), $MachinePrecision] / c$95$m), $MachinePrecision] / x$95$m), $MachinePrecision]}, If[LessEqual[x$95$m, 8.2e+30], N[(t$95$0 * t$95$0), $MachinePrecision], N[(N[(N[(-1.0 / s$95$m), $MachinePrecision] / N[(x$95$m * c$95$m), $MachinePrecision]), $MachinePrecision] / N[(x$95$m * N[(c$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{\frac{1}{s\_m}}{c\_m}}{x\_m}\\
\mathbf{if}\;x\_m \leq 8.2 \cdot 10^{+30}:\\
\;\;\;\;t\_0 \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{-1}{s\_m}}{x\_m \cdot c\_m}}{x\_m \cdot \left(c\_m \cdot s\_m\right)}\\
\end{array}
\end{array}
if x < 8.20000000000000011e30Initial program 66.7%
associate-/r*66.7%
unpow266.7%
sqr-neg66.7%
unpow266.7%
unpow266.7%
cos-neg66.7%
distribute-rgt-neg-out66.7%
sqr-neg66.7%
unpow266.7%
distribute-rgt-neg-out66.7%
*-commutative66.7%
distribute-rgt-neg-in66.7%
metadata-eval66.7%
*-commutative66.7%
associate-*l*59.4%
unpow259.4%
Simplified59.4%
Taylor expanded in x around 0 53.2%
associate-/r*53.2%
*-commutative53.2%
unpow253.2%
unpow253.2%
swap-sqr70.0%
unpow270.0%
associate-/r*69.9%
unpow269.9%
unpow269.9%
swap-sqr82.6%
unpow282.6%
associate-*r*82.1%
*-commutative82.1%
Simplified82.1%
unpow282.1%
associate-*r*80.3%
associate-*l*79.3%
Applied egg-rr79.3%
associate-/r*79.3%
inv-pow79.3%
metadata-eval79.3%
associate-/r*80.2%
metadata-eval80.2%
inv-pow80.2%
associate-/r*80.2%
associate-*r*82.4%
un-div-inv82.4%
associate-/r*82.4%
associate-/r*80.5%
associate-/r*80.5%
associate-/r*83.0%
Applied egg-rr83.0%
if 8.20000000000000011e30 < x Initial program 62.3%
associate-/r*62.3%
unpow262.3%
sqr-neg62.3%
unpow262.3%
unpow262.3%
cos-neg62.3%
distribute-rgt-neg-out62.3%
sqr-neg62.3%
unpow262.3%
distribute-rgt-neg-out62.3%
*-commutative62.3%
distribute-rgt-neg-in62.3%
metadata-eval62.3%
*-commutative62.3%
associate-*l*55.8%
unpow255.8%
Simplified55.8%
Taylor expanded in x around 0 46.6%
associate-/r*46.6%
*-commutative46.6%
unpow246.6%
unpow246.6%
swap-sqr52.4%
unpow252.4%
associate-/r*52.4%
unpow252.4%
unpow252.4%
swap-sqr57.3%
unpow257.3%
associate-*r*56.7%
*-commutative56.7%
Simplified56.7%
unpow256.7%
associate-*r*56.1%
associate-*l*55.6%
Applied egg-rr55.6%
associate-*r*56.1%
associate-*r*56.7%
pow256.7%
associate-*r*56.8%
*-commutative56.8%
associate-*r*57.3%
pow-flip57.4%
associate-*r*56.9%
*-commutative56.9%
metadata-eval56.9%
pow-prod-down53.6%
*-commutative53.6%
sqr-pow53.6%
associate-*l*56.3%
metadata-eval56.3%
unpow-156.3%
metadata-eval56.3%
unpow-156.3%
Applied egg-rr56.3%
Applied egg-rr64.5%
Final simplification78.4%
x_m = (fabs.f64 x)
c_m = (fabs.f64 c)
s_m = (fabs.f64 s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
(FPCore (x_m c_m s_m)
:precision binary64
(let* ((t_0 (* x_m (* c_m s_m))))
(if (<= x_m 8.2e+30)
(/ 1.0 (* c_m (* t_0 (* x_m s_m))))
(/ (/ (/ -1.0 s_m) (* x_m c_m)) t_0))))x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
double t_0 = x_m * (c_m * s_m);
double tmp;
if (x_m <= 8.2e+30) {
tmp = 1.0 / (c_m * (t_0 * (x_m * s_m)));
} else {
tmp = ((-1.0 / s_m) / (x_m * c_m)) / t_0;
}
return tmp;
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
real(8) :: t_0
real(8) :: tmp
t_0 = x_m * (c_m * s_m)
if (x_m <= 8.2d+30) then
tmp = 1.0d0 / (c_m * (t_0 * (x_m * s_m)))
else
tmp = (((-1.0d0) / s_m) / (x_m * c_m)) / t_0
end if
code = tmp
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
double t_0 = x_m * (c_m * s_m);
double tmp;
if (x_m <= 8.2e+30) {
tmp = 1.0 / (c_m * (t_0 * (x_m * s_m)));
} else {
tmp = ((-1.0 / s_m) / (x_m * c_m)) / t_0;
}
return tmp;
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): t_0 = x_m * (c_m * s_m) tmp = 0 if x_m <= 8.2e+30: tmp = 1.0 / (c_m * (t_0 * (x_m * s_m))) else: tmp = ((-1.0 / s_m) / (x_m * c_m)) / t_0 return tmp
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) t_0 = Float64(x_m * Float64(c_m * s_m)) tmp = 0.0 if (x_m <= 8.2e+30) tmp = Float64(1.0 / Float64(c_m * Float64(t_0 * Float64(x_m * s_m)))); else tmp = Float64(Float64(Float64(-1.0 / s_m) / Float64(x_m * c_m)) / t_0); end return tmp end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp_2 = code(x_m, c_m, s_m)
t_0 = x_m * (c_m * s_m);
tmp = 0.0;
if (x_m <= 8.2e+30)
tmp = 1.0 / (c_m * (t_0 * (x_m * s_m)));
else
tmp = ((-1.0 / s_m) / (x_m * c_m)) / t_0;
end
tmp_2 = tmp;
end
x_m = N[Abs[x], $MachinePrecision]
c_m = N[Abs[c], $MachinePrecision]
s_m = N[Abs[s], $MachinePrecision]
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
code[x$95$m_, c$95$m_, s$95$m_] := Block[{t$95$0 = N[(x$95$m * N[(c$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$95$m, 8.2e+30], N[(1.0 / N[(c$95$m * N[(t$95$0 * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-1.0 / s$95$m), $MachinePrecision] / N[(x$95$m * c$95$m), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\begin{array}{l}
t_0 := x\_m \cdot \left(c\_m \cdot s\_m\right)\\
\mathbf{if}\;x\_m \leq 8.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{1}{c\_m \cdot \left(t\_0 \cdot \left(x\_m \cdot s\_m\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{-1}{s\_m}}{x\_m \cdot c\_m}}{t\_0}\\
\end{array}
\end{array}
if x < 8.20000000000000011e30Initial program 66.7%
associate-/r*66.7%
unpow266.7%
sqr-neg66.7%
unpow266.7%
unpow266.7%
cos-neg66.7%
distribute-rgt-neg-out66.7%
sqr-neg66.7%
unpow266.7%
distribute-rgt-neg-out66.7%
*-commutative66.7%
distribute-rgt-neg-in66.7%
metadata-eval66.7%
*-commutative66.7%
associate-*l*59.4%
unpow259.4%
Simplified59.4%
Taylor expanded in x around 0 53.2%
associate-/r*53.2%
*-commutative53.2%
unpow253.2%
unpow253.2%
swap-sqr70.0%
unpow270.0%
associate-/r*69.9%
unpow269.9%
unpow269.9%
swap-sqr82.6%
unpow282.6%
associate-*r*82.1%
*-commutative82.1%
Simplified82.1%
Taylor expanded in s around 0 82.6%
unpow282.6%
associate-*r*80.7%
*-commutative80.7%
associate-*r*80.0%
*-commutative80.0%
associate-*r*79.1%
associate-*r*79.7%
*-commutative79.7%
*-commutative79.7%
Applied egg-rr79.7%
if 8.20000000000000011e30 < x Initial program 62.3%
associate-/r*62.3%
unpow262.3%
sqr-neg62.3%
unpow262.3%
unpow262.3%
cos-neg62.3%
distribute-rgt-neg-out62.3%
sqr-neg62.3%
unpow262.3%
distribute-rgt-neg-out62.3%
*-commutative62.3%
distribute-rgt-neg-in62.3%
metadata-eval62.3%
*-commutative62.3%
associate-*l*55.8%
unpow255.8%
Simplified55.8%
Taylor expanded in x around 0 46.6%
associate-/r*46.6%
*-commutative46.6%
unpow246.6%
unpow246.6%
swap-sqr52.4%
unpow252.4%
associate-/r*52.4%
unpow252.4%
unpow252.4%
swap-sqr57.3%
unpow257.3%
associate-*r*56.7%
*-commutative56.7%
Simplified56.7%
unpow256.7%
associate-*r*56.1%
associate-*l*55.6%
Applied egg-rr55.6%
associate-*r*56.1%
associate-*r*56.7%
pow256.7%
associate-*r*56.8%
*-commutative56.8%
associate-*r*57.3%
pow-flip57.4%
associate-*r*56.9%
*-commutative56.9%
metadata-eval56.9%
pow-prod-down53.6%
*-commutative53.6%
sqr-pow53.6%
associate-*l*56.3%
metadata-eval56.3%
unpow-156.3%
metadata-eval56.3%
unpow-156.3%
Applied egg-rr56.3%
Applied egg-rr64.5%
Final simplification75.9%
x_m = (fabs.f64 x) c_m = (fabs.f64 c) s_m = (fabs.f64 s) NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. (FPCore (x_m c_m s_m) :precision binary64 (/ 1.0 (* (* c_m s_m) (* x_m (* c_m (* x_m s_m))))))
x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
return 1.0 / ((c_m * s_m) * (x_m * (c_m * (x_m * s_m))));
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
code = 1.0d0 / ((c_m * s_m) * (x_m * (c_m * (x_m * s_m))))
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
return 1.0 / ((c_m * s_m) * (x_m * (c_m * (x_m * s_m))));
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): return 1.0 / ((c_m * s_m) * (x_m * (c_m * (x_m * s_m))))
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) return Float64(1.0 / Float64(Float64(c_m * s_m) * Float64(x_m * Float64(c_m * Float64(x_m * s_m))))) end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp = code(x_m, c_m, s_m)
tmp = 1.0 / ((c_m * s_m) * (x_m * (c_m * (x_m * s_m))));
end
x_m = N[Abs[x], $MachinePrecision] c_m = N[Abs[c], $MachinePrecision] s_m = N[Abs[s], $MachinePrecision] NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. code[x$95$m_, c$95$m_, s$95$m_] := N[(1.0 / N[(N[(c$95$m * s$95$m), $MachinePrecision] * N[(x$95$m * N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\frac{1}{\left(c\_m \cdot s\_m\right) \cdot \left(x\_m \cdot \left(c\_m \cdot \left(x\_m \cdot s\_m\right)\right)\right)}
\end{array}
Initial program 65.6%
associate-/r*65.6%
unpow265.6%
sqr-neg65.6%
unpow265.6%
unpow265.6%
cos-neg65.6%
distribute-rgt-neg-out65.6%
sqr-neg65.6%
unpow265.6%
distribute-rgt-neg-out65.6%
*-commutative65.6%
distribute-rgt-neg-in65.6%
metadata-eval65.6%
*-commutative65.6%
associate-*l*58.5%
unpow258.5%
Simplified58.5%
Taylor expanded in x around 0 51.5%
associate-/r*51.5%
*-commutative51.5%
unpow251.5%
unpow251.5%
swap-sqr65.6%
unpow265.6%
associate-/r*65.6%
unpow265.6%
unpow265.6%
swap-sqr76.2%
unpow276.2%
associate-*r*75.8%
*-commutative75.8%
Simplified75.8%
unpow275.8%
associate-*r*74.2%
associate-*l*73.4%
Applied egg-rr73.4%
Taylor expanded in s around 0 74.5%
Final simplification74.5%
x_m = (fabs.f64 x) c_m = (fabs.f64 c) s_m = (fabs.f64 s) NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. (FPCore (x_m c_m s_m) :precision binary64 (/ 1.0 (* (* c_m s_m) (* x_m (* x_m (* c_m s_m))))))
x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
return 1.0 / ((c_m * s_m) * (x_m * (x_m * (c_m * s_m))));
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
code = 1.0d0 / ((c_m * s_m) * (x_m * (x_m * (c_m * s_m))))
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
return 1.0 / ((c_m * s_m) * (x_m * (x_m * (c_m * s_m))));
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): return 1.0 / ((c_m * s_m) * (x_m * (x_m * (c_m * s_m))))
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) return Float64(1.0 / Float64(Float64(c_m * s_m) * Float64(x_m * Float64(x_m * Float64(c_m * s_m))))) end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp = code(x_m, c_m, s_m)
tmp = 1.0 / ((c_m * s_m) * (x_m * (x_m * (c_m * s_m))));
end
x_m = N[Abs[x], $MachinePrecision] c_m = N[Abs[c], $MachinePrecision] s_m = N[Abs[s], $MachinePrecision] NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. code[x$95$m_, c$95$m_, s$95$m_] := N[(1.0 / N[(N[(c$95$m * s$95$m), $MachinePrecision] * N[(x$95$m * N[(x$95$m * N[(c$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\frac{1}{\left(c\_m \cdot s\_m\right) \cdot \left(x\_m \cdot \left(x\_m \cdot \left(c\_m \cdot s\_m\right)\right)\right)}
\end{array}
Initial program 65.6%
associate-/r*65.6%
unpow265.6%
sqr-neg65.6%
unpow265.6%
unpow265.6%
cos-neg65.6%
distribute-rgt-neg-out65.6%
sqr-neg65.6%
unpow265.6%
distribute-rgt-neg-out65.6%
*-commutative65.6%
distribute-rgt-neg-in65.6%
metadata-eval65.6%
*-commutative65.6%
associate-*l*58.5%
unpow258.5%
Simplified58.5%
Taylor expanded in x around 0 51.5%
associate-/r*51.5%
*-commutative51.5%
unpow251.5%
unpow251.5%
swap-sqr65.6%
unpow265.6%
associate-/r*65.6%
unpow265.6%
unpow265.6%
swap-sqr76.2%
unpow276.2%
associate-*r*75.8%
*-commutative75.8%
Simplified75.8%
unpow275.8%
associate-*r*74.2%
associate-*l*73.4%
Applied egg-rr73.4%
Taylor expanded in s around 0 74.5%
*-commutative74.5%
associate-*r*73.4%
*-commutative73.4%
/-rgt-identity73.4%
*-commutative73.4%
*-commutative73.4%
associate-*l*75.3%
*-commutative75.3%
Applied egg-rr75.3%
/-rgt-identity75.3%
*-commutative75.3%
Simplified75.3%
Final simplification75.3%
x_m = (fabs.f64 x) c_m = (fabs.f64 c) s_m = (fabs.f64 s) NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. (FPCore (x_m c_m s_m) :precision binary64 (let* ((t_0 (* x_m (* c_m s_m)))) (/ 1.0 (* t_0 t_0))))
x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
double t_0 = x_m * (c_m * s_m);
return 1.0 / (t_0 * t_0);
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
real(8) :: t_0
t_0 = x_m * (c_m * s_m)
code = 1.0d0 / (t_0 * t_0)
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
double t_0 = x_m * (c_m * s_m);
return 1.0 / (t_0 * t_0);
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): t_0 = x_m * (c_m * s_m) return 1.0 / (t_0 * t_0)
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) t_0 = Float64(x_m * Float64(c_m * s_m)) return Float64(1.0 / Float64(t_0 * t_0)) end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp = code(x_m, c_m, s_m)
t_0 = x_m * (c_m * s_m);
tmp = 1.0 / (t_0 * t_0);
end
x_m = N[Abs[x], $MachinePrecision]
c_m = N[Abs[c], $MachinePrecision]
s_m = N[Abs[s], $MachinePrecision]
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
code[x$95$m_, c$95$m_, s$95$m_] := Block[{t$95$0 = N[(x$95$m * N[(c$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]}, N[(1.0 / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\begin{array}{l}
t_0 := x\_m \cdot \left(c\_m \cdot s\_m\right)\\
\frac{1}{t\_0 \cdot t\_0}
\end{array}
\end{array}
Initial program 65.6%
associate-/r*65.6%
unpow265.6%
sqr-neg65.6%
unpow265.6%
unpow265.6%
cos-neg65.6%
distribute-rgt-neg-out65.6%
sqr-neg65.6%
unpow265.6%
distribute-rgt-neg-out65.6%
*-commutative65.6%
distribute-rgt-neg-in65.6%
metadata-eval65.6%
*-commutative65.6%
associate-*l*58.5%
unpow258.5%
Simplified58.5%
Taylor expanded in x around 0 51.5%
associate-/r*51.5%
*-commutative51.5%
unpow251.5%
unpow251.5%
swap-sqr65.6%
unpow265.6%
associate-/r*65.6%
unpow265.6%
unpow265.6%
swap-sqr76.2%
unpow276.2%
associate-*r*75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in s around 0 76.2%
associate-*r*76.3%
*-commutative76.3%
associate-*r*75.8%
pow275.8%
*-commutative75.8%
*-commutative75.8%
associate-*l*74.2%
*-commutative74.2%
associate-*r*76.3%
*-commutative76.3%
Applied egg-rr76.3%
Final simplification76.3%
x_m = (fabs.f64 x) c_m = (fabs.f64 c) s_m = (fabs.f64 s) NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. (FPCore (x_m c_m s_m) :precision binary64 (/ (/ (/ (/ 1.0 s_m) c_m) x_m) (* x_m (* c_m s_m))))
x_m = fabs(x);
c_m = fabs(c);
s_m = fabs(s);
assert(x_m < c_m && c_m < s_m);
double code(double x_m, double c_m, double s_m) {
return (((1.0 / s_m) / c_m) / x_m) / (x_m * (c_m * s_m));
}
x_m = abs(x)
c_m = abs(c)
s_m = abs(s)
NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function.
real(8) function code(x_m, c_m, s_m)
real(8), intent (in) :: x_m
real(8), intent (in) :: c_m
real(8), intent (in) :: s_m
code = (((1.0d0 / s_m) / c_m) / x_m) / (x_m * (c_m * s_m))
end function
x_m = Math.abs(x);
c_m = Math.abs(c);
s_m = Math.abs(s);
assert x_m < c_m && c_m < s_m;
public static double code(double x_m, double c_m, double s_m) {
return (((1.0 / s_m) / c_m) / x_m) / (x_m * (c_m * s_m));
}
x_m = math.fabs(x) c_m = math.fabs(c) s_m = math.fabs(s) [x_m, c_m, s_m] = sort([x_m, c_m, s_m]) def code(x_m, c_m, s_m): return (((1.0 / s_m) / c_m) / x_m) / (x_m * (c_m * s_m))
x_m = abs(x) c_m = abs(c) s_m = abs(s) x_m, c_m, s_m = sort([x_m, c_m, s_m]) function code(x_m, c_m, s_m) return Float64(Float64(Float64(Float64(1.0 / s_m) / c_m) / x_m) / Float64(x_m * Float64(c_m * s_m))) end
x_m = abs(x);
c_m = abs(c);
s_m = abs(s);
x_m, c_m, s_m = num2cell(sort([x_m, c_m, s_m])){:}
function tmp = code(x_m, c_m, s_m)
tmp = (((1.0 / s_m) / c_m) / x_m) / (x_m * (c_m * s_m));
end
x_m = N[Abs[x], $MachinePrecision] c_m = N[Abs[c], $MachinePrecision] s_m = N[Abs[s], $MachinePrecision] NOTE: x_m, c_m, and s_m should be sorted in increasing order before calling this function. code[x$95$m_, c$95$m_, s$95$m_] := N[(N[(N[(N[(1.0 / s$95$m), $MachinePrecision] / c$95$m), $MachinePrecision] / x$95$m), $MachinePrecision] / N[(x$95$m * N[(c$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x_m = \left|x\right|
\\
c_m = \left|c\right|
\\
s_m = \left|s\right|
\\
[x_m, c_m, s_m] = \mathsf{sort}([x_m, c_m, s_m])\\
\\
\frac{\frac{\frac{\frac{1}{s\_m}}{c\_m}}{x\_m}}{x\_m \cdot \left(c\_m \cdot s\_m\right)}
\end{array}
Initial program 65.6%
associate-/r*65.6%
unpow265.6%
sqr-neg65.6%
unpow265.6%
unpow265.6%
cos-neg65.6%
distribute-rgt-neg-out65.6%
sqr-neg65.6%
unpow265.6%
distribute-rgt-neg-out65.6%
*-commutative65.6%
distribute-rgt-neg-in65.6%
metadata-eval65.6%
*-commutative65.6%
associate-*l*58.5%
unpow258.5%
Simplified58.5%
Taylor expanded in x around 0 51.5%
associate-/r*51.5%
*-commutative51.5%
unpow251.5%
unpow251.5%
swap-sqr65.6%
unpow265.6%
associate-/r*65.6%
unpow265.6%
unpow265.6%
swap-sqr76.2%
unpow276.2%
associate-*r*75.8%
*-commutative75.8%
Simplified75.8%
pow-flip76.1%
associate-*r*76.3%
metadata-eval76.3%
unpow-prod-down65.1%
Applied egg-rr65.1%
pow-prod-down76.3%
associate-*r*76.1%
metadata-eval76.1%
pow-prod-up76.0%
inv-pow76.0%
inv-pow76.0%
un-div-inv76.1%
associate-/r*76.1%
associate-/r*74.5%
associate-*r*76.3%
*-commutative76.3%
Applied egg-rr76.3%
Final simplification76.3%
herbie shell --seed 2024046
(FPCore (x c s)
:name "mixedcos"
:precision binary64
(/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))