
(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 22 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}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= (/ angle 180.0) 1e+21)
(*
2.0
(*
(- b a)
(*
(cos (* 0.005555555555555556 (* angle (pow (sqrt PI) 2.0))))
(* (sin t_0) (+ b a)))))
(if (<= (/ angle 180.0) 5e+121)
(fabs
(*
(sin (* PI (* angle 0.005555555555555556)))
(* 2.0 (pow (+ b a) 2.0))))
(*
(* (fma b b (* a (- a))) (* 2.0 (sin (* (/ angle 180.0) PI))))
(cos (pow (cbrt (expm1 (log1p t_0))) 3.0)))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if ((angle / 180.0) <= 1e+21) {
tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * pow(sqrt(((double) M_PI)), 2.0)))) * (sin(t_0) * (b + a))));
} else if ((angle / 180.0) <= 5e+121) {
tmp = fabs((sin((((double) M_PI) * (angle * 0.005555555555555556))) * (2.0 * pow((b + a), 2.0))));
} else {
tmp = (fma(b, b, (a * -a)) * (2.0 * sin(((angle / 180.0) * ((double) M_PI))))) * cos(pow(cbrt(expm1(log1p(t_0))), 3.0));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (Float64(angle / 180.0) <= 1e+21) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * (sqrt(pi) ^ 2.0)))) * Float64(sin(t_0) * Float64(b + a))))); elseif (Float64(angle / 180.0) <= 5e+121) tmp = abs(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * Float64(2.0 * (Float64(b + a) ^ 2.0)))); else tmp = Float64(Float64(fma(b, b, Float64(a * Float64(-a))) * Float64(2.0 * sin(Float64(Float64(angle / 180.0) * pi)))) * cos((cbrt(expm1(log1p(t_0))) ^ 3.0))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+21], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+121], N[Abs[N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(b * b + N[(a * (-a)), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[Power[N[Power[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 10^{+21}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \left(\sin t_0 \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+121}:\\
\;\;\;\;\left|\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot {\left(b + a\right)}^{2}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(b, b, a \cdot \left(-a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)\right) \cdot \cos \left({\left(\sqrt[3]{\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)}\right)}^{3}\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 1e21Initial program 63.7%
associate-*l*63.7%
unpow263.7%
unpow263.7%
difference-of-squares67.4%
Simplified67.4%
Taylor expanded in angle around inf 80.3%
add-sqr-sqrt83.0%
pow283.0%
Applied egg-rr83.0%
if 1e21 < (/.f64 angle 180) < 5.00000000000000007e121Initial program 33.0%
associate-*l*33.0%
unpow233.0%
unpow233.0%
Simplified33.0%
log1p-expm1-u33.0%
div-inv32.9%
metadata-eval32.9%
Applied egg-rr32.9%
Taylor expanded in angle around 0 29.4%
add-sqr-sqrt25.6%
sqrt-unprod43.5%
pow243.5%
Applied egg-rr48.6%
unpow248.6%
rem-sqrt-square49.7%
associate-*r*49.7%
*-commutative49.7%
associate-*r*49.4%
*-commutative49.4%
Simplified49.4%
if 5.00000000000000007e121 < (/.f64 angle 180) Initial program 32.6%
*-commutative32.6%
associate-*l*32.6%
unpow232.6%
fma-neg32.6%
unpow232.6%
distribute-rgt-neg-in32.6%
Simplified32.6%
add-cube-cbrt41.1%
pow340.6%
div-inv43.4%
metadata-eval43.4%
Applied egg-rr43.4%
expm1-log1p-u54.3%
*-commutative54.3%
*-commutative54.3%
associate-*r*54.3%
Applied egg-rr54.3%
Final simplification75.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= (pow b 2.0) 1e-223)
(*
2.0
(*
(- b a)
(*
(cos t_0)
(*
(+ b a)
(sin
(*
0.005555555555555556
(* angle (* (cbrt PI) (pow (cbrt PI) 2.0)))))))))
(*
2.0
(*
(- b a)
(*
(cos (* 0.005555555555555556 (* angle (pow (sqrt PI) 2.0))))
(* (sin t_0) (+ b a))))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (pow(b, 2.0) <= 1e-223) {
tmp = 2.0 * ((b - a) * (cos(t_0) * ((b + a) * sin((0.005555555555555556 * (angle * (cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0))))))));
} else {
tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * pow(sqrt(((double) M_PI)), 2.0)))) * (sin(t_0) * (b + a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (Math.pow(b, 2.0) <= 1e-223) {
tmp = 2.0 * ((b - a) * (Math.cos(t_0) * ((b + a) * Math.sin((0.005555555555555556 * (angle * (Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0))))))));
} else {
tmp = 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (angle * Math.pow(Math.sqrt(Math.PI), 2.0)))) * (Math.sin(t_0) * (b + a))));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if ((b ^ 2.0) <= 1e-223) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(angle * Float64(cbrt(pi) * (cbrt(pi) ^ 2.0))))))))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * (sqrt(pi) ^ 2.0)))) * Float64(sin(t_0) * Float64(b + a))))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 1e-223], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;{b}^{2} \leq 10^{-223}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \left(\sin t_0 \cdot \left(b + a\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 9.9999999999999997e-224Initial program 69.2%
associate-*l*69.2%
unpow269.2%
unpow269.2%
difference-of-squares69.2%
Simplified69.2%
Taylor expanded in angle around inf 74.8%
add-cube-cbrt77.7%
pow277.7%
Applied egg-rr77.7%
if 9.9999999999999997e-224 < (pow.f64 b 2) Initial program 49.1%
associate-*l*49.1%
unpow249.1%
unpow249.1%
difference-of-squares53.4%
Simplified53.4%
Taylor expanded in angle around inf 65.6%
add-sqr-sqrt70.5%
pow270.5%
Applied egg-rr70.5%
Final simplification73.0%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= (pow b 2.0) 2e-45)
(*
2.0
(*
(- b a)
(* (cos t_0) (* (+ b a) (sin (/ 1.0 (/ (/ 180.0 angle) PI)))))))
(*
2.0
(*
(- b a)
(*
(cos (* 0.005555555555555556 (* angle (pow (sqrt PI) 2.0))))
(* (sin t_0) (+ b a))))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (pow(b, 2.0) <= 2e-45) {
tmp = 2.0 * ((b - a) * (cos(t_0) * ((b + a) * sin((1.0 / ((180.0 / angle) / ((double) M_PI)))))));
} else {
tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * pow(sqrt(((double) M_PI)), 2.0)))) * (sin(t_0) * (b + a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (Math.pow(b, 2.0) <= 2e-45) {
tmp = 2.0 * ((b - a) * (Math.cos(t_0) * ((b + a) * Math.sin((1.0 / ((180.0 / angle) / Math.PI))))));
} else {
tmp = 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (angle * Math.pow(Math.sqrt(Math.PI), 2.0)))) * (Math.sin(t_0) * (b + a))));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if math.pow(b, 2.0) <= 2e-45: tmp = 2.0 * ((b - a) * (math.cos(t_0) * ((b + a) * math.sin((1.0 / ((180.0 / angle) / math.pi)))))) else: tmp = 2.0 * ((b - a) * (math.cos((0.005555555555555556 * (angle * math.pow(math.sqrt(math.pi), 2.0)))) * (math.sin(t_0) * (b + a)))) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if ((b ^ 2.0) <= 2e-45) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(Float64(b + a) * sin(Float64(1.0 / Float64(Float64(180.0 / angle) / pi))))))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * (sqrt(pi) ^ 2.0)))) * Float64(sin(t_0) * Float64(b + a))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if ((b ^ 2.0) <= 2e-45) tmp = 2.0 * ((b - a) * (cos(t_0) * ((b + a) * sin((1.0 / ((180.0 / angle) / pi)))))); else tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * (sqrt(pi) ^ 2.0)))) * (sin(t_0) * (b + a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e-45], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(1.0 / N[(N[(180.0 / angle), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{-45}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\left(b + a\right) \cdot \sin \left(\frac{1}{\frac{\frac{180}{angle}}{\pi}}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \left(\sin t_0 \cdot \left(b + a\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 1.99999999999999997e-45Initial program 64.1%
associate-*l*64.1%
unpow264.1%
unpow264.1%
difference-of-squares64.1%
Simplified64.1%
Taylor expanded in angle around inf 70.2%
associate-*r*69.0%
*-commutative69.0%
metadata-eval69.0%
div-inv68.8%
*-commutative68.8%
clear-num68.4%
div-inv66.2%
clear-num68.3%
Applied egg-rr70.3%
if 1.99999999999999997e-45 < (pow.f64 b 2) Initial program 48.5%
associate-*l*48.5%
unpow248.5%
unpow248.5%
difference-of-squares54.0%
Simplified54.0%
Taylor expanded in angle around inf 67.5%
add-sqr-sqrt75.2%
pow275.2%
Applied egg-rr75.2%
Final simplification72.8%
(FPCore (a b angle)
:precision binary64
(*
2.0
(*
(- b a)
(*
(* (sin (* 0.005555555555555556 (* angle PI))) (+ b a))
(log (exp (cos (* PI (* angle 0.005555555555555556)))))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (b + a)) * log(exp(cos((((double) M_PI) * (angle * 0.005555555555555556)))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((Math.sin((0.005555555555555556 * (angle * Math.PI))) * (b + a)) * Math.log(Math.exp(Math.cos((Math.PI * (angle * 0.005555555555555556)))))));
}
def code(a, b, angle): return 2.0 * ((b - a) * ((math.sin((0.005555555555555556 * (angle * math.pi))) * (b + a)) * math.log(math.exp(math.cos((math.pi * (angle * 0.005555555555555556)))))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(b + a)) * log(exp(cos(Float64(pi * Float64(angle * 0.005555555555555556)))))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * pi))) * (b + a)) * log(exp(cos((pi * (angle * 0.005555555555555556))))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + a\right)\right) \cdot \log \left(e^{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)\right)\right)
\end{array}
Initial program 56.1%
associate-*l*56.1%
unpow256.1%
unpow256.1%
difference-of-squares58.9%
Simplified58.9%
Taylor expanded in angle around inf 68.8%
associate-*r*70.2%
*-commutative70.2%
metadata-eval70.2%
div-inv71.1%
*-commutative71.1%
clear-num70.7%
div-inv69.0%
add-log-exp69.0%
div-inv70.7%
clear-num71.1%
div-inv70.2%
metadata-eval70.2%
*-commutative70.2%
Applied egg-rr70.2%
Final simplification70.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 2.0 (pow (+ b a) 2.0)))
(t_1 (* PI (* angle 0.005555555555555556)))
(t_2 (sin t_1))
(t_3 (fabs (* t_2 t_0))))
(if (<= (/ angle 180.0) -5e+23)
t_3
(if (<= (/ angle 180.0) 5e+36)
(* 2.0 (* (* (+ b a) t_2) (* (- b a) (cos t_1))))
(if (<= (/ angle 180.0) 5e+156)
t_3
(if (<= (/ angle 180.0) 2e+166)
(* t_0 (* (sin (* 2.0 t_1)) 0.5))
(*
2.0
(*
(- b a)
(* (sin (* 0.005555555555555556 (* angle PI))) (+ b a))))))))))
double code(double a, double b, double angle) {
double t_0 = 2.0 * pow((b + a), 2.0);
double t_1 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_2 = sin(t_1);
double t_3 = fabs((t_2 * t_0));
double tmp;
if ((angle / 180.0) <= -5e+23) {
tmp = t_3;
} else if ((angle / 180.0) <= 5e+36) {
tmp = 2.0 * (((b + a) * t_2) * ((b - a) * cos(t_1)));
} else if ((angle / 180.0) <= 5e+156) {
tmp = t_3;
} else if ((angle / 180.0) <= 2e+166) {
tmp = t_0 * (sin((2.0 * t_1)) * 0.5);
} else {
tmp = 2.0 * ((b - a) * (sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (b + a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 2.0 * Math.pow((b + a), 2.0);
double t_1 = Math.PI * (angle * 0.005555555555555556);
double t_2 = Math.sin(t_1);
double t_3 = Math.abs((t_2 * t_0));
double tmp;
if ((angle / 180.0) <= -5e+23) {
tmp = t_3;
} else if ((angle / 180.0) <= 5e+36) {
tmp = 2.0 * (((b + a) * t_2) * ((b - a) * Math.cos(t_1)));
} else if ((angle / 180.0) <= 5e+156) {
tmp = t_3;
} else if ((angle / 180.0) <= 2e+166) {
tmp = t_0 * (Math.sin((2.0 * t_1)) * 0.5);
} else {
tmp = 2.0 * ((b - a) * (Math.sin((0.005555555555555556 * (angle * Math.PI))) * (b + a)));
}
return tmp;
}
def code(a, b, angle): t_0 = 2.0 * math.pow((b + a), 2.0) t_1 = math.pi * (angle * 0.005555555555555556) t_2 = math.sin(t_1) t_3 = math.fabs((t_2 * t_0)) tmp = 0 if (angle / 180.0) <= -5e+23: tmp = t_3 elif (angle / 180.0) <= 5e+36: tmp = 2.0 * (((b + a) * t_2) * ((b - a) * math.cos(t_1))) elif (angle / 180.0) <= 5e+156: tmp = t_3 elif (angle / 180.0) <= 2e+166: tmp = t_0 * (math.sin((2.0 * t_1)) * 0.5) else: tmp = 2.0 * ((b - a) * (math.sin((0.005555555555555556 * (angle * math.pi))) * (b + a))) return tmp
function code(a, b, angle) t_0 = Float64(2.0 * (Float64(b + a) ^ 2.0)) t_1 = Float64(pi * Float64(angle * 0.005555555555555556)) t_2 = sin(t_1) t_3 = abs(Float64(t_2 * t_0)) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+23) tmp = t_3; elseif (Float64(angle / 180.0) <= 5e+36) tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * t_2) * Float64(Float64(b - a) * cos(t_1)))); elseif (Float64(angle / 180.0) <= 5e+156) tmp = t_3; elseif (Float64(angle / 180.0) <= 2e+166) tmp = Float64(t_0 * Float64(sin(Float64(2.0 * t_1)) * 0.5)); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(b + a)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 2.0 * ((b + a) ^ 2.0); t_1 = pi * (angle * 0.005555555555555556); t_2 = sin(t_1); t_3 = abs((t_2 * t_0)); tmp = 0.0; if ((angle / 180.0) <= -5e+23) tmp = t_3; elseif ((angle / 180.0) <= 5e+36) tmp = 2.0 * (((b + a) * t_2) * ((b - a) * cos(t_1))); elseif ((angle / 180.0) <= 5e+156) tmp = t_3; elseif ((angle / 180.0) <= 2e+166) tmp = t_0 * (sin((2.0 * t_1)) * 0.5); else tmp = 2.0 * ((b - a) * (sin((0.005555555555555556 * (angle * pi))) * (b + a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(2.0 * N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[(t$95$2 * t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+23], t$95$3, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+36], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+156], t$95$3, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+166], N[(t$95$0 * N[(N[Sin[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot {\left(b + a\right)}^{2}\\
t_1 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_2 := \sin t_1\\
t_3 := \left|t_2 \cdot t_0\right|\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+23}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+36}:\\
\;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot t_2\right) \cdot \left(\left(b - a\right) \cdot \cos t_1\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+156}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+166}:\\
\;\;\;\;t_0 \cdot \left(\sin \left(2 \cdot t_1\right) \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + a\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.9999999999999999e23 or 4.99999999999999977e36 < (/.f64 angle 180) < 4.99999999999999992e156Initial program 33.7%
associate-*l*33.7%
unpow233.7%
unpow233.7%
Simplified33.7%
log1p-expm1-u33.7%
div-inv35.4%
metadata-eval35.4%
Applied egg-rr35.4%
Taylor expanded in angle around 0 33.1%
add-sqr-sqrt27.0%
sqrt-unprod46.3%
pow246.3%
Applied egg-rr47.5%
unpow247.5%
rem-sqrt-square48.2%
associate-*r*48.2%
*-commutative48.2%
associate-*r*48.2%
*-commutative48.2%
Simplified48.2%
if -4.9999999999999999e23 < (/.f64 angle 180) < 4.99999999999999977e36Initial program 74.2%
associate-*l*74.2%
unpow274.2%
unpow274.2%
difference-of-squares78.6%
Simplified78.6%
Taylor expanded in angle around inf 94.2%
associate-*r*94.2%
*-commutative94.2%
*-commutative94.2%
*-commutative94.2%
associate-*r*94.1%
+-commutative94.1%
*-commutative94.1%
*-commutative94.1%
associate-*r*94.1%
Simplified94.1%
if 4.99999999999999992e156 < (/.f64 angle 180) < 1.99999999999999988e166Initial program 30.2%
*-commutative30.2%
associate-*l*30.2%
unpow230.2%
fma-neg30.2%
unpow230.2%
Simplified30.2%
Applied egg-rr25.9%
expm1-def30.2%
expm1-log1p80.2%
associate-*r*80.2%
*-commutative80.2%
sin-080.2%
+-lft-identity80.2%
*-commutative80.2%
Simplified80.2%
if 1.99999999999999988e166 < (/.f64 angle 180) Initial program 31.7%
associate-*l*31.7%
unpow231.7%
unpow231.7%
difference-of-squares31.7%
Simplified31.7%
Taylor expanded in angle around inf 32.7%
Taylor expanded in angle around 0 52.8%
Final simplification74.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556)))
(t_1 (sin t_0))
(t_2 (fabs (* t_1 (* 2.0 (pow (+ b a) 2.0))))))
(if (<= (/ angle 180.0) -10.0)
t_2
(if (<= (/ angle 180.0) 5.0)
(*
2.0
(*
(- b a)
(* (cos (* 0.005555555555555556 (* angle PI))) (* (+ b a) t_0))))
(if (<= (/ angle 180.0) 2e+112)
t_2
(* t_1 (* 2.0 (* (- b a) (+ b a)))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_1 = sin(t_0);
double t_2 = fabs((t_1 * (2.0 * pow((b + a), 2.0))));
double tmp;
if ((angle / 180.0) <= -10.0) {
tmp = t_2;
} else if ((angle / 180.0) <= 5.0) {
tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * ((b + a) * t_0)));
} else if ((angle / 180.0) <= 2e+112) {
tmp = t_2;
} else {
tmp = t_1 * (2.0 * ((b - a) * (b + a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double t_1 = Math.sin(t_0);
double t_2 = Math.abs((t_1 * (2.0 * Math.pow((b + a), 2.0))));
double tmp;
if ((angle / 180.0) <= -10.0) {
tmp = t_2;
} else if ((angle / 180.0) <= 5.0) {
tmp = 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * ((b + a) * t_0)));
} else if ((angle / 180.0) <= 2e+112) {
tmp = t_2;
} else {
tmp = t_1 * (2.0 * ((b - a) * (b + a)));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle * 0.005555555555555556) t_1 = math.sin(t_0) t_2 = math.fabs((t_1 * (2.0 * math.pow((b + a), 2.0)))) tmp = 0 if (angle / 180.0) <= -10.0: tmp = t_2 elif (angle / 180.0) <= 5.0: tmp = 2.0 * ((b - a) * (math.cos((0.005555555555555556 * (angle * math.pi))) * ((b + a) * t_0))) elif (angle / 180.0) <= 2e+112: tmp = t_2 else: tmp = t_1 * (2.0 * ((b - a) * (b + a))) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) t_1 = sin(t_0) t_2 = abs(Float64(t_1 * Float64(2.0 * (Float64(b + a) ^ 2.0)))) tmp = 0.0 if (Float64(angle / 180.0) <= -10.0) tmp = t_2; elseif (Float64(angle / 180.0) <= 5.0) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(Float64(b + a) * t_0)))); elseif (Float64(angle / 180.0) <= 2e+112) tmp = t_2; else tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(b - a) * Float64(b + a)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle * 0.005555555555555556); t_1 = sin(t_0); t_2 = abs((t_1 * (2.0 * ((b + a) ^ 2.0)))); tmp = 0.0; if ((angle / 180.0) <= -10.0) tmp = t_2; elseif ((angle / 180.0) <= 5.0) tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * pi))) * ((b + a) * t_0))); elseif ((angle / 180.0) <= 2e+112) tmp = t_2; else tmp = t_1 * (2.0 * ((b - a) * (b + a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(t$95$1 * N[(2.0 * N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -10.0], t$95$2, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5.0], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+112], t$95$2, N[(t$95$1 * N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \sin t_0\\
t_2 := \left|t_1 \cdot \left(2 \cdot {\left(b + a\right)}^{2}\right)\right|\\
\mathbf{if}\;\frac{angle}{180} \leq -10:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\frac{angle}{180} \leq 5:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot t_0\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+112}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -10 or 5 < (/.f64 angle 180) < 1.9999999999999999e112Initial program 35.5%
associate-*l*35.5%
unpow235.5%
unpow235.5%
Simplified35.5%
log1p-expm1-u35.5%
div-inv36.9%
metadata-eval36.9%
Applied egg-rr36.9%
Taylor expanded in angle around 0 27.9%
add-sqr-sqrt23.2%
sqrt-unprod43.7%
pow243.7%
Applied egg-rr46.1%
unpow246.1%
rem-sqrt-square47.4%
associate-*r*47.4%
*-commutative47.4%
associate-*r*47.4%
*-commutative47.4%
Simplified47.4%
if -10 < (/.f64 angle 180) < 5Initial program 78.2%
associate-*l*78.2%
unpow278.2%
unpow278.2%
difference-of-squares82.2%
Simplified82.2%
Taylor expanded in angle around inf 99.5%
Taylor expanded in angle around 0 99.5%
associate-*r*99.5%
*-commutative99.5%
*-commutative99.5%
Simplified99.5%
if 1.9999999999999999e112 < (/.f64 angle 180) Initial program 31.2%
associate-*l*31.2%
unpow231.2%
unpow231.2%
Simplified31.2%
log1p-expm1-u31.2%
div-inv34.9%
metadata-eval34.9%
Applied egg-rr34.9%
Taylor expanded in angle around 0 45.9%
Taylor expanded in angle around inf 41.4%
associate-*r*41.4%
*-commutative41.4%
associate-*r*45.9%
*-commutative45.9%
unpow245.9%
unpow245.9%
difference-of-squares45.9%
Simplified45.9%
Final simplification73.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* (sin t_0) (+ b a))))
(if (<= b 2.1e+76)
(* 2.0 (* (- b a) (* t_1 (cos t_0))))
(* 2.0 (* (- b a) t_1)))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0) * (b + a);
double tmp;
if (b <= 2.1e+76) {
tmp = 2.0 * ((b - a) * (t_1 * cos(t_0)));
} else {
tmp = 2.0 * ((b - a) * t_1);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.sin(t_0) * (b + a);
double tmp;
if (b <= 2.1e+76) {
tmp = 2.0 * ((b - a) * (t_1 * Math.cos(t_0)));
} else {
tmp = 2.0 * ((b - a) * t_1);
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.sin(t_0) * (b + a) tmp = 0 if b <= 2.1e+76: tmp = 2.0 * ((b - a) * (t_1 * math.cos(t_0))) else: tmp = 2.0 * ((b - a) * t_1) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(sin(t_0) * Float64(b + a)) tmp = 0.0 if (b <= 2.1e+76) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(t_1 * cos(t_0)))); else tmp = Float64(2.0 * Float64(Float64(b - a) * t_1)); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); t_1 = sin(t_0) * (b + a); tmp = 0.0; if (b <= 2.1e+76) tmp = 2.0 * ((b - a) * (t_1 * cos(t_0))); else tmp = 2.0 * ((b - a) * t_1); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 2.1e+76], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t_0 \cdot \left(b + a\right)\\
\mathbf{if}\;b \leq 2.1 \cdot 10^{+76}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \cos t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot t_1\right)\\
\end{array}
\end{array}
if b < 2.10000000000000007e76Initial program 58.6%
associate-*l*58.6%
unpow258.6%
unpow258.6%
difference-of-squares60.6%
Simplified60.6%
Taylor expanded in angle around inf 70.0%
if 2.10000000000000007e76 < b Initial program 43.8%
associate-*l*43.8%
unpow243.8%
unpow243.8%
difference-of-squares50.6%
Simplified50.6%
Taylor expanded in angle around inf 63.1%
Taylor expanded in angle around 0 73.9%
Final simplification70.7%
(FPCore (a b angle)
:precision binary64
(*
2.0
(*
(- b a)
(*
(* (sin (* 0.005555555555555556 (* angle PI))) (+ b a))
(cos (/ 1.0 (/ (/ 180.0 angle) PI)))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (b + a)) * cos((1.0 / ((180.0 / angle) / ((double) M_PI))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((Math.sin((0.005555555555555556 * (angle * Math.PI))) * (b + a)) * Math.cos((1.0 / ((180.0 / angle) / Math.PI)))));
}
def code(a, b, angle): return 2.0 * ((b - a) * ((math.sin((0.005555555555555556 * (angle * math.pi))) * (b + a)) * math.cos((1.0 / ((180.0 / angle) / math.pi)))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(b + a)) * cos(Float64(1.0 / Float64(Float64(180.0 / angle) / pi)))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * pi))) * (b + a)) * cos((1.0 / ((180.0 / angle) / pi))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(N[(180.0 / angle), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + a\right)\right) \cdot \cos \left(\frac{1}{\frac{\frac{180}{angle}}{\pi}}\right)\right)\right)
\end{array}
Initial program 56.1%
associate-*l*56.1%
unpow256.1%
unpow256.1%
difference-of-squares58.9%
Simplified58.9%
Taylor expanded in angle around inf 68.8%
associate-*r*70.2%
*-commutative70.2%
metadata-eval70.2%
div-inv71.1%
*-commutative71.1%
clear-num70.7%
div-inv69.0%
clear-num70.1%
Applied egg-rr70.1%
Final simplification70.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b -1.6e+165)
(*
2.0
(*
(- b a)
(* (cos t_0) (* (+ b a) (* PI (* angle 0.005555555555555556))))))
(* 2.0 (* (- b a) (* (sin t_0) (+ b a)))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b <= -1.6e+165) {
tmp = 2.0 * ((b - a) * (cos(t_0) * ((b + a) * (((double) M_PI) * (angle * 0.005555555555555556)))));
} else {
tmp = 2.0 * ((b - a) * (sin(t_0) * (b + a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b <= -1.6e+165) {
tmp = 2.0 * ((b - a) * (Math.cos(t_0) * ((b + a) * (Math.PI * (angle * 0.005555555555555556)))));
} else {
tmp = 2.0 * ((b - a) * (Math.sin(t_0) * (b + a)));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if b <= -1.6e+165: tmp = 2.0 * ((b - a) * (math.cos(t_0) * ((b + a) * (math.pi * (angle * 0.005555555555555556))))) else: tmp = 2.0 * ((b - a) * (math.sin(t_0) * (b + a))) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b <= -1.6e+165) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(Float64(b + a) * Float64(pi * Float64(angle * 0.005555555555555556)))))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(sin(t_0) * Float64(b + a)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (b <= -1.6e+165) tmp = 2.0 * ((b - a) * (cos(t_0) * ((b + a) * (pi * (angle * 0.005555555555555556))))); else tmp = 2.0 * ((b - a) * (sin(t_0) * (b + a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.6e+165], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;b \leq -1.6 \cdot 10^{+165}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\left(b + a\right) \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\sin t_0 \cdot \left(b + a\right)\right)\right)\\
\end{array}
\end{array}
if b < -1.6e165Initial program 45.4%
associate-*l*45.4%
unpow245.4%
unpow245.4%
difference-of-squares57.7%
Simplified57.7%
Taylor expanded in angle around inf 78.9%
Taylor expanded in angle around 0 81.8%
associate-*r*81.9%
*-commutative81.9%
*-commutative81.9%
Simplified81.9%
if -1.6e165 < b Initial program 57.7%
associate-*l*57.7%
unpow257.7%
unpow257.7%
difference-of-squares59.1%
Simplified59.1%
Taylor expanded in angle around inf 67.3%
Taylor expanded in angle around 0 67.2%
Final simplification69.1%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) -5e+168)
(fabs (* (* angle PI) (* (* b b) 0.011111111111111112)))
(if (<= (/ angle 180.0) 1e+25)
(* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a))))
(*
(sin (* PI (* angle 0.005555555555555556)))
(* 2.0 (* (- b a) (+ b a)))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+168) {
tmp = fabs(((angle * ((double) M_PI)) * ((b * b) * 0.011111111111111112)));
} else if ((angle / 180.0) <= 1e+25) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = sin((((double) M_PI) * (angle * 0.005555555555555556))) * (2.0 * ((b - a) * (b + a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+168) {
tmp = Math.abs(((angle * Math.PI) * ((b * b) * 0.011111111111111112)));
} else if ((angle / 180.0) <= 1e+25) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = Math.sin((Math.PI * (angle * 0.005555555555555556))) * (2.0 * ((b - a) * (b + a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -5e+168: tmp = math.fabs(((angle * math.pi) * ((b * b) * 0.011111111111111112))) elif (angle / 180.0) <= 1e+25: tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) else: tmp = math.sin((math.pi * (angle * 0.005555555555555556))) * (2.0 * ((b - a) * (b + a))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+168) tmp = abs(Float64(Float64(angle * pi) * Float64(Float64(b * b) * 0.011111111111111112))); elseif (Float64(angle / 180.0) <= 1e+25) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * Float64(2.0 * Float64(Float64(b - a) * Float64(b + a)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= -5e+168) tmp = abs(((angle * pi) * ((b * b) * 0.011111111111111112))); elseif ((angle / 180.0) <= 1e+25) tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); else tmp = sin((pi * (angle * 0.005555555555555556))) * (2.0 * ((b - a) * (b + a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+168], N[Abs[N[(N[(angle * Pi), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+25], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+168}:\\
\;\;\;\;\left|\left(angle \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right|\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+25}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.99999999999999967e168Initial program 37.3%
associate-*l*37.3%
unpow237.3%
unpow237.3%
difference-of-squares40.9%
Simplified40.9%
Taylor expanded in angle around 0 33.4%
Taylor expanded in b around inf 26.2%
*-commutative26.2%
unpow226.2%
Simplified26.2%
add-sqr-sqrt14.7%
sqrt-unprod44.4%
pow244.4%
associate-*r*44.4%
add-cube-cbrt44.4%
unpow244.4%
associate-*r*44.4%
unpow244.4%
add-cube-cbrt44.4%
Applied egg-rr44.4%
unpow244.4%
rem-sqrt-square44.4%
associate-*l*44.4%
associate-*r*44.4%
*-commutative44.4%
associate-*r*44.4%
associate-*l*44.4%
Simplified44.4%
if -4.99999999999999967e168 < (/.f64 angle 180) < 1.00000000000000009e25Initial program 67.6%
associate-*l*67.6%
unpow267.6%
unpow267.6%
difference-of-squares71.3%
Simplified71.3%
Taylor expanded in angle around 0 69.2%
associate-*r*82.1%
*-commutative82.1%
+-commutative82.1%
Simplified82.1%
if 1.00000000000000009e25 < (/.f64 angle 180) Initial program 33.2%
associate-*l*33.2%
unpow233.2%
unpow233.2%
Simplified33.2%
log1p-expm1-u33.2%
div-inv35.9%
metadata-eval35.9%
Applied egg-rr35.9%
Taylor expanded in angle around 0 42.9%
Taylor expanded in angle around inf 39.6%
associate-*r*39.6%
*-commutative39.6%
associate-*r*42.9%
*-commutative42.9%
unpow242.9%
unpow242.9%
difference-of-squares42.9%
Simplified42.9%
Final simplification68.6%
(FPCore (a b angle) :precision binary64 (if (or (<= a -3e-61) (not (<= a 8.6e-149))) (* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a)))) (* (sin (* 0.005555555555555556 (* angle PI))) (* 2.0 (* b b)))))
double code(double a, double b, double angle) {
double tmp;
if ((a <= -3e-61) || !(a <= 8.6e-149)) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (2.0 * (b * b));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((a <= -3e-61) || !(a <= 8.6e-149)) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = Math.sin((0.005555555555555556 * (angle * Math.PI))) * (2.0 * (b * b));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (a <= -3e-61) or not (a <= 8.6e-149): tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) else: tmp = math.sin((0.005555555555555556 * (angle * math.pi))) * (2.0 * (b * b)) return tmp
function code(a, b, angle) tmp = 0.0 if ((a <= -3e-61) || !(a <= 8.6e-149)) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(2.0 * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a <= -3e-61) || ~((a <= 8.6e-149))) tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); else tmp = sin((0.005555555555555556 * (angle * pi))) * (2.0 * (b * b)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[a, -3e-61], N[Not[LessEqual[a, 8.6e-149]], $MachinePrecision]], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{-61} \lor \neg \left(a \leq 8.6 \cdot 10^{-149}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if a < -3.00000000000000012e-61 or 8.60000000000000073e-149 < a Initial program 48.2%
associate-*l*48.2%
unpow248.2%
unpow248.2%
difference-of-squares52.5%
Simplified52.5%
Taylor expanded in angle around 0 52.9%
associate-*r*65.0%
*-commutative65.0%
+-commutative65.0%
Simplified65.0%
if -3.00000000000000012e-61 < a < 8.60000000000000073e-149Initial program 71.6%
associate-*l*71.6%
unpow271.6%
unpow271.6%
Simplified71.6%
log1p-expm1-u71.6%
div-inv73.1%
metadata-eval73.1%
Applied egg-rr73.1%
Taylor expanded in angle around 0 72.9%
rem-cube-cbrt70.1%
*-commutative70.1%
*-commutative70.1%
associate-*r*71.0%
Applied egg-rr71.0%
Taylor expanded in b around inf 71.4%
*-commutative71.4%
pow-base-171.4%
*-lft-identity71.4%
associate-*l*71.4%
*-commutative71.4%
unpow271.4%
Simplified71.4%
Final simplification67.1%
(FPCore (a b angle) :precision binary64 (if (or (<= a -2e-61) (not (<= a 2.6e-138))) (* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a)))) (* (sin (* PI (* angle 0.005555555555555556))) (* 2.0 (* b b)))))
double code(double a, double b, double angle) {
double tmp;
if ((a <= -2e-61) || !(a <= 2.6e-138)) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = sin((((double) M_PI) * (angle * 0.005555555555555556))) * (2.0 * (b * b));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((a <= -2e-61) || !(a <= 2.6e-138)) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = Math.sin((Math.PI * (angle * 0.005555555555555556))) * (2.0 * (b * b));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (a <= -2e-61) or not (a <= 2.6e-138): tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) else: tmp = math.sin((math.pi * (angle * 0.005555555555555556))) * (2.0 * (b * b)) return tmp
function code(a, b, angle) tmp = 0.0 if ((a <= -2e-61) || !(a <= 2.6e-138)) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * Float64(2.0 * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a <= -2e-61) || ~((a <= 2.6e-138))) tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); else tmp = sin((pi * (angle * 0.005555555555555556))) * (2.0 * (b * b)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[a, -2e-61], N[Not[LessEqual[a, 2.6e-138]], $MachinePrecision]], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{-61} \lor \neg \left(a \leq 2.6 \cdot 10^{-138}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(2 \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if a < -2.0000000000000001e-61 or 2.6e-138 < a Initial program 47.9%
associate-*l*47.9%
unpow247.9%
unpow247.9%
difference-of-squares52.2%
Simplified52.2%
Taylor expanded in angle around 0 52.7%
associate-*r*64.9%
*-commutative64.9%
+-commutative64.9%
Simplified64.9%
if -2.0000000000000001e-61 < a < 2.6e-138Initial program 71.5%
associate-*l*71.5%
unpow271.5%
unpow271.5%
Simplified71.5%
log1p-expm1-u71.5%
div-inv72.9%
metadata-eval72.9%
Applied egg-rr72.9%
Taylor expanded in angle around 0 72.7%
Taylor expanded in b around inf 71.2%
unpow271.2%
associate-*r*71.2%
associate-*r*71.4%
Simplified71.4%
Final simplification67.2%
(FPCore (a b angle) :precision binary64 (* 2.0 (* (- b a) (* (sin (* 0.005555555555555556 (* angle PI))) (+ b a)))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (b + a)));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (Math.sin((0.005555555555555556 * (angle * Math.PI))) * (b + a)));
}
def code(a, b, angle): return 2.0 * ((b - a) * (math.sin((0.005555555555555556 * (angle * math.pi))) * (b + a)))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(b + a)))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * (sin((0.005555555555555556 * (angle * pi))) * (b + a))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + a\right)\right)\right)
\end{array}
Initial program 56.1%
associate-*l*56.1%
unpow256.1%
unpow256.1%
difference-of-squares58.9%
Simplified58.9%
Taylor expanded in angle around inf 68.8%
Taylor expanded in angle around 0 67.6%
Final simplification67.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.011111111111111112 (* angle (* (- b a) (* a PI)))))
(t_1 (* 0.011111111111111112 (* PI (* b (* angle b))))))
(if (<= b -9.4e-86)
t_1
(if (<= b 2.1e-19)
t_0
(if (<= b 3.8e+143)
(* 0.011111111111111112 (* (* angle PI) (* b b)))
(if (<= b 6.2e+189) t_0 t_1))))))
double code(double a, double b, double angle) {
double t_0 = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
double t_1 = 0.011111111111111112 * (((double) M_PI) * (b * (angle * b)));
double tmp;
if (b <= -9.4e-86) {
tmp = t_1;
} else if (b <= 2.1e-19) {
tmp = t_0;
} else if (b <= 3.8e+143) {
tmp = 0.011111111111111112 * ((angle * ((double) M_PI)) * (b * b));
} else if (b <= 6.2e+189) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
double t_1 = 0.011111111111111112 * (Math.PI * (b * (angle * b)));
double tmp;
if (b <= -9.4e-86) {
tmp = t_1;
} else if (b <= 2.1e-19) {
tmp = t_0;
} else if (b <= 3.8e+143) {
tmp = 0.011111111111111112 * ((angle * Math.PI) * (b * b));
} else if (b <= 6.2e+189) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(a, b, angle): t_0 = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) t_1 = 0.011111111111111112 * (math.pi * (b * (angle * b))) tmp = 0 if b <= -9.4e-86: tmp = t_1 elif b <= 2.1e-19: tmp = t_0 elif b <= 3.8e+143: tmp = 0.011111111111111112 * ((angle * math.pi) * (b * b)) elif b <= 6.2e+189: tmp = t_0 else: tmp = t_1 return tmp
function code(a, b, angle) t_0 = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))) t_1 = Float64(0.011111111111111112 * Float64(pi * Float64(b * Float64(angle * b)))) tmp = 0.0 if (b <= -9.4e-86) tmp = t_1; elseif (b <= 2.1e-19) tmp = t_0; elseif (b <= 3.8e+143) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * pi) * Float64(b * b))); elseif (b <= 6.2e+189) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); t_1 = 0.011111111111111112 * (pi * (b * (angle * b))); tmp = 0.0; if (b <= -9.4e-86) tmp = t_1; elseif (b <= 2.1e-19) tmp = t_0; elseif (b <= 3.8e+143) tmp = 0.011111111111111112 * ((angle * pi) * (b * b)); elseif (b <= 6.2e+189) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.011111111111111112 * N[(Pi * N[(b * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9.4e-86], t$95$1, If[LessEqual[b, 2.1e-19], t$95$0, If[LessEqual[b, 3.8e+143], N[(0.011111111111111112 * N[(N[(angle * Pi), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.2e+189], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
t_1 := 0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(angle \cdot b\right)\right)\right)\\
\mathbf{if}\;b \leq -9.4 \cdot 10^{-86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-19}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+143}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot b\right)\right)\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{+189}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -9.4000000000000002e-86 or 6.1999999999999999e189 < b Initial program 49.2%
associate-*l*49.2%
unpow249.2%
unpow249.2%
difference-of-squares53.8%
Simplified53.8%
Taylor expanded in angle around 0 52.3%
Taylor expanded in b around inf 46.1%
*-commutative46.1%
associate-*r*46.2%
*-commutative46.2%
unpow246.2%
associate-*r*57.0%
Simplified57.0%
if -9.4000000000000002e-86 < b < 2.0999999999999999e-19 or 3.8e143 < b < 6.1999999999999999e189Initial program 63.7%
associate-*l*63.7%
unpow263.7%
unpow263.7%
difference-of-squares65.4%
Simplified65.4%
Taylor expanded in angle around 0 62.6%
Taylor expanded in a around inf 61.9%
*-commutative61.9%
Simplified61.9%
if 2.0999999999999999e-19 < b < 3.8e143Initial program 51.3%
associate-*l*51.3%
unpow251.3%
unpow251.3%
difference-of-squares51.3%
Simplified51.3%
Taylor expanded in angle around 0 51.7%
Taylor expanded in b around inf 48.1%
*-commutative48.1%
unpow248.1%
Simplified48.1%
Taylor expanded in angle around 0 48.1%
unpow248.1%
*-commutative48.1%
associate-*r*48.2%
Simplified48.2%
Final simplification58.4%
(FPCore (a b angle)
:precision binary64
(if (<= b -2.1e+139)
(* 0.011111111111111112 (* PI (* b (* angle b))))
(if (<= b -9e-80)
(* 0.011111111111111112 (* angle (* (- b a) (* b PI))))
(if (<= b 1.25e-19)
(* 0.011111111111111112 (* angle (* (- b a) (* a PI))))
(* 0.011111111111111112 (* (* angle b) (* b PI)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= -2.1e+139) {
tmp = 0.011111111111111112 * (((double) M_PI) * (b * (angle * b)));
} else if (b <= -9e-80) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * ((double) M_PI))));
} else if (b <= 1.25e-19) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * ((angle * b) * (b * ((double) M_PI)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= -2.1e+139) {
tmp = 0.011111111111111112 * (Math.PI * (b * (angle * b)));
} else if (b <= -9e-80) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * Math.PI)));
} else if (b <= 1.25e-19) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
} else {
tmp = 0.011111111111111112 * ((angle * b) * (b * Math.PI));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= -2.1e+139: tmp = 0.011111111111111112 * (math.pi * (b * (angle * b))) elif b <= -9e-80: tmp = 0.011111111111111112 * (angle * ((b - a) * (b * math.pi))) elif b <= 1.25e-19: tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) else: tmp = 0.011111111111111112 * ((angle * b) * (b * math.pi)) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= -2.1e+139) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(b * Float64(angle * b)))); elseif (b <= -9e-80) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(b * pi)))); elseif (b <= 1.25e-19) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle * b) * Float64(b * pi))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= -2.1e+139) tmp = 0.011111111111111112 * (pi * (b * (angle * b))); elseif (b <= -9e-80) tmp = 0.011111111111111112 * (angle * ((b - a) * (b * pi))); elseif (b <= 1.25e-19) tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); else tmp = 0.011111111111111112 * ((angle * b) * (b * pi)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, -2.1e+139], N[(0.011111111111111112 * N[(Pi * N[(b * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -9e-80], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.25e-19], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle * b), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.1 \cdot 10^{+139}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(angle \cdot b\right)\right)\right)\\
\mathbf{elif}\;b \leq -9 \cdot 10^{-80}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{-19}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \left(b \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < -2.0999999999999999e139Initial program 42.1%
associate-*l*42.1%
unpow242.1%
unpow242.1%
difference-of-squares52.1%
Simplified52.1%
Taylor expanded in angle around 0 44.5%
Taylor expanded in b around inf 44.1%
*-commutative44.1%
associate-*r*44.2%
*-commutative44.2%
unpow244.2%
associate-*r*61.9%
Simplified61.9%
if -2.0999999999999999e139 < b < -9.0000000000000006e-80Initial program 54.6%
associate-*l*54.6%
unpow254.6%
unpow254.6%
difference-of-squares54.6%
Simplified54.6%
Taylor expanded in angle around 0 57.8%
Taylor expanded in a around 0 53.3%
*-commutative53.3%
Simplified53.3%
if -9.0000000000000006e-80 < b < 1.2500000000000001e-19Initial program 66.2%
associate-*l*66.2%
unpow266.2%
unpow266.2%
difference-of-squares66.2%
Simplified66.2%
Taylor expanded in angle around 0 62.3%
Taylor expanded in a around inf 60.7%
*-commutative60.7%
Simplified60.7%
if 1.2500000000000001e-19 < b Initial program 47.6%
associate-*l*47.6%
unpow247.6%
unpow247.6%
difference-of-squares53.0%
Simplified53.0%
Taylor expanded in angle around 0 54.9%
Taylor expanded in b around inf 47.9%
*-commutative47.9%
unpow247.9%
Simplified47.9%
Taylor expanded in angle around 0 47.9%
*-commutative47.9%
unpow247.9%
*-commutative47.9%
associate-*r*47.9%
associate-*l*58.0%
Simplified58.0%
Final simplification59.0%
(FPCore (a b angle) :precision binary64 (if (or (<= b -7e+203) (not (<= b 7e+189))) (* 0.011111111111111112 (* PI (* b (* angle b)))) (* 0.011111111111111112 (* angle (* (- b a) (* PI (+ b a)))))))
double code(double a, double b, double angle) {
double tmp;
if ((b <= -7e+203) || !(b <= 7e+189)) {
tmp = 0.011111111111111112 * (((double) M_PI) * (b * (angle * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (b + a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((b <= -7e+203) || !(b <= 7e+189)) {
tmp = 0.011111111111111112 * (Math.PI * (b * (angle * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (b + a))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (b <= -7e+203) or not (b <= 7e+189): tmp = 0.011111111111111112 * (math.pi * (b * (angle * b))) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (math.pi * (b + a)))) return tmp
function code(a, b, angle) tmp = 0.0 if ((b <= -7e+203) || !(b <= 7e+189)) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(b * Float64(angle * b)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(b + a))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b <= -7e+203) || ~((b <= 7e+189))) tmp = 0.011111111111111112 * (pi * (b * (angle * b))); else tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (b + a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[b, -7e+203], N[Not[LessEqual[b, 7e+189]], $MachinePrecision]], N[(0.011111111111111112 * N[(Pi * N[(b * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{+203} \lor \neg \left(b \leq 7 \cdot 10^{+189}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(angle \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < -7.00000000000000062e203 or 6.99999999999999991e189 < b Initial program 44.3%
associate-*l*44.3%
unpow244.3%
unpow244.3%
difference-of-squares52.7%
Simplified52.7%
Taylor expanded in angle around 0 50.7%
Taylor expanded in b around inf 54.6%
*-commutative54.6%
associate-*r*54.6%
*-commutative54.6%
unpow254.6%
associate-*r*77.4%
Simplified77.4%
if -7.00000000000000062e203 < b < 6.99999999999999991e189Initial program 58.9%
associate-*l*58.9%
unpow258.9%
unpow258.9%
difference-of-squares60.4%
Simplified60.4%
Taylor expanded in angle around 0 58.4%
Final simplification62.1%
(FPCore (a b angle) :precision binary64 (if (or (<= a -5.1e-182) (not (<= a 3.2e-172))) (* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a)))) (* 0.011111111111111112 (* (* angle PI) (* b b)))))
double code(double a, double b, double angle) {
double tmp;
if ((a <= -5.1e-182) || !(a <= 3.2e-172)) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = 0.011111111111111112 * ((angle * ((double) M_PI)) * (b * b));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((a <= -5.1e-182) || !(a <= 3.2e-172)) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = 0.011111111111111112 * ((angle * Math.PI) * (b * b));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (a <= -5.1e-182) or not (a <= 3.2e-172): tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) else: tmp = 0.011111111111111112 * ((angle * math.pi) * (b * b)) return tmp
function code(a, b, angle) tmp = 0.0 if ((a <= -5.1e-182) || !(a <= 3.2e-172)) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle * pi) * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a <= -5.1e-182) || ~((a <= 3.2e-172))) tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); else tmp = 0.011111111111111112 * ((angle * pi) * (b * b)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[a, -5.1e-182], N[Not[LessEqual[a, 3.2e-172]], $MachinePrecision]], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle * Pi), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.1 \cdot 10^{-182} \lor \neg \left(a \leq 3.2 \cdot 10^{-172}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if a < -5.10000000000000017e-182 or 3.2000000000000001e-172 < a Initial program 49.2%
associate-*l*49.2%
unpow249.2%
unpow249.2%
difference-of-squares52.7%
Simplified52.7%
Taylor expanded in angle around 0 51.0%
associate-*r*61.3%
*-commutative61.3%
+-commutative61.3%
Simplified61.3%
if -5.10000000000000017e-182 < a < 3.2000000000000001e-172Initial program 85.0%
associate-*l*85.0%
unpow285.0%
unpow285.0%
difference-of-squares85.0%
Simplified85.0%
Taylor expanded in angle around 0 82.0%
Taylor expanded in b around inf 82.0%
*-commutative82.0%
unpow282.0%
Simplified82.0%
Taylor expanded in angle around 0 82.0%
unpow282.0%
*-commutative82.0%
associate-*r*82.0%
Simplified82.0%
Final simplification65.3%
(FPCore (a b angle) :precision binary64 (if (or (<= b -9e-80) (not (<= b 1.95e-19))) (* 0.011111111111111112 (* (* angle b) (* b PI))) (* angle (* -0.011111111111111112 (* PI (* a a))))))
double code(double a, double b, double angle) {
double tmp;
if ((b <= -9e-80) || !(b <= 1.95e-19)) {
tmp = 0.011111111111111112 * ((angle * b) * (b * ((double) M_PI)));
} else {
tmp = angle * (-0.011111111111111112 * (((double) M_PI) * (a * a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((b <= -9e-80) || !(b <= 1.95e-19)) {
tmp = 0.011111111111111112 * ((angle * b) * (b * Math.PI));
} else {
tmp = angle * (-0.011111111111111112 * (Math.PI * (a * a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (b <= -9e-80) or not (b <= 1.95e-19): tmp = 0.011111111111111112 * ((angle * b) * (b * math.pi)) else: tmp = angle * (-0.011111111111111112 * (math.pi * (a * a))) return tmp
function code(a, b, angle) tmp = 0.0 if ((b <= -9e-80) || !(b <= 1.95e-19)) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * b) * Float64(b * pi))); else tmp = Float64(angle * Float64(-0.011111111111111112 * Float64(pi * Float64(a * a)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b <= -9e-80) || ~((b <= 1.95e-19))) tmp = 0.011111111111111112 * ((angle * b) * (b * pi)); else tmp = angle * (-0.011111111111111112 * (pi * (a * a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[b, -9e-80], N[Not[LessEqual[b, 1.95e-19]], $MachinePrecision]], N[(0.011111111111111112 * N[(N[(angle * b), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(angle * N[(-0.011111111111111112 * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{-80} \lor \neg \left(b \leq 1.95 \cdot 10^{-19}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \left(b \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if b < -9.0000000000000006e-80 or 1.94999999999999998e-19 < b Initial program 48.2%
associate-*l*48.2%
unpow248.2%
unpow248.2%
difference-of-squares53.2%
Simplified53.2%
Taylor expanded in angle around 0 52.8%
Taylor expanded in b around inf 44.6%
*-commutative44.6%
unpow244.6%
Simplified44.6%
Taylor expanded in angle around 0 44.6%
*-commutative44.6%
unpow244.6%
*-commutative44.6%
associate-*r*44.6%
associate-*l*53.6%
Simplified53.6%
if -9.0000000000000006e-80 < b < 1.94999999999999998e-19Initial program 66.2%
associate-*l*66.2%
unpow266.2%
unpow266.2%
difference-of-squares66.2%
Simplified66.2%
Taylor expanded in angle around 0 62.3%
Taylor expanded in b around 0 60.7%
*-commutative60.7%
associate-*l*60.7%
*-commutative60.7%
unpow260.7%
Simplified60.7%
Final simplification56.7%
(FPCore (a b angle) :precision binary64 (if (or (<= b -6e-80) (not (<= b 1.62e-19))) (* 0.011111111111111112 (* (* angle b) (* b PI))) (* (* angle -0.011111111111111112) (* PI (* a a)))))
double code(double a, double b, double angle) {
double tmp;
if ((b <= -6e-80) || !(b <= 1.62e-19)) {
tmp = 0.011111111111111112 * ((angle * b) * (b * ((double) M_PI)));
} else {
tmp = (angle * -0.011111111111111112) * (((double) M_PI) * (a * a));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((b <= -6e-80) || !(b <= 1.62e-19)) {
tmp = 0.011111111111111112 * ((angle * b) * (b * Math.PI));
} else {
tmp = (angle * -0.011111111111111112) * (Math.PI * (a * a));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (b <= -6e-80) or not (b <= 1.62e-19): tmp = 0.011111111111111112 * ((angle * b) * (b * math.pi)) else: tmp = (angle * -0.011111111111111112) * (math.pi * (a * a)) return tmp
function code(a, b, angle) tmp = 0.0 if ((b <= -6e-80) || !(b <= 1.62e-19)) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * b) * Float64(b * pi))); else tmp = Float64(Float64(angle * -0.011111111111111112) * Float64(pi * Float64(a * a))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b <= -6e-80) || ~((b <= 1.62e-19))) tmp = 0.011111111111111112 * ((angle * b) * (b * pi)); else tmp = (angle * -0.011111111111111112) * (pi * (a * a)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[b, -6e-80], N[Not[LessEqual[b, 1.62e-19]], $MachinePrecision]], N[(0.011111111111111112 * N[(N[(angle * b), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * -0.011111111111111112), $MachinePrecision] * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{-80} \lor \neg \left(b \leq 1.62 \cdot 10^{-19}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \left(b \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot -0.011111111111111112\right) \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\\
\end{array}
\end{array}
if b < -6.00000000000000014e-80 or 1.62000000000000009e-19 < b Initial program 48.2%
associate-*l*48.2%
unpow248.2%
unpow248.2%
difference-of-squares53.2%
Simplified53.2%
Taylor expanded in angle around 0 52.8%
Taylor expanded in b around inf 44.6%
*-commutative44.6%
unpow244.6%
Simplified44.6%
Taylor expanded in angle around 0 44.6%
*-commutative44.6%
unpow244.6%
*-commutative44.6%
associate-*r*44.6%
associate-*l*53.6%
Simplified53.6%
if -6.00000000000000014e-80 < b < 1.62000000000000009e-19Initial program 66.2%
associate-*l*66.2%
unpow266.2%
unpow266.2%
difference-of-squares66.2%
Simplified66.2%
Taylor expanded in angle around 0 62.3%
Taylor expanded in b around 0 60.7%
associate-*r*60.7%
*-commutative60.7%
unpow260.7%
Simplified60.7%
Final simplification56.7%
(FPCore (a b angle)
:precision binary64
(if (<= b -9e-80)
(* 0.011111111111111112 (* PI (* b (* angle b))))
(if (<= b 2.1e-19)
(* (* angle -0.011111111111111112) (* PI (* a a)))
(* 0.011111111111111112 (* (* angle b) (* b PI))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= -9e-80) {
tmp = 0.011111111111111112 * (((double) M_PI) * (b * (angle * b)));
} else if (b <= 2.1e-19) {
tmp = (angle * -0.011111111111111112) * (((double) M_PI) * (a * a));
} else {
tmp = 0.011111111111111112 * ((angle * b) * (b * ((double) M_PI)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= -9e-80) {
tmp = 0.011111111111111112 * (Math.PI * (b * (angle * b)));
} else if (b <= 2.1e-19) {
tmp = (angle * -0.011111111111111112) * (Math.PI * (a * a));
} else {
tmp = 0.011111111111111112 * ((angle * b) * (b * Math.PI));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= -9e-80: tmp = 0.011111111111111112 * (math.pi * (b * (angle * b))) elif b <= 2.1e-19: tmp = (angle * -0.011111111111111112) * (math.pi * (a * a)) else: tmp = 0.011111111111111112 * ((angle * b) * (b * math.pi)) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= -9e-80) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(b * Float64(angle * b)))); elseif (b <= 2.1e-19) tmp = Float64(Float64(angle * -0.011111111111111112) * Float64(pi * Float64(a * a))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle * b) * Float64(b * pi))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= -9e-80) tmp = 0.011111111111111112 * (pi * (b * (angle * b))); elseif (b <= 2.1e-19) tmp = (angle * -0.011111111111111112) * (pi * (a * a)); else tmp = 0.011111111111111112 * ((angle * b) * (b * pi)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, -9e-80], N[(0.011111111111111112 * N[(Pi * N[(b * N[(angle * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e-19], N[(N[(angle * -0.011111111111111112), $MachinePrecision] * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle * b), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{-80}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(angle \cdot b\right)\right)\right)\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-19}:\\
\;\;\;\;\left(angle \cdot -0.011111111111111112\right) \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \left(b \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < -9.0000000000000006e-80Initial program 48.6%
associate-*l*48.6%
unpow248.6%
unpow248.6%
difference-of-squares53.4%
Simplified53.4%
Taylor expanded in angle around 0 51.4%
Taylor expanded in b around inf 42.5%
*-commutative42.5%
associate-*r*42.5%
*-commutative42.5%
unpow242.5%
associate-*r*50.9%
Simplified50.9%
if -9.0000000000000006e-80 < b < 2.0999999999999999e-19Initial program 66.2%
associate-*l*66.2%
unpow266.2%
unpow266.2%
difference-of-squares66.2%
Simplified66.2%
Taylor expanded in angle around 0 62.3%
Taylor expanded in b around 0 60.7%
associate-*r*60.7%
*-commutative60.7%
unpow260.7%
Simplified60.7%
if 2.0999999999999999e-19 < b Initial program 47.6%
associate-*l*47.6%
unpow247.6%
unpow247.6%
difference-of-squares53.0%
Simplified53.0%
Taylor expanded in angle around 0 54.9%
Taylor expanded in b around inf 47.9%
*-commutative47.9%
unpow247.9%
Simplified47.9%
Taylor expanded in angle around 0 47.9%
*-commutative47.9%
unpow247.9%
*-commutative47.9%
associate-*r*47.9%
associate-*l*58.0%
Simplified58.0%
Final simplification56.8%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* b b)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * (b * b)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 56.1%
associate-*l*56.1%
unpow256.1%
unpow256.1%
difference-of-squares58.9%
Simplified58.9%
Taylor expanded in angle around 0 56.9%
Taylor expanded in b around inf 39.4%
*-commutative39.4%
unpow239.4%
Simplified39.4%
Final simplification39.4%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* (* angle b) (* b PI))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * ((angle * b) * (b * ((double) M_PI)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * ((angle * b) * (b * Math.PI));
}
def code(a, b, angle): return 0.011111111111111112 * ((angle * b) * (b * math.pi))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(angle * b) * Float64(b * pi))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * ((angle * b) * (b * pi)); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(angle * b), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\left(angle \cdot b\right) \cdot \left(b \cdot \pi\right)\right)
\end{array}
Initial program 56.1%
associate-*l*56.1%
unpow256.1%
unpow256.1%
difference-of-squares58.9%
Simplified58.9%
Taylor expanded in angle around 0 56.9%
Taylor expanded in b around inf 39.4%
*-commutative39.4%
unpow239.4%
Simplified39.4%
Taylor expanded in angle around 0 39.4%
*-commutative39.4%
unpow239.4%
*-commutative39.4%
associate-*r*39.3%
associate-*l*42.6%
Simplified42.6%
Final simplification42.6%
herbie shell --seed 2023194
(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)))))