
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (pow a 2.0) 1e+111)
(*
(+ a b_m)
(*
(- b_m a)
(sin (* (* 2.0 (cbrt (pow PI 3.0))) (* angle 0.005555555555555556)))))
(*
(+ a b_m)
(*
(- b_m a)
(sin
(*
(* angle 0.005555555555555556)
(* 2.0 (cbrt (exp (* 3.0 (log PI)))))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (pow(a, 2.0) <= 1e+111) {
tmp = (a + b_m) * ((b_m - a) * sin(((2.0 * cbrt(pow(((double) M_PI), 3.0))) * (angle * 0.005555555555555556))));
} else {
tmp = (a + b_m) * ((b_m - a) * sin(((angle * 0.005555555555555556) * (2.0 * cbrt(exp((3.0 * log(((double) M_PI)))))))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (Math.pow(a, 2.0) <= 1e+111) {
tmp = (a + b_m) * ((b_m - a) * Math.sin(((2.0 * Math.cbrt(Math.pow(Math.PI, 3.0))) * (angle * 0.005555555555555556))));
} else {
tmp = (a + b_m) * ((b_m - a) * Math.sin(((angle * 0.005555555555555556) * (2.0 * Math.cbrt(Math.exp((3.0 * Math.log(Math.PI))))))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if ((a ^ 2.0) <= 1e+111) tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(Float64(Float64(2.0 * cbrt((pi ^ 3.0))) * Float64(angle * 0.005555555555555556))))); else tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(Float64(Float64(angle * 0.005555555555555556) * Float64(2.0 * cbrt(exp(Float64(3.0 * log(pi))))))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 1e+111], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(N[(2.0 * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(2.0 * N[Power[N[Exp[N[(3.0 * N[Log[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 10^{+111}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\left(2 \cdot \sqrt[3]{{\pi}^{3}}\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \sqrt[3]{e^{3 \cdot \log \pi}}\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 9.99999999999999957e110Initial program 62.9%
associate-*l*62.9%
*-commutative62.9%
associate-*l*62.9%
Simplified62.9%
unpow262.9%
unpow262.9%
difference-of-squares62.9%
Applied egg-rr62.9%
pow162.9%
associate-*l*66.5%
2-sin66.5%
associate-*r*66.5%
div-inv66.1%
metadata-eval66.1%
Applied egg-rr66.1%
add-cbrt-cube69.2%
pow369.2%
Applied egg-rr69.2%
if 9.99999999999999957e110 < (pow.f64 a #s(literal 2 binary64)) Initial program 43.5%
associate-*l*43.5%
*-commutative43.5%
associate-*l*43.5%
Simplified43.5%
unpow243.5%
unpow243.5%
difference-of-squares57.2%
Applied egg-rr57.2%
pow157.2%
associate-*l*73.9%
2-sin73.9%
associate-*r*73.9%
div-inv73.8%
metadata-eval73.8%
Applied egg-rr73.8%
add-cbrt-cube74.5%
pow374.5%
Applied egg-rr74.5%
add-exp-log74.5%
log-pow78.5%
Applied egg-rr78.5%
Final simplification73.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= a 3.8e+208)
(*
(+ a b_m)
(*
(- b_m a)
(sin (* (* 2.0 (cbrt (pow PI 3.0))) (* angle 0.005555555555555556)))))
(*
(+ a b_m)
(*
(- b_m a)
(sin (expm1 (log1p (* (* angle 0.005555555555555556) (* 2.0 PI)))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (a <= 3.8e+208) {
tmp = (a + b_m) * ((b_m - a) * sin(((2.0 * cbrt(pow(((double) M_PI), 3.0))) * (angle * 0.005555555555555556))));
} else {
tmp = (a + b_m) * ((b_m - a) * sin(expm1(log1p(((angle * 0.005555555555555556) * (2.0 * ((double) M_PI)))))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (a <= 3.8e+208) {
tmp = (a + b_m) * ((b_m - a) * Math.sin(((2.0 * Math.cbrt(Math.pow(Math.PI, 3.0))) * (angle * 0.005555555555555556))));
} else {
tmp = (a + b_m) * ((b_m - a) * Math.sin(Math.expm1(Math.log1p(((angle * 0.005555555555555556) * (2.0 * Math.PI))))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (a <= 3.8e+208) tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(Float64(Float64(2.0 * cbrt((pi ^ 3.0))) * Float64(angle * 0.005555555555555556))))); else tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(expm1(log1p(Float64(Float64(angle * 0.005555555555555556) * Float64(2.0 * pi))))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[a, 3.8e+208], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(N[(2.0 * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.8 \cdot 10^{+208}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\left(2 \cdot \sqrt[3]{{\pi}^{3}}\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.8000000000000002e208Initial program 54.9%
associate-*l*54.9%
*-commutative54.9%
associate-*l*54.9%
Simplified54.9%
unpow254.9%
unpow254.9%
difference-of-squares58.9%
Applied egg-rr58.9%
pow158.9%
associate-*l*67.6%
2-sin67.6%
associate-*r*67.6%
div-inv67.2%
metadata-eval67.2%
Applied egg-rr67.2%
add-cbrt-cube69.5%
pow369.5%
Applied egg-rr69.5%
if 3.8000000000000002e208 < a Initial program 54.5%
associate-*l*54.5%
*-commutative54.5%
associate-*l*54.5%
Simplified54.5%
unpow254.5%
unpow254.5%
difference-of-squares78.2%
Applied egg-rr78.2%
pow178.2%
associate-*l*90.8%
2-sin90.8%
associate-*r*90.8%
div-inv90.8%
metadata-eval90.8%
Applied egg-rr90.8%
expm1-log1p-u86.2%
expm1-undefine28.2%
metadata-eval28.2%
div-inv28.2%
associate-*l*28.2%
div-inv28.2%
metadata-eval28.2%
Applied egg-rr28.2%
expm1-define86.2%
associate-*r*86.2%
*-commutative86.2%
Simplified86.2%
Final simplification71.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (/ angle 180.0) 2e+116)
(*
(+ a b_m)
(* (- b_m a) (sin (* (* angle 0.005555555555555556) (* 2.0 PI)))))
(*
(* (+ a b_m) (- b_m a))
(sin (* angle (* PI (pow (cbrt 0.011111111111111112) 3.0)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 2e+116) {
tmp = (a + b_m) * ((b_m - a) * sin(((angle * 0.005555555555555556) * (2.0 * ((double) M_PI)))));
} else {
tmp = ((a + b_m) * (b_m - a)) * sin((angle * (((double) M_PI) * pow(cbrt(0.011111111111111112), 3.0))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 2e+116) {
tmp = (a + b_m) * ((b_m - a) * Math.sin(((angle * 0.005555555555555556) * (2.0 * Math.PI))));
} else {
tmp = ((a + b_m) * (b_m - a)) * Math.sin((angle * (Math.PI * Math.pow(Math.cbrt(0.011111111111111112), 3.0))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 2e+116) tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(Float64(Float64(angle * 0.005555555555555556) * Float64(2.0 * pi))))); else tmp = Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * sin(Float64(angle * Float64(pi * (cbrt(0.011111111111111112) ^ 3.0))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+116], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * N[Power[N[Power[0.011111111111111112, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+116}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot {\left(\sqrt[3]{0.011111111111111112}\right)}^{3}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000003e116Initial program 59.3%
associate-*l*59.3%
*-commutative59.3%
associate-*l*59.4%
Simplified59.4%
unpow259.4%
unpow259.4%
difference-of-squares64.5%
Applied egg-rr64.5%
pow164.5%
associate-*l*74.8%
2-sin74.8%
associate-*r*74.8%
div-inv74.6%
metadata-eval74.6%
Applied egg-rr74.6%
if 2.00000000000000003e116 < (/.f64 angle #s(literal 180 binary64)) Initial program 23.4%
associate-*l*23.4%
*-commutative23.4%
associate-*l*23.4%
Simplified23.4%
unpow223.4%
unpow223.4%
difference-of-squares32.8%
Applied egg-rr32.8%
sin-cos-mult32.8%
clear-num32.8%
+-inverses32.8%
add-log-exp0.0%
add-log-exp0.0%
sum-log0.0%
exp-lft-sqr0.0%
Applied egg-rr32.2%
add-cube-cbrt37.4%
pow336.7%
metadata-eval36.7%
div-inv38.0%
associate-*l*38.0%
div-inv36.7%
metadata-eval36.7%
Applied egg-rr36.7%
Taylor expanded in angle around inf 35.2%
Final simplification69.6%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* (* angle 0.005555555555555556) (* 2.0 PI))))
(if (<= b_m 5e+188)
(* (+ a b_m) (* (- b_m a) (sin t_0)))
(* (+ a b_m) (* (- b_m a) (sin (expm1 (log1p t_0))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = (angle * 0.005555555555555556) * (2.0 * ((double) M_PI));
double tmp;
if (b_m <= 5e+188) {
tmp = (a + b_m) * ((b_m - a) * sin(t_0));
} else {
tmp = (a + b_m) * ((b_m - a) * sin(expm1(log1p(t_0))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = (angle * 0.005555555555555556) * (2.0 * Math.PI);
double tmp;
if (b_m <= 5e+188) {
tmp = (a + b_m) * ((b_m - a) * Math.sin(t_0));
} else {
tmp = (a + b_m) * ((b_m - a) * Math.sin(Math.expm1(Math.log1p(t_0))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = (angle * 0.005555555555555556) * (2.0 * math.pi) tmp = 0 if b_m <= 5e+188: tmp = (a + b_m) * ((b_m - a) * math.sin(t_0)) else: tmp = (a + b_m) * ((b_m - a) * math.sin(math.expm1(math.log1p(t_0)))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(Float64(angle * 0.005555555555555556) * Float64(2.0 * pi)) tmp = 0.0 if (b_m <= 5e+188) tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(t_0))); else tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(expm1(log1p(t_0))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 5e+188], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \left(angle \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\\
\mathbf{if}\;b\_m \leq 5 \cdot 10^{+188}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 5.0000000000000001e188Initial program 56.7%
associate-*l*56.7%
*-commutative56.7%
associate-*l*56.7%
Simplified56.7%
unpow256.7%
unpow256.7%
difference-of-squares61.6%
Applied egg-rr61.6%
pow161.6%
associate-*l*70.7%
2-sin70.7%
associate-*r*70.8%
div-inv70.8%
metadata-eval70.8%
Applied egg-rr70.8%
if 5.0000000000000001e188 < b Initial program 37.5%
associate-*l*37.5%
*-commutative37.5%
associate-*l*37.5%
Simplified37.5%
unpow237.5%
unpow237.5%
difference-of-squares50.7%
Applied egg-rr50.7%
pow150.7%
associate-*l*58.2%
2-sin58.2%
associate-*r*58.2%
div-inv54.1%
metadata-eval54.1%
Applied egg-rr54.1%
expm1-log1p-u58.3%
expm1-undefine17.3%
metadata-eval17.3%
div-inv17.3%
associate-*l*17.3%
div-inv17.3%
metadata-eval17.3%
Applied egg-rr17.3%
expm1-define58.3%
associate-*r*58.3%
*-commutative58.3%
Simplified58.3%
Final simplification69.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (sin (* (* angle 0.005555555555555556) (* 2.0 PI)))))
(if (<= (/ angle 180.0) 5e+74)
(* (+ a b_m) (* (- b_m a) t_0))
(if (<= (/ angle 180.0) 5e+206)
(* (+ a b_m) (* t_0 (fabs (- b_m a))))
(*
(* (+ a b_m) (- b_m a))
(sin (* 2.0 (* 0.005555555555555556 (* PI angle)))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = sin(((angle * 0.005555555555555556) * (2.0 * ((double) M_PI))));
double tmp;
if ((angle / 180.0) <= 5e+74) {
tmp = (a + b_m) * ((b_m - a) * t_0);
} else if ((angle / 180.0) <= 5e+206) {
tmp = (a + b_m) * (t_0 * fabs((b_m - a)));
} else {
tmp = ((a + b_m) * (b_m - a)) * sin((2.0 * (0.005555555555555556 * (((double) M_PI) * angle))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = Math.sin(((angle * 0.005555555555555556) * (2.0 * Math.PI)));
double tmp;
if ((angle / 180.0) <= 5e+74) {
tmp = (a + b_m) * ((b_m - a) * t_0);
} else if ((angle / 180.0) <= 5e+206) {
tmp = (a + b_m) * (t_0 * Math.abs((b_m - a)));
} else {
tmp = ((a + b_m) * (b_m - a)) * Math.sin((2.0 * (0.005555555555555556 * (Math.PI * angle))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = math.sin(((angle * 0.005555555555555556) * (2.0 * math.pi))) tmp = 0 if (angle / 180.0) <= 5e+74: tmp = (a + b_m) * ((b_m - a) * t_0) elif (angle / 180.0) <= 5e+206: tmp = (a + b_m) * (t_0 * math.fabs((b_m - a))) else: tmp = ((a + b_m) * (b_m - a)) * math.sin((2.0 * (0.005555555555555556 * (math.pi * angle)))) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = sin(Float64(Float64(angle * 0.005555555555555556) * Float64(2.0 * pi))) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+74) tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * t_0)); elseif (Float64(angle / 180.0) <= 5e+206) tmp = Float64(Float64(a + b_m) * Float64(t_0 * abs(Float64(b_m - a)))); else tmp = Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * sin(Float64(2.0 * Float64(0.005555555555555556 * Float64(pi * angle))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = sin(((angle * 0.005555555555555556) * (2.0 * pi))); tmp = 0.0; if ((angle / 180.0) <= 5e+74) tmp = (a + b_m) * ((b_m - a) * t_0); elseif ((angle / 180.0) <= 5e+206) tmp = (a + b_m) * (t_0 * abs((b_m - a))); else tmp = ((a + b_m) * (b_m - a)) * sin((2.0 * (0.005555555555555556 * (pi * angle)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[Sin[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+74], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+206], N[(N[(a + b$95$m), $MachinePrecision] * N[(t$95$0 * N[Abs[N[(b$95$m - a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+74}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot t\_0\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+206}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(t\_0 \cdot \left|b\_m - a\right|\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \sin \left(2 \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999963e74Initial program 60.5%
associate-*l*60.5%
*-commutative60.5%
associate-*l*60.5%
Simplified60.5%
unpow260.5%
unpow260.5%
difference-of-squares65.5%
Applied egg-rr65.5%
pow165.5%
associate-*l*76.4%
2-sin76.4%
associate-*r*76.4%
div-inv76.1%
metadata-eval76.1%
Applied egg-rr76.1%
if 4.99999999999999963e74 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000002e206Initial program 24.4%
associate-*l*24.4%
*-commutative24.4%
associate-*l*24.4%
Simplified24.4%
unpow224.4%
unpow224.4%
difference-of-squares34.4%
Applied egg-rr34.4%
pow134.4%
associate-*l*34.4%
2-sin34.4%
associate-*r*34.4%
div-inv34.5%
metadata-eval34.5%
Applied egg-rr34.5%
add-sqr-sqrt15.6%
sqrt-unprod32.8%
pow232.8%
Applied egg-rr32.8%
unpow232.8%
rem-sqrt-square32.8%
Simplified32.8%
if 5.0000000000000002e206 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.0%
associate-*l*34.0%
*-commutative34.0%
associate-*l*34.0%
Simplified34.0%
unpow234.0%
unpow234.0%
difference-of-squares41.2%
Applied egg-rr41.2%
Applied egg-rr40.9%
distribute-lft-out40.9%
sin-040.9%
+-lft-identity40.9%
metadata-eval40.9%
*-rgt-identity40.9%
associate-*l*40.9%
associate-*r*56.9%
*-commutative56.9%
Simplified56.9%
Final simplification70.0%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= b_m 1.9e+210)
(*
(+ a b_m)
(* (- b_m a) (sin (* (* angle 0.005555555555555556) (* 2.0 PI)))))
(fabs
(*
(+ a b_m)
(* (- b_m a) (sin (* PI (* 2.0 (* angle 0.005555555555555556)))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 1.9e+210) {
tmp = (a + b_m) * ((b_m - a) * sin(((angle * 0.005555555555555556) * (2.0 * ((double) M_PI)))));
} else {
tmp = fabs(((a + b_m) * ((b_m - a) * sin((((double) M_PI) * (2.0 * (angle * 0.005555555555555556)))))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 1.9e+210) {
tmp = (a + b_m) * ((b_m - a) * Math.sin(((angle * 0.005555555555555556) * (2.0 * Math.PI))));
} else {
tmp = Math.abs(((a + b_m) * ((b_m - a) * Math.sin((Math.PI * (2.0 * (angle * 0.005555555555555556)))))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if b_m <= 1.9e+210: tmp = (a + b_m) * ((b_m - a) * math.sin(((angle * 0.005555555555555556) * (2.0 * math.pi)))) else: tmp = math.fabs(((a + b_m) * ((b_m - a) * math.sin((math.pi * (2.0 * (angle * 0.005555555555555556))))))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (b_m <= 1.9e+210) tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(Float64(Float64(angle * 0.005555555555555556) * Float64(2.0 * pi))))); else tmp = abs(Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(Float64(pi * Float64(2.0 * Float64(angle * 0.005555555555555556))))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (b_m <= 1.9e+210) tmp = (a + b_m) * ((b_m - a) * sin(((angle * 0.005555555555555556) * (2.0 * pi)))); else tmp = abs(((a + b_m) * ((b_m - a) * sin((pi * (2.0 * (angle * 0.005555555555555556))))))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[b$95$m, 1.9e+210], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(Pi * N[(2.0 * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 1.9 \cdot 10^{+210}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\pi \cdot \left(2 \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right|\\
\end{array}
\end{array}
if b < 1.90000000000000014e210Initial program 56.2%
associate-*l*56.2%
*-commutative56.2%
associate-*l*56.2%
Simplified56.2%
unpow256.2%
unpow256.2%
difference-of-squares61.0%
Applied egg-rr61.0%
pow161.0%
associate-*l*70.1%
2-sin70.1%
associate-*r*70.1%
div-inv70.2%
metadata-eval70.2%
Applied egg-rr70.2%
if 1.90000000000000014e210 < b Initial program 40.9%
associate-*l*40.9%
*-commutative40.9%
associate-*l*40.9%
Simplified40.9%
unpow240.9%
unpow240.9%
difference-of-squares55.3%
Applied egg-rr55.3%
pow155.3%
associate-*l*63.5%
2-sin63.5%
associate-*r*63.5%
div-inv59.0%
metadata-eval59.0%
Applied egg-rr59.0%
add-cbrt-cube81.6%
pow381.6%
Applied egg-rr81.6%
pow181.6%
sqr-pow54.4%
pow-prod-down50.3%
pow250.3%
associate-*r*50.3%
rem-cbrt-cube50.3%
associate-*r*50.3%
metadata-eval50.3%
Applied egg-rr50.3%
unpow1/250.3%
unpow250.3%
rem-sqrt-square50.3%
associate-*r*54.5%
+-commutative54.5%
*-commutative54.5%
associate-*l*54.5%
Simplified54.5%
Final simplification68.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (pow a 2.0) 2e+273) (* (* (+ a b_m) (- b_m a)) (sin (* (* PI angle) 0.011111111111111112))) (* 0.011111111111111112 (* a (* angle (* (- b_m a) PI))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (pow(a, 2.0) <= 2e+273) {
tmp = ((a + b_m) * (b_m - a)) * sin(((((double) M_PI) * angle) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * ((double) M_PI))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (Math.pow(a, 2.0) <= 2e+273) {
tmp = ((a + b_m) * (b_m - a)) * Math.sin(((Math.PI * angle) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * Math.PI)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if math.pow(a, 2.0) <= 2e+273: tmp = ((a + b_m) * (b_m - a)) * math.sin(((math.pi * angle) * 0.011111111111111112)) else: tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * math.pi))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if ((a ^ 2.0) <= 2e+273) tmp = Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * sin(Float64(Float64(pi * angle) * 0.011111111111111112))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(angle * Float64(Float64(b_m - a) * pi)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if ((a ^ 2.0) <= 2e+273) tmp = ((a + b_m) * (b_m - a)) * sin(((pi * angle) * 0.011111111111111112)); else tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * pi))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e+273], N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+273}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 1.99999999999999989e273Initial program 62.2%
associate-*l*62.2%
*-commutative62.2%
associate-*l*62.2%
Simplified62.2%
unpow262.2%
unpow262.2%
difference-of-squares62.2%
Applied egg-rr62.2%
sin-cos-mult62.2%
clear-num62.1%
+-inverses62.1%
add-log-exp24.0%
add-log-exp15.2%
sum-log15.2%
exp-lft-sqr15.7%
Applied egg-rr61.8%
Taylor expanded in angle around inf 63.6%
+-commutative63.6%
*-commutative63.6%
+-commutative63.6%
Simplified63.6%
if 1.99999999999999989e273 < (pow.f64 a #s(literal 2 binary64)) Initial program 38.2%
Taylor expanded in angle around 0 35.8%
unpow238.2%
unpow238.2%
difference-of-squares56.8%
Applied egg-rr53.1%
Taylor expanded in b around 0 47.9%
Taylor expanded in angle around 0 65.7%
Final simplification64.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= b_m 2.35e+257)
(*
(+ a b_m)
(* (- b_m a) (sin (* (* angle 0.005555555555555556) (* 2.0 PI)))))
(*
(* (+ a b_m) (- b_m a))
(*
2.0
(* (cos (* PI (/ angle 180.0))) (* PI (* angle 0.005555555555555556)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 2.35e+257) {
tmp = (a + b_m) * ((b_m - a) * sin(((angle * 0.005555555555555556) * (2.0 * ((double) M_PI)))));
} else {
tmp = ((a + b_m) * (b_m - a)) * (2.0 * (cos((((double) M_PI) * (angle / 180.0))) * (((double) M_PI) * (angle * 0.005555555555555556))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 2.35e+257) {
tmp = (a + b_m) * ((b_m - a) * Math.sin(((angle * 0.005555555555555556) * (2.0 * Math.PI))));
} else {
tmp = ((a + b_m) * (b_m - a)) * (2.0 * (Math.cos((Math.PI * (angle / 180.0))) * (Math.PI * (angle * 0.005555555555555556))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if b_m <= 2.35e+257: tmp = (a + b_m) * ((b_m - a) * math.sin(((angle * 0.005555555555555556) * (2.0 * math.pi)))) else: tmp = ((a + b_m) * (b_m - a)) * (2.0 * (math.cos((math.pi * (angle / 180.0))) * (math.pi * (angle * 0.005555555555555556)))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (b_m <= 2.35e+257) tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(Float64(Float64(angle * 0.005555555555555556) * Float64(2.0 * pi))))); else tmp = Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle / 180.0))) * Float64(pi * Float64(angle * 0.005555555555555556))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (b_m <= 2.35e+257) tmp = (a + b_m) * ((b_m - a) * sin(((angle * 0.005555555555555556) * (2.0 * pi)))); else tmp = ((a + b_m) * (b_m - a)) * (2.0 * (cos((pi * (angle / 180.0))) * (pi * (angle * 0.005555555555555556)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[b$95$m, 2.35e+257], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 2.35 \cdot 10^{+257}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.35e257Initial program 55.7%
associate-*l*55.7%
*-commutative55.7%
associate-*l*55.7%
Simplified55.7%
unpow255.7%
unpow255.7%
difference-of-squares60.8%
Applied egg-rr60.8%
pow160.8%
associate-*l*70.2%
2-sin70.2%
associate-*r*70.2%
div-inv69.9%
metadata-eval69.9%
Applied egg-rr69.9%
if 2.35e257 < b Initial program 36.4%
associate-*l*36.4%
*-commutative36.4%
associate-*l*36.4%
Simplified36.4%
unpow236.4%
unpow236.4%
difference-of-squares54.5%
Applied egg-rr54.5%
Taylor expanded in angle around 0 100.0%
associate-*r*100.0%
*-commutative100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
Final simplification71.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556))))
(if (<= b_m 9e+257)
(* (+ a b_m) (* (- b_m a) (sin (* 2.0 t_0))))
(*
(* (+ a b_m) (- b_m a))
(* 2.0 (* (cos (* PI (/ angle 180.0))) t_0))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double tmp;
if (b_m <= 9e+257) {
tmp = (a + b_m) * ((b_m - a) * sin((2.0 * t_0)));
} else {
tmp = ((a + b_m) * (b_m - a)) * (2.0 * (cos((((double) M_PI) * (angle / 180.0))) * t_0));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double tmp;
if (b_m <= 9e+257) {
tmp = (a + b_m) * ((b_m - a) * Math.sin((2.0 * t_0)));
} else {
tmp = ((a + b_m) * (b_m - a)) * (2.0 * (Math.cos((Math.PI * (angle / 180.0))) * t_0));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = math.pi * (angle * 0.005555555555555556) tmp = 0 if b_m <= 9e+257: tmp = (a + b_m) * ((b_m - a) * math.sin((2.0 * t_0))) else: tmp = ((a + b_m) * (b_m - a)) * (2.0 * (math.cos((math.pi * (angle / 180.0))) * t_0)) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) tmp = 0.0 if (b_m <= 9e+257) tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(Float64(2.0 * t_0)))); else tmp = Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle / 180.0))) * t_0))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = pi * (angle * 0.005555555555555556); tmp = 0.0; if (b_m <= 9e+257) tmp = (a + b_m) * ((b_m - a) * sin((2.0 * t_0))); else tmp = ((a + b_m) * (b_m - a)) * (2.0 * (cos((pi * (angle / 180.0))) * t_0)); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 9e+257], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
\mathbf{if}\;b\_m \leq 9 \cdot 10^{+257}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(2 \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if b < 8.9999999999999999e257Initial program 55.7%
associate-*l*55.7%
*-commutative55.7%
associate-*l*55.7%
Simplified55.7%
unpow255.7%
unpow255.7%
difference-of-squares60.8%
Applied egg-rr60.8%
pow160.8%
associate-*l*70.2%
2-sin70.2%
associate-*r*70.2%
div-inv69.9%
metadata-eval69.9%
Applied egg-rr69.9%
add-cbrt-cube70.9%
pow370.9%
Applied egg-rr70.9%
pow170.9%
rem-cbrt-cube69.9%
associate-*r*69.9%
Applied egg-rr69.9%
if 8.9999999999999999e257 < b Initial program 36.4%
associate-*l*36.4%
*-commutative36.4%
associate-*l*36.4%
Simplified36.4%
unpow236.4%
unpow236.4%
difference-of-squares54.5%
Applied egg-rr54.5%
Taylor expanded in angle around 0 100.0%
associate-*r*100.0%
*-commutative100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
Final simplification71.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= b_m 3e+225)
(*
(+ a b_m)
(* (- b_m a) (sin (* 2.0 (* PI (* angle 0.005555555555555556))))))
(* (+ a b_m) (* (- b_m a) (* (* PI angle) 0.011111111111111112)))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 3e+225) {
tmp = (a + b_m) * ((b_m - a) * sin((2.0 * (((double) M_PI) * (angle * 0.005555555555555556)))));
} else {
tmp = (a + b_m) * ((b_m - a) * ((((double) M_PI) * angle) * 0.011111111111111112));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (b_m <= 3e+225) {
tmp = (a + b_m) * ((b_m - a) * Math.sin((2.0 * (Math.PI * (angle * 0.005555555555555556)))));
} else {
tmp = (a + b_m) * ((b_m - a) * ((Math.PI * angle) * 0.011111111111111112));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if b_m <= 3e+225: tmp = (a + b_m) * ((b_m - a) * math.sin((2.0 * (math.pi * (angle * 0.005555555555555556))))) else: tmp = (a + b_m) * ((b_m - a) * ((math.pi * angle) * 0.011111111111111112)) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (b_m <= 3e+225) tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * sin(Float64(2.0 * Float64(pi * Float64(angle * 0.005555555555555556)))))); else tmp = Float64(Float64(a + b_m) * Float64(Float64(b_m - a) * Float64(Float64(pi * angle) * 0.011111111111111112))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (b_m <= 3e+225) tmp = (a + b_m) * ((b_m - a) * sin((2.0 * (pi * (angle * 0.005555555555555556))))); else tmp = (a + b_m) * ((b_m - a) * ((pi * angle) * 0.011111111111111112)); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[b$95$m, 3e+225], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b$95$m), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;b\_m \leq 3 \cdot 10^{+225}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(\left(b\_m - a\right) \cdot \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if b < 3e225Initial program 56.4%
associate-*l*56.4%
*-commutative56.4%
associate-*l*56.4%
Simplified56.4%
unpow256.4%
unpow256.4%
difference-of-squares61.2%
Applied egg-rr61.2%
pow161.2%
associate-*l*70.3%
2-sin70.3%
associate-*r*70.3%
div-inv70.4%
metadata-eval70.4%
Applied egg-rr70.4%
add-cbrt-cube70.5%
pow370.5%
Applied egg-rr70.5%
pow170.5%
rem-cbrt-cube70.4%
associate-*r*70.3%
Applied egg-rr70.3%
if 3e225 < b Initial program 38.1%
associate-*l*38.1%
*-commutative38.1%
associate-*l*38.1%
Simplified38.1%
unpow238.1%
unpow238.1%
difference-of-squares53.1%
Applied egg-rr53.1%
pow153.1%
associate-*l*61.8%
2-sin61.8%
associate-*r*61.8%
div-inv57.1%
metadata-eval57.1%
Applied egg-rr57.1%
Taylor expanded in angle around 0 81.0%
Final simplification71.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= angle 5.8e-140)
(* (+ a b_m) (* 0.011111111111111112 (* angle (* (- b_m a) PI))))
(*
(* (+ a b_m) (- b_m a))
(sin (* 2.0 (* 0.005555555555555556 (* PI angle)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 5.8e-140) {
tmp = (a + b_m) * (0.011111111111111112 * (angle * ((b_m - a) * ((double) M_PI))));
} else {
tmp = ((a + b_m) * (b_m - a)) * sin((2.0 * (0.005555555555555556 * (((double) M_PI) * angle))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 5.8e-140) {
tmp = (a + b_m) * (0.011111111111111112 * (angle * ((b_m - a) * Math.PI)));
} else {
tmp = ((a + b_m) * (b_m - a)) * Math.sin((2.0 * (0.005555555555555556 * (Math.PI * angle))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if angle <= 5.8e-140: tmp = (a + b_m) * (0.011111111111111112 * (angle * ((b_m - a) * math.pi))) else: tmp = ((a + b_m) * (b_m - a)) * math.sin((2.0 * (0.005555555555555556 * (math.pi * angle)))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (angle <= 5.8e-140) tmp = Float64(Float64(a + b_m) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b_m - a) * pi)))); else tmp = Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * sin(Float64(2.0 * Float64(0.005555555555555556 * Float64(pi * angle))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (angle <= 5.8e-140) tmp = (a + b_m) * (0.011111111111111112 * (angle * ((b_m - a) * pi))); else tmp = ((a + b_m) * (b_m - a)) * sin((2.0 * (0.005555555555555556 * (pi * angle)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[angle, 5.8e-140], N[(N[(a + b$95$m), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(2.0 * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 5.8 \cdot 10^{-140}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \sin \left(2 \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if angle < 5.79999999999999995e-140Initial program 57.0%
associate-*l*57.0%
*-commutative57.0%
associate-*l*57.0%
Simplified57.0%
unpow257.0%
unpow257.0%
difference-of-squares62.1%
Applied egg-rr62.1%
pow162.1%
associate-*l*75.8%
2-sin75.8%
associate-*r*75.8%
div-inv75.9%
metadata-eval75.9%
Applied egg-rr75.9%
Taylor expanded in angle around 0 70.0%
if 5.79999999999999995e-140 < angle Initial program 50.6%
associate-*l*50.6%
*-commutative50.6%
associate-*l*50.6%
Simplified50.6%
unpow250.6%
unpow250.6%
difference-of-squares57.5%
Applied egg-rr57.5%
Applied egg-rr56.4%
distribute-lft-out56.4%
sin-056.4%
+-lft-identity56.4%
metadata-eval56.4%
*-rgt-identity56.4%
associate-*l*56.4%
associate-*r*57.8%
*-commutative57.8%
Simplified57.8%
Final simplification65.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= angle 6.5e-140) (* (+ a b_m) (* 0.011111111111111112 (* angle (* (- b_m a) PI)))) (* (* (+ a b_m) (- b_m a)) (sin (* (* PI angle) 0.011111111111111112)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 6.5e-140) {
tmp = (a + b_m) * (0.011111111111111112 * (angle * ((b_m - a) * ((double) M_PI))));
} else {
tmp = ((a + b_m) * (b_m - a)) * sin(((((double) M_PI) * angle) * 0.011111111111111112));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 6.5e-140) {
tmp = (a + b_m) * (0.011111111111111112 * (angle * ((b_m - a) * Math.PI)));
} else {
tmp = ((a + b_m) * (b_m - a)) * Math.sin(((Math.PI * angle) * 0.011111111111111112));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if angle <= 6.5e-140: tmp = (a + b_m) * (0.011111111111111112 * (angle * ((b_m - a) * math.pi))) else: tmp = ((a + b_m) * (b_m - a)) * math.sin(((math.pi * angle) * 0.011111111111111112)) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (angle <= 6.5e-140) tmp = Float64(Float64(a + b_m) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b_m - a) * pi)))); else tmp = Float64(Float64(Float64(a + b_m) * Float64(b_m - a)) * sin(Float64(Float64(pi * angle) * 0.011111111111111112))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (angle <= 6.5e-140) tmp = (a + b_m) * (0.011111111111111112 * (angle * ((b_m - a) * pi))); else tmp = ((a + b_m) * (b_m - a)) * sin(((pi * angle) * 0.011111111111111112)); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[angle, 6.5e-140], N[(N[(a + b$95$m), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 6.5 \cdot 10^{-140}:\\
\;\;\;\;\left(a + b\_m\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if angle < 6.4999999999999995e-140Initial program 57.0%
associate-*l*57.0%
*-commutative57.0%
associate-*l*57.0%
Simplified57.0%
unpow257.0%
unpow257.0%
difference-of-squares62.1%
Applied egg-rr62.1%
pow162.1%
associate-*l*75.8%
2-sin75.8%
associate-*r*75.8%
div-inv75.9%
metadata-eval75.9%
Applied egg-rr75.9%
Taylor expanded in angle around 0 70.0%
if 6.4999999999999995e-140 < angle Initial program 50.6%
associate-*l*50.6%
*-commutative50.6%
associate-*l*50.6%
Simplified50.6%
unpow250.6%
unpow250.6%
difference-of-squares57.5%
Applied egg-rr57.5%
sin-cos-mult57.5%
clear-num57.5%
+-inverses57.5%
add-log-exp22.9%
add-log-exp14.0%
sum-log14.0%
exp-lft-sqr16.3%
Applied egg-rr56.4%
Taylor expanded in angle around inf 57.8%
+-commutative57.8%
*-commutative57.8%
+-commutative57.8%
Simplified57.8%
Final simplification65.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= a 5.4e+136) (* (* angle 0.011111111111111112) (* PI (* (+ a b_m) (- b_m a)))) (* 0.011111111111111112 (* a (* angle (* (- b_m a) PI))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (a <= 5.4e+136) {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * ((a + b_m) * (b_m - a)));
} else {
tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * ((double) M_PI))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (a <= 5.4e+136) {
tmp = (angle * 0.011111111111111112) * (Math.PI * ((a + b_m) * (b_m - a)));
} else {
tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * Math.PI)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if a <= 5.4e+136: tmp = (angle * 0.011111111111111112) * (math.pi * ((a + b_m) * (b_m - a))) else: tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * math.pi))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (a <= 5.4e+136) tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(Float64(a + b_m) * Float64(b_m - a)))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(angle * Float64(Float64(b_m - a) * pi)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (a <= 5.4e+136) tmp = (angle * 0.011111111111111112) * (pi * ((a + b_m) * (b_m - a))); else tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * pi))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[a, 5.4e+136], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.4 \cdot 10^{+136}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 5.4000000000000003e136Initial program 58.3%
Taylor expanded in angle around 0 53.8%
unpow258.3%
unpow258.3%
difference-of-squares60.3%
Applied egg-rr56.8%
Taylor expanded in angle around 0 56.8%
associate-*r*56.8%
+-commutative56.8%
*-commutative56.8%
+-commutative56.8%
Simplified56.8%
if 5.4000000000000003e136 < a Initial program 37.9%
Taylor expanded in angle around 0 35.6%
unpow237.9%
unpow237.9%
difference-of-squares61.7%
Applied egg-rr52.5%
Taylor expanded in b around 0 52.5%
Taylor expanded in angle around 0 74.1%
Final simplification59.7%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= a 7.8e+136) (* 0.011111111111111112 (* angle (* PI (* (+ a b_m) (- b_m a))))) (* 0.011111111111111112 (* a (* angle (* (- b_m a) PI))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (a <= 7.8e+136) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * ((a + b_m) * (b_m - a))));
} else {
tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * ((double) M_PI))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (a <= 7.8e+136) {
tmp = 0.011111111111111112 * (angle * (Math.PI * ((a + b_m) * (b_m - a))));
} else {
tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * Math.PI)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if a <= 7.8e+136: tmp = 0.011111111111111112 * (angle * (math.pi * ((a + b_m) * (b_m - a)))) else: tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * math.pi))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (a <= 7.8e+136) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(a + b_m) * Float64(b_m - a))))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(angle * Float64(Float64(b_m - a) * pi)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (a <= 7.8e+136) tmp = 0.011111111111111112 * (angle * (pi * ((a + b_m) * (b_m - a)))); else tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * pi))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[a, 7.8e+136], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.8 \cdot 10^{+136}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 7.80000000000000038e136Initial program 58.3%
Taylor expanded in angle around 0 53.8%
unpow258.3%
unpow258.3%
difference-of-squares60.3%
Applied egg-rr56.8%
if 7.80000000000000038e136 < a Initial program 37.9%
Taylor expanded in angle around 0 35.6%
unpow237.9%
unpow237.9%
difference-of-squares61.7%
Applied egg-rr52.5%
Taylor expanded in b around 0 52.5%
Taylor expanded in angle around 0 74.1%
Final simplification59.7%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= a 2.05e+24) (* 0.011111111111111112 (* angle (* PI (* b_m (- b_m a))))) (* 0.011111111111111112 (* a (* angle (* (- b_m a) PI))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (a <= 2.05e+24) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b_m * (b_m - a))));
} else {
tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * ((double) M_PI))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (a <= 2.05e+24) {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b_m * (b_m - a))));
} else {
tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * Math.PI)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if a <= 2.05e+24: tmp = 0.011111111111111112 * (angle * (math.pi * (b_m * (b_m - a)))) else: tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * math.pi))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (a <= 2.05e+24) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b_m * Float64(b_m - a))))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(angle * Float64(Float64(b_m - a) * pi)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (a <= 2.05e+24) tmp = 0.011111111111111112 * (angle * (pi * (b_m * (b_m - a)))); else tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * pi))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[a, 2.05e+24], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b$95$m * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.05 \cdot 10^{+24}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b\_m \cdot \left(b\_m - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.05e24Initial program 58.3%
Taylor expanded in angle around 0 54.1%
unpow258.3%
unpow258.3%
difference-of-squares60.5%
Applied egg-rr57.4%
Taylor expanded in b around inf 46.6%
if 2.05e24 < a Initial program 44.3%
Taylor expanded in angle around 0 40.4%
unpow244.3%
unpow244.3%
difference-of-squares60.6%
Applied egg-rr51.9%
Taylor expanded in b around 0 49.9%
Taylor expanded in angle around 0 64.6%
Final simplification51.0%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= angle 2.2e+75) (* 0.011111111111111112 (* a (* angle (* (- b_m a) PI)))) (* 0.011111111111111112 (* angle (* a (* b_m PI))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 2.2e+75) {
tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * (angle * (a * (b_m * ((double) M_PI))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (angle <= 2.2e+75) {
tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * Math.PI)));
} else {
tmp = 0.011111111111111112 * (angle * (a * (b_m * Math.PI)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if angle <= 2.2e+75: tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * math.pi))) else: tmp = 0.011111111111111112 * (angle * (a * (b_m * math.pi))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (angle <= 2.2e+75) tmp = Float64(0.011111111111111112 * Float64(a * Float64(angle * Float64(Float64(b_m - a) * pi)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(a * Float64(b_m * pi)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (angle <= 2.2e+75) tmp = 0.011111111111111112 * (a * (angle * ((b_m - a) * pi))); else tmp = 0.011111111111111112 * (angle * (a * (b_m * pi))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[angle, 2.2e+75], N[(0.011111111111111112 * N[(a * N[(angle * N[(N[(b$95$m - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(a * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 2.2 \cdot 10^{+75}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(\left(b\_m - a\right) \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b\_m \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if angle < 2.20000000000000012e75Initial program 60.7%
Taylor expanded in angle around 0 56.6%
unpow260.7%
unpow260.7%
difference-of-squares65.7%
Applied egg-rr61.1%
Taylor expanded in b around 0 42.1%
Taylor expanded in angle around 0 47.3%
if 2.20000000000000012e75 < angle Initial program 27.3%
Taylor expanded in angle around 0 23.5%
unpow227.3%
unpow227.3%
difference-of-squares36.2%
Applied egg-rr32.4%
Taylor expanded in b around 0 23.9%
Taylor expanded in a around 0 27.5%
*-commutative27.5%
Simplified27.5%
Final simplification43.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 0.011111111111111112 (* angle (* a (* b_m PI)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 0.011111111111111112 * (angle * (a * (b_m * ((double) M_PI))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 0.011111111111111112 * (angle * (a * (b_m * Math.PI)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 0.011111111111111112 * (angle * (a * (b_m * math.pi)))
b_m = abs(b) function code(a, b_m, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(a * Float64(b_m * pi)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 0.011111111111111112 * (angle * (a * (b_m * pi))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(0.011111111111111112 * N[(angle * N[(a * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b\_m \cdot \pi\right)\right)\right)
\end{array}
Initial program 54.9%
Taylor expanded in angle around 0 50.8%
unpow254.9%
unpow254.9%
difference-of-squares60.5%
Applied egg-rr56.1%
Taylor expanded in b around 0 38.9%
Taylor expanded in a around 0 24.5%
*-commutative24.5%
Simplified24.5%
Final simplification24.5%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* 0.011111111111111112 (* a (* angle (* b_m PI)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return 0.011111111111111112 * (a * (angle * (b_m * ((double) M_PI))));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return 0.011111111111111112 * (a * (angle * (b_m * Math.PI)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return 0.011111111111111112 * (a * (angle * (b_m * math.pi)))
b_m = abs(b) function code(a, b_m, angle) return Float64(0.011111111111111112 * Float64(a * Float64(angle * Float64(b_m * pi)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = 0.011111111111111112 * (a * (angle * (b_m * pi))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(0.011111111111111112 * N[(a * N[(angle * N[(b$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(b\_m \cdot \pi\right)\right)\right)
\end{array}
Initial program 54.9%
Taylor expanded in angle around 0 50.8%
unpow254.9%
unpow254.9%
difference-of-squares60.5%
Applied egg-rr56.1%
Taylor expanded in b around 0 38.9%
Taylor expanded in a around 0 22.0%
herbie shell --seed 2024139
(FPCore (a b angle)
:name "ab-angle->ABCF B"
:precision binary64
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))