
(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 23 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
(if (<= (/ angle 180.0) -5e+191)
(*
(* 2.0 (* (- b a) (+ b a)))
(*
(pow (cbrt (sin (* PI (* angle 0.005555555555555556)))) 3.0)
(cos (* (/ angle 180.0) (* (cbrt PI) (* (cbrt PI) (cbrt PI)))))))
(if (<= (/ angle 180.0) 5e+55)
(*
2.0
(*
(- b a)
(*
(cos (pow (cbrt (* 0.005555555555555556 (* angle PI))) 3.0))
(* (sin (* (/ angle 180.0) (* (sqrt PI) (sqrt PI)))) (+ b a)))))
(*
(sin (* (/ angle 180.0) PI))
(*
(* 2.0 (+ (pow (+ b a) 2.0) (* a (+ a a))))
(cos (/ 1.0 (/ 180.0 (* angle PI)))))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+191) {
tmp = (2.0 * ((b - a) * (b + a))) * (pow(cbrt(sin((((double) M_PI) * (angle * 0.005555555555555556)))), 3.0) * cos(((angle / 180.0) * (cbrt(((double) M_PI)) * (cbrt(((double) M_PI)) * cbrt(((double) M_PI)))))));
} else if ((angle / 180.0) <= 5e+55) {
tmp = 2.0 * ((b - a) * (cos(pow(cbrt((0.005555555555555556 * (angle * ((double) M_PI)))), 3.0)) * (sin(((angle / 180.0) * (sqrt(((double) M_PI)) * sqrt(((double) M_PI))))) * (b + a))));
} else {
tmp = sin(((angle / 180.0) * ((double) M_PI))) * ((2.0 * (pow((b + a), 2.0) + (a * (a + a)))) * cos((1.0 / (180.0 / (angle * ((double) M_PI))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+191) {
tmp = (2.0 * ((b - a) * (b + a))) * (Math.pow(Math.cbrt(Math.sin((Math.PI * (angle * 0.005555555555555556)))), 3.0) * Math.cos(((angle / 180.0) * (Math.cbrt(Math.PI) * (Math.cbrt(Math.PI) * Math.cbrt(Math.PI))))));
} else if ((angle / 180.0) <= 5e+55) {
tmp = 2.0 * ((b - a) * (Math.cos(Math.pow(Math.cbrt((0.005555555555555556 * (angle * Math.PI))), 3.0)) * (Math.sin(((angle / 180.0) * (Math.sqrt(Math.PI) * Math.sqrt(Math.PI)))) * (b + a))));
} else {
tmp = Math.sin(((angle / 180.0) * Math.PI)) * ((2.0 * (Math.pow((b + a), 2.0) + (a * (a + a)))) * Math.cos((1.0 / (180.0 / (angle * Math.PI)))));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+191) tmp = Float64(Float64(2.0 * Float64(Float64(b - a) * Float64(b + a))) * Float64((cbrt(sin(Float64(pi * Float64(angle * 0.005555555555555556)))) ^ 3.0) * cos(Float64(Float64(angle / 180.0) * Float64(cbrt(pi) * Float64(cbrt(pi) * cbrt(pi))))))); elseif (Float64(angle / 180.0) <= 5e+55) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos((cbrt(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 3.0)) * Float64(sin(Float64(Float64(angle / 180.0) * Float64(sqrt(pi) * sqrt(pi)))) * Float64(b + a))))); else tmp = Float64(sin(Float64(Float64(angle / 180.0) * pi)) * Float64(Float64(2.0 * Float64((Float64(b + a) ^ 2.0) + Float64(a * Float64(a + a)))) * cos(Float64(1.0 / Float64(180.0 / Float64(angle * pi)))))); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+191], N[(N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+55], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[Power[N[Power[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[(2.0 * N[(N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * N[(a + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(180.0 / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+191}:\\
\;\;\;\;\left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \left({\left(\sqrt[3]{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}^{3} \cdot \cos \left(\frac{angle}{180} \cdot \left(\sqrt[3]{\pi} \cdot \left(\sqrt[3]{\pi} \cdot \sqrt[3]{\pi}\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+55}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left({\left(\sqrt[3]{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}^{3}\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right) \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(2 \cdot \left({\left(b + a\right)}^{2} + a \cdot \left(a + a\right)\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5.0000000000000002e191Initial program 19.4%
associate-*l*19.4%
unpow219.4%
unpow219.4%
difference-of-squares19.5%
Simplified19.5%
add-cube-cbrt19.5%
pow319.5%
div-inv22.4%
metadata-eval22.4%
Applied egg-rr22.4%
add-cube-cbrt55.7%
Applied egg-rr55.7%
if -5.0000000000000002e191 < (/.f64 angle 180) < 5.00000000000000046e55Initial program 70.1%
associate-*l*70.1%
unpow270.1%
unpow270.1%
difference-of-squares73.0%
Simplified73.0%
Taylor expanded in angle around inf 83.0%
associate-*r*84.1%
*-commutative84.1%
metadata-eval84.1%
div-inv84.7%
*-commutative84.7%
associate-*r/84.7%
*-commutative84.7%
Applied egg-rr84.7%
associate-/l*84.1%
associate-/r/84.7%
Simplified84.7%
*-commutative84.7%
*-commutative84.7%
associate-*r*82.8%
add-cube-cbrt82.7%
unpow383.3%
rem-cube-cbrt82.0%
unpow381.0%
add-cube-cbrt83.3%
associate-*r*82.1%
*-commutative82.1%
*-commutative82.1%
Applied egg-rr82.1%
add-sqr-sqrt85.5%
Applied egg-rr85.5%
if 5.00000000000000046e55 < (/.f64 angle 180) Initial program 29.6%
*-commutative29.6%
associate-*l*29.6%
unpow229.6%
fma-neg29.6%
unpow229.6%
Simplified29.6%
fma-neg29.6%
prod-diff21.8%
fma-neg21.8%
difference-of-squares21.8%
sub-neg21.8%
distribute-rgt-in17.8%
add-sqr-sqrt9.5%
sqrt-unprod26.0%
sqr-neg26.0%
sqrt-prod16.5%
add-sqr-sqrt34.6%
distribute-rgt-in38.5%
pow238.5%
add-sqr-sqrt20.1%
sqrt-unprod28.7%
sqr-neg28.7%
sqrt-prod18.4%
add-sqr-sqrt38.3%
Applied egg-rr38.3%
fma-udef38.3%
distribute-lft-out38.3%
Simplified38.3%
associate-*r/38.4%
clear-num44.2%
Applied egg-rr44.2%
Final simplification73.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI)) (t_1 (sin t_0)))
(if (<= (* (cos t_0) (* t_1 (* 2.0 (- (pow b 2.0) (pow a 2.0))))) INFINITY)
(*
2.0
(*
(- b a)
(*
(cos (pow (cbrt (* 0.005555555555555556 (* angle PI))) 3.0))
(*
(+ b a)
(log1p (expm1 (sin (* PI (* angle 0.005555555555555556)))))))))
(* 2.0 (* (- b a) (* (+ b a) t_1))))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = sin(t_0);
double tmp;
if ((cos(t_0) * (t_1 * (2.0 * (pow(b, 2.0) - pow(a, 2.0))))) <= ((double) INFINITY)) {
tmp = 2.0 * ((b - a) * (cos(pow(cbrt((0.005555555555555556 * (angle * ((double) M_PI)))), 3.0)) * ((b + a) * log1p(expm1(sin((((double) M_PI) * (angle * 0.005555555555555556))))))));
} else {
tmp = 2.0 * ((b - a) * ((b + a) * 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.sin(t_0);
double tmp;
if ((Math.cos(t_0) * (t_1 * (2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((b - a) * (Math.cos(Math.pow(Math.cbrt((0.005555555555555556 * (angle * Math.PI))), 3.0)) * ((b + a) * Math.log1p(Math.expm1(Math.sin((Math.PI * (angle * 0.005555555555555556))))))));
} else {
tmp = 2.0 * ((b - a) * ((b + a) * t_1));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = sin(t_0) tmp = 0.0 if (Float64(cos(t_0) * Float64(t_1 * Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))))) <= Inf) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos((cbrt(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 3.0)) * Float64(Float64(b + a) * log1p(expm1(sin(Float64(pi * Float64(angle * 0.005555555555555556))))))))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * 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[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[N[(N[Cos[t$95$0], $MachinePrecision] * N[(t$95$1 * N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[Power[N[Power[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Log[1 + N[(Exp[N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := \sin t_0\\
\mathbf{if}\;\cos t_0 \cdot \left(t_1 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left({\left(\sqrt[3]{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}^{3}\right) \cdot \left(\left(b + a\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot t_1\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < +inf.0Initial program 59.8%
associate-*l*59.8%
unpow259.8%
unpow259.8%
difference-of-squares59.8%
Simplified59.8%
Taylor expanded in angle around inf 66.5%
associate-*r*68.0%
*-commutative68.0%
metadata-eval68.0%
div-inv67.9%
*-commutative67.9%
associate-*r/67.6%
*-commutative67.6%
Applied egg-rr67.6%
associate-/l*68.2%
associate-/r/67.9%
Simplified67.9%
*-commutative67.9%
*-commutative67.9%
associate-*r*67.6%
add-cube-cbrt68.1%
unpow369.5%
rem-cube-cbrt69.7%
unpow368.5%
add-cube-cbrt69.5%
associate-*r*68.8%
*-commutative68.8%
*-commutative68.8%
Applied egg-rr68.8%
*-commutative68.8%
div-inv69.8%
metadata-eval69.8%
pow169.8%
metadata-eval69.8%
sqrt-pow130.3%
log1p-expm1-u30.3%
sqrt-pow169.8%
metadata-eval69.8%
pow169.8%
associate-*r*67.9%
*-commutative67.9%
*-commutative67.9%
associate-*r*69.8%
*-commutative69.8%
Applied egg-rr69.8%
if +inf.0 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) Initial program 0.0%
associate-*l*0.0%
unpow20.0%
unpow20.0%
difference-of-squares33.7%
Simplified33.7%
Taylor expanded in angle around inf 53.4%
associate-*r*53.4%
*-commutative53.4%
metadata-eval53.4%
div-inv53.4%
*-commutative53.4%
associate-*r/60.1%
*-commutative60.1%
Applied egg-rr60.1%
associate-/l*53.4%
associate-/r/53.4%
Simplified53.4%
Taylor expanded in angle around 0 80.1%
Final simplification70.4%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (/ angle 180.0) PI))
(t_1 (* 0.005555555555555556 (* angle PI))))
(if (<=
(* (cos t_0) (* (sin t_0) (* 2.0 (- (pow b 2.0) (pow a 2.0)))))
5e+301)
(* 2.0 (* (- b a) (* (cos (pow (cbrt t_1) 3.0)) (* (+ b a) (sin t_1)))))
(* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a)))))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double t_1 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if ((cos(t_0) * (sin(t_0) * (2.0 * (pow(b, 2.0) - pow(a, 2.0))))) <= 5e+301) {
tmp = 2.0 * ((b - a) * (cos(pow(cbrt(t_1), 3.0)) * ((b + a) * sin(t_1))));
} 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 t_0 = (angle / 180.0) * Math.PI;
double t_1 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if ((Math.cos(t_0) * (Math.sin(t_0) * (2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))))) <= 5e+301) {
tmp = 2.0 * ((b - a) * (Math.cos(Math.pow(Math.cbrt(t_1), 3.0)) * ((b + a) * Math.sin(t_1))));
} else {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) t_1 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (Float64(cos(t_0) * Float64(sin(t_0) * Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))))) <= 5e+301) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos((cbrt(t_1) ^ 3.0)) * Float64(Float64(b + a) * sin(t_1))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); 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[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+301], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;\cos t_0 \cdot \left(\sin t_0 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq 5 \cdot 10^{+301}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left({\left(\sqrt[3]{t_1}\right)}^{3}\right) \cdot \left(\left(b + a\right) \cdot \sin t_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < 5.0000000000000004e301Initial program 60.3%
associate-*l*60.3%
unpow260.3%
unpow260.3%
difference-of-squares60.3%
Simplified60.3%
Taylor expanded in angle around inf 65.7%
*-commutative65.9%
*-commutative65.9%
associate-*r*66.5%
add-cube-cbrt66.1%
unpow367.3%
rem-cube-cbrt68.6%
unpow367.1%
add-cube-cbrt67.3%
associate-*r*66.9%
*-commutative66.9%
*-commutative66.9%
Applied egg-rr67.4%
if 5.0000000000000004e301 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) Initial program 42.0%
associate-*l*42.0%
unpow242.0%
unpow242.0%
difference-of-squares51.0%
Simplified51.0%
Taylor expanded in angle around 0 60.0%
associate-*r*74.9%
*-commutative74.9%
+-commutative74.9%
Simplified74.9%
Final simplification69.0%
(FPCore (a b angle)
:precision binary64
(if (<= (- (pow b 2.0) (pow a 2.0)) INFINITY)
(*
2.0
(*
(- b a)
(*
(cos (pow (cbrt (* 0.005555555555555556 (* angle PI))) 3.0))
(* (sin (* (/ angle 180.0) (* (sqrt PI) (sqrt PI)))) (+ b a)))))
(*
(* 2.0 (* (- b a) (+ b a)))
(*
(pow
(cbrt (sin (* (* angle 0.005555555555555556) (cbrt (* PI (* PI PI))))))
3.0)
(cos (* (/ angle 180.0) PI))))))
double code(double a, double b, double angle) {
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= ((double) INFINITY)) {
tmp = 2.0 * ((b - a) * (cos(pow(cbrt((0.005555555555555556 * (angle * ((double) M_PI)))), 3.0)) * (sin(((angle / 180.0) * (sqrt(((double) M_PI)) * sqrt(((double) M_PI))))) * (b + a))));
} else {
tmp = (2.0 * ((b - a) * (b + a))) * (pow(cbrt(sin(((angle * 0.005555555555555556) * cbrt((((double) M_PI) * (((double) M_PI) * ((double) M_PI))))))), 3.0) * cos(((angle / 180.0) * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((b - a) * (Math.cos(Math.pow(Math.cbrt((0.005555555555555556 * (angle * Math.PI))), 3.0)) * (Math.sin(((angle / 180.0) * (Math.sqrt(Math.PI) * Math.sqrt(Math.PI)))) * (b + a))));
} else {
tmp = (2.0 * ((b - a) * (b + a))) * (Math.pow(Math.cbrt(Math.sin(((angle * 0.005555555555555556) * Math.cbrt((Math.PI * (Math.PI * Math.PI)))))), 3.0) * Math.cos(((angle / 180.0) * Math.PI)));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= Inf) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos((cbrt(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 3.0)) * Float64(sin(Float64(Float64(angle / 180.0) * Float64(sqrt(pi) * sqrt(pi)))) * Float64(b + a))))); else tmp = Float64(Float64(2.0 * Float64(Float64(b - a) * Float64(b + a))) * Float64((cbrt(sin(Float64(Float64(angle * 0.005555555555555556) * cbrt(Float64(pi * Float64(pi * pi)))))) ^ 3.0) * cos(Float64(Float64(angle / 180.0) * pi)))); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[Power[N[Power[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[N[Sin[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[Power[N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq \infty:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left({\left(\sqrt[3]{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}^{3}\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right) \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \left({\left(\sqrt[3]{\sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt[3]{\pi \cdot \left(\pi \cdot \pi\right)}\right)}\right)}^{3} \cdot \cos \left(\frac{angle}{180} \cdot \pi\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < +inf.0Initial program 59.8%
associate-*l*59.8%
unpow259.8%
unpow259.8%
difference-of-squares59.8%
Simplified59.8%
Taylor expanded in angle around inf 66.5%
associate-*r*68.0%
*-commutative68.0%
metadata-eval68.0%
div-inv67.9%
*-commutative67.9%
associate-*r/67.6%
*-commutative67.6%
Applied egg-rr67.6%
associate-/l*68.2%
associate-/r/67.9%
Simplified67.9%
*-commutative67.9%
*-commutative67.9%
associate-*r*67.6%
add-cube-cbrt68.1%
unpow369.5%
rem-cube-cbrt69.7%
unpow368.5%
add-cube-cbrt69.5%
associate-*r*68.8%
*-commutative68.8%
*-commutative68.8%
Applied egg-rr68.8%
add-sqr-sqrt70.8%
Applied egg-rr70.8%
if +inf.0 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 0.0%
associate-*l*0.0%
unpow20.0%
unpow20.0%
difference-of-squares33.7%
Simplified33.7%
add-cube-cbrt33.7%
pow333.7%
div-inv33.7%
metadata-eval33.7%
Applied egg-rr33.7%
add-cbrt-cube80.4%
Applied egg-rr80.4%
Final simplification71.4%
(FPCore (a b angle)
:precision binary64
(*
2.0
(*
(- b a)
(*
(cos (pow (cbrt (* 0.005555555555555556 (* angle PI))) 3.0))
(* (sin (* (/ angle 180.0) (* (sqrt PI) (sqrt PI)))) (+ b a))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (cos(pow(cbrt((0.005555555555555556 * (angle * ((double) M_PI)))), 3.0)) * (sin(((angle / 180.0) * (sqrt(((double) M_PI)) * sqrt(((double) M_PI))))) * (b + a))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (Math.cos(Math.pow(Math.cbrt((0.005555555555555556 * (angle * Math.PI))), 3.0)) * (Math.sin(((angle / 180.0) * (Math.sqrt(Math.PI) * Math.sqrt(Math.PI)))) * (b + a))));
}
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(cos((cbrt(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 3.0)) * Float64(sin(Float64(Float64(angle / 180.0) * Float64(sqrt(pi) * sqrt(pi)))) * Float64(b + a))))) end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[Power[N[Power[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left({\left(\sqrt[3]{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}^{3}\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right) \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Initial program 56.3%
associate-*l*56.3%
unpow256.3%
unpow256.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around inf 65.7%
associate-*r*67.2%
*-commutative67.2%
metadata-eval67.2%
div-inv67.1%
*-commutative67.1%
associate-*r/67.2%
*-commutative67.2%
Applied egg-rr67.2%
associate-/l*67.3%
associate-/r/67.1%
Simplified67.1%
*-commutative67.1%
*-commutative67.1%
associate-*r*66.0%
add-cube-cbrt67.7%
unpow368.6%
rem-cube-cbrt69.2%
unpow368.0%
add-cube-cbrt68.6%
associate-*r*67.5%
*-commutative67.5%
*-commutative67.5%
Applied egg-rr67.5%
add-sqr-sqrt69.8%
Applied egg-rr69.8%
Final simplification69.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b 2.9e+47)
(* 2.0 (* (- b a) (* (cos t_0) (* (+ b a) (sin (pow (cbrt t_0) 3.0))))))
(if (<= b 5.8e+153)
(*
2.0
(*
(- b a)
(*
(* (+ b a) (sin (* (/ angle 180.0) PI)))
(cos (/ (* angle PI) 180.0)))))
(if (<= b 1.6e+215)
(* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a))))
(*
(* (sin t_0) (* 2.0 (* b b)))
(cos (pow (cbrt (* PI (* angle 0.005555555555555556))) 3.0))))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b <= 2.9e+47) {
tmp = 2.0 * ((b - a) * (cos(t_0) * ((b + a) * sin(pow(cbrt(t_0), 3.0)))));
} else if (b <= 5.8e+153) {
tmp = 2.0 * ((b - a) * (((b + a) * sin(((angle / 180.0) * ((double) M_PI)))) * cos(((angle * ((double) M_PI)) / 180.0))));
} else if (b <= 1.6e+215) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = (sin(t_0) * (2.0 * (b * b))) * cos(pow(cbrt((((double) M_PI) * (angle * 0.005555555555555556))), 3.0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b <= 2.9e+47) {
tmp = 2.0 * ((b - a) * (Math.cos(t_0) * ((b + a) * Math.sin(Math.pow(Math.cbrt(t_0), 3.0)))));
} else if (b <= 5.8e+153) {
tmp = 2.0 * ((b - a) * (((b + a) * Math.sin(((angle / 180.0) * Math.PI))) * Math.cos(((angle * Math.PI) / 180.0))));
} else if (b <= 1.6e+215) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = (Math.sin(t_0) * (2.0 * (b * b))) * Math.cos(Math.pow(Math.cbrt((Math.PI * (angle * 0.005555555555555556))), 3.0));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b <= 2.9e+47) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(Float64(b + a) * sin((cbrt(t_0) ^ 3.0)))))); elseif (b <= 5.8e+153) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(Float64(b + a) * sin(Float64(Float64(angle / 180.0) * pi))) * cos(Float64(Float64(angle * pi) / 180.0))))); elseif (b <= 1.6e+215) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(Float64(sin(t_0) * Float64(2.0 * Float64(b * b))) * cos((cbrt(Float64(pi * Float64(angle * 0.005555555555555556))) ^ 3.0))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 2.9e+47], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.8e+153], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[(b + a), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.6e+215], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $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}\;b \leq 2.9 \cdot 10^{+47}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\left(b + a\right) \cdot \sin \left({\left(\sqrt[3]{t_0}\right)}^{3}\right)\right)\right)\right)\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{+153}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(\left(b + a\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(\frac{angle \cdot \pi}{180}\right)\right)\right)\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{+215}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sin t_0 \cdot \left(2 \cdot \left(b \cdot b\right)\right)\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\
\end{array}
\end{array}
if b < 2.8999999999999998e47Initial program 59.5%
associate-*l*59.5%
unpow259.5%
unpow259.5%
difference-of-squares60.9%
Simplified60.9%
Taylor expanded in angle around inf 68.2%
*-commutative68.5%
*-commutative68.5%
associate-*r*68.6%
add-cube-cbrt68.8%
unpow370.4%
rem-cube-cbrt70.0%
unpow368.6%
add-cube-cbrt70.4%
associate-*r*68.5%
*-commutative68.5%
*-commutative68.5%
Applied egg-rr69.1%
if 2.8999999999999998e47 < b < 5.80000000000000004e153Initial program 53.9%
associate-*l*53.9%
unpow253.9%
unpow253.9%
difference-of-squares53.9%
Simplified53.9%
Taylor expanded in angle around inf 48.9%
associate-*r*52.8%
*-commutative52.8%
metadata-eval52.8%
div-inv60.3%
*-commutative60.3%
associate-*r/49.1%
*-commutative49.1%
Applied egg-rr49.1%
associate-/l*48.1%
associate-/r/60.3%
Simplified60.3%
associate-*r*52.8%
*-commutative52.8%
metadata-eval52.8%
div-inv60.3%
*-commutative60.3%
associate-*r/49.1%
*-commutative49.1%
Applied egg-rr60.3%
if 5.80000000000000004e153 < b < 1.5999999999999999e215Initial program 18.1%
associate-*l*18.1%
unpow218.1%
unpow218.1%
difference-of-squares26.4%
Simplified26.4%
Taylor expanded in angle around 0 34.7%
associate-*r*58.3%
*-commutative58.3%
+-commutative58.3%
Simplified58.3%
if 1.5999999999999999e215 < b Initial program 47.7%
*-commutative47.7%
associate-*l*47.7%
unpow247.7%
fma-neg58.2%
unpow258.2%
distribute-rgt-neg-in58.2%
Simplified58.2%
Taylor expanded in b around inf 74.0%
unpow274.0%
associate-*r*74.0%
*-commutative74.0%
Simplified74.0%
add-cube-cbrt74.0%
pow374.0%
div-inv74.0%
metadata-eval74.0%
Applied egg-rr84.6%
Final simplification69.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= b 5.4e+153)
(*
2.0
(*
(- b a)
(*
(cos (pow (cbrt t_0) 3.0))
(* (+ b a) (sin (* (/ angle 180.0) PI))))))
(if (<= b 1.6e+215)
(* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a))))
(*
(* (sin t_0) (* 2.0 (* b b)))
(cos (pow (cbrt (* PI (* angle 0.005555555555555556))) 3.0)))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (b <= 5.4e+153) {
tmp = 2.0 * ((b - a) * (cos(pow(cbrt(t_0), 3.0)) * ((b + a) * sin(((angle / 180.0) * ((double) M_PI))))));
} else if (b <= 1.6e+215) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = (sin(t_0) * (2.0 * (b * b))) * cos(pow(cbrt((((double) M_PI) * (angle * 0.005555555555555556))), 3.0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (b <= 5.4e+153) {
tmp = 2.0 * ((b - a) * (Math.cos(Math.pow(Math.cbrt(t_0), 3.0)) * ((b + a) * Math.sin(((angle / 180.0) * Math.PI)))));
} else if (b <= 1.6e+215) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = (Math.sin(t_0) * (2.0 * (b * b))) * Math.cos(Math.pow(Math.cbrt((Math.PI * (angle * 0.005555555555555556))), 3.0));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (b <= 5.4e+153) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos((cbrt(t_0) ^ 3.0)) * Float64(Float64(b + a) * sin(Float64(Float64(angle / 180.0) * pi)))))); elseif (b <= 1.6e+215) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(Float64(sin(t_0) * Float64(2.0 * Float64(b * b))) * cos((cbrt(Float64(pi * Float64(angle * 0.005555555555555556))) ^ 3.0))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 5.4e+153], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.6e+215], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $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}\;b \leq 5.4 \cdot 10^{+153}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left({\left(\sqrt[3]{t_0}\right)}^{3}\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)\right)\right)\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{+215}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sin t_0 \cdot \left(2 \cdot \left(b \cdot b\right)\right)\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\\
\end{array}
\end{array}
if b < 5.4000000000000001e153Initial program 59.1%
associate-*l*59.1%
unpow259.1%
unpow259.1%
difference-of-squares60.4%
Simplified60.4%
Taylor expanded in angle around inf 66.8%
associate-*r*68.0%
*-commutative68.0%
metadata-eval68.0%
div-inv67.9%
*-commutative67.9%
associate-*r/67.1%
*-commutative67.1%
Applied egg-rr67.1%
associate-/l*68.2%
associate-/r/67.9%
Simplified67.9%
*-commutative67.9%
*-commutative67.9%
associate-*r*67.6%
add-cube-cbrt67.7%
unpow369.2%
rem-cube-cbrt69.4%
unpow368.1%
add-cube-cbrt69.2%
associate-*r*67.9%
*-commutative67.9%
*-commutative67.9%
Applied egg-rr67.9%
if 5.4000000000000001e153 < b < 1.5999999999999999e215Initial program 18.1%
associate-*l*18.1%
unpow218.1%
unpow218.1%
difference-of-squares26.4%
Simplified26.4%
Taylor expanded in angle around 0 34.7%
associate-*r*58.3%
*-commutative58.3%
+-commutative58.3%
Simplified58.3%
if 1.5999999999999999e215 < b Initial program 47.7%
*-commutative47.7%
associate-*l*47.7%
unpow247.7%
fma-neg58.2%
unpow258.2%
distribute-rgt-neg-in58.2%
Simplified58.2%
Taylor expanded in b around inf 74.0%
unpow274.0%
associate-*r*74.0%
*-commutative74.0%
Simplified74.0%
add-cube-cbrt74.0%
pow374.0%
div-inv74.0%
metadata-eval74.0%
Applied egg-rr84.6%
Final simplification68.7%
(FPCore (a b angle)
:precision binary64
(*
2.0
(*
(- b a)
(*
(* (+ b a) (sin (* (/ angle 180.0) PI)))
(log (exp (cos (* 0.005555555555555556 (* angle PI)))))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (((b + a) * sin(((angle / 180.0) * ((double) M_PI)))) * log(exp(cos((0.005555555555555556 * (angle * ((double) M_PI))))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (((b + a) * Math.sin(((angle / 180.0) * Math.PI))) * Math.log(Math.exp(Math.cos((0.005555555555555556 * (angle * Math.PI)))))));
}
def code(a, b, angle): return 2.0 * ((b - a) * (((b + a) * math.sin(((angle / 180.0) * math.pi))) * math.log(math.exp(math.cos((0.005555555555555556 * (angle * math.pi)))))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(Float64(b + a) * sin(Float64(Float64(angle / 180.0) * pi))) * log(exp(cos(Float64(0.005555555555555556 * Float64(angle * pi)))))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * (((b + a) * sin(((angle / 180.0) * pi))) * log(exp(cos((0.005555555555555556 * (angle * pi))))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[(b + a), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\left(b + a\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \log \left(e^{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right)\right)
\end{array}
Initial program 56.3%
associate-*l*56.3%
unpow256.3%
unpow256.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around inf 65.7%
associate-*r*67.2%
*-commutative67.2%
metadata-eval67.2%
div-inv67.1%
*-commutative67.1%
associate-*r/67.2%
*-commutative67.2%
Applied egg-rr67.2%
associate-/l*67.3%
associate-/r/67.1%
Simplified67.1%
add-log-exp67.1%
Applied egg-rr67.1%
Final simplification67.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556))))
(if (<= (pow a 2.0) 5e+14)
(* 2.0 (* (* (- b a) (cos t_0)) (* (+ b a) (sin t_0))))
(*
(* (+ b a) (sin (* 0.005555555555555556 (* angle PI))))
(* 2.0 (- b a))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double tmp;
if (pow(a, 2.0) <= 5e+14) {
tmp = 2.0 * (((b - a) * cos(t_0)) * ((b + a) * sin(t_0)));
} else {
tmp = ((b + a) * sin((0.005555555555555556 * (angle * ((double) M_PI))))) * (2.0 * (b - a));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double tmp;
if (Math.pow(a, 2.0) <= 5e+14) {
tmp = 2.0 * (((b - a) * Math.cos(t_0)) * ((b + a) * Math.sin(t_0)));
} else {
tmp = ((b + a) * Math.sin((0.005555555555555556 * (angle * Math.PI)))) * (2.0 * (b - a));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle * 0.005555555555555556) tmp = 0 if math.pow(a, 2.0) <= 5e+14: tmp = 2.0 * (((b - a) * math.cos(t_0)) * ((b + a) * math.sin(t_0))) else: tmp = ((b + a) * math.sin((0.005555555555555556 * (angle * math.pi)))) * (2.0 * (b - a)) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) tmp = 0.0 if ((a ^ 2.0) <= 5e+14) tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * cos(t_0)) * Float64(Float64(b + a) * sin(t_0)))); else tmp = Float64(Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) * Float64(2.0 * Float64(b - a))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle * 0.005555555555555556); tmp = 0.0; if ((a ^ 2.0) <= 5e+14) tmp = 2.0 * (((b - a) * cos(t_0)) * ((b + a) * sin(t_0))); else tmp = ((b + a) * sin((0.005555555555555556 * (angle * pi)))) * (2.0 * (b - a)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+14], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+14}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \cos t_0\right) \cdot \left(\left(b + a\right) \cdot \sin t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(2 \cdot \left(b - a\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 5e14Initial program 62.8%
associate-*l*62.8%
unpow262.8%
unpow262.8%
difference-of-squares62.8%
Simplified62.8%
Taylor expanded in angle around inf 67.2%
associate-*r*67.2%
*-commutative67.2%
*-commutative67.2%
associate-*r*69.1%
*-commutative69.1%
*-commutative69.1%
*-commutative69.1%
associate-*r*67.5%
*-commutative67.5%
+-commutative67.5%
Simplified67.5%
if 5e14 < (pow.f64 a 2) Initial program 49.7%
associate-*l*49.7%
unpow249.7%
unpow249.7%
difference-of-squares53.6%
Simplified53.6%
add-cube-cbrt59.1%
pow359.3%
div-inv59.4%
metadata-eval59.4%
Applied egg-rr59.4%
Taylor expanded in angle around inf 67.6%
associate-*r*67.6%
*-commutative67.6%
+-commutative67.6%
Simplified67.6%
Final simplification67.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle PI)))))
(if (<= b 2.35e+19)
(* (* (+ b a) t_0) (* 2.0 (- b a)))
(if (<= b 4.5e+237)
(* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a))))
(* (cos (/ 1.0 (/ 180.0 (* angle PI)))) (* t_0 (* 2.0 (* b b))))))))
double code(double a, double b, double angle) {
double t_0 = sin((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (b <= 2.35e+19) {
tmp = ((b + a) * t_0) * (2.0 * (b - a));
} else if (b <= 4.5e+237) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = cos((1.0 / (180.0 / (angle * ((double) M_PI))))) * (t_0 * (2.0 * (b * b)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.sin((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (b <= 2.35e+19) {
tmp = ((b + a) * t_0) * (2.0 * (b - a));
} else if (b <= 4.5e+237) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = Math.cos((1.0 / (180.0 / (angle * Math.PI)))) * (t_0 * (2.0 * (b * b)));
}
return tmp;
}
def code(a, b, angle): t_0 = math.sin((0.005555555555555556 * (angle * math.pi))) tmp = 0 if b <= 2.35e+19: tmp = ((b + a) * t_0) * (2.0 * (b - a)) elif b <= 4.5e+237: tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) else: tmp = math.cos((1.0 / (180.0 / (angle * math.pi)))) * (t_0 * (2.0 * (b * b))) return tmp
function code(a, b, angle) t_0 = sin(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (b <= 2.35e+19) tmp = Float64(Float64(Float64(b + a) * t_0) * Float64(2.0 * Float64(b - a))); elseif (b <= 4.5e+237) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(cos(Float64(1.0 / Float64(180.0 / Float64(angle * pi)))) * Float64(t_0 * Float64(2.0 * Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = sin((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (b <= 2.35e+19) tmp = ((b + a) * t_0) * (2.0 * (b - a)); elseif (b <= 4.5e+237) tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); else tmp = cos((1.0 / (180.0 / (angle * pi)))) * (t_0 * (2.0 * (b * b))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, 2.35e+19], N[(N[(N[(b + a), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.5e+237], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(1.0 / N[(180.0 / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;b \leq 2.35 \cdot 10^{+19}:\\
\;\;\;\;\left(\left(b + a\right) \cdot t_0\right) \cdot \left(2 \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+237}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right) \cdot \left(t_0 \cdot \left(2 \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.35e19Initial program 59.3%
associate-*l*59.3%
unpow259.3%
unpow259.3%
difference-of-squares60.9%
Simplified60.9%
add-cube-cbrt61.2%
pow362.7%
div-inv63.1%
metadata-eval63.1%
Applied egg-rr63.1%
Taylor expanded in angle around inf 67.1%
associate-*r*67.1%
*-commutative67.1%
+-commutative67.1%
Simplified67.1%
if 2.35e19 < b < 4.49999999999999964e237Initial program 43.7%
associate-*l*43.7%
unpow243.7%
unpow243.7%
difference-of-squares46.4%
Simplified46.4%
Taylor expanded in angle around 0 48.0%
associate-*r*55.5%
*-commutative55.5%
+-commutative55.5%
Simplified55.5%
if 4.49999999999999964e237 < b Initial program 47.4%
*-commutative47.4%
associate-*l*47.4%
unpow247.4%
fma-neg59.2%
unpow259.2%
distribute-rgt-neg-in59.2%
Simplified59.2%
Taylor expanded in b around inf 76.9%
unpow276.9%
associate-*r*76.9%
*-commutative76.9%
Simplified76.9%
associate-*r/71.0%
clear-num76.9%
Applied egg-rr76.9%
Final simplification66.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))) (t_1 (sin t_0)))
(if (<= b 1.7e+46)
(* 2.0 (* (- b a) (* (* (+ b a) t_1) (cos t_0))))
(if (<= b 3.5e+240)
(* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a))))
(* (cos (/ 1.0 (/ 180.0 (* angle PI)))) (* t_1 (* 2.0 (* b b))))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double tmp;
if (b <= 1.7e+46) {
tmp = 2.0 * ((b - a) * (((b + a) * t_1) * cos(t_0)));
} else if (b <= 3.5e+240) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = cos((1.0 / (180.0 / (angle * ((double) M_PI))))) * (t_1 * (2.0 * (b * b)));
}
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);
double tmp;
if (b <= 1.7e+46) {
tmp = 2.0 * ((b - a) * (((b + a) * t_1) * Math.cos(t_0)));
} else if (b <= 3.5e+240) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = Math.cos((1.0 / (180.0 / (angle * Math.PI)))) * (t_1 * (2.0 * (b * b)));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.sin(t_0) tmp = 0 if b <= 1.7e+46: tmp = 2.0 * ((b - a) * (((b + a) * t_1) * math.cos(t_0))) elif b <= 3.5e+240: tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) else: tmp = math.cos((1.0 / (180.0 / (angle * math.pi)))) * (t_1 * (2.0 * (b * b))) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) tmp = 0.0 if (b <= 1.7e+46) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(Float64(b + a) * t_1) * cos(t_0)))); elseif (b <= 3.5e+240) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(cos(Float64(1.0 / Float64(180.0 / Float64(angle * pi)))) * Float64(t_1 * Float64(2.0 * Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); t_1 = sin(t_0); tmp = 0.0; if (b <= 1.7e+46) tmp = 2.0 * ((b - a) * (((b + a) * t_1) * cos(t_0))); elseif (b <= 3.5e+240) tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); else tmp = cos((1.0 / (180.0 / (angle * pi)))) * (t_1 * (2.0 * (b * b))); 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[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[b, 1.7e+46], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[(b + a), $MachinePrecision] * t$95$1), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.5e+240], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(1.0 / N[(180.0 / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t_0\\
\mathbf{if}\;b \leq 1.7 \cdot 10^{+46}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(\left(b + a\right) \cdot t_1\right) \cdot \cos t_0\right)\right)\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{+240}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right) \cdot \left(t_1 \cdot \left(2 \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.6999999999999999e46Initial program 59.6%
associate-*l*59.6%
unpow259.6%
unpow259.6%
difference-of-squares61.0%
Simplified61.0%
Taylor expanded in angle around inf 68.4%
if 1.6999999999999999e46 < b < 3.50000000000000033e240Initial program 40.0%
associate-*l*40.0%
unpow240.0%
unpow240.0%
difference-of-squares43.1%
Simplified43.1%
Taylor expanded in angle around 0 45.7%
associate-*r*54.5%
*-commutative54.5%
+-commutative54.5%
Simplified54.5%
if 3.50000000000000033e240 < b Initial program 47.4%
*-commutative47.4%
associate-*l*47.4%
unpow247.4%
fma-neg59.2%
unpow259.2%
distribute-rgt-neg-in59.2%
Simplified59.2%
Taylor expanded in b around inf 76.9%
unpow276.9%
associate-*r*76.9%
*-commutative76.9%
Simplified76.9%
associate-*r/71.0%
clear-num76.9%
Applied egg-rr76.9%
Final simplification67.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (sin (* 0.005555555555555556 (* angle PI)))))
(if (<= b 2.1e+19)
(* (* (+ b a) t_0) (* 2.0 (- b a)))
(if (<= b 3e+240)
(* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a))))
(* (* t_0 (* 2.0 (* b b))) (cos (/ (* angle PI) 180.0)))))))
double code(double a, double b, double angle) {
double t_0 = sin((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (b <= 2.1e+19) {
tmp = ((b + a) * t_0) * (2.0 * (b - a));
} else if (b <= 3e+240) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = (t_0 * (2.0 * (b * b))) * 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)));
double tmp;
if (b <= 2.1e+19) {
tmp = ((b + a) * t_0) * (2.0 * (b - a));
} else if (b <= 3e+240) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = (t_0 * (2.0 * (b * b))) * Math.cos(((angle * Math.PI) / 180.0));
}
return tmp;
}
def code(a, b, angle): t_0 = math.sin((0.005555555555555556 * (angle * math.pi))) tmp = 0 if b <= 2.1e+19: tmp = ((b + a) * t_0) * (2.0 * (b - a)) elif b <= 3e+240: tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) else: tmp = (t_0 * (2.0 * (b * b))) * math.cos(((angle * math.pi) / 180.0)) return tmp
function code(a, b, angle) t_0 = sin(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (b <= 2.1e+19) tmp = Float64(Float64(Float64(b + a) * t_0) * Float64(2.0 * Float64(b - a))); elseif (b <= 3e+240) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(Float64(t_0 * Float64(2.0 * Float64(b * b))) * cos(Float64(Float64(angle * pi) / 180.0))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = sin((0.005555555555555556 * (angle * pi))); tmp = 0.0; if (b <= 2.1e+19) tmp = ((b + a) * t_0) * (2.0 * (b - a)); elseif (b <= 3e+240) tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); else tmp = (t_0 * (2.0 * (b * b))) * cos(((angle * pi) / 180.0)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, 2.1e+19], N[(N[(N[(b + a), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e+240], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;b \leq 2.1 \cdot 10^{+19}:\\
\;\;\;\;\left(\left(b + a\right) \cdot t_0\right) \cdot \left(2 \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;b \leq 3 \cdot 10^{+240}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_0 \cdot \left(2 \cdot \left(b \cdot b\right)\right)\right) \cdot \cos \left(\frac{angle \cdot \pi}{180}\right)\\
\end{array}
\end{array}
if b < 2.1e19Initial program 59.3%
associate-*l*59.3%
unpow259.3%
unpow259.3%
difference-of-squares60.9%
Simplified60.9%
add-cube-cbrt61.2%
pow362.7%
div-inv63.1%
metadata-eval63.1%
Applied egg-rr63.1%
Taylor expanded in angle around inf 67.1%
associate-*r*67.1%
*-commutative67.1%
+-commutative67.1%
Simplified67.1%
if 2.1e19 < b < 2.9999999999999999e240Initial program 43.7%
associate-*l*43.7%
unpow243.7%
unpow243.7%
difference-of-squares46.4%
Simplified46.4%
Taylor expanded in angle around 0 48.0%
associate-*r*55.5%
*-commutative55.5%
+-commutative55.5%
Simplified55.5%
if 2.9999999999999999e240 < b Initial program 47.4%
*-commutative47.4%
associate-*l*47.4%
unpow247.4%
fma-neg59.2%
unpow259.2%
distribute-rgt-neg-in59.2%
Simplified59.2%
Taylor expanded in b around inf 76.9%
unpow276.9%
associate-*r*76.9%
*-commutative76.9%
Simplified76.9%
associate-*r/82.7%
Applied egg-rr82.7%
Final simplification66.4%
(FPCore (a b angle)
:precision binary64
(*
2.0
(*
(- b a)
(*
(* (+ b a) (sin (* (/ angle 180.0) PI)))
(cos (* 0.005555555555555556 (* angle PI)))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (((b + a) * sin(((angle / 180.0) * ((double) M_PI)))) * cos((0.005555555555555556 * (angle * ((double) M_PI))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (((b + a) * Math.sin(((angle / 180.0) * Math.PI))) * Math.cos((0.005555555555555556 * (angle * Math.PI)))));
}
def code(a, b, angle): return 2.0 * ((b - a) * (((b + a) * math.sin(((angle / 180.0) * math.pi))) * math.cos((0.005555555555555556 * (angle * math.pi)))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(Float64(b + a) * sin(Float64(Float64(angle / 180.0) * pi))) * cos(Float64(0.005555555555555556 * Float64(angle * pi)))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * (((b + a) * sin(((angle / 180.0) * pi))) * cos((0.005555555555555556 * (angle * pi))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[(b + a), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\left(b + a\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 56.3%
associate-*l*56.3%
unpow256.3%
unpow256.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around inf 65.7%
associate-*r*67.2%
*-commutative67.2%
metadata-eval67.2%
div-inv67.1%
*-commutative67.1%
associate-*r/67.2%
*-commutative67.2%
Applied egg-rr67.2%
associate-/l*67.3%
associate-/r/67.1%
Simplified67.1%
Final simplification67.1%
(FPCore (a b angle) :precision binary64 (if (<= (pow b 2.0) 5e+38) (* (* (+ b a) (sin (* 0.005555555555555556 (* angle PI)))) (* 2.0 (- b a))) (* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a))))))
double code(double a, double b, double angle) {
double tmp;
if (pow(b, 2.0) <= 5e+38) {
tmp = ((b + a) * sin((0.005555555555555556 * (angle * ((double) M_PI))))) * (2.0 * (b - a));
} 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 (Math.pow(b, 2.0) <= 5e+38) {
tmp = ((b + a) * Math.sin((0.005555555555555556 * (angle * Math.PI)))) * (2.0 * (b - a));
} else {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if math.pow(b, 2.0) <= 5e+38: tmp = ((b + a) * math.sin((0.005555555555555556 * (angle * math.pi)))) * (2.0 * (b - a)) else: tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) return tmp
function code(a, b, angle) tmp = 0.0 if ((b ^ 2.0) <= 5e+38) tmp = Float64(Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) * Float64(2.0 * Float64(b - a))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b ^ 2.0) <= 5e+38) tmp = ((b + a) * sin((0.005555555555555556 * (angle * pi)))) * (2.0 * (b - a)); else tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 5e+38], N[(N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 5 \cdot 10^{+38}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(2 \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 4.9999999999999997e38Initial program 64.7%
associate-*l*64.7%
unpow264.7%
unpow264.7%
difference-of-squares64.7%
Simplified64.7%
add-cube-cbrt66.1%
pow367.6%
div-inv67.7%
metadata-eval67.7%
Applied egg-rr67.7%
Taylor expanded in angle around inf 70.9%
associate-*r*70.9%
*-commutative70.9%
+-commutative70.9%
Simplified70.9%
if 4.9999999999999997e38 < (pow.f64 b 2) Initial program 45.6%
associate-*l*45.6%
unpow245.6%
unpow245.6%
difference-of-squares50.1%
Simplified50.1%
Taylor expanded in angle around 0 52.7%
associate-*r*61.8%
*-commutative61.8%
+-commutative61.8%
Simplified61.8%
Final simplification66.9%
(FPCore (a b angle)
:precision binary64
(if (<= a 2e+183)
(* 2.0 (* (+ b a) (* (- b a) (sin (* angle (* PI 0.005555555555555556))))))
(if (<= a 8.5e+299)
(* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a))))
(* (* angle PI) (* (pow (+ b a) 2.0) 0.011111111111111112)))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2e+183) {
tmp = 2.0 * ((b + a) * ((b - a) * sin((angle * (((double) M_PI) * 0.005555555555555556)))));
} else if (a <= 8.5e+299) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = (angle * ((double) M_PI)) * (pow((b + a), 2.0) * 0.011111111111111112);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2e+183) {
tmp = 2.0 * ((b + a) * ((b - a) * Math.sin((angle * (Math.PI * 0.005555555555555556)))));
} else if (a <= 8.5e+299) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = (angle * Math.PI) * (Math.pow((b + a), 2.0) * 0.011111111111111112);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2e+183: tmp = 2.0 * ((b + a) * ((b - a) * math.sin((angle * (math.pi * 0.005555555555555556))))) elif a <= 8.5e+299: tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) else: tmp = (angle * math.pi) * (math.pow((b + a), 2.0) * 0.011111111111111112) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2e+183) tmp = Float64(2.0 * Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(angle * Float64(pi * 0.005555555555555556)))))); elseif (a <= 8.5e+299) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(Float64(angle * pi) * Float64((Float64(b + a) ^ 2.0) * 0.011111111111111112)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2e+183) tmp = 2.0 * ((b + a) * ((b - a) * sin((angle * (pi * 0.005555555555555556))))); elseif (a <= 8.5e+299) tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); else tmp = (angle * pi) * (((b + a) ^ 2.0) * 0.011111111111111112); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2e+183], N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.5e+299], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * Pi), $MachinePrecision] * N[(N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2 \cdot 10^{+183}:\\
\;\;\;\;2 \cdot \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{+299}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot \pi\right) \cdot \left({\left(b + a\right)}^{2} \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if a < 1.99999999999999989e183Initial program 56.7%
associate-*l*56.7%
unpow256.7%
unpow256.7%
difference-of-squares57.6%
Simplified57.6%
add-cube-cbrt60.7%
pow362.0%
div-inv61.1%
metadata-eval61.1%
Applied egg-rr61.1%
Taylor expanded in angle around inf 64.6%
associate-*r*64.6%
*-commutative64.6%
associate-*l*63.5%
+-commutative63.5%
Simplified63.5%
if 1.99999999999999989e183 < a < 8.50000000000000045e299Initial program 55.4%
associate-*l*55.4%
unpow255.4%
unpow255.4%
difference-of-squares67.1%
Simplified67.1%
Taylor expanded in angle around 0 63.3%
associate-*r*88.3%
*-commutative88.3%
+-commutative88.3%
Simplified88.3%
if 8.50000000000000045e299 < a Initial program 33.3%
*-commutative33.3%
associate-*l*33.3%
unpow233.3%
fma-neg33.3%
unpow233.3%
Simplified33.3%
Applied egg-rr66.7%
log-pow66.7%
sin-066.7%
+-lft-identity66.7%
associate-*l*66.7%
*-commutative66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in angle around 0 100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*100.0%
+-commutative100.0%
Simplified100.0%
Final simplification66.5%
(FPCore (a b angle) :precision binary64 (if (<= a 8.5e+299) (* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a)))) (* (* angle PI) (* (pow (+ b a) 2.0) 0.011111111111111112))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 8.5e+299) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
} else {
tmp = (angle * ((double) M_PI)) * (pow((b + a), 2.0) * 0.011111111111111112);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 8.5e+299) {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
} else {
tmp = (angle * Math.PI) * (Math.pow((b + a), 2.0) * 0.011111111111111112);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 8.5e+299: tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) else: tmp = (angle * math.pi) * (math.pow((b + a), 2.0) * 0.011111111111111112) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 8.5e+299) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); else tmp = Float64(Float64(angle * pi) * Float64((Float64(b + a) ^ 2.0) * 0.011111111111111112)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 8.5e+299) tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); else tmp = (angle * pi) * (((b + a) ^ 2.0) * 0.011111111111111112); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 8.5e+299], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * Pi), $MachinePrecision] * N[(N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.5 \cdot 10^{+299}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot \pi\right) \cdot \left({\left(b + a\right)}^{2} \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if a < 8.50000000000000045e299Initial program 56.6%
associate-*l*56.6%
unpow256.6%
unpow256.6%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around 0 57.1%
associate-*r*63.4%
*-commutative63.4%
+-commutative63.4%
Simplified63.4%
if 8.50000000000000045e299 < a Initial program 33.3%
*-commutative33.3%
associate-*l*33.3%
unpow233.3%
fma-neg33.3%
unpow233.3%
Simplified33.3%
Applied egg-rr66.7%
log-pow66.7%
sin-066.7%
+-lft-identity66.7%
associate-*l*66.7%
*-commutative66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in angle around 0 100.0%
*-commutative100.0%
associate-*r*100.0%
associate-*l*100.0%
+-commutative100.0%
Simplified100.0%
Final simplification63.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.011111111111111112 (* angle (* PI (* b b))))))
(if (<= a 1.2e-23)
t_0
(if (<= a 6.2e+34)
(* angle (* (* PI (* a a)) -0.011111111111111112))
(if (<= a 5.2e+47)
t_0
(* 0.011111111111111112 (* angle (* (- b a) (* a PI)))))))))
double code(double a, double b, double angle) {
double t_0 = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
double tmp;
if (a <= 1.2e-23) {
tmp = t_0;
} else if (a <= 6.2e+34) {
tmp = angle * ((((double) M_PI) * (a * a)) * -0.011111111111111112);
} else if (a <= 5.2e+47) {
tmp = t_0;
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
double tmp;
if (a <= 1.2e-23) {
tmp = t_0;
} else if (a <= 6.2e+34) {
tmp = angle * ((Math.PI * (a * a)) * -0.011111111111111112);
} else if (a <= 5.2e+47) {
tmp = t_0;
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.011111111111111112 * (angle * (math.pi * (b * b))) tmp = 0 if a <= 1.2e-23: tmp = t_0 elif a <= 6.2e+34: tmp = angle * ((math.pi * (a * a)) * -0.011111111111111112) elif a <= 5.2e+47: tmp = t_0 else: tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) return tmp
function code(a, b, angle) t_0 = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))) tmp = 0.0 if (a <= 1.2e-23) tmp = t_0; elseif (a <= 6.2e+34) tmp = Float64(angle * Float64(Float64(pi * Float64(a * a)) * -0.011111111111111112)); elseif (a <= 5.2e+47) tmp = t_0; else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.011111111111111112 * (angle * (pi * (b * b))); tmp = 0.0; if (a <= 1.2e-23) tmp = t_0; elseif (a <= 6.2e+34) tmp = angle * ((pi * (a * a)) * -0.011111111111111112); elseif (a <= 5.2e+47) tmp = t_0; else tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 1.2e-23], t$95$0, If[LessEqual[a, 6.2e+34], N[(angle * N[(N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e+47], t$95$0, N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{if}\;a \leq 1.2 \cdot 10^{-23}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{+34}:\\
\;\;\;\;angle \cdot \left(\left(\pi \cdot \left(a \cdot a\right)\right) \cdot -0.011111111111111112\right)\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{+47}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.19999999999999998e-23 or 6.19999999999999955e34 < a < 5.20000000000000007e47Initial program 57.9%
associate-*l*57.9%
unpow257.9%
unpow257.9%
difference-of-squares59.0%
Simplified59.0%
Taylor expanded in angle around 0 57.1%
Taylor expanded in b around inf 42.7%
*-commutative42.7%
unpow242.7%
Simplified42.7%
if 1.19999999999999998e-23 < a < 6.19999999999999955e34Initial program 47.9%
associate-*l*47.9%
unpow247.9%
unpow247.9%
difference-of-squares47.9%
Simplified47.9%
Taylor expanded in angle around 0 37.9%
Taylor expanded in b around 0 38.4%
*-commutative38.4%
associate-*l*38.4%
*-commutative38.4%
unpow238.4%
Simplified38.4%
if 5.20000000000000007e47 < a Initial program 52.3%
associate-*l*52.3%
unpow252.3%
unpow252.3%
difference-of-squares57.9%
Simplified57.9%
Taylor expanded in angle around 0 57.8%
Taylor expanded in a around inf 54.2%
*-commutative54.2%
Simplified54.2%
Final simplification45.0%
(FPCore (a b angle) :precision binary64 (if (<= b 1.7e-71) (* angle (* (* PI (* a a)) -0.011111111111111112)) (* 0.011111111111111112 (* angle (* (- b a) (* b PI))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.7e-71) {
tmp = angle * ((((double) M_PI) * (a * a)) * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.7e-71) {
tmp = angle * ((Math.PI * (a * a)) * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.7e-71: tmp = angle * ((math.pi * (a * a)) * -0.011111111111111112) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (b * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.7e-71) tmp = Float64(angle * Float64(Float64(pi * Float64(a * a)) * -0.011111111111111112)); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(b * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.7e-71) tmp = angle * ((pi * (a * a)) * -0.011111111111111112); else tmp = 0.011111111111111112 * (angle * ((b - a) * (b * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.7e-71], N[(angle * N[(N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.7 \cdot 10^{-71}:\\
\;\;\;\;angle \cdot \left(\left(\pi \cdot \left(a \cdot a\right)\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.70000000000000002e-71Initial program 59.4%
associate-*l*59.4%
unpow259.4%
unpow259.4%
difference-of-squares61.2%
Simplified61.2%
Taylor expanded in angle around 0 59.3%
Taylor expanded in b around 0 43.6%
*-commutative43.6%
associate-*l*43.6%
*-commutative43.6%
unpow243.6%
Simplified43.6%
if 1.70000000000000002e-71 < b Initial program 49.4%
associate-*l*49.4%
unpow249.4%
unpow249.4%
difference-of-squares51.9%
Simplified51.9%
Taylor expanded in angle around 0 50.1%
Taylor expanded in a around 0 48.4%
*-commutative48.4%
Simplified48.4%
Final simplification45.1%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* (- b a) (* PI (+ b a))))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (b + a))));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (b + a))));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * ((b - a) * (math.pi * (b + a))))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(b + a))))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (b + a)))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Initial program 56.3%
associate-*l*56.3%
unpow256.3%
unpow256.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around 0 56.5%
Final simplification56.5%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
}
def code(a, b, angle): return 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)
\end{array}
Initial program 56.3%
associate-*l*56.3%
unpow256.3%
unpow256.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around 0 56.5%
associate-*r*62.7%
*-commutative62.7%
+-commutative62.7%
Simplified62.7%
Final simplification62.7%
(FPCore (a b angle) :precision binary64 (if (<= b 1.8e-71) (* angle (* (* PI (* a a)) -0.011111111111111112)) (* angle (* (* b PI) (* b 0.011111111111111112)))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.8e-71) {
tmp = angle * ((((double) M_PI) * (a * a)) * -0.011111111111111112);
} else {
tmp = angle * ((b * ((double) M_PI)) * (b * 0.011111111111111112));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.8e-71) {
tmp = angle * ((Math.PI * (a * a)) * -0.011111111111111112);
} else {
tmp = angle * ((b * Math.PI) * (b * 0.011111111111111112));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.8e-71: tmp = angle * ((math.pi * (a * a)) * -0.011111111111111112) else: tmp = angle * ((b * math.pi) * (b * 0.011111111111111112)) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.8e-71) tmp = Float64(angle * Float64(Float64(pi * Float64(a * a)) * -0.011111111111111112)); else tmp = Float64(angle * Float64(Float64(b * pi) * Float64(b * 0.011111111111111112))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.8e-71) tmp = angle * ((pi * (a * a)) * -0.011111111111111112); else tmp = angle * ((b * pi) * (b * 0.011111111111111112)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.8e-71], N[(angle * N[(N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(angle * N[(N[(b * Pi), $MachinePrecision] * N[(b * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.8 \cdot 10^{-71}:\\
\;\;\;\;angle \cdot \left(\left(\pi \cdot \left(a \cdot a\right)\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\left(b \cdot \pi\right) \cdot \left(b \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if b < 1.8e-71Initial program 59.4%
associate-*l*59.4%
unpow259.4%
unpow259.4%
difference-of-squares61.2%
Simplified61.2%
Taylor expanded in angle around 0 59.3%
Taylor expanded in b around 0 43.6%
*-commutative43.6%
associate-*l*43.6%
*-commutative43.6%
unpow243.6%
Simplified43.6%
if 1.8e-71 < b Initial program 49.4%
associate-*l*49.4%
unpow249.4%
unpow249.4%
difference-of-squares51.9%
Simplified51.9%
Taylor expanded in angle around 0 50.1%
Taylor expanded in b around inf 45.3%
*-commutative45.3%
unpow245.3%
Simplified45.3%
Taylor expanded in angle around 0 45.3%
*-commutative45.3%
*-commutative45.3%
unpow245.3%
associate-*l*45.2%
associate-*r*45.1%
associate-*l*46.4%
Simplified46.4%
Final simplification44.5%
(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.3%
associate-*l*56.3%
unpow256.3%
unpow256.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around 0 56.5%
Taylor expanded in b around inf 35.6%
*-commutative35.6%
unpow235.6%
Simplified35.6%
Final simplification35.6%
(FPCore (a b angle) :precision binary64 (* angle (* (* b PI) (* b 0.011111111111111112))))
double code(double a, double b, double angle) {
return angle * ((b * ((double) M_PI)) * (b * 0.011111111111111112));
}
public static double code(double a, double b, double angle) {
return angle * ((b * Math.PI) * (b * 0.011111111111111112));
}
def code(a, b, angle): return angle * ((b * math.pi) * (b * 0.011111111111111112))
function code(a, b, angle) return Float64(angle * Float64(Float64(b * pi) * Float64(b * 0.011111111111111112))) end
function tmp = code(a, b, angle) tmp = angle * ((b * pi) * (b * 0.011111111111111112)); end
code[a_, b_, angle_] := N[(angle * N[(N[(b * Pi), $MachinePrecision] * N[(b * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
angle \cdot \left(\left(b \cdot \pi\right) \cdot \left(b \cdot 0.011111111111111112\right)\right)
\end{array}
Initial program 56.3%
associate-*l*56.3%
unpow256.3%
unpow256.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around 0 56.5%
Taylor expanded in b around inf 35.6%
*-commutative35.6%
unpow235.6%
Simplified35.6%
Taylor expanded in angle around 0 35.6%
*-commutative35.6%
*-commutative35.6%
unpow235.6%
associate-*l*35.6%
associate-*r*35.6%
associate-*l*36.0%
Simplified36.0%
Final simplification36.0%
herbie shell --seed 2023200
(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)))))