
(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 11 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))) (t_1 (cos (* x_m 2.0))))
(if (<= x_m 4.8e+27)
(* (/ (/ (/ 1.0 x_m) s_m) c_m) (/ t_1 (* c_m (* x_m s_m))))
(/ t_1 (* 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 = s_m * (x_m * c_m);
double t_1 = cos((x_m * 2.0));
double tmp;
if (x_m <= 4.8e+27) {
tmp = (((1.0 / x_m) / s_m) / c_m) * (t_1 / (c_m * (x_m * s_m)));
} else {
tmp = t_1 / (t_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) :: t_1
real(8) :: tmp
t_0 = s_m * (x_m * c_m)
t_1 = cos((x_m * 2.0d0))
if (x_m <= 4.8d+27) then
tmp = (((1.0d0 / x_m) / s_m) / c_m) * (t_1 / (c_m * (x_m * s_m)))
else
tmp = t_1 / (t_0 * 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 t_1 = Math.cos((x_m * 2.0));
double tmp;
if (x_m <= 4.8e+27) {
tmp = (((1.0 / x_m) / s_m) / c_m) * (t_1 / (c_m * (x_m * s_m)));
} else {
tmp = t_1 / (t_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) t_1 = math.cos((x_m * 2.0)) tmp = 0 if x_m <= 4.8e+27: tmp = (((1.0 / x_m) / s_m) / c_m) * (t_1 / (c_m * (x_m * s_m))) else: tmp = t_1 / (t_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)) t_1 = cos(Float64(x_m * 2.0)) tmp = 0.0 if (x_m <= 4.8e+27) tmp = Float64(Float64(Float64(Float64(1.0 / x_m) / s_m) / c_m) * Float64(t_1 / Float64(c_m * Float64(x_m * s_m)))); else tmp = Float64(t_1 / Float64(t_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);
t_1 = cos((x_m * 2.0));
tmp = 0.0;
if (x_m <= 4.8e+27)
tmp = (((1.0 / x_m) / s_m) / c_m) * (t_1 / (c_m * (x_m * s_m)));
else
tmp = t_1 / (t_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]}, Block[{t$95$1 = N[Cos[N[(x$95$m * 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$95$m, 4.8e+27], N[(N[(N[(N[(1.0 / x$95$m), $MachinePrecision] / s$95$m), $MachinePrecision] / c$95$m), $MachinePrecision] * N[(t$95$1 / N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / 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 := s\_m \cdot \left(x\_m \cdot c\_m\right)\\
t_1 := \cos \left(x\_m \cdot 2\right)\\
\mathbf{if}\;x\_m \leq 4.8 \cdot 10^{+27}:\\
\;\;\;\;\frac{\frac{\frac{1}{x\_m}}{s\_m}}{c\_m} \cdot \frac{t\_1}{c\_m \cdot \left(x\_m \cdot s\_m\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{t\_0 \cdot t\_0}\\
\end{array}
\end{array}
if x < 4.79999999999999995e27Initial program 60.7%
associate-/r*60.7%
*-commutative60.7%
unpow260.7%
sqr-neg60.7%
unpow260.7%
cos-neg60.7%
*-commutative60.7%
distribute-rgt-neg-in60.7%
metadata-eval60.7%
unpow260.7%
sqr-neg60.7%
unpow260.7%
associate-*r*53.9%
unpow253.9%
*-commutative53.9%
Simplified53.9%
associate-/l/54.0%
div-inv53.9%
add-sqr-sqrt29.5%
sqrt-unprod46.3%
*-commutative46.3%
*-commutative46.3%
swap-sqr46.3%
metadata-eval46.3%
metadata-eval46.3%
swap-sqr46.3%
sqrt-unprod23.0%
add-sqr-sqrt53.9%
*-commutative53.9%
unpow253.9%
associate-*r*60.7%
*-commutative60.7%
*-commutative60.7%
add-sqr-sqrt60.7%
pow260.7%
Applied egg-rr96.9%
associate-*r/96.9%
*-rgt-identity96.9%
*-commutative96.9%
Simplified96.9%
*-commutative96.9%
unpow-prod-down71.1%
associate-/l/71.2%
*-rgt-identity71.2%
pow271.2%
frac-times71.5%
unpow271.5%
*-commutative71.5%
times-frac96.7%
associate-/r*96.8%
*-commutative96.8%
Applied egg-rr96.8%
Taylor expanded in x around inf 96.8%
if 4.79999999999999995e27 < x Initial program 65.0%
associate-/r*65.0%
*-commutative65.0%
unpow265.0%
sqr-neg65.0%
unpow265.0%
cos-neg65.0%
*-commutative65.0%
distribute-rgt-neg-in65.0%
metadata-eval65.0%
unpow265.0%
sqr-neg65.0%
unpow265.0%
associate-*r*63.0%
unpow263.0%
*-commutative63.0%
Simplified63.0%
associate-/l/63.0%
div-inv63.0%
add-sqr-sqrt0.0%
sqrt-unprod39.2%
*-commutative39.2%
*-commutative39.2%
swap-sqr39.2%
metadata-eval39.2%
metadata-eval39.2%
swap-sqr39.2%
sqrt-unprod61.6%
add-sqr-sqrt63.0%
*-commutative63.0%
unpow263.0%
associate-*r*64.9%
*-commutative64.9%
*-commutative64.9%
add-sqr-sqrt64.9%
pow264.9%
Applied egg-rr96.4%
associate-*r/96.6%
*-rgt-identity96.6%
*-commutative96.6%
Simplified96.6%
unpow296.6%
*-commutative96.6%
*-commutative96.6%
*-commutative96.6%
associate-*l*91.9%
*-commutative91.9%
associate-*l*94.9%
Applied egg-rr94.9%
Final simplification96.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 (* s_m (* x_m c_m))))
(if (<= x_m 3.6e-16)
(* (/ (/ (/ 1.0 x_m) s_m) c_m) (/ 1.0 (* c_m (* x_m s_m))))
(/ (cos (* x_m 2.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 = s_m * (x_m * c_m);
double tmp;
if (x_m <= 3.6e-16) {
tmp = (((1.0 / x_m) / s_m) / c_m) * (1.0 / (c_m * (x_m * s_m)));
} else {
tmp = cos((x_m * 2.0)) / (t_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 <= 3.6d-16) then
tmp = (((1.0d0 / x_m) / s_m) / c_m) * (1.0d0 / (c_m * (x_m * s_m)))
else
tmp = cos((x_m * 2.0d0)) / (t_0 * 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 <= 3.6e-16) {
tmp = (((1.0 / x_m) / s_m) / c_m) * (1.0 / (c_m * (x_m * s_m)));
} else {
tmp = Math.cos((x_m * 2.0)) / (t_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 <= 3.6e-16: tmp = (((1.0 / x_m) / s_m) / c_m) * (1.0 / (c_m * (x_m * s_m))) else: tmp = math.cos((x_m * 2.0)) / (t_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 <= 3.6e-16) tmp = Float64(Float64(Float64(Float64(1.0 / x_m) / s_m) / c_m) * Float64(1.0 / Float64(c_m * Float64(x_m * s_m)))); else tmp = Float64(cos(Float64(x_m * 2.0)) / Float64(t_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 <= 3.6e-16)
tmp = (((1.0 / x_m) / s_m) / c_m) * (1.0 / (c_m * (x_m * s_m)));
else
tmp = cos((x_m * 2.0)) / (t_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, 3.6e-16], N[(N[(N[(N[(1.0 / x$95$m), $MachinePrecision] / s$95$m), $MachinePrecision] / c$95$m), $MachinePrecision] * N[(1.0 / N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(x$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 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 := s\_m \cdot \left(x\_m \cdot c\_m\right)\\
\mathbf{if}\;x\_m \leq 3.6 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{\frac{1}{x\_m}}{s\_m}}{c\_m} \cdot \frac{1}{c\_m \cdot \left(x\_m \cdot s\_m\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(x\_m \cdot 2\right)}{t\_0 \cdot t\_0}\\
\end{array}
\end{array}
if x < 3.59999999999999983e-16Initial program 59.5%
associate-/r*59.6%
*-commutative59.6%
unpow259.6%
sqr-neg59.6%
unpow259.6%
cos-neg59.6%
*-commutative59.6%
distribute-rgt-neg-in59.6%
metadata-eval59.6%
unpow259.6%
sqr-neg59.6%
unpow259.6%
associate-*r*52.3%
unpow252.3%
*-commutative52.3%
Simplified52.3%
associate-/l/52.3%
div-inv52.3%
add-sqr-sqrt31.6%
sqrt-unprod44.1%
*-commutative44.1%
*-commutative44.1%
swap-sqr44.1%
metadata-eval44.1%
metadata-eval44.1%
swap-sqr44.1%
sqrt-unprod19.2%
add-sqr-sqrt52.3%
*-commutative52.3%
unpow252.3%
associate-*r*59.6%
*-commutative59.6%
*-commutative59.6%
add-sqr-sqrt59.5%
pow259.5%
Applied egg-rr96.7%
associate-*r/96.7%
*-rgt-identity96.7%
*-commutative96.7%
Simplified96.7%
*-commutative96.7%
unpow-prod-down70.7%
associate-/l/70.7%
*-rgt-identity70.7%
pow270.7%
frac-times71.0%
unpow271.0%
*-commutative71.0%
times-frac96.5%
associate-/r*96.6%
*-commutative96.6%
Applied egg-rr96.6%
Taylor expanded in x around inf 96.6%
Taylor expanded in x around 0 84.1%
if 3.59999999999999983e-16 < x Initial program 67.3%
associate-/r*67.2%
*-commutative67.2%
unpow267.2%
sqr-neg67.2%
unpow267.2%
cos-neg67.2%
*-commutative67.2%
distribute-rgt-neg-in67.2%
metadata-eval67.2%
unpow267.2%
sqr-neg67.2%
unpow267.2%
associate-*r*65.6%
unpow265.6%
*-commutative65.6%
Simplified65.6%
associate-/l/65.6%
div-inv65.6%
add-sqr-sqrt0.0%
sqrt-unprod46.1%
*-commutative46.1%
*-commutative46.1%
swap-sqr46.1%
metadata-eval46.1%
metadata-eval46.1%
swap-sqr46.1%
sqrt-unprod64.5%
add-sqr-sqrt65.6%
*-commutative65.6%
unpow265.6%
associate-*r*67.2%
*-commutative67.2%
*-commutative67.2%
add-sqr-sqrt67.2%
pow267.2%
Applied egg-rr97.0%
associate-*r/97.1%
*-rgt-identity97.1%
*-commutative97.1%
Simplified97.1%
unpow297.1%
*-commutative97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*93.3%
*-commutative93.3%
associate-*l*95.7%
Applied egg-rr95.7%
Final simplification87.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 (* (/ (/ (/ 1.0 x_m) s_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) {
return (((1.0 / x_m) / s_m) / c_m) * (1.0 / (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 / x_m) / s_m) / c_m) * (1.0d0 / (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 / x_m) / s_m) / c_m) * (1.0 / (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 / x_m) / s_m) / c_m) * (1.0 / (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(Float64(Float64(Float64(1.0 / x_m) / s_m) / c_m) * Float64(1.0 / 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 / x_m) / s_m) / c_m) * (1.0 / (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[(N[(N[(N[(1.0 / x$95$m), $MachinePrecision] / s$95$m), $MachinePrecision] / c$95$m), $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])\\
\\
\frac{\frac{\frac{1}{x\_m}}{s\_m}}{c\_m} \cdot \frac{1}{c\_m \cdot \left(x\_m \cdot s\_m\right)}
\end{array}
Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
cos-neg61.7%
*-commutative61.7%
distribute-rgt-neg-in61.7%
metadata-eval61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
associate-*r*56.0%
unpow256.0%
*-commutative56.0%
Simplified56.0%
associate-/l/56.0%
div-inv56.0%
add-sqr-sqrt22.7%
sqrt-unprod44.7%
*-commutative44.7%
*-commutative44.7%
swap-sqr44.7%
metadata-eval44.7%
metadata-eval44.7%
swap-sqr44.7%
sqrt-unprod31.9%
add-sqr-sqrt56.0%
*-commutative56.0%
unpow256.0%
associate-*r*61.7%
*-commutative61.7%
*-commutative61.7%
add-sqr-sqrt61.7%
pow261.7%
Applied egg-rr96.8%
associate-*r/96.8%
*-rgt-identity96.8%
*-commutative96.8%
Simplified96.8%
*-commutative96.8%
unpow-prod-down71.6%
associate-/l/71.6%
*-rgt-identity71.6%
pow271.6%
frac-times71.9%
unpow271.9%
*-commutative71.9%
times-frac96.7%
associate-/r*96.7%
*-commutative96.7%
Applied egg-rr96.7%
Taylor expanded in x around inf 96.8%
Taylor expanded in x around 0 78.5%
Final simplification78.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 (let* ((t_0 (/ 1.0 (* c_m (* x_m s_m))))) (* 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 = 1.0 / (c_m * (x_m * s_m));
return 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 = 1.0d0 / (c_m * (x_m * s_m))
code = 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 = 1.0 / (c_m * (x_m * s_m));
return 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 = 1.0 / (c_m * (x_m * s_m)) return 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(1.0 / Float64(c_m * Float64(x_m * s_m))) return 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 = 1.0 / (c_m * (x_m * s_m));
tmp = 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[(1.0 / N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * 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 := \frac{1}{c\_m \cdot \left(x\_m \cdot s\_m\right)}\\
t\_0 \cdot t\_0
\end{array}
\end{array}
Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
cos-neg61.7%
*-commutative61.7%
distribute-rgt-neg-in61.7%
metadata-eval61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
associate-*r*56.0%
unpow256.0%
*-commutative56.0%
Simplified56.0%
associate-/l/56.0%
div-inv56.0%
add-sqr-sqrt22.7%
sqrt-unprod44.7%
*-commutative44.7%
*-commutative44.7%
swap-sqr44.7%
metadata-eval44.7%
metadata-eval44.7%
swap-sqr44.7%
sqrt-unprod31.9%
add-sqr-sqrt56.0%
*-commutative56.0%
unpow256.0%
associate-*r*61.7%
*-commutative61.7%
*-commutative61.7%
add-sqr-sqrt61.7%
pow261.7%
Applied egg-rr96.8%
associate-*r/96.8%
*-rgt-identity96.8%
*-commutative96.8%
Simplified96.8%
unpow296.8%
associate-*r*94.2%
associate-*l*91.8%
*-commutative91.8%
*-commutative91.8%
*-commutative91.8%
associate-*l*93.5%
Applied egg-rr93.5%
Taylor expanded in x around 0 76.4%
inv-pow76.4%
associate-*r*78.3%
*-commutative78.3%
*-commutative78.3%
associate-*l*76.5%
*-commutative76.5%
associate-*l*78.1%
unpow-prod-down78.1%
inv-pow78.1%
*-commutative78.1%
associate-*r*76.7%
*-commutative76.7%
inv-pow76.7%
*-commutative76.7%
associate-*r*78.5%
*-commutative78.5%
Applied egg-rr78.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 x_m) s_m) (* c_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 / x_m) / s_m) / (c_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) / x_m) / s_m) / (c_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 / x_m) / s_m) / (c_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 / x_m) / s_m) / (c_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(Float64(Float64(-1.0 / x_m) / s_m) / Float64(c_m * Float64(c_m * Float64(x_m * Float64(-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 / x_m) / s_m) / (c_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[(N[(N[(-1.0 / x$95$m), $MachinePrecision] / s$95$m), $MachinePrecision] / N[(c$95$m * 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])\\
\\
\frac{\frac{\frac{-1}{x\_m}}{s\_m}}{c\_m \cdot \left(c\_m \cdot \left(x\_m \cdot \left(-s\_m\right)\right)\right)}
\end{array}
Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
cos-neg61.7%
*-commutative61.7%
distribute-rgt-neg-in61.7%
metadata-eval61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
associate-*r*56.0%
unpow256.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in x around 0 50.6%
associate-/r*50.6%
*-commutative50.6%
unpow250.6%
unpow250.6%
swap-sqr61.9%
unpow261.9%
associate-/r*61.8%
unpow261.8%
unpow261.8%
swap-sqr78.5%
unpow278.5%
*-commutative78.5%
associate-*l*78.1%
Simplified78.1%
pow-flip78.1%
associate-*r*78.5%
*-commutative78.5%
pow-flip78.5%
add-sqr-sqrt78.5%
sqrt-div78.5%
metadata-eval78.5%
sqrt-pow153.0%
metadata-eval53.0%
pow153.0%
*-commutative53.0%
*-commutative53.0%
associate-*l*52.0%
sqrt-div52.0%
metadata-eval52.0%
sqrt-pow176.9%
metadata-eval76.9%
pow176.9%
*-commutative76.9%
*-commutative76.9%
associate-*l*78.3%
Applied egg-rr78.3%
metadata-eval78.3%
associate-*r*76.9%
*-commutative76.9%
frac-times76.8%
*-commutative76.8%
associate-/l/76.8%
div-inv76.8%
clear-num76.8%
metadata-eval76.8%
associate-*r*78.5%
*-commutative78.5%
frac-times78.5%
*-commutative78.5%
associate-/l/78.5%
div-inv78.4%
frac-2neg78.4%
frac-times75.1%
Applied egg-rr73.6%
Taylor expanded in s around 0 75.2%
Final simplification75.2%
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 (* s_m c_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 * (s_m * c_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 * (s_m * c_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 * (s_m * c_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 * (s_m * c_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(s_m * c_m)) return Float64(Float64(1.0 / 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 * (s_m * c_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[(s$95$m * c$95$m), $MachinePrecision]), $MachinePrecision]}, N[(N[(1.0 / t$95$0), $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(s\_m \cdot c\_m\right)\\
\frac{\frac{1}{t\_0}}{t\_0}
\end{array}
\end{array}
Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
cos-neg61.7%
*-commutative61.7%
distribute-rgt-neg-in61.7%
metadata-eval61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
associate-*r*56.0%
unpow256.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in x around 0 50.6%
associate-/r*50.6%
*-commutative50.6%
unpow250.6%
unpow250.6%
swap-sqr61.9%
unpow261.9%
associate-/r*61.8%
unpow261.8%
unpow261.8%
swap-sqr78.5%
unpow278.5%
*-commutative78.5%
associate-*l*78.1%
Simplified78.1%
pow-flip78.1%
associate-*r*78.5%
*-commutative78.5%
pow-flip78.5%
add-sqr-sqrt78.5%
sqrt-div78.5%
metadata-eval78.5%
sqrt-pow153.0%
metadata-eval53.0%
pow153.0%
*-commutative53.0%
*-commutative53.0%
associate-*l*52.0%
sqrt-div52.0%
metadata-eval52.0%
sqrt-pow176.9%
metadata-eval76.9%
pow176.9%
*-commutative76.9%
*-commutative76.9%
associate-*l*78.3%
Applied egg-rr78.3%
un-div-inv78.3%
*-commutative78.3%
associate-*r*76.5%
*-commutative76.5%
associate-*r*78.1%
Applied egg-rr78.1%
Final simplification78.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 (/ (/ 1.0 (* x_m s_m)) (* c_m (* x_m (* s_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) {
return (1.0 / (x_m * s_m)) / (c_m * (x_m * (s_m * c_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 / (x_m * s_m)) / (c_m * (x_m * (s_m * c_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 / (x_m * s_m)) / (c_m * (x_m * (s_m * c_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 / (x_m * s_m)) / (c_m * (x_m * (s_m * c_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(1.0 / Float64(x_m * s_m)) / Float64(c_m * Float64(x_m * Float64(s_m * c_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 / (x_m * s_m)) / (c_m * (x_m * (s_m * c_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[(1.0 / N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision] / N[(c$95$m * N[(x$95$m * N[(s$95$m * c$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])\\
\\
\frac{\frac{1}{x\_m \cdot s\_m}}{c\_m \cdot \left(x\_m \cdot \left(s\_m \cdot c\_m\right)\right)}
\end{array}
Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
cos-neg61.7%
*-commutative61.7%
distribute-rgt-neg-in61.7%
metadata-eval61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
associate-*r*56.0%
unpow256.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in x around 0 50.6%
associate-/r*50.6%
*-commutative50.6%
unpow250.6%
unpow250.6%
swap-sqr61.9%
unpow261.9%
associate-/r*61.8%
unpow261.8%
unpow261.8%
swap-sqr78.5%
unpow278.5%
*-commutative78.5%
associate-*l*78.1%
Simplified78.1%
pow-flip78.1%
associate-*r*78.5%
*-commutative78.5%
pow-flip78.5%
add-sqr-sqrt78.5%
sqrt-div78.5%
metadata-eval78.5%
sqrt-pow153.0%
metadata-eval53.0%
pow153.0%
*-commutative53.0%
*-commutative53.0%
associate-*l*52.0%
sqrt-div52.0%
metadata-eval52.0%
sqrt-pow176.9%
metadata-eval76.9%
pow176.9%
*-commutative76.9%
*-commutative76.9%
associate-*l*78.3%
Applied egg-rr78.3%
metadata-eval78.3%
associate-*r*76.9%
*-commutative76.9%
frac-times76.8%
*-commutative76.8%
associate-/l/76.8%
div-inv76.8%
clear-num76.8%
metadata-eval76.8%
associate-*r*78.5%
*-commutative78.5%
frac-times78.5%
*-commutative78.5%
associate-/l/78.5%
div-inv78.4%
frac-times75.1%
*-un-lft-identity75.1%
associate-/l/75.2%
*-commutative75.2%
Applied egg-rr73.6%
Final simplification73.6%
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 x_m) (* (* s_m c_m) (* x_m (* s_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) {
return (1.0 / x_m) / ((s_m * c_m) * (x_m * (s_m * c_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 / x_m) / ((s_m * c_m) * (x_m * (s_m * c_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 / x_m) / ((s_m * c_m) * (x_m * (s_m * c_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 / x_m) / ((s_m * c_m) * (x_m * (s_m * c_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(1.0 / x_m) / Float64(Float64(s_m * c_m) * Float64(x_m * Float64(s_m * c_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 / x_m) / ((s_m * c_m) * (x_m * (s_m * c_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[(1.0 / x$95$m), $MachinePrecision] / N[(N[(s$95$m * c$95$m), $MachinePrecision] * N[(x$95$m * N[(s$95$m * c$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])\\
\\
\frac{\frac{1}{x\_m}}{\left(s\_m \cdot c\_m\right) \cdot \left(x\_m \cdot \left(s\_m \cdot c\_m\right)\right)}
\end{array}
Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
cos-neg61.7%
*-commutative61.7%
distribute-rgt-neg-in61.7%
metadata-eval61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
associate-*r*56.0%
unpow256.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in x around 0 50.6%
associate-/r*50.6%
*-commutative50.6%
unpow250.6%
unpow250.6%
swap-sqr61.9%
unpow261.9%
associate-/r*61.8%
unpow261.8%
unpow261.8%
swap-sqr78.5%
unpow278.5%
*-commutative78.5%
associate-*l*78.1%
Simplified78.1%
pow-flip78.1%
associate-*r*78.5%
*-commutative78.5%
pow-flip78.5%
add-sqr-sqrt78.5%
sqrt-div78.5%
metadata-eval78.5%
sqrt-pow153.0%
metadata-eval53.0%
pow153.0%
*-commutative53.0%
*-commutative53.0%
associate-*l*52.0%
sqrt-div52.0%
metadata-eval52.0%
sqrt-pow176.9%
metadata-eval76.9%
pow176.9%
*-commutative76.9%
*-commutative76.9%
associate-*l*78.3%
Applied egg-rr78.3%
metadata-eval78.3%
associate-*r*76.9%
*-commutative76.9%
frac-times76.8%
*-commutative76.8%
associate-/l/76.8%
div-inv76.8%
clear-num76.8%
metadata-eval76.8%
associate-*r*78.5%
*-commutative78.5%
frac-times78.5%
*-commutative78.5%
associate-/l/78.5%
div-inv78.4%
associate-/l/76.6%
frac-times75.0%
*-un-lft-identity75.0%
Applied egg-rr76.6%
Final simplification76.6%
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 x_m) (* (* c_m (* x_m s_m)) (* s_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) {
return (1.0 / x_m) / ((c_m * (x_m * s_m)) * (s_m * c_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 / x_m) / ((c_m * (x_m * s_m)) * (s_m * c_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 / x_m) / ((c_m * (x_m * s_m)) * (s_m * c_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 / x_m) / ((c_m * (x_m * s_m)) * (s_m * c_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(1.0 / x_m) / Float64(Float64(c_m * Float64(x_m * s_m)) * Float64(s_m * c_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 / x_m) / ((c_m * (x_m * s_m)) * (s_m * c_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[(1.0 / x$95$m), $MachinePrecision] / N[(N[(c$95$m * N[(x$95$m * s$95$m), $MachinePrecision]), $MachinePrecision] * N[(s$95$m * c$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{1}{x\_m}}{\left(c\_m \cdot \left(x\_m \cdot s\_m\right)\right) \cdot \left(s\_m \cdot c\_m\right)}
\end{array}
Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
cos-neg61.7%
*-commutative61.7%
distribute-rgt-neg-in61.7%
metadata-eval61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
associate-*r*56.0%
unpow256.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in x around 0 50.6%
associate-/r*50.6%
*-commutative50.6%
unpow250.6%
unpow250.6%
swap-sqr61.9%
unpow261.9%
associate-/r*61.8%
unpow261.8%
unpow261.8%
swap-sqr78.5%
unpow278.5%
*-commutative78.5%
associate-*l*78.1%
Simplified78.1%
pow-flip78.1%
associate-*r*78.5%
*-commutative78.5%
pow-flip78.5%
add-sqr-sqrt78.5%
sqrt-div78.5%
metadata-eval78.5%
sqrt-pow153.0%
metadata-eval53.0%
pow153.0%
*-commutative53.0%
*-commutative53.0%
associate-*l*52.0%
sqrt-div52.0%
metadata-eval52.0%
sqrt-pow176.9%
metadata-eval76.9%
pow176.9%
*-commutative76.9%
*-commutative76.9%
associate-*l*78.3%
Applied egg-rr78.3%
metadata-eval78.3%
associate-*r*76.9%
*-commutative76.9%
frac-times76.8%
*-commutative76.8%
associate-/l/76.8%
div-inv76.8%
clear-num76.8%
metadata-eval76.8%
associate-*r*78.5%
*-commutative78.5%
frac-times78.5%
*-commutative78.5%
associate-/l/78.5%
div-inv78.4%
associate-/l/76.6%
frac-times75.0%
*-un-lft-identity75.0%
Applied egg-rr76.6%
*-commutative76.6%
*-commutative76.6%
*-commutative76.6%
associate-*r*75.2%
Simplified75.2%
Final simplification75.2%
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 (* (* 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) {
return 1.0 / ((x_m * c_m) * (s_m * (s_m * (x_m * c_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 / ((x_m * c_m) * (s_m * (s_m * (x_m * c_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 / ((x_m * c_m) * (s_m * (s_m * (x_m * c_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 / ((x_m * c_m) * (s_m * (s_m * (x_m * c_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(x_m * c_m) * Float64(s_m * Float64(s_m * Float64(x_m * c_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 / ((x_m * c_m) * (s_m * (s_m * (x_m * c_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[(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])\\
\\
\frac{1}{\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}
Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
cos-neg61.7%
*-commutative61.7%
distribute-rgt-neg-in61.7%
metadata-eval61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
associate-*r*56.0%
unpow256.0%
*-commutative56.0%
Simplified56.0%
associate-/l/56.0%
div-inv56.0%
add-sqr-sqrt22.7%
sqrt-unprod44.7%
*-commutative44.7%
*-commutative44.7%
swap-sqr44.7%
metadata-eval44.7%
metadata-eval44.7%
swap-sqr44.7%
sqrt-unprod31.9%
add-sqr-sqrt56.0%
*-commutative56.0%
unpow256.0%
associate-*r*61.7%
*-commutative61.7%
*-commutative61.7%
add-sqr-sqrt61.7%
pow261.7%
Applied egg-rr96.8%
associate-*r/96.8%
*-rgt-identity96.8%
*-commutative96.8%
Simplified96.8%
unpow296.8%
associate-*r*94.2%
associate-*l*91.8%
*-commutative91.8%
*-commutative91.8%
*-commutative91.8%
associate-*l*93.5%
Applied egg-rr93.5%
Taylor expanded in x around 0 76.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 (/ 1.0 (* (* x_m c_m) (* s_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 / ((x_m * c_m) * (s_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 / ((x_m * c_m) * (s_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 / ((x_m * c_m) * (s_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 / ((x_m * c_m) * (s_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(x_m * c_m) * Float64(s_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 / ((x_m * c_m) * (s_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[(x$95$m * c$95$m), $MachinePrecision] * N[(s$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(x\_m \cdot c\_m\right) \cdot \left(s\_m \cdot \left(c\_m \cdot \left(x\_m \cdot s\_m\right)\right)\right)}
\end{array}
Initial program 61.7%
associate-/r*61.7%
*-commutative61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
cos-neg61.7%
*-commutative61.7%
distribute-rgt-neg-in61.7%
metadata-eval61.7%
unpow261.7%
sqr-neg61.7%
unpow261.7%
associate-*r*56.0%
unpow256.0%
*-commutative56.0%
Simplified56.0%
associate-/l/56.0%
div-inv56.0%
add-sqr-sqrt22.7%
sqrt-unprod44.7%
*-commutative44.7%
*-commutative44.7%
swap-sqr44.7%
metadata-eval44.7%
metadata-eval44.7%
swap-sqr44.7%
sqrt-unprod31.9%
add-sqr-sqrt56.0%
*-commutative56.0%
unpow256.0%
associate-*r*61.7%
*-commutative61.7%
*-commutative61.7%
add-sqr-sqrt61.7%
pow261.7%
Applied egg-rr96.8%
associate-*r/96.8%
*-rgt-identity96.8%
*-commutative96.8%
Simplified96.8%
unpow296.8%
associate-*r*94.2%
associate-*l*91.8%
*-commutative91.8%
*-commutative91.8%
*-commutative91.8%
associate-*l*93.5%
Applied egg-rr93.5%
Taylor expanded in x around 0 76.4%
Taylor expanded in s around 0 75.3%
Final simplification75.3%
herbie shell --seed 2024153
(FPCore (x c s)
:name "mixedcos"
:precision binary64
(/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))