
(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 17 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 (* (/ angle 180.0) PI))
(t_1 (cbrt (sqrt t_0)))
(t_2 (* (sin (* 0.005555555555555556 (* angle PI))) (+ b a)))
(t_3 (cbrt (cbrt (* PI (* angle 0.005555555555555556))))))
(if (<= (/ angle 180.0) -1e-66)
(* (* 2.0 (* (- b a) (+ b a))) (* (sin t_0) (cos (/ PI (/ 180.0 angle)))))
(if (<= (/ angle 180.0) 4e+121)
(* 2.0 (* t_2 (* (- b a) (cos (expm1 (log1p t_0))))))
(*
2.0
(* t_2 (* (- b a) (cos (* (pow (* t_3 t_3) 3.0) (* t_1 t_1))))))))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = cbrt(sqrt(t_0));
double t_2 = sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (b + a);
double t_3 = cbrt(cbrt((((double) M_PI) * (angle * 0.005555555555555556))));
double tmp;
if ((angle / 180.0) <= -1e-66) {
tmp = (2.0 * ((b - a) * (b + a))) * (sin(t_0) * cos((((double) M_PI) / (180.0 / angle))));
} else if ((angle / 180.0) <= 4e+121) {
tmp = 2.0 * (t_2 * ((b - a) * cos(expm1(log1p(t_0)))));
} else {
tmp = 2.0 * (t_2 * ((b - a) * cos((pow((t_3 * t_3), 3.0) * (t_1 * t_1)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
double t_1 = Math.cbrt(Math.sqrt(t_0));
double t_2 = Math.sin((0.005555555555555556 * (angle * Math.PI))) * (b + a);
double t_3 = Math.cbrt(Math.cbrt((Math.PI * (angle * 0.005555555555555556))));
double tmp;
if ((angle / 180.0) <= -1e-66) {
tmp = (2.0 * ((b - a) * (b + a))) * (Math.sin(t_0) * Math.cos((Math.PI / (180.0 / angle))));
} else if ((angle / 180.0) <= 4e+121) {
tmp = 2.0 * (t_2 * ((b - a) * Math.cos(Math.expm1(Math.log1p(t_0)))));
} else {
tmp = 2.0 * (t_2 * ((b - a) * Math.cos((Math.pow((t_3 * t_3), 3.0) * (t_1 * t_1)))));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = cbrt(sqrt(t_0)) t_2 = Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(b + a)) t_3 = cbrt(cbrt(Float64(pi * Float64(angle * 0.005555555555555556)))) tmp = 0.0 if (Float64(angle / 180.0) <= -1e-66) tmp = Float64(Float64(2.0 * Float64(Float64(b - a) * Float64(b + a))) * Float64(sin(t_0) * cos(Float64(pi / Float64(180.0 / angle))))); elseif (Float64(angle / 180.0) <= 4e+121) tmp = Float64(2.0 * Float64(t_2 * Float64(Float64(b - a) * cos(expm1(log1p(t_0)))))); else tmp = Float64(2.0 * Float64(t_2 * Float64(Float64(b - a) * cos(Float64((Float64(t_3 * t_3) ^ 3.0) * Float64(t_1 * t_1)))))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[t$95$0], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -1e-66], N[(N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e+121], N[(2.0 * N[(t$95$2 * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$2 * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(N[Power[N[(t$95$3 * t$95$3), $MachinePrecision], 3.0], $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \sqrt[3]{\sqrt{t_0}}\\
t_2 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + a\right)\\
t_3 := \sqrt[3]{\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}}\\
\mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{-66}:\\
\;\;\;\;\left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \left(\sin t_0 \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+121}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \left(\left(b - a\right) \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \left(\left(b - a\right) \cdot \cos \left({\left(t_3 \cdot t_3\right)}^{3} \cdot \left(t_1 \cdot t_1\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -9.9999999999999998e-67Initial program 47.0%
associate-*l*47.0%
unpow247.0%
unpow247.0%
difference-of-squares52.5%
Simplified52.5%
clear-num55.2%
un-div-inv56.7%
Applied egg-rr56.7%
if -9.9999999999999998e-67 < (/.f64 angle 180) < 4.00000000000000015e121Initial program 67.1%
associate-*l*67.1%
associate-*l*67.1%
unpow267.1%
unpow267.1%
difference-of-squares71.6%
Simplified71.6%
Taylor expanded in angle around inf 90.1%
associate-*r*90.1%
*-commutative90.1%
*-commutative90.1%
Simplified90.1%
associate-*r*90.0%
*-commutative90.0%
metadata-eval90.0%
div-inv90.5%
*-commutative90.5%
expm1-log1p-u93.4%
Applied egg-rr93.4%
if 4.00000000000000015e121 < (/.f64 angle 180) Initial program 22.2%
associate-*l*22.2%
associate-*l*22.2%
unpow222.2%
unpow222.2%
difference-of-squares22.2%
Simplified22.2%
Taylor expanded in angle around inf 28.5%
associate-*r*28.5%
*-commutative28.5%
*-commutative28.5%
Simplified28.5%
*-commutative28.5%
*-commutative28.5%
associate-*r*24.4%
add-cube-cbrt36.5%
unpow334.9%
associate-*r*34.4%
*-commutative34.4%
*-commutative34.4%
associate-*r*34.9%
*-commutative34.9%
metadata-eval34.9%
div-inv34.0%
*-commutative34.0%
Applied egg-rr34.0%
add-cube-cbrt37.3%
unpow-prod-down31.0%
div-inv30.6%
metadata-eval30.6%
div-inv31.1%
metadata-eval31.1%
Applied egg-rr31.0%
rem-cube-cbrt28.1%
pow1/326.1%
metadata-eval26.1%
div-inv26.1%
add-sqr-sqrt25.7%
unpow-prod-down26.2%
Applied egg-rr26.2%
unpow1/321.9%
unpow1/343.7%
Simplified43.7%
Final simplification75.3%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cbrt (cbrt (* PI (* angle 0.005555555555555556)))))
(t_1 (* (sin (* 0.005555555555555556 (* angle PI))) (+ b a))))
(if (<= (pow a 2.0) 5e+176)
(* 2.0 (* t_1 (* (- b a) (log (exp (cos (* (/ angle 180.0) PI)))))))
(*
2.0
(*
t_1
(*
(- b a)
(cos
(*
(pow t_0 3.0)
(pow
(*
t_0
(cbrt
(cbrt (* (* angle 0.005555555555555556) (cbrt (pow PI 3.0))))))
3.0)))))))))
double code(double a, double b, double angle) {
double t_0 = cbrt(cbrt((((double) M_PI) * (angle * 0.005555555555555556))));
double t_1 = sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (b + a);
double tmp;
if (pow(a, 2.0) <= 5e+176) {
tmp = 2.0 * (t_1 * ((b - a) * log(exp(cos(((angle / 180.0) * ((double) M_PI)))))));
} else {
tmp = 2.0 * (t_1 * ((b - a) * cos((pow(t_0, 3.0) * pow((t_0 * cbrt(cbrt(((angle * 0.005555555555555556) * cbrt(pow(((double) M_PI), 3.0)))))), 3.0)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.cbrt(Math.cbrt((Math.PI * (angle * 0.005555555555555556))));
double t_1 = Math.sin((0.005555555555555556 * (angle * Math.PI))) * (b + a);
double tmp;
if (Math.pow(a, 2.0) <= 5e+176) {
tmp = 2.0 * (t_1 * ((b - a) * Math.log(Math.exp(Math.cos(((angle / 180.0) * Math.PI))))));
} else {
tmp = 2.0 * (t_1 * ((b - a) * Math.cos((Math.pow(t_0, 3.0) * Math.pow((t_0 * Math.cbrt(Math.cbrt(((angle * 0.005555555555555556) * Math.cbrt(Math.pow(Math.PI, 3.0)))))), 3.0)))));
}
return tmp;
}
function code(a, b, angle) t_0 = cbrt(cbrt(Float64(pi * Float64(angle * 0.005555555555555556)))) t_1 = Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(b + a)) tmp = 0.0 if ((a ^ 2.0) <= 5e+176) tmp = Float64(2.0 * Float64(t_1 * Float64(Float64(b - a) * log(exp(cos(Float64(Float64(angle / 180.0) * pi))))))); else tmp = Float64(2.0 * Float64(t_1 * Float64(Float64(b - a) * cos(Float64((t_0 ^ 3.0) * (Float64(t_0 * cbrt(cbrt(Float64(Float64(angle * 0.005555555555555556) * cbrt((pi ^ 3.0)))))) ^ 3.0)))))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+176], N[(2.0 * N[(t$95$1 * N[(N[(b - a), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(N[Power[t$95$0, 3.0], $MachinePrecision] * N[Power[N[(t$95$0 * N[Power[N[Power[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}}\\
t_1 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + a\right)\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+176}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(\left(b - a\right) \cdot \log \left(e^{\cos \left(\frac{angle}{180} \cdot \pi\right)}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(\left(b - a\right) \cdot \cos \left({t_0}^{3} \cdot {\left(t_0 \cdot \sqrt[3]{\sqrt[3]{\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt[3]{{\pi}^{3}}}}\right)}^{3}\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 5e176Initial program 60.0%
associate-*l*60.0%
associate-*l*60.0%
unpow260.0%
unpow260.0%
difference-of-squares60.0%
Simplified60.0%
Taylor expanded in angle around inf 64.7%
associate-*r*64.8%
*-commutative64.8%
*-commutative64.8%
Simplified64.8%
associate-*r*64.9%
*-commutative64.9%
metadata-eval64.9%
div-inv66.4%
*-commutative66.4%
add-log-exp66.4%
Applied egg-rr66.4%
if 5e176 < (pow.f64 a 2) Initial program 42.9%
associate-*l*42.9%
associate-*l*42.9%
unpow242.9%
unpow242.9%
difference-of-squares55.8%
Simplified55.8%
Taylor expanded in angle around inf 79.3%
associate-*r*79.3%
*-commutative79.3%
*-commutative79.3%
Simplified79.3%
*-commutative79.3%
*-commutative79.3%
associate-*r*78.3%
add-cube-cbrt81.9%
unpow380.7%
associate-*r*80.5%
*-commutative80.5%
*-commutative80.5%
associate-*r*80.7%
*-commutative80.7%
metadata-eval80.7%
div-inv82.9%
*-commutative82.9%
Applied egg-rr82.9%
add-cube-cbrt83.0%
unpow-prod-down84.6%
div-inv85.8%
metadata-eval85.8%
div-inv85.8%
metadata-eval85.8%
Applied egg-rr85.8%
add-cbrt-cube85.8%
pow385.8%
Applied egg-rr85.8%
Final simplification72.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cbrt (cbrt (* PI (* angle 0.005555555555555556))))))
(*
2.0
(*
(* (+ b a) (sin (* 0.005555555555555556 (* angle (pow (sqrt PI) 2.0)))))
(* (- b a) (cos (* (pow (* t_0 t_0) 3.0) (pow t_0 3.0))))))))
double code(double a, double b, double angle) {
double t_0 = cbrt(cbrt((((double) M_PI) * (angle * 0.005555555555555556))));
return 2.0 * (((b + a) * sin((0.005555555555555556 * (angle * pow(sqrt(((double) M_PI)), 2.0))))) * ((b - a) * cos((pow((t_0 * t_0), 3.0) * pow(t_0, 3.0)))));
}
public static double code(double a, double b, double angle) {
double t_0 = Math.cbrt(Math.cbrt((Math.PI * (angle * 0.005555555555555556))));
return 2.0 * (((b + a) * Math.sin((0.005555555555555556 * (angle * Math.pow(Math.sqrt(Math.PI), 2.0))))) * ((b - a) * Math.cos((Math.pow((t_0 * t_0), 3.0) * Math.pow(t_0, 3.0)))));
}
function code(a, b, angle) t_0 = cbrt(cbrt(Float64(pi * Float64(angle * 0.005555555555555556)))) return Float64(2.0 * Float64(Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(angle * (sqrt(pi) ^ 2.0))))) * Float64(Float64(b - a) * cos(Float64((Float64(t_0 * t_0) ^ 3.0) * (t_0 ^ 3.0)))))) end
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision]}, N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], 3.0], $MachinePrecision] * N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}}\\
2 \cdot \left(\left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\right) \cdot \left(\left(b - a\right) \cdot \cos \left({\left(t_0 \cdot t_0\right)}^{3} \cdot {t_0}^{3}\right)\right)\right)
\end{array}
\end{array}
Initial program 54.5%
associate-*l*54.5%
associate-*l*54.5%
unpow254.5%
unpow254.5%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around inf 69.4%
associate-*r*69.4%
*-commutative69.4%
*-commutative69.4%
Simplified69.4%
*-commutative69.4%
*-commutative69.4%
associate-*r*69.2%
add-cube-cbrt68.7%
unpow369.1%
associate-*r*69.0%
*-commutative69.0%
*-commutative69.0%
associate-*r*69.1%
*-commutative69.1%
metadata-eval69.1%
div-inv70.1%
*-commutative70.1%
Applied egg-rr70.1%
add-cube-cbrt69.2%
unpow-prod-down70.1%
div-inv70.5%
metadata-eval70.5%
div-inv70.2%
metadata-eval70.2%
Applied egg-rr70.2%
add-sqr-sqrt71.6%
pow271.6%
Applied egg-rr71.6%
Final simplification71.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cbrt (cbrt (* PI (* angle 0.005555555555555556)))))
(t_1 (* (sin (* 0.005555555555555556 (* angle PI))) (+ b a))))
(if (<= (pow a 2.0) 5e+176)
(* 2.0 (* t_1 (* (- b a) (log (exp (cos (* (/ angle 180.0) PI)))))))
(*
2.0
(* t_1 (* (- b a) (cos (* (pow (* t_0 t_0) 3.0) (pow t_0 3.0)))))))))
double code(double a, double b, double angle) {
double t_0 = cbrt(cbrt((((double) M_PI) * (angle * 0.005555555555555556))));
double t_1 = sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (b + a);
double tmp;
if (pow(a, 2.0) <= 5e+176) {
tmp = 2.0 * (t_1 * ((b - a) * log(exp(cos(((angle / 180.0) * ((double) M_PI)))))));
} else {
tmp = 2.0 * (t_1 * ((b - a) * cos((pow((t_0 * t_0), 3.0) * pow(t_0, 3.0)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.cbrt(Math.cbrt((Math.PI * (angle * 0.005555555555555556))));
double t_1 = Math.sin((0.005555555555555556 * (angle * Math.PI))) * (b + a);
double tmp;
if (Math.pow(a, 2.0) <= 5e+176) {
tmp = 2.0 * (t_1 * ((b - a) * Math.log(Math.exp(Math.cos(((angle / 180.0) * Math.PI))))));
} else {
tmp = 2.0 * (t_1 * ((b - a) * Math.cos((Math.pow((t_0 * t_0), 3.0) * Math.pow(t_0, 3.0)))));
}
return tmp;
}
function code(a, b, angle) t_0 = cbrt(cbrt(Float64(pi * Float64(angle * 0.005555555555555556)))) t_1 = Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(b + a)) tmp = 0.0 if ((a ^ 2.0) <= 5e+176) tmp = Float64(2.0 * Float64(t_1 * Float64(Float64(b - a) * log(exp(cos(Float64(Float64(angle / 180.0) * pi))))))); else tmp = Float64(2.0 * Float64(t_1 * Float64(Float64(b - a) * cos(Float64((Float64(t_0 * t_0) ^ 3.0) * (t_0 ^ 3.0)))))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+176], N[(2.0 * N[(t$95$1 * N[(N[(b - a), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], 3.0], $MachinePrecision] * N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}}\\
t_1 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + a\right)\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+176}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(\left(b - a\right) \cdot \log \left(e^{\cos \left(\frac{angle}{180} \cdot \pi\right)}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \left(\left(b - a\right) \cdot \cos \left({\left(t_0 \cdot t_0\right)}^{3} \cdot {t_0}^{3}\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 5e176Initial program 60.0%
associate-*l*60.0%
associate-*l*60.0%
unpow260.0%
unpow260.0%
difference-of-squares60.0%
Simplified60.0%
Taylor expanded in angle around inf 64.7%
associate-*r*64.8%
*-commutative64.8%
*-commutative64.8%
Simplified64.8%
associate-*r*64.9%
*-commutative64.9%
metadata-eval64.9%
div-inv66.4%
*-commutative66.4%
add-log-exp66.4%
Applied egg-rr66.4%
if 5e176 < (pow.f64 a 2) Initial program 42.9%
associate-*l*42.9%
associate-*l*42.9%
unpow242.9%
unpow242.9%
difference-of-squares55.8%
Simplified55.8%
Taylor expanded in angle around inf 79.3%
associate-*r*79.3%
*-commutative79.3%
*-commutative79.3%
Simplified79.3%
*-commutative79.3%
*-commutative79.3%
associate-*r*78.3%
add-cube-cbrt81.9%
unpow380.7%
associate-*r*80.5%
*-commutative80.5%
*-commutative80.5%
associate-*r*80.7%
*-commutative80.7%
metadata-eval80.7%
div-inv82.9%
*-commutative82.9%
Applied egg-rr82.9%
add-cube-cbrt83.0%
unpow-prod-down84.6%
div-inv85.8%
metadata-eval85.8%
div-inv85.8%
metadata-eval85.8%
Applied egg-rr85.8%
Final simplification72.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (sin (* 0.005555555555555556 (* angle PI))) (+ b a))))
(if (<= (pow a 2.0) 5e+176)
(* 2.0 (* t_0 (* (- b a) (log (exp (cos (* (/ angle 180.0) PI)))))))
(* 2.0 (* t_0 (* (- b a) (fabs (cos (* angle (/ PI 180.0))))))))))
double code(double a, double b, double angle) {
double t_0 = sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (b + a);
double tmp;
if (pow(a, 2.0) <= 5e+176) {
tmp = 2.0 * (t_0 * ((b - a) * log(exp(cos(((angle / 180.0) * ((double) M_PI)))))));
} else {
tmp = 2.0 * (t_0 * ((b - a) * fabs(cos((angle * (((double) M_PI) / 180.0))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.sin((0.005555555555555556 * (angle * Math.PI))) * (b + a);
double tmp;
if (Math.pow(a, 2.0) <= 5e+176) {
tmp = 2.0 * (t_0 * ((b - a) * Math.log(Math.exp(Math.cos(((angle / 180.0) * Math.PI))))));
} else {
tmp = 2.0 * (t_0 * ((b - a) * Math.abs(Math.cos((angle * (Math.PI / 180.0))))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.sin((0.005555555555555556 * (angle * math.pi))) * (b + a) tmp = 0 if math.pow(a, 2.0) <= 5e+176: tmp = 2.0 * (t_0 * ((b - a) * math.log(math.exp(math.cos(((angle / 180.0) * math.pi)))))) else: tmp = 2.0 * (t_0 * ((b - a) * math.fabs(math.cos((angle * (math.pi / 180.0)))))) return tmp
function code(a, b, angle) t_0 = Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(b + a)) tmp = 0.0 if ((a ^ 2.0) <= 5e+176) tmp = Float64(2.0 * Float64(t_0 * Float64(Float64(b - a) * log(exp(cos(Float64(Float64(angle / 180.0) * pi))))))); else tmp = Float64(2.0 * Float64(t_0 * Float64(Float64(b - a) * abs(cos(Float64(angle * Float64(pi / 180.0))))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = sin((0.005555555555555556 * (angle * pi))) * (b + a); tmp = 0.0; if ((a ^ 2.0) <= 5e+176) tmp = 2.0 * (t_0 * ((b - a) * log(exp(cos(((angle / 180.0) * pi)))))); else tmp = 2.0 * (t_0 * ((b - a) * abs(cos((angle * (pi / 180.0)))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+176], N[(2.0 * N[(t$95$0 * N[(N[(b - a), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[(N[(b - a), $MachinePrecision] * N[Abs[N[Cos[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + a\right)\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+176}:\\
\;\;\;\;2 \cdot \left(t_0 \cdot \left(\left(b - a\right) \cdot \log \left(e^{\cos \left(\frac{angle}{180} \cdot \pi\right)}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_0 \cdot \left(\left(b - a\right) \cdot \left|\cos \left(angle \cdot \frac{\pi}{180}\right)\right|\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 5e176Initial program 60.0%
associate-*l*60.0%
associate-*l*60.0%
unpow260.0%
unpow260.0%
difference-of-squares60.0%
Simplified60.0%
Taylor expanded in angle around inf 64.7%
associate-*r*64.8%
*-commutative64.8%
*-commutative64.8%
Simplified64.8%
associate-*r*64.9%
*-commutative64.9%
metadata-eval64.9%
div-inv66.4%
*-commutative66.4%
add-log-exp66.4%
Applied egg-rr66.4%
if 5e176 < (pow.f64 a 2) Initial program 42.9%
associate-*l*42.9%
associate-*l*42.9%
unpow242.9%
unpow242.9%
difference-of-squares55.8%
Simplified55.8%
Taylor expanded in angle around inf 79.3%
associate-*r*79.3%
*-commutative79.3%
*-commutative79.3%
Simplified79.3%
*-commutative79.3%
*-commutative79.3%
associate-*r*78.3%
add-cube-cbrt81.9%
unpow380.7%
associate-*r*80.5%
*-commutative80.5%
*-commutative80.5%
associate-*r*80.7%
*-commutative80.7%
metadata-eval80.7%
div-inv82.9%
*-commutative82.9%
Applied egg-rr82.9%
add-cube-cbrt83.0%
unpow-prod-down84.6%
div-inv85.8%
metadata-eval85.8%
div-inv85.8%
metadata-eval85.8%
Applied egg-rr85.8%
pow-prod-down81.7%
add-cube-cbrt80.7%
metadata-eval80.7%
div-inv82.9%
rem-cube-cbrt76.9%
add-sqr-sqrt72.0%
sqrt-unprod84.4%
pow284.4%
Applied egg-rr84.4%
unpow284.4%
rem-sqrt-square84.4%
associate-*r/84.4%
associate-*l/84.4%
*-commutative84.4%
Simplified84.4%
Final simplification72.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (sin (* 0.005555555555555556 (* angle PI))) (+ b a))))
(if (<= (pow a 2.0) 5e+141)
(* 2.0 (* t_0 (* (- b a) (cos (/ PI (/ 180.0 angle))))))
(* 2.0 (* t_0 (* (- b a) (fabs (cos (* angle (/ PI 180.0))))))))))
double code(double a, double b, double angle) {
double t_0 = sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (b + a);
double tmp;
if (pow(a, 2.0) <= 5e+141) {
tmp = 2.0 * (t_0 * ((b - a) * cos((((double) M_PI) / (180.0 / angle)))));
} else {
tmp = 2.0 * (t_0 * ((b - a) * fabs(cos((angle * (((double) M_PI) / 180.0))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.sin((0.005555555555555556 * (angle * Math.PI))) * (b + a);
double tmp;
if (Math.pow(a, 2.0) <= 5e+141) {
tmp = 2.0 * (t_0 * ((b - a) * Math.cos((Math.PI / (180.0 / angle)))));
} else {
tmp = 2.0 * (t_0 * ((b - a) * Math.abs(Math.cos((angle * (Math.PI / 180.0))))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.sin((0.005555555555555556 * (angle * math.pi))) * (b + a) tmp = 0 if math.pow(a, 2.0) <= 5e+141: tmp = 2.0 * (t_0 * ((b - a) * math.cos((math.pi / (180.0 / angle))))) else: tmp = 2.0 * (t_0 * ((b - a) * math.fabs(math.cos((angle * (math.pi / 180.0)))))) return tmp
function code(a, b, angle) t_0 = Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(b + a)) tmp = 0.0 if ((a ^ 2.0) <= 5e+141) tmp = Float64(2.0 * Float64(t_0 * Float64(Float64(b - a) * cos(Float64(pi / Float64(180.0 / angle)))))); else tmp = Float64(2.0 * Float64(t_0 * Float64(Float64(b - a) * abs(cos(Float64(angle * Float64(pi / 180.0))))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = sin((0.005555555555555556 * (angle * pi))) * (b + a); tmp = 0.0; if ((a ^ 2.0) <= 5e+141) tmp = 2.0 * (t_0 * ((b - a) * cos((pi / (180.0 / angle))))); else tmp = 2.0 * (t_0 * ((b - a) * abs(cos((angle * (pi / 180.0)))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+141], N[(2.0 * N[(t$95$0 * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[(N[(b - a), $MachinePrecision] * N[Abs[N[Cos[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + a\right)\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+141}:\\
\;\;\;\;2 \cdot \left(t_0 \cdot \left(\left(b - a\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_0 \cdot \left(\left(b - a\right) \cdot \left|\cos \left(angle \cdot \frac{\pi}{180}\right)\right|\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 5.00000000000000025e141Initial program 60.5%
associate-*l*60.5%
associate-*l*60.5%
unpow260.5%
unpow260.5%
difference-of-squares60.5%
Simplified60.5%
Taylor expanded in angle around inf 65.2%
associate-*r*65.2%
*-commutative65.2%
*-commutative65.2%
Simplified65.2%
*-commutative65.2%
*-commutative65.2%
associate-*r*65.3%
add-cube-cbrt62.8%
unpow364.0%
associate-*r*64.1%
*-commutative64.1%
*-commutative64.1%
associate-*r*64.0%
*-commutative64.0%
metadata-eval64.0%
div-inv64.5%
*-commutative64.5%
Applied egg-rr64.5%
rem-cube-cbrt66.9%
associate-*r/65.3%
Applied egg-rr65.3%
associate-/l*67.1%
Simplified67.1%
if 5.00000000000000025e141 < (pow.f64 a 2) Initial program 43.6%
associate-*l*43.6%
associate-*l*43.6%
unpow243.6%
unpow243.6%
difference-of-squares55.1%
Simplified55.1%
Taylor expanded in angle around inf 77.1%
associate-*r*77.1%
*-commutative77.1%
*-commutative77.1%
Simplified77.1%
*-commutative77.1%
*-commutative77.1%
associate-*r*76.2%
add-cube-cbrt79.5%
unpow378.4%
associate-*r*78.0%
*-commutative78.0%
*-commutative78.0%
associate-*r*78.4%
*-commutative78.4%
metadata-eval78.4%
div-inv80.2%
*-commutative80.2%
Applied egg-rr80.2%
add-cube-cbrt79.3%
unpow-prod-down80.4%
div-inv81.7%
metadata-eval81.7%
div-inv81.7%
metadata-eval81.7%
Applied egg-rr81.7%
pow-prod-down78.2%
add-cube-cbrt78.4%
metadata-eval78.4%
div-inv80.2%
rem-cube-cbrt74.9%
add-sqr-sqrt69.5%
sqrt-unprod80.9%
pow280.9%
Applied egg-rr80.9%
unpow280.9%
rem-sqrt-square80.9%
associate-*r/80.9%
associate-*l/80.9%
*-commutative80.9%
Simplified80.9%
Final simplification72.0%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= (/ angle 180.0) 200000000000.0)
(* 2.0 (* (* (sin t_0) (+ b a)) (* (- b a) (cos t_0))))
(* 2.0 (* (* (- b a) (+ b a)) (sin (* (/ angle 180.0) PI)))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if ((angle / 180.0) <= 200000000000.0) {
tmp = 2.0 * ((sin(t_0) * (b + a)) * ((b - a) * cos(t_0)));
} else {
tmp = 2.0 * (((b - a) * (b + a)) * sin(((angle / 180.0) * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if ((angle / 180.0) <= 200000000000.0) {
tmp = 2.0 * ((Math.sin(t_0) * (b + a)) * ((b - a) * Math.cos(t_0)));
} else {
tmp = 2.0 * (((b - a) * (b + a)) * Math.sin(((angle / 180.0) * Math.PI)));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if (angle / 180.0) <= 200000000000.0: tmp = 2.0 * ((math.sin(t_0) * (b + a)) * ((b - a) * math.cos(t_0))) else: tmp = 2.0 * (((b - a) * (b + a)) * math.sin(((angle / 180.0) * math.pi))) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (Float64(angle / 180.0) <= 200000000000.0) tmp = Float64(2.0 * Float64(Float64(sin(t_0) * Float64(b + a)) * Float64(Float64(b - a) * cos(t_0)))); else tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(angle / 180.0) * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if ((angle / 180.0) <= 200000000000.0) tmp = 2.0 * ((sin(t_0) * (b + a)) * ((b - a) * cos(t_0))); else tmp = 2.0 * (((b - a) * (b + a)) * sin(((angle / 180.0) * pi))); end tmp_2 = 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], 200000000000.0], N[(2.0 * N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $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 200000000000:\\
\;\;\;\;2 \cdot \left(\left(\sin t_0 \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot \cos t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 2e11Initial program 63.9%
associate-*l*63.9%
associate-*l*63.9%
unpow263.9%
unpow263.9%
difference-of-squares69.2%
Simplified69.2%
Taylor expanded in angle around inf 81.1%
associate-*r*81.1%
*-commutative81.1%
*-commutative81.1%
Simplified81.1%
if 2e11 < (/.f64 angle 180) Initial program 19.2%
associate-*l*19.2%
associate-*l*19.2%
unpow219.2%
unpow219.2%
difference-of-squares19.2%
Simplified19.2%
Taylor expanded in angle around 0 36.1%
Final simplification71.6%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 5e+169)
(*
2.0
(*
(* (sin (* 0.005555555555555556 (* angle PI))) (+ b a))
(* (- b a) (cos (/ PI (/ 180.0 angle))))))
(* 2.0 (* (* (- b a) (+ b a)) (sin (* (/ angle 180.0) PI))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+169) {
tmp = 2.0 * ((sin((0.005555555555555556 * (angle * ((double) M_PI)))) * (b + a)) * ((b - a) * cos((((double) M_PI) / (180.0 / angle)))));
} else {
tmp = 2.0 * (((b - a) * (b + a)) * sin(((angle / 180.0) * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+169) {
tmp = 2.0 * ((Math.sin((0.005555555555555556 * (angle * Math.PI))) * (b + a)) * ((b - a) * Math.cos((Math.PI / (180.0 / angle)))));
} else {
tmp = 2.0 * (((b - a) * (b + a)) * Math.sin(((angle / 180.0) * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 5e+169: tmp = 2.0 * ((math.sin((0.005555555555555556 * (angle * math.pi))) * (b + a)) * ((b - a) * math.cos((math.pi / (180.0 / angle))))) else: tmp = 2.0 * (((b - a) * (b + a)) * math.sin(((angle / 180.0) * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+169) tmp = Float64(2.0 * Float64(Float64(sin(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(b + a)) * Float64(Float64(b - a) * cos(Float64(pi / Float64(180.0 / angle)))))); else tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(angle / 180.0) * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 5e+169) tmp = 2.0 * ((sin((0.005555555555555556 * (angle * pi))) * (b + a)) * ((b - a) * cos((pi / (180.0 / angle))))); else tmp = 2.0 * (((b - a) * (b + a)) * sin(((angle / 180.0) * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+169], N[(2.0 * N[(N[(N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+169}:\\
\;\;\;\;2 \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 5.00000000000000017e169Initial program 59.1%
associate-*l*59.1%
associate-*l*59.2%
unpow259.2%
unpow259.2%
difference-of-squares63.8%
Simplified63.8%
Taylor expanded in angle around inf 75.3%
associate-*r*75.3%
*-commutative75.3%
*-commutative75.3%
Simplified75.3%
*-commutative75.3%
*-commutative75.3%
associate-*r*75.8%
add-cube-cbrt73.1%
unpow373.9%
associate-*r*73.9%
*-commutative73.9%
*-commutative73.9%
associate-*r*73.9%
*-commutative73.9%
metadata-eval73.9%
div-inv75.2%
*-commutative75.2%
Applied egg-rr75.2%
rem-cube-cbrt76.1%
associate-*r/76.3%
Applied egg-rr76.3%
associate-/l*77.0%
Simplified77.0%
if 5.00000000000000017e169 < (/.f64 angle 180) Initial program 19.5%
associate-*l*19.5%
associate-*l*19.5%
unpow219.5%
unpow219.5%
difference-of-squares19.5%
Simplified19.5%
Taylor expanded in angle around 0 39.4%
Final simplification72.6%
(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 54.5%
associate-*l*54.5%
associate-*l*54.5%
unpow254.5%
unpow254.5%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around inf 69.4%
associate-*r*69.4%
*-commutative69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in angle around 0 68.1%
Final simplification68.1%
(FPCore (a b angle)
:precision binary64
(if (<= angle -1.6e+56)
(* -0.011111111111111112 (fabs (* PI (* angle (* a a)))))
(if (<= angle 44000000000.0)
(* (* (* angle (- b a)) (* PI (+ b a))) 0.011111111111111112)
(* (* angle 0.011111111111111112) (* PI (+ (* a a) (* b b)))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= -1.6e+56) {
tmp = -0.011111111111111112 * fabs((((double) M_PI) * (angle * (a * a))));
} else if (angle <= 44000000000.0) {
tmp = ((angle * (b - a)) * (((double) M_PI) * (b + a))) * 0.011111111111111112;
} else {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * ((a * a) + (b * b)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= -1.6e+56) {
tmp = -0.011111111111111112 * Math.abs((Math.PI * (angle * (a * a))));
} else if (angle <= 44000000000.0) {
tmp = ((angle * (b - a)) * (Math.PI * (b + a))) * 0.011111111111111112;
} else {
tmp = (angle * 0.011111111111111112) * (Math.PI * ((a * a) + (b * b)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= -1.6e+56: tmp = -0.011111111111111112 * math.fabs((math.pi * (angle * (a * a)))) elif angle <= 44000000000.0: tmp = ((angle * (b - a)) * (math.pi * (b + a))) * 0.011111111111111112 else: tmp = (angle * 0.011111111111111112) * (math.pi * ((a * a) + (b * b))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= -1.6e+56) tmp = Float64(-0.011111111111111112 * abs(Float64(pi * Float64(angle * Float64(a * a))))); elseif (angle <= 44000000000.0) tmp = Float64(Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a))) * 0.011111111111111112); else tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(Float64(a * a) + Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= -1.6e+56) tmp = -0.011111111111111112 * abs((pi * (angle * (a * a)))); elseif (angle <= 44000000000.0) tmp = ((angle * (b - a)) * (pi * (b + a))) * 0.011111111111111112; else tmp = (angle * 0.011111111111111112) * (pi * ((a * a) + (b * b))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, -1.6e+56], N[(-0.011111111111111112 * N[Abs[N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 44000000000.0], N[(N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -1.6 \cdot 10^{+56}:\\
\;\;\;\;-0.011111111111111112 \cdot \left|\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right|\\
\mathbf{elif}\;angle \leq 44000000000:\\
\;\;\;\;\left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a \cdot a + b \cdot b\right)\right)\\
\end{array}
\end{array}
if angle < -1.60000000000000002e56Initial program 38.2%
*-commutative38.2%
associate-*l*38.2%
unpow238.2%
fma-neg38.2%
unpow238.2%
Simplified38.2%
Taylor expanded in angle around 0 20.3%
associate-*r*20.3%
unpow220.3%
unpow220.3%
*-lft-identity20.3%
cancel-sign-sub-inv20.3%
metadata-eval20.3%
unpow220.3%
+-commutative20.3%
unpow220.3%
fma-def20.3%
unpow220.3%
unpow220.3%
fma-def20.3%
mul-1-neg20.3%
+-commutative20.3%
sub-neg20.3%
Simplified20.3%
Taylor expanded in b around 0 17.5%
unpow217.5%
*-commutative17.5%
Simplified17.5%
Taylor expanded in a around 0 17.5%
unpow217.5%
associate-*l*17.5%
Simplified17.5%
add-sqr-sqrt7.0%
sqrt-unprod31.1%
pow231.1%
*-commutative31.1%
*-commutative31.1%
associate-*l*31.1%
Applied egg-rr31.1%
unpow231.1%
rem-sqrt-square29.1%
*-commutative29.1%
unpow229.1%
associate-*l*29.1%
*-commutative29.1%
unpow229.1%
Simplified29.1%
if -1.60000000000000002e56 < angle < 4.4e10Initial program 71.1%
associate-*l*71.1%
unpow271.1%
unpow271.1%
difference-of-squares77.8%
Simplified77.8%
Taylor expanded in angle around 0 73.6%
*-commutative73.6%
associate-*r*88.8%
Simplified88.8%
if 4.4e10 < angle Initial program 20.1%
*-commutative20.1%
associate-*l*20.1%
unpow220.1%
fma-neg23.8%
unpow223.8%
Simplified23.8%
fma-udef20.1%
distribute-rgt-neg-in20.1%
add-sqr-sqrt13.5%
sqrt-unprod25.6%
sqr-neg25.6%
sqrt-prod12.1%
add-sqr-sqrt29.5%
Applied egg-rr29.5%
add-exp-log13.9%
associate-*l*13.9%
fma-def13.9%
Applied egg-rr13.9%
Taylor expanded in angle around 0 29.2%
associate-*r*29.2%
*-commutative29.2%
+-commutative29.2%
unpow229.2%
unpow229.2%
Simplified29.2%
Final simplification65.8%
(FPCore (a b angle) :precision binary64 (if (or (<= a -3.6e+164) (not (<= a 2.5e+118))) (* -0.011111111111111112 (* PI (* a (* angle a)))) (* 0.011111111111111112 (* PI (* angle (- (* b b) (* a a)))))))
double code(double a, double b, double angle) {
double tmp;
if ((a <= -3.6e+164) || !(a <= 2.5e+118)) {
tmp = -0.011111111111111112 * (((double) M_PI) * (a * (angle * a)));
} else {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * ((b * b) - (a * a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((a <= -3.6e+164) || !(a <= 2.5e+118)) {
tmp = -0.011111111111111112 * (Math.PI * (a * (angle * a)));
} else {
tmp = 0.011111111111111112 * (Math.PI * (angle * ((b * b) - (a * a))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (a <= -3.6e+164) or not (a <= 2.5e+118): tmp = -0.011111111111111112 * (math.pi * (a * (angle * a))) else: tmp = 0.011111111111111112 * (math.pi * (angle * ((b * b) - (a * a)))) return tmp
function code(a, b, angle) tmp = 0.0 if ((a <= -3.6e+164) || !(a <= 2.5e+118)) tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(a * Float64(angle * a)))); else tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(Float64(b * b) - Float64(a * a))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a <= -3.6e+164) || ~((a <= 2.5e+118))) tmp = -0.011111111111111112 * (pi * (a * (angle * a))); else tmp = 0.011111111111111112 * (pi * (angle * ((b * b) - (a * a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[a, -3.6e+164], N[Not[LessEqual[a, 2.5e+118]], $MachinePrecision]], N[(-0.011111111111111112 * N[(Pi * N[(a * N[(angle * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.6 \cdot 10^{+164} \lor \neg \left(a \leq 2.5 \cdot 10^{+118}\right):\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot \left(angle \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b - a \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if a < -3.5999999999999999e164 or 2.49999999999999986e118 < a Initial program 38.2%
*-commutative38.2%
associate-*l*38.2%
unpow238.2%
fma-neg51.7%
unpow251.7%
Simplified51.7%
Taylor expanded in angle around 0 36.8%
associate-*r*36.8%
unpow236.8%
unpow236.8%
*-lft-identity36.8%
cancel-sign-sub-inv36.8%
metadata-eval36.8%
unpow236.8%
+-commutative36.8%
unpow236.8%
fma-def36.8%
unpow236.8%
unpow236.8%
fma-def36.8%
mul-1-neg36.8%
+-commutative36.8%
sub-neg36.8%
Simplified36.8%
Taylor expanded in b around 0 48.9%
unpow248.9%
*-commutative48.9%
Simplified48.9%
Taylor expanded in angle around 0 48.9%
associate-*r*48.9%
*-commutative48.9%
unpow248.9%
associate-*r*69.2%
Simplified69.2%
if -3.5999999999999999e164 < a < 2.49999999999999986e118Initial program 60.4%
*-commutative60.4%
associate-*l*60.4%
unpow260.4%
fma-neg60.4%
unpow260.4%
Simplified60.4%
Taylor expanded in angle around 0 54.1%
associate-*r*54.1%
unpow254.1%
unpow254.1%
*-lft-identity54.1%
cancel-sign-sub-inv54.1%
metadata-eval54.1%
unpow254.1%
+-commutative54.1%
unpow254.1%
fma-def54.1%
unpow254.1%
unpow254.1%
fma-def54.1%
mul-1-neg54.1%
+-commutative54.1%
sub-neg54.1%
Simplified54.1%
Final simplification58.1%
(FPCore (a b angle) :precision binary64 (if (or (<= a -3.6e+164) (not (<= a 5.4e+109))) (* -0.011111111111111112 (* PI (* a (* angle a)))) (* (* angle 0.011111111111111112) (* PI (- (* b b) (* a a))))))
double code(double a, double b, double angle) {
double tmp;
if ((a <= -3.6e+164) || !(a <= 5.4e+109)) {
tmp = -0.011111111111111112 * (((double) M_PI) * (a * (angle * a)));
} else {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * ((b * b) - (a * a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((a <= -3.6e+164) || !(a <= 5.4e+109)) {
tmp = -0.011111111111111112 * (Math.PI * (a * (angle * a)));
} else {
tmp = (angle * 0.011111111111111112) * (Math.PI * ((b * b) - (a * a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (a <= -3.6e+164) or not (a <= 5.4e+109): tmp = -0.011111111111111112 * (math.pi * (a * (angle * a))) else: tmp = (angle * 0.011111111111111112) * (math.pi * ((b * b) - (a * a))) return tmp
function code(a, b, angle) tmp = 0.0 if ((a <= -3.6e+164) || !(a <= 5.4e+109)) tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(a * Float64(angle * a)))); else tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(Float64(b * b) - Float64(a * a)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a <= -3.6e+164) || ~((a <= 5.4e+109))) tmp = -0.011111111111111112 * (pi * (a * (angle * a))); else tmp = (angle * 0.011111111111111112) * (pi * ((b * b) - (a * a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[a, -3.6e+164], N[Not[LessEqual[a, 5.4e+109]], $MachinePrecision]], N[(-0.011111111111111112 * N[(Pi * N[(a * N[(angle * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.6 \cdot 10^{+164} \lor \neg \left(a \leq 5.4 \cdot 10^{+109}\right):\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot \left(angle \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(b \cdot b - a \cdot a\right)\right)\\
\end{array}
\end{array}
if a < -3.5999999999999999e164 or 5.40000000000000003e109 < a Initial program 40.0%
*-commutative40.0%
associate-*l*40.0%
unpow240.0%
fma-neg53.1%
unpow253.1%
Simplified53.1%
Taylor expanded in angle around 0 38.5%
associate-*r*38.6%
unpow238.6%
unpow238.6%
*-lft-identity38.6%
cancel-sign-sub-inv38.6%
metadata-eval38.6%
unpow238.6%
+-commutative38.6%
unpow238.6%
fma-def38.6%
unpow238.6%
unpow238.6%
fma-def38.6%
mul-1-neg38.6%
+-commutative38.6%
sub-neg38.6%
Simplified38.6%
Taylor expanded in b around 0 50.3%
unpow250.3%
*-commutative50.3%
Simplified50.3%
Taylor expanded in angle around 0 50.3%
associate-*r*50.3%
*-commutative50.3%
unpow250.3%
associate-*r*70.0%
Simplified70.0%
if -3.5999999999999999e164 < a < 5.40000000000000003e109Initial program 60.0%
*-commutative60.0%
associate-*l*60.0%
unpow260.0%
fma-neg60.0%
unpow260.0%
Simplified60.0%
Taylor expanded in angle around 0 53.7%
associate-*r*53.7%
*-commutative53.7%
*-commutative53.7%
unpow253.7%
unpow253.7%
*-commutative53.7%
Simplified53.7%
Final simplification58.1%
(FPCore (a b angle) :precision binary64 (if (or (<= angle -9.8e+64) (not (<= angle 44000000000.0))) (* (* angle 0.011111111111111112) (* PI (+ (* a a) (* b b)))) (* (* (* angle (- b a)) (* PI (+ b a))) 0.011111111111111112)))
double code(double a, double b, double angle) {
double tmp;
if ((angle <= -9.8e+64) || !(angle <= 44000000000.0)) {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * ((a * a) + (b * b)));
} else {
tmp = ((angle * (b - a)) * (((double) M_PI) * (b + a))) * 0.011111111111111112;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle <= -9.8e+64) || !(angle <= 44000000000.0)) {
tmp = (angle * 0.011111111111111112) * (Math.PI * ((a * a) + (b * b)));
} else {
tmp = ((angle * (b - a)) * (Math.PI * (b + a))) * 0.011111111111111112;
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle <= -9.8e+64) or not (angle <= 44000000000.0): tmp = (angle * 0.011111111111111112) * (math.pi * ((a * a) + (b * b))) else: tmp = ((angle * (b - a)) * (math.pi * (b + a))) * 0.011111111111111112 return tmp
function code(a, b, angle) tmp = 0.0 if ((angle <= -9.8e+64) || !(angle <= 44000000000.0)) tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(Float64(a * a) + Float64(b * b)))); else tmp = Float64(Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a))) * 0.011111111111111112); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle <= -9.8e+64) || ~((angle <= 44000000000.0))) tmp = (angle * 0.011111111111111112) * (pi * ((a * a) + (b * b))); else tmp = ((angle * (b - a)) * (pi * (b + a))) * 0.011111111111111112; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[angle, -9.8e+64], N[Not[LessEqual[angle, 44000000000.0]], $MachinePrecision]], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -9.8 \cdot 10^{+64} \lor \neg \left(angle \leq 44000000000\right):\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(a \cdot a + b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if angle < -9.8000000000000005e64 or 4.4e10 < angle Initial program 26.7%
*-commutative26.7%
associate-*l*26.7%
unpow226.7%
fma-neg28.8%
unpow228.8%
Simplified28.8%
fma-udef26.7%
distribute-rgt-neg-in26.7%
add-sqr-sqrt16.4%
sqrt-unprod30.4%
sqr-neg30.4%
sqrt-prod14.0%
add-sqr-sqrt31.0%
Applied egg-rr31.0%
add-exp-log18.6%
associate-*l*18.6%
fma-def18.6%
Applied egg-rr18.6%
Taylor expanded in angle around 0 29.0%
associate-*r*29.0%
*-commutative29.0%
+-commutative29.0%
unpow229.0%
unpow229.0%
Simplified29.0%
if -9.8000000000000005e64 < angle < 4.4e10Initial program 71.5%
associate-*l*71.5%
unpow271.5%
unpow271.5%
difference-of-squares78.1%
Simplified78.1%
Taylor expanded in angle around 0 72.7%
*-commutative72.7%
associate-*r*87.7%
Simplified87.7%
Final simplification65.4%
(FPCore (a b angle) :precision binary64 (if (or (<= a -1.4e-72) (not (<= a 4e-29))) (* -0.011111111111111112 (* PI (* a (* angle a)))) (* 0.011111111111111112 (* angle (* PI (* b b))))))
double code(double a, double b, double angle) {
double tmp;
if ((a <= -1.4e-72) || !(a <= 4e-29)) {
tmp = -0.011111111111111112 * (((double) M_PI) * (a * (angle * 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 <= -1.4e-72) || !(a <= 4e-29)) {
tmp = -0.011111111111111112 * (Math.PI * (a * (angle * a)));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (a <= -1.4e-72) or not (a <= 4e-29): tmp = -0.011111111111111112 * (math.pi * (a * (angle * a))) else: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) return tmp
function code(a, b, angle) tmp = 0.0 if ((a <= -1.4e-72) || !(a <= 4e-29)) tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(a * Float64(angle * a)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a <= -1.4e-72) || ~((a <= 4e-29))) tmp = -0.011111111111111112 * (pi * (a * (angle * a))); else tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[a, -1.4e-72], N[Not[LessEqual[a, 4e-29]], $MachinePrecision]], N[(-0.011111111111111112 * N[(Pi * N[(a * N[(angle * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{-72} \lor \neg \left(a \leq 4 \cdot 10^{-29}\right):\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot \left(angle \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if a < -1.3999999999999999e-72 or 3.99999999999999977e-29 < a Initial program 51.6%
*-commutative51.6%
associate-*l*51.6%
unpow251.6%
fma-neg57.9%
unpow257.9%
Simplified57.9%
Taylor expanded in angle around 0 47.6%
associate-*r*47.6%
unpow247.6%
unpow247.6%
*-lft-identity47.6%
cancel-sign-sub-inv47.6%
metadata-eval47.6%
unpow247.6%
+-commutative47.6%
unpow247.6%
fma-def47.6%
unpow247.6%
unpow247.6%
fma-def47.6%
mul-1-neg47.6%
+-commutative47.6%
sub-neg47.6%
Simplified47.6%
Taylor expanded in b around 0 44.5%
unpow244.5%
*-commutative44.5%
Simplified44.5%
Taylor expanded in angle around 0 44.5%
associate-*r*44.5%
*-commutative44.5%
unpow244.5%
associate-*r*54.1%
Simplified54.1%
if -1.3999999999999999e-72 < a < 3.99999999999999977e-29Initial program 58.3%
*-commutative58.3%
associate-*l*58.3%
unpow258.3%
fma-neg58.3%
unpow258.3%
Simplified58.3%
Taylor expanded in angle around 0 52.0%
associate-*r*52.0%
unpow252.0%
unpow252.0%
*-lft-identity52.0%
cancel-sign-sub-inv52.0%
metadata-eval52.0%
unpow252.0%
+-commutative52.0%
unpow252.0%
fma-def52.0%
unpow252.0%
unpow252.0%
fma-def52.0%
mul-1-neg52.0%
+-commutative52.0%
sub-neg52.0%
Simplified52.0%
Taylor expanded in b around inf 49.2%
unpow249.2%
*-commutative49.2%
Simplified49.2%
Final simplification51.9%
(FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* angle (* a (* a PI)))))
double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (a * (a * ((double) M_PI))));
}
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (a * (a * Math.PI)));
}
def code(a, b, angle): return -0.011111111111111112 * (angle * (a * (a * math.pi)))
function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(angle * Float64(a * Float64(a * pi)))) end
function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (angle * (a * (a * pi))); end
code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(angle * N[(a * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(a \cdot \pi\right)\right)\right)
\end{array}
Initial program 54.5%
*-commutative54.5%
associate-*l*54.5%
unpow254.5%
fma-neg58.1%
unpow258.1%
Simplified58.1%
Taylor expanded in angle around 0 49.5%
associate-*r*49.5%
unpow249.5%
unpow249.5%
*-lft-identity49.5%
cancel-sign-sub-inv49.5%
metadata-eval49.5%
unpow249.5%
+-commutative49.5%
unpow249.5%
fma-def49.5%
unpow249.5%
unpow249.5%
fma-def49.5%
mul-1-neg49.5%
+-commutative49.5%
sub-neg49.5%
Simplified49.5%
Taylor expanded in b around 0 39.3%
unpow239.3%
*-commutative39.3%
Simplified39.3%
Taylor expanded in a around 0 39.3%
unpow239.3%
associate-*l*39.2%
Simplified39.2%
Final simplification39.2%
(FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* angle (* PI (* a a)))))
double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (((double) M_PI) * (a * a)));
}
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (Math.PI * (a * a)));
}
def code(a, b, angle): return -0.011111111111111112 * (angle * (math.pi * (a * a)))
function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(a * a)))) end
function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (angle * (pi * (a * a))); end
code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(angle * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)
\end{array}
Initial program 54.5%
*-commutative54.5%
associate-*l*54.5%
unpow254.5%
fma-neg58.1%
unpow258.1%
Simplified58.1%
Taylor expanded in angle around 0 49.5%
associate-*r*49.5%
unpow249.5%
unpow249.5%
*-lft-identity49.5%
cancel-sign-sub-inv49.5%
metadata-eval49.5%
unpow249.5%
+-commutative49.5%
unpow249.5%
fma-def49.5%
unpow249.5%
unpow249.5%
fma-def49.5%
mul-1-neg49.5%
+-commutative49.5%
sub-neg49.5%
Simplified49.5%
Taylor expanded in b around 0 39.3%
unpow239.3%
*-commutative39.3%
Simplified39.3%
Final simplification39.3%
(FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* PI (* a (* angle a)))))
double code(double a, double b, double angle) {
return -0.011111111111111112 * (((double) M_PI) * (a * (angle * a)));
}
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (Math.PI * (a * (angle * a)));
}
def code(a, b, angle): return -0.011111111111111112 * (math.pi * (a * (angle * a)))
function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(pi * Float64(a * Float64(angle * a)))) end
function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (pi * (a * (angle * a))); end
code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(Pi * N[(a * N[(angle * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot \left(angle \cdot a\right)\right)\right)
\end{array}
Initial program 54.5%
*-commutative54.5%
associate-*l*54.5%
unpow254.5%
fma-neg58.1%
unpow258.1%
Simplified58.1%
Taylor expanded in angle around 0 49.5%
associate-*r*49.5%
unpow249.5%
unpow249.5%
*-lft-identity49.5%
cancel-sign-sub-inv49.5%
metadata-eval49.5%
unpow249.5%
+-commutative49.5%
unpow249.5%
fma-def49.5%
unpow249.5%
unpow249.5%
fma-def49.5%
mul-1-neg49.5%
+-commutative49.5%
sub-neg49.5%
Simplified49.5%
Taylor expanded in b around 0 39.3%
unpow239.3%
*-commutative39.3%
Simplified39.3%
Taylor expanded in angle around 0 39.3%
associate-*r*39.3%
*-commutative39.3%
unpow239.3%
associate-*r*42.8%
Simplified42.8%
Final simplification42.8%
herbie shell --seed 2023174
(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)))))