
(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 21 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 (* PI (/ angle 180.0))) (t_1 (sin t_0)))
(if (<= (/ angle 180.0) -2e+207)
(*
t_1
(*
(* 2.0 (pow (pow (pow (+ b a) 2.0) 3.0) 0.3333333333333333))
(cos t_0)))
(*
2.0
(*
(* t_1 (+ b a))
(* (- b a) (cos (* PI (* 0.005555555555555556 angle)))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double t_1 = sin(t_0);
double tmp;
if ((angle / 180.0) <= -2e+207) {
tmp = t_1 * ((2.0 * pow(pow(pow((b + a), 2.0), 3.0), 0.3333333333333333)) * cos(t_0));
} else {
tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * cos((((double) M_PI) * (0.005555555555555556 * angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
double t_1 = Math.sin(t_0);
double tmp;
if ((angle / 180.0) <= -2e+207) {
tmp = t_1 * ((2.0 * Math.pow(Math.pow(Math.pow((b + a), 2.0), 3.0), 0.3333333333333333)) * Math.cos(t_0));
} else {
tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * Math.cos((Math.PI * (0.005555555555555556 * angle)))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) t_1 = math.sin(t_0) tmp = 0 if (angle / 180.0) <= -2e+207: tmp = t_1 * ((2.0 * math.pow(math.pow(math.pow((b + a), 2.0), 3.0), 0.3333333333333333)) * math.cos(t_0)) else: tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * math.cos((math.pi * (0.005555555555555556 * angle))))) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) t_1 = sin(t_0) tmp = 0.0 if (Float64(angle / 180.0) <= -2e+207) tmp = Float64(t_1 * Float64(Float64(2.0 * (((Float64(b + a) ^ 2.0) ^ 3.0) ^ 0.3333333333333333)) * cos(t_0))); else tmp = Float64(2.0 * Float64(Float64(t_1 * Float64(b + a)) * Float64(Float64(b - a) * cos(Float64(pi * Float64(0.005555555555555556 * angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle / 180.0); t_1 = sin(t_0); tmp = 0.0; if ((angle / 180.0) <= -2e+207) tmp = t_1 * ((2.0 * ((((b + a) ^ 2.0) ^ 3.0) ^ 0.3333333333333333)) * cos(t_0)); else tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * cos((pi * (0.005555555555555556 * angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+207], N[(t$95$1 * N[(N[(2.0 * N[Power[N[Power[N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t$95$1 * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
t_1 := \sin t_0\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+207}:\\
\;\;\;\;t_1 \cdot \left(\left(2 \cdot {\left({\left({\left(b + a\right)}^{2}\right)}^{3}\right)}^{0.3333333333333333}\right) \cdot \cos t_0\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2.0000000000000001e207Initial program 21.2%
*-commutative21.2%
associate-*l*21.2%
unpow221.2%
fma-neg21.2%
unpow221.2%
Simplified21.2%
add-cbrt-cube22.3%
pow1/343.8%
pow343.8%
fma-neg39.8%
difference-of-squares43.8%
sub-neg43.8%
distribute-rgt-in39.8%
add-sqr-sqrt18.0%
sqrt-unprod44.6%
sqr-neg44.6%
sqrt-prod26.6%
add-sqr-sqrt40.7%
distribute-rgt-in44.7%
pow244.7%
Applied egg-rr44.7%
if -2.0000000000000001e207 < (/.f64 angle 180) Initial program 56.3%
associate-*l*56.2%
unpow256.2%
unpow256.2%
difference-of-squares58.9%
Simplified58.9%
Taylor expanded in angle around inf 71.3%
associate-*r*71.3%
*-commutative71.3%
*-commutative71.3%
associate-*r*73.1%
*-commutative73.1%
*-commutative73.1%
*-commutative73.1%
associate-*r*72.7%
*-commutative72.7%
+-commutative72.7%
Simplified72.7%
*-commutative72.7%
metadata-eval72.7%
div-inv74.4%
Applied egg-rr74.4%
Final simplification71.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cbrt (cos (* PI (* 0.005555555555555556 angle))))))
(*
2.0
(*
(* (- b a) (* (* t_0 t_0) (cbrt (cos (/ (* PI angle) 180.0)))))
(* (sin (* PI (/ angle 180.0))) (+ b a))))))
double code(double a, double b, double angle) {
double t_0 = cbrt(cos((((double) M_PI) * (0.005555555555555556 * angle))));
return 2.0 * (((b - a) * ((t_0 * t_0) * cbrt(cos(((((double) M_PI) * angle) / 180.0))))) * (sin((((double) M_PI) * (angle / 180.0))) * (b + a)));
}
public static double code(double a, double b, double angle) {
double t_0 = Math.cbrt(Math.cos((Math.PI * (0.005555555555555556 * angle))));
return 2.0 * (((b - a) * ((t_0 * t_0) * Math.cbrt(Math.cos(((Math.PI * angle) / 180.0))))) * (Math.sin((Math.PI * (angle / 180.0))) * (b + a)));
}
function code(a, b, angle) t_0 = cbrt(cos(Float64(pi * Float64(0.005555555555555556 * angle)))) return Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(Float64(t_0 * t_0) * cbrt(cos(Float64(Float64(pi * angle) / 180.0))))) * Float64(sin(Float64(pi * Float64(angle / 180.0))) * Float64(b + a)))) end
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]}, N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(N[(t$95$0 * t$95$0), $MachinePrecision] * N[Power[N[Cos[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\\
2 \cdot \left(\left(\left(b - a\right) \cdot \left(\left(t_0 \cdot t_0\right) \cdot \sqrt[3]{\cos \left(\frac{\pi \cdot angle}{180}\right)}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(b + a\right)\right)\right)
\end{array}
\end{array}
Initial program 52.8%
associate-*l*52.8%
unpow252.8%
unpow252.8%
difference-of-squares55.6%
Simplified55.6%
Taylor expanded in angle around inf 66.8%
associate-*r*66.8%
*-commutative66.8%
*-commutative66.8%
associate-*r*68.3%
*-commutative68.3%
*-commutative68.3%
*-commutative68.3%
associate-*r*67.7%
*-commutative67.7%
+-commutative67.7%
Simplified67.7%
*-commutative67.7%
metadata-eval67.7%
div-inv69.2%
Applied egg-rr69.2%
add-cube-cbrt69.2%
Applied egg-rr69.2%
*-commutative69.2%
metadata-eval69.2%
div-inv67.1%
associate-*r/69.4%
Applied egg-rr69.4%
Final simplification69.4%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (/ angle 180.0))) (t_1 (sin t_0)))
(if (<= (/ angle 180.0) -2e+207)
(* t_1 (* (cos t_0) (* 2.0 (+ (pow (+ b a) 2.0) (* a (+ a a))))))
(*
2.0
(*
(* t_1 (+ b a))
(* (- b a) (cos (* PI (* 0.005555555555555556 angle)))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double t_1 = sin(t_0);
double tmp;
if ((angle / 180.0) <= -2e+207) {
tmp = t_1 * (cos(t_0) * (2.0 * (pow((b + a), 2.0) + (a * (a + a)))));
} else {
tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * cos((((double) M_PI) * (0.005555555555555556 * angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
double t_1 = Math.sin(t_0);
double tmp;
if ((angle / 180.0) <= -2e+207) {
tmp = t_1 * (Math.cos(t_0) * (2.0 * (Math.pow((b + a), 2.0) + (a * (a + a)))));
} else {
tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * Math.cos((Math.PI * (0.005555555555555556 * angle)))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) t_1 = math.sin(t_0) tmp = 0 if (angle / 180.0) <= -2e+207: tmp = t_1 * (math.cos(t_0) * (2.0 * (math.pow((b + a), 2.0) + (a * (a + a))))) else: tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * math.cos((math.pi * (0.005555555555555556 * angle))))) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) t_1 = sin(t_0) tmp = 0.0 if (Float64(angle / 180.0) <= -2e+207) tmp = Float64(t_1 * Float64(cos(t_0) * Float64(2.0 * Float64((Float64(b + a) ^ 2.0) + Float64(a * Float64(a + a)))))); else tmp = Float64(2.0 * Float64(Float64(t_1 * Float64(b + a)) * Float64(Float64(b - a) * cos(Float64(pi * Float64(0.005555555555555556 * angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle / 180.0); t_1 = sin(t_0); tmp = 0.0; if ((angle / 180.0) <= -2e+207) tmp = t_1 * (cos(t_0) * (2.0 * (((b + a) ^ 2.0) + (a * (a + a))))); else tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * cos((pi * (0.005555555555555556 * angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+207], N[(t$95$1 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(2.0 * N[(N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * N[(a + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t$95$1 * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
t_1 := \sin t_0\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+207}:\\
\;\;\;\;t_1 \cdot \left(\cos t_0 \cdot \left(2 \cdot \left({\left(b + a\right)}^{2} + a \cdot \left(a + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2.0000000000000001e207Initial program 21.2%
*-commutative21.2%
associate-*l*21.2%
unpow221.2%
fma-neg21.2%
unpow221.2%
Simplified21.2%
fma-neg21.2%
prod-diff21.2%
fma-neg21.2%
difference-of-squares25.2%
sub-neg25.2%
distribute-rgt-in21.2%
add-sqr-sqrt12.0%
sqrt-unprod35.3%
sqr-neg35.3%
sqrt-prod23.3%
add-sqr-sqrt38.6%
distribute-rgt-in42.6%
pow242.6%
add-sqr-sqrt19.3%
sqrt-unprod30.5%
sqr-neg30.5%
sqrt-prod23.3%
add-sqr-sqrt42.6%
Applied egg-rr42.6%
fma-udef42.6%
distribute-lft-out42.6%
Simplified42.6%
if -2.0000000000000001e207 < (/.f64 angle 180) Initial program 56.3%
associate-*l*56.2%
unpow256.2%
unpow256.2%
difference-of-squares58.9%
Simplified58.9%
Taylor expanded in angle around inf 71.3%
associate-*r*71.3%
*-commutative71.3%
*-commutative71.3%
associate-*r*73.1%
*-commutative73.1%
*-commutative73.1%
*-commutative73.1%
associate-*r*72.7%
*-commutative72.7%
+-commutative72.7%
Simplified72.7%
*-commutative72.7%
metadata-eval72.7%
div-inv74.4%
Applied egg-rr74.4%
Final simplification71.3%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* PI angle)))
(t_1 (* (+ b a) (sin t_0))))
(if (<= (pow a 2.0) 1e+156)
(* 2.0 (* (* (- b a) (cos t_0)) t_1))
(* 2.0 (* (- b a) t_1)))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle);
double t_1 = (b + a) * sin(t_0);
double tmp;
if (pow(a, 2.0) <= 1e+156) {
tmp = 2.0 * (((b - a) * cos(t_0)) * t_1);
} else {
tmp = 2.0 * ((b - a) * t_1);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (Math.PI * angle);
double t_1 = (b + a) * Math.sin(t_0);
double tmp;
if (Math.pow(a, 2.0) <= 1e+156) {
tmp = 2.0 * (((b - a) * Math.cos(t_0)) * t_1);
} else {
tmp = 2.0 * ((b - a) * t_1);
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (math.pi * angle) t_1 = (b + a) * math.sin(t_0) tmp = 0 if math.pow(a, 2.0) <= 1e+156: tmp = 2.0 * (((b - a) * math.cos(t_0)) * t_1) else: tmp = 2.0 * ((b - a) * t_1) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(pi * angle)) t_1 = Float64(Float64(b + a) * sin(t_0)) tmp = 0.0 if ((a ^ 2.0) <= 1e+156) tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * cos(t_0)) * t_1)); else tmp = Float64(2.0 * Float64(Float64(b - a) * t_1)); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (pi * angle); t_1 = (b + a) * sin(t_0); tmp = 0.0; if ((a ^ 2.0) <= 1e+156) tmp = 2.0 * (((b - a) * cos(t_0)) * t_1); else tmp = 2.0 * ((b - a) * t_1); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 1e+156], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
t_1 := \left(b + a\right) \cdot \sin t_0\\
\mathbf{if}\;{a}^{2} \leq 10^{+156}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \cos t_0\right) \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot t_1\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 9.9999999999999998e155Initial program 57.0%
associate-*l*57.0%
unpow257.0%
unpow257.0%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 64.7%
associate-*r*64.7%
*-commutative64.7%
+-commutative64.7%
Simplified64.7%
if 9.9999999999999998e155 < (pow.f64 a 2) Initial program 45.5%
associate-*l*45.5%
unpow245.5%
unpow245.5%
difference-of-squares53.2%
Simplified53.2%
add-cube-cbrt56.7%
pow356.7%
div-inv56.7%
metadata-eval56.7%
Applied egg-rr56.7%
Taylor expanded in angle around inf 75.7%
Final simplification68.7%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) -2e+207)
(*
2.0
(*
(pow (+ b a) 2.0)
(* (sin (* PI (* 2.0 (* 0.005555555555555556 angle)))) 0.5)))
(*
2.0
(*
(* (sin (* PI (/ angle 180.0))) (+ b a))
(* (- b a) (cos (* PI (* 0.005555555555555556 angle))))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -2e+207) {
tmp = 2.0 * (pow((b + a), 2.0) * (sin((((double) M_PI) * (2.0 * (0.005555555555555556 * angle)))) * 0.5));
} else {
tmp = 2.0 * ((sin((((double) M_PI) * (angle / 180.0))) * (b + a)) * ((b - a) * cos((((double) M_PI) * (0.005555555555555556 * angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -2e+207) {
tmp = 2.0 * (Math.pow((b + a), 2.0) * (Math.sin((Math.PI * (2.0 * (0.005555555555555556 * angle)))) * 0.5));
} else {
tmp = 2.0 * ((Math.sin((Math.PI * (angle / 180.0))) * (b + a)) * ((b - a) * Math.cos((Math.PI * (0.005555555555555556 * angle)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -2e+207: tmp = 2.0 * (math.pow((b + a), 2.0) * (math.sin((math.pi * (2.0 * (0.005555555555555556 * angle)))) * 0.5)) else: tmp = 2.0 * ((math.sin((math.pi * (angle / 180.0))) * (b + a)) * ((b - a) * math.cos((math.pi * (0.005555555555555556 * angle))))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -2e+207) tmp = Float64(2.0 * Float64((Float64(b + a) ^ 2.0) * Float64(sin(Float64(pi * Float64(2.0 * Float64(0.005555555555555556 * angle)))) * 0.5))); else tmp = Float64(2.0 * Float64(Float64(sin(Float64(pi * Float64(angle / 180.0))) * Float64(b + a)) * Float64(Float64(b - a) * cos(Float64(pi * Float64(0.005555555555555556 * angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= -2e+207) tmp = 2.0 * (((b + a) ^ 2.0) * (sin((pi * (2.0 * (0.005555555555555556 * angle)))) * 0.5)); else tmp = 2.0 * ((sin((pi * (angle / 180.0))) * (b + a)) * ((b - a) * cos((pi * (0.005555555555555556 * angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+207], N[(2.0 * N[(N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Sin[N[(Pi * N[(2.0 * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+207}:\\
\;\;\;\;2 \cdot \left({\left(b + a\right)}^{2} \cdot \left(\sin \left(\pi \cdot \left(2 \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right) \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2.0000000000000001e207Initial program 21.2%
*-commutative21.2%
associate-*l*21.2%
unpow221.2%
fma-neg21.2%
unpow221.2%
Simplified21.2%
Applied egg-rr24.3%
expm1-def21.5%
expm1-log1p38.5%
associate-*l*38.5%
sin-038.5%
+-lft-identity38.5%
associate-*l*38.5%
*-commutative38.5%
*-commutative38.5%
Simplified38.5%
if -2.0000000000000001e207 < (/.f64 angle 180) Initial program 56.3%
associate-*l*56.2%
unpow256.2%
unpow256.2%
difference-of-squares58.9%
Simplified58.9%
Taylor expanded in angle around inf 71.3%
associate-*r*71.3%
*-commutative71.3%
*-commutative71.3%
associate-*r*73.1%
*-commutative73.1%
*-commutative73.1%
*-commutative73.1%
associate-*r*72.7%
*-commutative72.7%
+-commutative72.7%
Simplified72.7%
*-commutative72.7%
metadata-eval72.7%
div-inv74.4%
Applied egg-rr74.4%
Final simplification70.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (/ angle 180.0))) (t_1 (sin t_0)))
(if (<= (/ angle 180.0) -2e+207)
(* t_1 (* (cos t_0) (* 2.0 (+ (* b b) (* a a)))))
(*
2.0
(*
(* t_1 (+ b a))
(* (- b a) (cos (* PI (* 0.005555555555555556 angle)))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double t_1 = sin(t_0);
double tmp;
if ((angle / 180.0) <= -2e+207) {
tmp = t_1 * (cos(t_0) * (2.0 * ((b * b) + (a * a))));
} else {
tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * cos((((double) M_PI) * (0.005555555555555556 * angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
double t_1 = Math.sin(t_0);
double tmp;
if ((angle / 180.0) <= -2e+207) {
tmp = t_1 * (Math.cos(t_0) * (2.0 * ((b * b) + (a * a))));
} else {
tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * Math.cos((Math.PI * (0.005555555555555556 * angle)))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) t_1 = math.sin(t_0) tmp = 0 if (angle / 180.0) <= -2e+207: tmp = t_1 * (math.cos(t_0) * (2.0 * ((b * b) + (a * a)))) else: tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * math.cos((math.pi * (0.005555555555555556 * angle))))) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) t_1 = sin(t_0) tmp = 0.0 if (Float64(angle / 180.0) <= -2e+207) tmp = Float64(t_1 * Float64(cos(t_0) * Float64(2.0 * Float64(Float64(b * b) + Float64(a * a))))); else tmp = Float64(2.0 * Float64(Float64(t_1 * Float64(b + a)) * Float64(Float64(b - a) * cos(Float64(pi * Float64(0.005555555555555556 * angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle / 180.0); t_1 = sin(t_0); tmp = 0.0; if ((angle / 180.0) <= -2e+207) tmp = t_1 * (cos(t_0) * (2.0 * ((b * b) + (a * a)))); else tmp = 2.0 * ((t_1 * (b + a)) * ((b - a) * cos((pi * (0.005555555555555556 * angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+207], N[(t$95$1 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(2.0 * N[(N[(b * b), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t$95$1 * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
t_1 := \sin t_0\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+207}:\\
\;\;\;\;t_1 \cdot \left(\cos t_0 \cdot \left(2 \cdot \left(b \cdot b + a \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2.0000000000000001e207Initial program 21.2%
*-commutative21.2%
associate-*l*21.2%
unpow221.2%
fma-neg21.2%
unpow221.2%
Simplified21.2%
fma-udef21.2%
add-sqr-sqrt6.0%
sqrt-unprod46.1%
sqr-neg46.1%
sqrt-unprod42.6%
add-sqr-sqrt42.6%
Applied egg-rr42.6%
if -2.0000000000000001e207 < (/.f64 angle 180) Initial program 56.3%
associate-*l*56.2%
unpow256.2%
unpow256.2%
difference-of-squares58.9%
Simplified58.9%
Taylor expanded in angle around inf 71.3%
associate-*r*71.3%
*-commutative71.3%
*-commutative71.3%
associate-*r*73.1%
*-commutative73.1%
*-commutative73.1%
*-commutative73.1%
associate-*r*72.7%
*-commutative72.7%
+-commutative72.7%
Simplified72.7%
*-commutative72.7%
metadata-eval72.7%
div-inv74.4%
Applied egg-rr74.4%
Final simplification71.3%
(FPCore (a b angle) :precision binary64 (* 2.0 (* (* (- b a) (cos (* 0.005555555555555556 (* PI angle)))) (* (+ b a) (sin (* PI (* 0.005555555555555556 angle)))))))
double code(double a, double b, double angle) {
return 2.0 * (((b - a) * cos((0.005555555555555556 * (((double) M_PI) * angle)))) * ((b + a) * sin((((double) M_PI) * (0.005555555555555556 * angle)))));
}
public static double code(double a, double b, double angle) {
return 2.0 * (((b - a) * Math.cos((0.005555555555555556 * (Math.PI * angle)))) * ((b + a) * Math.sin((Math.PI * (0.005555555555555556 * angle)))));
}
def code(a, b, angle): return 2.0 * (((b - a) * math.cos((0.005555555555555556 * (math.pi * angle)))) * ((b + a) * math.sin((math.pi * (0.005555555555555556 * angle)))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(Float64(b - a) * cos(Float64(0.005555555555555556 * Float64(pi * angle)))) * Float64(Float64(b + a) * sin(Float64(pi * Float64(0.005555555555555556 * angle)))))) end
function tmp = code(a, b, angle) tmp = 2.0 * (((b - a) * cos((0.005555555555555556 * (pi * angle)))) * ((b + a) * sin((pi * (0.005555555555555556 * angle))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(\left(b - a\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)
\end{array}
Initial program 52.8%
associate-*l*52.8%
unpow252.8%
unpow252.8%
difference-of-squares55.6%
Simplified55.6%
Taylor expanded in angle around inf 66.8%
associate-*r*66.8%
*-commutative66.8%
*-commutative66.8%
associate-*r*68.3%
*-commutative68.3%
*-commutative68.3%
*-commutative68.3%
associate-*r*67.7%
*-commutative67.7%
+-commutative67.7%
Simplified67.7%
Taylor expanded in angle around inf 68.5%
Final simplification68.5%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) -5e+20)
(*
2.0
(*
(pow (+ b a) 2.0)
(* (sin (* PI (* 2.0 (* 0.005555555555555556 angle)))) 0.5)))
(*
2.0
(* (- b a) (* (+ b a) (sin (* PI (* 0.005555555555555556 angle))))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+20) {
tmp = 2.0 * (pow((b + a), 2.0) * (sin((((double) M_PI) * (2.0 * (0.005555555555555556 * angle)))) * 0.5));
} else {
tmp = 2.0 * ((b - a) * ((b + a) * sin((((double) M_PI) * (0.005555555555555556 * angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+20) {
tmp = 2.0 * (Math.pow((b + a), 2.0) * (Math.sin((Math.PI * (2.0 * (0.005555555555555556 * angle)))) * 0.5));
} else {
tmp = 2.0 * ((b - a) * ((b + a) * Math.sin((Math.PI * (0.005555555555555556 * angle)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -5e+20: tmp = 2.0 * (math.pow((b + a), 2.0) * (math.sin((math.pi * (2.0 * (0.005555555555555556 * angle)))) * 0.5)) else: tmp = 2.0 * ((b - a) * ((b + a) * math.sin((math.pi * (0.005555555555555556 * angle))))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+20) tmp = Float64(2.0 * Float64((Float64(b + a) ^ 2.0) * Float64(sin(Float64(pi * Float64(2.0 * Float64(0.005555555555555556 * angle)))) * 0.5))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(pi * Float64(0.005555555555555556 * angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= -5e+20) tmp = 2.0 * (((b + a) ^ 2.0) * (sin((pi * (2.0 * (0.005555555555555556 * angle)))) * 0.5)); else tmp = 2.0 * ((b - a) * ((b + a) * sin((pi * (0.005555555555555556 * angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+20], N[(2.0 * N[(N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Sin[N[(Pi * N[(2.0 * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+20}:\\
\;\;\;\;2 \cdot \left({\left(b + a\right)}^{2} \cdot \left(\sin \left(\pi \cdot \left(2 \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right) \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5e20Initial program 24.8%
*-commutative24.8%
associate-*l*24.8%
unpow224.8%
fma-neg26.7%
unpow226.7%
Simplified26.7%
Applied egg-rr25.4%
expm1-def24.0%
expm1-log1p36.2%
associate-*l*36.2%
sin-036.2%
+-lft-identity36.2%
associate-*l*36.2%
*-commutative36.2%
*-commutative36.2%
Simplified36.2%
if -5e20 < (/.f64 angle 180) Initial program 60.5%
associate-*l*60.5%
unpow260.5%
unpow260.5%
difference-of-squares63.5%
Simplified63.5%
Taylor expanded in angle around inf 77.7%
associate-*r*77.7%
*-commutative77.7%
*-commutative77.7%
associate-*r*79.3%
*-commutative79.3%
*-commutative79.3%
*-commutative79.3%
associate-*r*78.8%
*-commutative78.8%
+-commutative78.8%
Simplified78.8%
Taylor expanded in angle around 0 78.8%
Final simplification69.7%
(FPCore (a b angle)
:precision binary64
(if (<= angle -5.6e+102)
(* 2.0 (* a (* (* a 0.5) (sin (* angle (* PI 0.011111111111111112))))))
(if (<= angle 4.8e+78)
(* 0.011111111111111112 (* (* PI (+ b a)) (* (- b a) angle)))
(*
2.0
(* (sin (* PI (* 0.005555555555555556 angle))) (* (- b a) (+ b a)))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= -5.6e+102) {
tmp = 2.0 * (a * ((a * 0.5) * sin((angle * (((double) M_PI) * 0.011111111111111112)))));
} else if (angle <= 4.8e+78) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * ((b - a) * angle));
} else {
tmp = 2.0 * (sin((((double) M_PI) * (0.005555555555555556 * angle))) * ((b - a) * (b + a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= -5.6e+102) {
tmp = 2.0 * (a * ((a * 0.5) * Math.sin((angle * (Math.PI * 0.011111111111111112)))));
} else if (angle <= 4.8e+78) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * ((b - a) * angle));
} else {
tmp = 2.0 * (Math.sin((Math.PI * (0.005555555555555556 * angle))) * ((b - a) * (b + a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= -5.6e+102: tmp = 2.0 * (a * ((a * 0.5) * math.sin((angle * (math.pi * 0.011111111111111112))))) elif angle <= 4.8e+78: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * ((b - a) * angle)) else: tmp = 2.0 * (math.sin((math.pi * (0.005555555555555556 * angle))) * ((b - a) * (b + a))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= -5.6e+102) tmp = Float64(2.0 * Float64(a * Float64(Float64(a * 0.5) * sin(Float64(angle * Float64(pi * 0.011111111111111112)))))); elseif (angle <= 4.8e+78) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(Float64(b - a) * angle))); else tmp = Float64(2.0 * Float64(sin(Float64(pi * Float64(0.005555555555555556 * angle))) * Float64(Float64(b - a) * Float64(b + a)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= -5.6e+102) tmp = 2.0 * (a * ((a * 0.5) * sin((angle * (pi * 0.011111111111111112))))); elseif (angle <= 4.8e+78) tmp = 0.011111111111111112 * ((pi * (b + a)) * ((b - a) * angle)); else tmp = 2.0 * (sin((pi * (0.005555555555555556 * angle))) * ((b - a) * (b + a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, -5.6e+102], N[(2.0 * N[(a * N[(N[(a * 0.5), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 4.8e+78], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;2 \cdot \left(a \cdot \left(\left(a \cdot 0.5\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{elif}\;angle \leq 4.8 \cdot 10^{+78}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\\
\end{array}
\end{array}
if angle < -5.60000000000000037e102Initial program 24.4%
*-commutative24.4%
associate-*l*24.4%
unpow224.4%
fma-neg26.9%
unpow226.9%
Simplified26.9%
Applied egg-rr38.4%
log-pow38.4%
sin-038.4%
+-lft-identity38.4%
associate-*l*38.4%
*-commutative38.4%
*-commutative38.4%
Simplified38.4%
Taylor expanded in b around 0 30.0%
expm1-log1p-u20.0%
expm1-udef22.3%
pow222.3%
*-commutative22.3%
pow1/222.3%
log-pow22.3%
add-log-exp22.3%
Applied egg-rr22.3%
expm1-def20.0%
expm1-log1p30.0%
associate-*l*30.0%
associate-*r*30.0%
*-commutative30.0%
associate-*l*32.2%
Simplified32.2%
if -5.60000000000000037e102 < angle < 4.7999999999999997e78Initial program 65.0%
associate-*l*65.0%
unpow265.0%
unpow265.0%
difference-of-squares68.1%
Simplified68.1%
Taylor expanded in angle around 0 70.5%
associate-*r*87.2%
*-commutative87.2%
+-commutative87.2%
Simplified87.2%
if 4.7999999999999997e78 < angle Initial program 33.7%
associate-*l*33.7%
unpow233.7%
unpow233.7%
difference-of-squares35.8%
Simplified35.8%
add-cube-cbrt34.6%
pow338.5%
div-inv36.4%
metadata-eval36.4%
Applied egg-rr36.4%
Taylor expanded in angle around inf 38.1%
*-commutative38.1%
associate-*l*38.1%
associate-*r*41.9%
*-commutative41.9%
*-commutative41.9%
+-commutative41.9%
Simplified41.9%
Final simplification70.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle))))
(if (<= (/ angle 180.0) -1e+16)
(* t_0 (* 2.0 (fma b b (* a (- a)))))
(* 2.0 (* (- b a) (* (+ b a) (sin t_0)))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
double tmp;
if ((angle / 180.0) <= -1e+16) {
tmp = t_0 * (2.0 * fma(b, b, (a * -a)));
} else {
tmp = 2.0 * ((b - a) * ((b + a) * sin(t_0)));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(pi * Float64(0.005555555555555556 * angle)) tmp = 0.0 if (Float64(angle / 180.0) <= -1e+16) tmp = Float64(t_0 * Float64(2.0 * fma(b, b, Float64(a * Float64(-a))))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(t_0)))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -1e+16], N[(t$95$0 * N[(2.0 * N[(b * b + N[(a * (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{+16}:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \mathsf{fma}\left(b, b, a \cdot \left(-a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin t_0\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -1e16Initial program 24.4%
*-commutative24.4%
associate-*l*24.4%
unpow224.4%
fma-neg26.2%
unpow226.2%
Simplified26.2%
Taylor expanded in angle around 0 25.3%
*-commutative25.3%
*-commutative25.3%
associate-*r*25.3%
*-commutative25.3%
Simplified25.3%
Taylor expanded in angle around 0 32.2%
if -1e16 < (/.f64 angle 180) Initial program 60.8%
associate-*l*60.8%
unpow260.8%
unpow260.8%
difference-of-squares63.9%
Simplified63.9%
Taylor expanded in angle around inf 78.1%
associate-*r*78.1%
*-commutative78.1%
*-commutative78.1%
associate-*r*79.7%
*-commutative79.7%
*-commutative79.7%
*-commutative79.7%
associate-*r*79.2%
*-commutative79.2%
+-commutative79.2%
Simplified79.2%
Taylor expanded in angle around 0 79.2%
Final simplification68.9%
(FPCore (a b angle)
:precision binary64
(if (<= angle -5.6e+102)
(* 2.0 (* a (* (* a 0.5) (sin (* angle (* PI 0.011111111111111112))))))
(if (<= angle 6.8e+68)
(* 0.011111111111111112 (* (* PI (+ b a)) (* (- b a) angle)))
(* 0.011111111111111112 (* (pow (+ b a) 2.0) (* PI angle))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= -5.6e+102) {
tmp = 2.0 * (a * ((a * 0.5) * sin((angle * (((double) M_PI) * 0.011111111111111112)))));
} else if (angle <= 6.8e+68) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * ((b - a) * angle));
} else {
tmp = 0.011111111111111112 * (pow((b + a), 2.0) * (((double) M_PI) * angle));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= -5.6e+102) {
tmp = 2.0 * (a * ((a * 0.5) * Math.sin((angle * (Math.PI * 0.011111111111111112)))));
} else if (angle <= 6.8e+68) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * ((b - a) * angle));
} else {
tmp = 0.011111111111111112 * (Math.pow((b + a), 2.0) * (Math.PI * angle));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= -5.6e+102: tmp = 2.0 * (a * ((a * 0.5) * math.sin((angle * (math.pi * 0.011111111111111112))))) elif angle <= 6.8e+68: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * ((b - a) * angle)) else: tmp = 0.011111111111111112 * (math.pow((b + a), 2.0) * (math.pi * angle)) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= -5.6e+102) tmp = Float64(2.0 * Float64(a * Float64(Float64(a * 0.5) * sin(Float64(angle * Float64(pi * 0.011111111111111112)))))); elseif (angle <= 6.8e+68) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(Float64(b - a) * angle))); else tmp = Float64(0.011111111111111112 * Float64((Float64(b + a) ^ 2.0) * Float64(pi * angle))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= -5.6e+102) tmp = 2.0 * (a * ((a * 0.5) * sin((angle * (pi * 0.011111111111111112))))); elseif (angle <= 6.8e+68) tmp = 0.011111111111111112 * ((pi * (b + a)) * ((b - a) * angle)); else tmp = 0.011111111111111112 * (((b + a) ^ 2.0) * (pi * angle)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, -5.6e+102], N[(2.0 * N[(a * N[(N[(a * 0.5), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 6.8e+68], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision] * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;2 \cdot \left(a \cdot \left(\left(a \cdot 0.5\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{elif}\;angle \leq 6.8 \cdot 10^{+68}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left({\left(b + a\right)}^{2} \cdot \left(\pi \cdot angle\right)\right)\\
\end{array}
\end{array}
if angle < -5.60000000000000037e102Initial program 24.4%
*-commutative24.4%
associate-*l*24.4%
unpow224.4%
fma-neg26.9%
unpow226.9%
Simplified26.9%
Applied egg-rr38.4%
log-pow38.4%
sin-038.4%
+-lft-identity38.4%
associate-*l*38.4%
*-commutative38.4%
*-commutative38.4%
Simplified38.4%
Taylor expanded in b around 0 30.0%
expm1-log1p-u20.0%
expm1-udef22.3%
pow222.3%
*-commutative22.3%
pow1/222.3%
log-pow22.3%
add-log-exp22.3%
Applied egg-rr22.3%
expm1-def20.0%
expm1-log1p30.0%
associate-*l*30.0%
associate-*r*30.0%
*-commutative30.0%
associate-*l*32.2%
Simplified32.2%
if -5.60000000000000037e102 < angle < 6.8000000000000003e68Initial program 65.6%
associate-*l*65.6%
unpow265.6%
unpow265.6%
difference-of-squares68.7%
Simplified68.7%
Taylor expanded in angle around 0 71.2%
associate-*r*88.2%
*-commutative88.2%
+-commutative88.2%
Simplified88.2%
if 6.8000000000000003e68 < angle Initial program 33.7%
*-commutative33.7%
associate-*l*33.7%
unpow233.7%
fma-neg35.7%
unpow235.7%
Simplified35.7%
Applied egg-rr25.7%
log-pow29.7%
sin-029.7%
+-lft-identity29.7%
associate-*l*29.7%
*-commutative29.7%
*-commutative29.7%
Simplified29.7%
Taylor expanded in angle around 0 31.0%
associate-*r*31.0%
+-commutative31.0%
Simplified31.0%
Final simplification68.1%
(FPCore (a b angle)
:precision binary64
(if (<= angle -3.1e+229)
(* 0.011111111111111112 (* angle (* b (* b PI))))
(if (<= angle 6.8e+68)
(* 0.011111111111111112 (* (* PI (+ b a)) (* (- b a) angle)))
(* 0.011111111111111112 (* (pow (+ b a) 2.0) (* PI angle))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= -3.1e+229) {
tmp = 0.011111111111111112 * (angle * (b * (b * ((double) M_PI))));
} else if (angle <= 6.8e+68) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * ((b - a) * angle));
} else {
tmp = 0.011111111111111112 * (pow((b + a), 2.0) * (((double) M_PI) * angle));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= -3.1e+229) {
tmp = 0.011111111111111112 * (angle * (b * (b * Math.PI)));
} else if (angle <= 6.8e+68) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * ((b - a) * angle));
} else {
tmp = 0.011111111111111112 * (Math.pow((b + a), 2.0) * (Math.PI * angle));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= -3.1e+229: tmp = 0.011111111111111112 * (angle * (b * (b * math.pi))) elif angle <= 6.8e+68: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * ((b - a) * angle)) else: tmp = 0.011111111111111112 * (math.pow((b + a), 2.0) * (math.pi * angle)) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= -3.1e+229) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(b * Float64(b * pi)))); elseif (angle <= 6.8e+68) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(Float64(b - a) * angle))); else tmp = Float64(0.011111111111111112 * Float64((Float64(b + a) ^ 2.0) * Float64(pi * angle))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= -3.1e+229) tmp = 0.011111111111111112 * (angle * (b * (b * pi))); elseif (angle <= 6.8e+68) tmp = 0.011111111111111112 * ((pi * (b + a)) * ((b - a) * angle)); else tmp = 0.011111111111111112 * (((b + a) ^ 2.0) * (pi * angle)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, -3.1e+229], N[(0.011111111111111112 * N[(angle * N[(b * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 6.8e+68], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision] * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -3.1 \cdot 10^{+229}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;angle \leq 6.8 \cdot 10^{+68}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left({\left(b + a\right)}^{2} \cdot \left(\pi \cdot angle\right)\right)\\
\end{array}
\end{array}
if angle < -3.10000000000000014e229Initial program 24.8%
associate-*l*24.8%
unpow224.8%
unpow224.8%
difference-of-squares30.1%
Simplified30.1%
Taylor expanded in angle around 0 17.8%
Taylor expanded in b around inf 35.3%
*-commutative35.3%
unpow235.3%
Simplified35.3%
Taylor expanded in angle around 0 35.3%
unpow235.3%
associate-*l*35.3%
Simplified35.3%
if -3.10000000000000014e229 < angle < 6.8000000000000003e68Initial program 60.9%
associate-*l*60.9%
unpow260.9%
unpow260.9%
difference-of-squares63.7%
Simplified63.7%
Taylor expanded in angle around 0 66.0%
associate-*r*81.1%
*-commutative81.1%
+-commutative81.1%
Simplified81.1%
if 6.8000000000000003e68 < angle Initial program 33.7%
*-commutative33.7%
associate-*l*33.7%
unpow233.7%
fma-neg35.7%
unpow235.7%
Simplified35.7%
Applied egg-rr25.7%
log-pow29.7%
sin-029.7%
+-lft-identity29.7%
associate-*l*29.7%
*-commutative29.7%
*-commutative29.7%
Simplified29.7%
Taylor expanded in angle around 0 31.0%
associate-*r*31.0%
+-commutative31.0%
Simplified31.0%
Final simplification67.7%
(FPCore (a b angle)
:precision binary64
(if (<= a 0.7)
(* 0.011111111111111112 (* PI (* angle (* b b))))
(if (<= a 1.58e+184)
(* 0.011111111111111112 (* angle (* (- b a) (* a PI))))
(if (<= a 5e+217)
(* 2.0 (* PI (* 0.005555555555555556 (* angle (* a a)))))
(* (* angle -0.011111111111111112) (* PI (* a a)))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 0.7) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else if (a <= 1.58e+184) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
} else if (a <= 5e+217) {
tmp = 2.0 * (((double) M_PI) * (0.005555555555555556 * (angle * (a * a))));
} else {
tmp = (angle * -0.011111111111111112) * (((double) M_PI) * (a * a));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 0.7) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else if (a <= 1.58e+184) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
} else if (a <= 5e+217) {
tmp = 2.0 * (Math.PI * (0.005555555555555556 * (angle * (a * a))));
} else {
tmp = (angle * -0.011111111111111112) * (Math.PI * (a * a));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 0.7: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) elif a <= 1.58e+184: tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) elif a <= 5e+217: tmp = 2.0 * (math.pi * (0.005555555555555556 * (angle * (a * a)))) else: tmp = (angle * -0.011111111111111112) * (math.pi * (a * a)) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 0.7) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); elseif (a <= 1.58e+184) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))); elseif (a <= 5e+217) tmp = Float64(2.0 * Float64(pi * Float64(0.005555555555555556 * Float64(angle * Float64(a * a))))); else tmp = Float64(Float64(angle * -0.011111111111111112) * Float64(pi * Float64(a * a))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 0.7) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); elseif (a <= 1.58e+184) tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); elseif (a <= 5e+217) tmp = 2.0 * (pi * (0.005555555555555556 * (angle * (a * a)))); else tmp = (angle * -0.011111111111111112) * (pi * (a * a)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 0.7], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.58e+184], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5e+217], N[(2.0 * N[(Pi * N[(0.005555555555555556 * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * -0.011111111111111112), $MachinePrecision] * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 0.7:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{elif}\;a \leq 1.58 \cdot 10^{+184}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;a \leq 5 \cdot 10^{+217}:\\
\;\;\;\;2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot -0.011111111111111112\right) \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\\
\end{array}
\end{array}
if a < 0.69999999999999996Initial program 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares58.0%
Simplified58.0%
Taylor expanded in angle around 0 56.3%
Taylor expanded in b around inf 41.1%
*-commutative41.1%
unpow241.1%
Simplified41.1%
Taylor expanded in angle around 0 41.1%
unpow241.1%
associate-*r*41.2%
Simplified41.2%
if 0.69999999999999996 < a < 1.58e184Initial program 54.7%
associate-*l*54.7%
unpow254.7%
unpow254.7%
difference-of-squares54.8%
Simplified54.8%
Taylor expanded in angle around 0 48.9%
Taylor expanded in a around inf 48.4%
*-commutative48.4%
Simplified48.4%
if 1.58e184 < a < 5.00000000000000041e217Initial program 20.6%
*-commutative20.6%
associate-*l*20.6%
unpow220.6%
fma-neg21.0%
unpow221.0%
Simplified21.0%
fma-neg20.6%
difference-of-squares21.0%
sub-neg21.0%
distribute-rgt-in21.0%
add-sqr-sqrt0.0%
sqrt-unprod50.2%
sqr-neg50.2%
sqrt-prod50.2%
add-sqr-sqrt50.2%
distribute-rgt-in50.2%
add-sqr-sqrt50.2%
associate-*r*50.2%
Applied egg-rr50.2%
Taylor expanded in b around 0 50.2%
associate-*r*50.2%
unpow250.2%
associate-*r*40.2%
*-commutative40.2%
associate-*r*40.2%
*-commutative40.2%
Simplified40.2%
Taylor expanded in angle around 0 60.2%
associate-*r*60.2%
associate-*r*60.2%
unpow260.2%
Simplified60.2%
if 5.00000000000000041e217 < a Initial program 35.4%
associate-*l*35.4%
unpow235.4%
unpow235.4%
difference-of-squares52.1%
Simplified52.1%
Taylor expanded in angle around 0 57.6%
Taylor expanded in b around 0 57.6%
associate-*r*57.6%
*-commutative57.6%
unpow257.6%
Simplified57.6%
Final simplification44.2%
(FPCore (a b angle)
:precision binary64
(if (<= angle -4.2e+229)
(* 0.011111111111111112 (* angle (* b (* b PI))))
(if (<= angle 2.4e+87)
(* 0.011111111111111112 (* (* PI (+ b a)) (* (- b a) angle)))
(* 2.0 (* PI (* 0.005555555555555556 (* angle (* a a))))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= -4.2e+229) {
tmp = 0.011111111111111112 * (angle * (b * (b * ((double) M_PI))));
} else if (angle <= 2.4e+87) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * ((b - a) * angle));
} else {
tmp = 2.0 * (((double) M_PI) * (0.005555555555555556 * (angle * (a * a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= -4.2e+229) {
tmp = 0.011111111111111112 * (angle * (b * (b * Math.PI)));
} else if (angle <= 2.4e+87) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * ((b - a) * angle));
} else {
tmp = 2.0 * (Math.PI * (0.005555555555555556 * (angle * (a * a))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= -4.2e+229: tmp = 0.011111111111111112 * (angle * (b * (b * math.pi))) elif angle <= 2.4e+87: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * ((b - a) * angle)) else: tmp = 2.0 * (math.pi * (0.005555555555555556 * (angle * (a * a)))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= -4.2e+229) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(b * Float64(b * pi)))); elseif (angle <= 2.4e+87) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(Float64(b - a) * angle))); else tmp = Float64(2.0 * Float64(pi * Float64(0.005555555555555556 * Float64(angle * Float64(a * a))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= -4.2e+229) tmp = 0.011111111111111112 * (angle * (b * (b * pi))); elseif (angle <= 2.4e+87) tmp = 0.011111111111111112 * ((pi * (b + a)) * ((b - a) * angle)); else tmp = 2.0 * (pi * (0.005555555555555556 * (angle * (a * a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, -4.2e+229], N[(0.011111111111111112 * N[(angle * N[(b * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 2.4e+87], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(Pi * N[(0.005555555555555556 * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -4.2 \cdot 10^{+229}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;angle \leq 2.4 \cdot 10^{+87}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < -4.19999999999999975e229Initial program 24.8%
associate-*l*24.8%
unpow224.8%
unpow224.8%
difference-of-squares30.1%
Simplified30.1%
Taylor expanded in angle around 0 17.8%
Taylor expanded in b around inf 35.3%
*-commutative35.3%
unpow235.3%
Simplified35.3%
Taylor expanded in angle around 0 35.3%
unpow235.3%
associate-*l*35.3%
Simplified35.3%
if -4.19999999999999975e229 < angle < 2.39999999999999981e87Initial program 60.4%
associate-*l*60.4%
unpow260.4%
unpow260.4%
difference-of-squares63.1%
Simplified63.1%
Taylor expanded in angle around 0 65.3%
associate-*r*80.0%
*-commutative80.0%
+-commutative80.0%
Simplified80.0%
if 2.39999999999999981e87 < angle Initial program 33.0%
*-commutative33.0%
associate-*l*33.0%
unpow233.0%
fma-neg35.2%
unpow235.2%
Simplified35.2%
fma-neg33.0%
difference-of-squares35.2%
sub-neg35.2%
distribute-rgt-in28.7%
add-sqr-sqrt8.8%
sqrt-unprod27.2%
sqr-neg27.2%
sqrt-prod18.3%
add-sqr-sqrt26.0%
distribute-rgt-in26.0%
add-sqr-sqrt16.2%
associate-*r*16.2%
Applied egg-rr16.2%
Taylor expanded in b around 0 18.9%
associate-*r*18.9%
unpow218.9%
associate-*r*13.4%
*-commutative13.4%
associate-*r*17.1%
*-commutative17.1%
Simplified17.1%
Taylor expanded in angle around 0 27.7%
associate-*r*27.7%
associate-*r*27.7%
unpow227.7%
Simplified27.7%
Final simplification67.3%
(FPCore (a b angle) :precision binary64 (if (<= angle 2.4e+87) (* 0.011111111111111112 (* angle (* (- b a) (* PI (+ b a))))) (* 2.0 (* PI (* 0.005555555555555556 (* angle (* a a)))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 2.4e+87) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (b + a))));
} else {
tmp = 2.0 * (((double) M_PI) * (0.005555555555555556 * (angle * (a * a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 2.4e+87) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (b + a))));
} else {
tmp = 2.0 * (Math.PI * (0.005555555555555556 * (angle * (a * a))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 2.4e+87: tmp = 0.011111111111111112 * (angle * ((b - a) * (math.pi * (b + a)))) else: tmp = 2.0 * (math.pi * (0.005555555555555556 * (angle * (a * a)))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 2.4e+87) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(b + a))))); else tmp = Float64(2.0 * Float64(pi * Float64(0.005555555555555556 * Float64(angle * Float64(a * a))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 2.4e+87) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (b + a)))); else tmp = 2.0 * (pi * (0.005555555555555556 * (angle * (a * a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 2.4e+87], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(Pi * N[(0.005555555555555556 * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 2.4 \cdot 10^{+87}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 2.39999999999999981e87Initial program 57.2%
associate-*l*57.2%
unpow257.2%
unpow257.2%
difference-of-squares60.1%
Simplified60.1%
Taylor expanded in angle around 0 61.0%
if 2.39999999999999981e87 < angle Initial program 33.0%
*-commutative33.0%
associate-*l*33.0%
unpow233.0%
fma-neg35.2%
unpow235.2%
Simplified35.2%
fma-neg33.0%
difference-of-squares35.2%
sub-neg35.2%
distribute-rgt-in28.7%
add-sqr-sqrt8.8%
sqrt-unprod27.2%
sqr-neg27.2%
sqrt-prod18.3%
add-sqr-sqrt26.0%
distribute-rgt-in26.0%
add-sqr-sqrt16.2%
associate-*r*16.2%
Applied egg-rr16.2%
Taylor expanded in b around 0 18.9%
associate-*r*18.9%
unpow218.9%
associate-*r*13.4%
*-commutative13.4%
associate-*r*17.1%
*-commutative17.1%
Simplified17.1%
Taylor expanded in angle around 0 27.7%
associate-*r*27.7%
associate-*r*27.7%
unpow227.7%
Simplified27.7%
Final simplification55.0%
(FPCore (a b angle) :precision binary64 (if (<= a 0.028) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* 0.011111111111111112 (* angle (* (- b a) (* a PI))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 0.028) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 0.028) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 0.028: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 0.028) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); 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) tmp = 0.0; if (a <= 0.028) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 0.028], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 0.028:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\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 < 0.0280000000000000006Initial program 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares58.0%
Simplified58.0%
Taylor expanded in angle around 0 56.3%
Taylor expanded in b around inf 41.1%
*-commutative41.1%
unpow241.1%
Simplified41.1%
Taylor expanded in angle around 0 41.1%
unpow241.1%
associate-*r*41.2%
Simplified41.2%
if 0.0280000000000000006 < a Initial program 44.9%
associate-*l*44.9%
unpow244.9%
unpow244.9%
difference-of-squares49.3%
Simplified49.3%
Taylor expanded in angle around 0 45.7%
Taylor expanded in a around inf 45.4%
*-commutative45.4%
Simplified45.4%
Final simplification42.3%
(FPCore (a b angle) :precision binary64 (if (<= a 130000000000.0) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* (* angle -0.011111111111111112) (* PI (* a a)))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 130000000000.0) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = (angle * -0.011111111111111112) * (((double) M_PI) * (a * a));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 130000000000.0) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = (angle * -0.011111111111111112) * (Math.PI * (a * a));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 130000000000.0: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = (angle * -0.011111111111111112) * (math.pi * (a * a)) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 130000000000.0) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(Float64(angle * -0.011111111111111112) * Float64(pi * Float64(a * a))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 130000000000.0) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = (angle * -0.011111111111111112) * (pi * (a * a)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 130000000000.0], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * -0.011111111111111112), $MachinePrecision] * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 130000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot -0.011111111111111112\right) \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\\
\end{array}
\end{array}
if a < 1.3e11Initial program 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares57.9%
Simplified57.9%
Taylor expanded in angle around 0 56.3%
Taylor expanded in b around inf 40.9%
*-commutative40.9%
unpow240.9%
Simplified40.9%
Taylor expanded in angle around 0 40.9%
unpow240.9%
associate-*r*40.9%
Simplified40.9%
if 1.3e11 < a Initial program 44.3%
associate-*l*44.3%
unpow244.3%
unpow244.3%
difference-of-squares49.0%
Simplified49.0%
Taylor expanded in angle around 0 45.3%
Taylor expanded in b around 0 45.3%
associate-*r*45.3%
*-commutative45.3%
unpow245.3%
Simplified45.3%
Final simplification42.0%
(FPCore (a b angle) :precision binary64 (if (<= a 136000000000.0) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* -0.011111111111111112 (* PI (* angle (* a a))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 136000000000.0) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = -0.011111111111111112 * (((double) M_PI) * (angle * (a * a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 136000000000.0) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = -0.011111111111111112 * (Math.PI * (angle * (a * a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 136000000000.0: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = -0.011111111111111112 * (math.pi * (angle * (a * a))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 136000000000.0) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(angle * Float64(a * a)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 136000000000.0) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = -0.011111111111111112 * (pi * (angle * (a * a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 136000000000.0], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 136000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.36e11Initial program 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares57.9%
Simplified57.9%
Taylor expanded in angle around 0 56.3%
Taylor expanded in b around inf 40.9%
*-commutative40.9%
unpow240.9%
Simplified40.9%
Taylor expanded in angle around 0 40.9%
unpow240.9%
associate-*r*40.9%
Simplified40.9%
if 1.36e11 < a Initial program 44.3%
associate-*l*44.3%
unpow244.3%
unpow244.3%
difference-of-squares49.0%
Simplified49.0%
Taylor expanded in angle around 0 45.3%
Taylor expanded in b around 0 45.3%
*-commutative45.3%
associate-*r*45.4%
*-commutative45.4%
unpow245.4%
Simplified45.4%
Final simplification42.1%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* b (* b PI)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (b * (b * ((double) M_PI))));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (b * (b * Math.PI)));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * (b * (b * math.pi)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(b * Float64(b * pi)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (b * (b * pi))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(b * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right)
\end{array}
Initial program 52.8%
associate-*l*52.8%
unpow252.8%
unpow252.8%
difference-of-squares55.6%
Simplified55.6%
Taylor expanded in angle around 0 53.4%
Taylor expanded in b around inf 33.2%
*-commutative33.2%
unpow233.2%
Simplified33.2%
Taylor expanded in angle around 0 33.2%
unpow233.2%
associate-*l*33.1%
Simplified33.1%
Final simplification33.1%
(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 52.8%
associate-*l*52.8%
unpow252.8%
unpow252.8%
difference-of-squares55.6%
Simplified55.6%
Taylor expanded in angle around 0 53.4%
Taylor expanded in b around inf 33.2%
*-commutative33.2%
unpow233.2%
Simplified33.2%
Final simplification33.2%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* PI (* angle (* b b)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (Math.PI * (angle * (b * b)));
}
def code(a, b, angle): return 0.011111111111111112 * (math.pi * (angle * (b * b)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 52.8%
associate-*l*52.8%
unpow252.8%
unpow252.8%
difference-of-squares55.6%
Simplified55.6%
Taylor expanded in angle around 0 53.4%
Taylor expanded in b around inf 33.2%
*-commutative33.2%
unpow233.2%
Simplified33.2%
Taylor expanded in angle around 0 33.2%
unpow233.2%
associate-*r*33.2%
Simplified33.2%
Final simplification33.2%
herbie shell --seed 2023214
(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)))))