
(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 15 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+27)
(*
(+ a b)
(* (- b a) (sin (* 2.0 (fabs (* angle (* PI 0.005555555555555556)))))))
(if (<= (/ angle 180.0) 5e+169)
(* (+ a b) (* (- b a) (sin (* 2.0 (* (/ angle 180.0) PI)))))
(if (<= (/ angle 180.0) 1e+273)
(* (* 2.0 (sin (/ (* angle PI) 180.0))) (* (+ a b) (- b a)))
(* (+ a b) (* a (- (sin (* PI (* angle 0.011111111111111112))))))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+27) {
tmp = (a + b) * ((b - a) * sin((2.0 * fabs((angle * (((double) M_PI) * 0.005555555555555556))))));
} else if ((angle / 180.0) <= 5e+169) {
tmp = (a + b) * ((b - a) * sin((2.0 * ((angle / 180.0) * ((double) M_PI)))));
} else if ((angle / 180.0) <= 1e+273) {
tmp = (2.0 * sin(((angle * ((double) M_PI)) / 180.0))) * ((a + b) * (b - a));
} else {
tmp = (a + b) * (a * -sin((((double) M_PI) * (angle * 0.011111111111111112))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+27) {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * Math.abs((angle * (Math.PI * 0.005555555555555556))))));
} else if ((angle / 180.0) <= 5e+169) {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * ((angle / 180.0) * Math.PI))));
} else if ((angle / 180.0) <= 1e+273) {
tmp = (2.0 * Math.sin(((angle * Math.PI) / 180.0))) * ((a + b) * (b - a));
} else {
tmp = (a + b) * (a * -Math.sin((Math.PI * (angle * 0.011111111111111112))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -5e+27: tmp = (a + b) * ((b - a) * math.sin((2.0 * math.fabs((angle * (math.pi * 0.005555555555555556)))))) elif (angle / 180.0) <= 5e+169: tmp = (a + b) * ((b - a) * math.sin((2.0 * ((angle / 180.0) * math.pi)))) elif (angle / 180.0) <= 1e+273: tmp = (2.0 * math.sin(((angle * math.pi) / 180.0))) * ((a + b) * (b - a)) else: tmp = (a + b) * (a * -math.sin((math.pi * (angle * 0.011111111111111112)))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+27) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * abs(Float64(angle * Float64(pi * 0.005555555555555556))))))); elseif (Float64(angle / 180.0) <= 5e+169) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(Float64(angle / 180.0) * pi))))); elseif (Float64(angle / 180.0) <= 1e+273) tmp = Float64(Float64(2.0 * sin(Float64(Float64(angle * pi) / 180.0))) * Float64(Float64(a + b) * Float64(b - a))); else tmp = Float64(Float64(a + b) * Float64(a * Float64(-sin(Float64(pi * Float64(angle * 0.011111111111111112)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= -5e+27) tmp = (a + b) * ((b - a) * sin((2.0 * abs((angle * (pi * 0.005555555555555556)))))); elseif ((angle / 180.0) <= 5e+169) tmp = (a + b) * ((b - a) * sin((2.0 * ((angle / 180.0) * pi)))); elseif ((angle / 180.0) <= 1e+273) tmp = (2.0 * sin(((angle * pi) / 180.0))) * ((a + b) * (b - a)); else tmp = (a + b) * (a * -sin((pi * (angle * 0.011111111111111112)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+27], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[Abs[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+169], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+273], N[(N[(2.0 * N[Sin[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(a * (-N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+27}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left|angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right|\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+169}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+273}:\\
\;\;\;\;\left(2 \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(a \cdot \left(-\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.99999999999999979e27Initial program 27.5%
*-commutative27.5%
associate-*l*27.5%
associate-*l*27.5%
unpow227.5%
unpow227.5%
difference-of-squares27.5%
Simplified27.5%
difference-of-squares27.5%
*-commutative27.5%
prod-diff18.7%
fma-neg18.7%
distribute-lft-in18.7%
Applied egg-rr17.8%
*-commutative17.8%
distribute-rgt-out17.8%
*-commutative17.8%
Simplified25.2%
rem-cube-cbrt29.5%
Applied egg-rr29.5%
rem-cube-cbrt25.2%
add-sqr-sqrt0.0%
sqrt-unprod20.8%
associate-*r*20.3%
associate-*r*19.2%
swap-sqr17.1%
pow217.1%
metadata-eval17.1%
Applied egg-rr17.1%
unpow217.1%
metadata-eval17.1%
swap-sqr19.2%
associate-*r*20.3%
associate-*r*20.8%
rem-sqrt-square43.9%
*-commutative43.9%
associate-*l*41.6%
*-commutative41.6%
Simplified41.6%
if -4.99999999999999979e27 < (/.f64 angle 180) < 5.00000000000000017e169Initial program 74.5%
*-commutative74.5%
associate-*l*74.5%
associate-*l*74.5%
unpow274.5%
unpow274.5%
difference-of-squares78.8%
Simplified78.8%
difference-of-squares74.5%
*-commutative74.5%
prod-diff58.9%
fma-neg58.9%
distribute-lft-in58.9%
Applied egg-rr61.8%
*-commutative61.8%
distribute-rgt-out61.8%
*-commutative61.8%
Simplified90.4%
metadata-eval90.4%
div-inv91.1%
Applied egg-rr91.1%
if 5.00000000000000017e169 < (/.f64 angle 180) < 9.99999999999999945e272Initial program 17.7%
*-commutative17.7%
associate-*l*17.7%
associate-*l*17.7%
unpow217.7%
unpow217.7%
difference-of-squares17.7%
Simplified17.7%
associate-*r/23.1%
Applied egg-rr23.1%
Taylor expanded in angle around 0 40.4%
if 9.99999999999999945e272 < (/.f64 angle 180) Initial program 44.1%
*-commutative44.1%
associate-*l*44.1%
associate-*l*44.1%
unpow244.1%
unpow244.1%
difference-of-squares44.1%
Simplified44.1%
difference-of-squares44.1%
*-commutative44.1%
prod-diff4.1%
fma-neg4.1%
distribute-lft-in4.1%
Applied egg-rr4.1%
*-commutative4.1%
distribute-rgt-out4.1%
*-commutative4.1%
Simplified64.1%
Taylor expanded in b around 0 48.0%
mul-1-neg48.0%
*-commutative48.0%
distribute-rgt-neg-in48.0%
associate-*r*64.1%
*-commutative64.1%
Simplified64.1%
Final simplification73.9%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) -5e+79)
(*
(+ a b)
(* (- b a) (sin (* 2.0 (fabs (* angle (* PI 0.005555555555555556)))))))
(*
(+ a b)
(*
(- b a)
(sin (* 2.0 (pow (cbrt (* 0.005555555555555556 (* angle PI))) 3.0)))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+79) {
tmp = (a + b) * ((b - a) * sin((2.0 * fabs((angle * (((double) M_PI) * 0.005555555555555556))))));
} else {
tmp = (a + b) * ((b - a) * sin((2.0 * pow(cbrt((0.005555555555555556 * (angle * ((double) M_PI)))), 3.0))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+79) {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * Math.abs((angle * (Math.PI * 0.005555555555555556))))));
} else {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * Math.pow(Math.cbrt((0.005555555555555556 * (angle * Math.PI))), 3.0))));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+79) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * abs(Float64(angle * Float64(pi * 0.005555555555555556))))))); else tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * (cbrt(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 3.0))))); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+79], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[Abs[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[Power[N[Power[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+79}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left|angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot {\left(\sqrt[3]{0.005555555555555556 \cdot \left(angle \cdot \pi\right)}\right)}^{3}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5e79Initial program 27.5%
*-commutative27.5%
associate-*l*27.5%
associate-*l*27.5%
unpow227.5%
unpow227.5%
difference-of-squares27.5%
Simplified27.5%
difference-of-squares27.5%
*-commutative27.5%
prod-diff18.6%
fma-neg18.6%
distribute-lft-in18.6%
Applied egg-rr17.5%
*-commutative17.5%
distribute-rgt-out17.5%
*-commutative17.5%
Simplified26.4%
rem-cube-cbrt27.4%
Applied egg-rr27.4%
rem-cube-cbrt26.4%
add-sqr-sqrt0.0%
sqrt-unprod16.2%
associate-*r*17.5%
associate-*r*16.1%
swap-sqr14.2%
pow214.2%
metadata-eval14.2%
Applied egg-rr14.2%
unpow214.2%
metadata-eval14.2%
swap-sqr16.1%
associate-*r*17.5%
associate-*r*16.2%
rem-sqrt-square44.3%
*-commutative44.3%
associate-*l*43.6%
*-commutative43.6%
Simplified43.6%
if -5e79 < (/.f64 angle 180) Initial program 65.8%
*-commutative65.8%
associate-*l*65.8%
associate-*l*65.8%
unpow265.8%
unpow265.8%
difference-of-squares69.3%
Simplified69.3%
difference-of-squares65.8%
*-commutative65.8%
prod-diff50.9%
fma-neg50.9%
distribute-lft-in50.9%
Applied egg-rr53.3%
*-commutative53.3%
distribute-rgt-out53.3%
*-commutative53.3%
Simplified78.9%
rem-cube-cbrt80.1%
Applied egg-rr80.1%
Taylor expanded in angle around 0 80.4%
Final simplification72.3%
(FPCore (a b angle) :precision binary64 (if (<= b 1.9e+153) (* (+ a b) (* (- b a) (sin (* 2.0 (/ 1.0 (/ 180.0 (* angle PI))))))) (* (+ a b) (* (- b a) (* PI (* angle 0.011111111111111112))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.9e+153) {
tmp = (a + b) * ((b - a) * sin((2.0 * (1.0 / (180.0 / (angle * ((double) M_PI)))))));
} else {
tmp = (a + b) * ((b - a) * (((double) M_PI) * (angle * 0.011111111111111112)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.9e+153) {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * (1.0 / (180.0 / (angle * Math.PI))))));
} else {
tmp = (a + b) * ((b - a) * (Math.PI * (angle * 0.011111111111111112)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.9e+153: tmp = (a + b) * ((b - a) * math.sin((2.0 * (1.0 / (180.0 / (angle * math.pi)))))) else: tmp = (a + b) * ((b - a) * (math.pi * (angle * 0.011111111111111112))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.9e+153) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(1.0 / Float64(180.0 / Float64(angle * pi))))))); else tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(pi * Float64(angle * 0.011111111111111112)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.9e+153) tmp = (a + b) * ((b - a) * sin((2.0 * (1.0 / (180.0 / (angle * pi)))))); else tmp = (a + b) * ((b - a) * (pi * (angle * 0.011111111111111112))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.9e+153], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(1.0 / N[(180.0 / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.9 \cdot 10^{+153}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \frac{1}{\frac{180}{angle \cdot \pi}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.89999999999999983e153Initial program 59.4%
*-commutative59.4%
associate-*l*59.4%
associate-*l*59.4%
unpow259.4%
unpow259.4%
difference-of-squares61.1%
Simplified61.1%
difference-of-squares59.4%
*-commutative59.4%
prod-diff44.3%
fma-neg44.3%
distribute-lft-in44.3%
Applied egg-rr44.8%
*-commutative44.8%
distribute-rgt-out44.8%
*-commutative44.8%
Simplified66.4%
associate-*r*66.0%
metadata-eval66.0%
div-inv66.7%
clear-num67.4%
Applied egg-rr67.4%
if 1.89999999999999983e153 < b Initial program 40.1%
*-commutative40.1%
associate-*l*40.1%
associate-*l*40.1%
unpow240.1%
unpow240.1%
difference-of-squares51.8%
Simplified51.8%
difference-of-squares40.1%
*-commutative40.1%
prod-diff40.1%
fma-neg40.1%
distribute-lft-in40.1%
Applied egg-rr51.8%
*-commutative51.8%
distribute-rgt-out51.8%
*-commutative51.8%
Simplified76.9%
Taylor expanded in angle around 0 80.6%
associate-*r*80.7%
Simplified80.7%
Final simplification68.8%
(FPCore (a b angle) :precision binary64 (if (<= b 6.9e+245) (* (+ a b) (* (- b a) (sin (* 2.0 (* (/ angle 180.0) PI))))) (* 0.011111111111111112 (* (+ a b) (* (- b a) (* angle PI))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 6.9e+245) {
tmp = (a + b) * ((b - a) * sin((2.0 * ((angle / 180.0) * ((double) M_PI)))));
} else {
tmp = 0.011111111111111112 * ((a + b) * ((b - a) * (angle * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 6.9e+245) {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * ((angle / 180.0) * Math.PI))));
} else {
tmp = 0.011111111111111112 * ((a + b) * ((b - a) * (angle * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 6.9e+245: tmp = (a + b) * ((b - a) * math.sin((2.0 * ((angle / 180.0) * math.pi)))) else: tmp = 0.011111111111111112 * ((a + b) * ((b - a) * (angle * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 6.9e+245) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(Float64(angle / 180.0) * pi))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(angle * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 6.9e+245) tmp = (a + b) * ((b - a) * sin((2.0 * ((angle / 180.0) * pi)))); else tmp = 0.011111111111111112 * ((a + b) * ((b - a) * (angle * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 6.9e+245], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.9 \cdot 10^{+245}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 6.89999999999999983e245Initial program 58.2%
*-commutative58.2%
associate-*l*58.2%
associate-*l*58.2%
unpow258.2%
unpow258.2%
difference-of-squares59.9%
Simplified59.9%
difference-of-squares58.2%
*-commutative58.2%
prod-diff43.9%
fma-neg43.9%
distribute-lft-in43.9%
Applied egg-rr44.4%
*-commutative44.4%
distribute-rgt-out44.4%
*-commutative44.4%
Simplified67.2%
metadata-eval67.2%
div-inv68.0%
Applied egg-rr68.0%
if 6.89999999999999983e245 < b Initial program 43.2%
*-commutative43.2%
associate-*l*43.2%
associate-*l*43.2%
unpow243.2%
unpow243.2%
difference-of-squares64.7%
Simplified64.7%
Taylor expanded in angle around 0 79.0%
add-sqr-sqrt35.7%
sqrt-unprod42.9%
pow242.9%
associate-*r*42.9%
*-commutative42.9%
+-commutative42.9%
*-commutative42.9%
Applied egg-rr42.9%
sqrt-pow179.0%
metadata-eval79.0%
pow179.0%
associate-*r*85.7%
Applied egg-rr85.7%
Final simplification68.9%
(FPCore (a b angle) :precision binary64 (if (<= b 7.6e+23) (* (+ a b) (* (- b a) (sin (* angle (* PI 0.011111111111111112))))) (* (+ a b) (* 0.011111111111111112 (* (- b a) (* angle PI))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 7.6e+23) {
tmp = (a + b) * ((b - a) * sin((angle * (((double) M_PI) * 0.011111111111111112))));
} else {
tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 7.6e+23) {
tmp = (a + b) * ((b - a) * Math.sin((angle * (Math.PI * 0.011111111111111112))));
} else {
tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 7.6e+23: tmp = (a + b) * ((b - a) * math.sin((angle * (math.pi * 0.011111111111111112)))) else: tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 7.6e+23) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(angle * Float64(pi * 0.011111111111111112))))); else tmp = Float64(Float64(a + b) * Float64(0.011111111111111112 * Float64(Float64(b - a) * Float64(angle * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 7.6e+23) tmp = (a + b) * ((b - a) * sin((angle * (pi * 0.011111111111111112)))); else tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 7.6e+23], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(0.011111111111111112 * N[(N[(b - a), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.6 \cdot 10^{+23}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 7.5999999999999995e23Initial program 59.6%
*-commutative59.6%
associate-*l*59.6%
associate-*l*59.6%
unpow259.6%
unpow259.6%
difference-of-squares61.6%
Simplified61.6%
difference-of-squares59.6%
*-commutative59.6%
prod-diff43.8%
fma-neg43.8%
distribute-lft-in43.8%
Applied egg-rr44.6%
*-commutative44.6%
distribute-rgt-out44.6%
*-commutative44.6%
Simplified67.4%
rem-cube-cbrt67.5%
Applied egg-rr67.5%
Taylor expanded in angle around 0 69.2%
Taylor expanded in angle around inf 66.9%
*-commutative66.9%
associate-*l*67.9%
Simplified67.9%
if 7.5999999999999995e23 < b Initial program 49.5%
*-commutative49.5%
associate-*l*49.5%
associate-*l*49.5%
unpow249.5%
unpow249.5%
difference-of-squares55.0%
Simplified55.0%
difference-of-squares49.5%
*-commutative49.5%
prod-diff44.0%
fma-neg44.0%
distribute-lft-in44.0%
Applied egg-rr48.8%
*-commutative48.8%
distribute-rgt-out48.8%
*-commutative48.8%
Simplified67.7%
Taylor expanded in angle around 0 69.0%
associate-*r*68.9%
Simplified68.9%
Final simplification68.1%
(FPCore (a b angle) :precision binary64 (if (<= b 9e-122) (* (+ a b) (* (- a) (sin (* (* angle PI) 0.011111111111111112)))) (* (+ a b) (* (* angle 0.011111111111111112) (* (- b a) PI)))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 9e-122) {
tmp = (a + b) * (-a * sin(((angle * ((double) M_PI)) * 0.011111111111111112)));
} else {
tmp = (a + b) * ((angle * 0.011111111111111112) * ((b - a) * ((double) M_PI)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 9e-122) {
tmp = (a + b) * (-a * Math.sin(((angle * Math.PI) * 0.011111111111111112)));
} else {
tmp = (a + b) * ((angle * 0.011111111111111112) * ((b - a) * Math.PI));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 9e-122: tmp = (a + b) * (-a * math.sin(((angle * math.pi) * 0.011111111111111112))) else: tmp = (a + b) * ((angle * 0.011111111111111112) * ((b - a) * math.pi)) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 9e-122) tmp = Float64(Float64(a + b) * Float64(Float64(-a) * sin(Float64(Float64(angle * pi) * 0.011111111111111112)))); else tmp = Float64(Float64(a + b) * Float64(Float64(angle * 0.011111111111111112) * Float64(Float64(b - a) * pi))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 9e-122) tmp = (a + b) * (-a * sin(((angle * pi) * 0.011111111111111112))); else tmp = (a + b) * ((angle * 0.011111111111111112) * ((b - a) * pi)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 9e-122], N[(N[(a + b), $MachinePrecision] * N[((-a) * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9 \cdot 10^{-122}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(-a\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < 8.99999999999999959e-122Initial program 57.7%
*-commutative57.7%
associate-*l*57.7%
associate-*l*57.7%
unpow257.7%
unpow257.7%
difference-of-squares60.2%
Simplified60.2%
difference-of-squares57.7%
*-commutative57.7%
prod-diff43.1%
fma-neg43.1%
distribute-lft-in43.1%
Applied egg-rr44.0%
*-commutative44.0%
distribute-rgt-out44.0%
*-commutative44.0%
Simplified66.2%
add-cube-cbrt65.7%
pow365.7%
Applied egg-rr65.7%
Taylor expanded in b around 0 50.6%
mul-1-neg50.6%
pow-base-150.6%
*-lft-identity50.6%
*-commutative50.6%
Simplified50.6%
if 8.99999999999999959e-122 < b Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares60.1%
Simplified60.1%
difference-of-squares56.9%
*-commutative56.9%
prod-diff45.1%
fma-neg45.1%
distribute-lft-in45.1%
Applied egg-rr47.9%
*-commutative47.9%
distribute-rgt-out47.9%
*-commutative47.9%
Simplified69.6%
Taylor expanded in angle around 0 69.3%
associate-*r*69.4%
*-commutative69.4%
Simplified69.4%
Final simplification57.5%
(FPCore (a b angle) :precision binary64 (if (<= b 2.2e-62) (* (+ a b) (* a (- (sin (* PI (* angle 0.011111111111111112)))))) (* (+ a b) (* 0.011111111111111112 (* (- b a) (* angle PI))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 2.2e-62) {
tmp = (a + b) * (a * -sin((((double) M_PI) * (angle * 0.011111111111111112))));
} else {
tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 2.2e-62) {
tmp = (a + b) * (a * -Math.sin((Math.PI * (angle * 0.011111111111111112))));
} else {
tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 2.2e-62: tmp = (a + b) * (a * -math.sin((math.pi * (angle * 0.011111111111111112)))) else: tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 2.2e-62) tmp = Float64(Float64(a + b) * Float64(a * Float64(-sin(Float64(pi * Float64(angle * 0.011111111111111112)))))); else tmp = Float64(Float64(a + b) * Float64(0.011111111111111112 * Float64(Float64(b - a) * Float64(angle * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 2.2e-62) tmp = (a + b) * (a * -sin((pi * (angle * 0.011111111111111112)))); else tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 2.2e-62], N[(N[(a + b), $MachinePrecision] * N[(a * (-N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(0.011111111111111112 * N[(N[(b - a), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.2 \cdot 10^{-62}:\\
\;\;\;\;\left(a + b\right) \cdot \left(a \cdot \left(-\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.20000000000000017e-62Initial program 58.1%
*-commutative58.1%
associate-*l*58.1%
associate-*l*58.1%
unpow258.1%
unpow258.1%
difference-of-squares60.3%
Simplified60.3%
difference-of-squares58.1%
*-commutative58.1%
prod-diff43.7%
fma-neg43.7%
distribute-lft-in43.7%
Applied egg-rr44.6%
*-commutative44.6%
distribute-rgt-out44.6%
*-commutative44.6%
Simplified66.8%
Taylor expanded in b around 0 51.9%
mul-1-neg51.9%
*-commutative51.9%
distribute-rgt-neg-in51.9%
associate-*r*51.8%
*-commutative51.8%
Simplified51.8%
if 2.20000000000000017e-62 < b Initial program 56.0%
*-commutative56.0%
associate-*l*56.0%
associate-*l*56.0%
unpow256.0%
unpow256.0%
difference-of-squares59.9%
Simplified59.9%
difference-of-squares56.0%
*-commutative56.0%
prod-diff44.1%
fma-neg44.1%
distribute-lft-in44.1%
Applied egg-rr47.6%
*-commutative47.6%
distribute-rgt-out47.6%
*-commutative47.6%
Simplified69.1%
Taylor expanded in angle around 0 71.1%
associate-*r*71.1%
Simplified71.1%
Final simplification57.6%
(FPCore (a b angle) :precision binary64 (if (<= b 6.2e-147) (* (* -2.0 (* a a)) (sin (* angle (* PI 0.005555555555555556)))) (* (+ a b) (* (* angle 0.011111111111111112) (* (- b a) PI)))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 6.2e-147) {
tmp = (-2.0 * (a * a)) * sin((angle * (((double) M_PI) * 0.005555555555555556)));
} else {
tmp = (a + b) * ((angle * 0.011111111111111112) * ((b - a) * ((double) M_PI)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 6.2e-147) {
tmp = (-2.0 * (a * a)) * Math.sin((angle * (Math.PI * 0.005555555555555556)));
} else {
tmp = (a + b) * ((angle * 0.011111111111111112) * ((b - a) * Math.PI));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 6.2e-147: tmp = (-2.0 * (a * a)) * math.sin((angle * (math.pi * 0.005555555555555556))) else: tmp = (a + b) * ((angle * 0.011111111111111112) * ((b - a) * math.pi)) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 6.2e-147) tmp = Float64(Float64(-2.0 * Float64(a * a)) * sin(Float64(angle * Float64(pi * 0.005555555555555556)))); else tmp = Float64(Float64(a + b) * Float64(Float64(angle * 0.011111111111111112) * Float64(Float64(b - a) * pi))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 6.2e-147) tmp = (-2.0 * (a * a)) * sin((angle * (pi * 0.005555555555555556))); else tmp = (a + b) * ((angle * 0.011111111111111112) * ((b - a) * pi)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 6.2e-147], N[(N[(-2.0 * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.2 \cdot 10^{-147}:\\
\;\;\;\;\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(angle \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\\
\end{array}
\end{array}
if b < 6.2000000000000005e-147Initial program 58.4%
*-commutative58.4%
associate-*l*58.4%
associate-*l*58.4%
unpow258.4%
unpow258.4%
difference-of-squares61.0%
Simplified61.0%
associate-*r/60.7%
Applied egg-rr60.7%
Taylor expanded in angle around 0 59.4%
Taylor expanded in b around 0 40.6%
associate-*r*40.6%
unpow240.6%
*-commutative40.6%
associate-*l*42.6%
Simplified42.6%
if 6.2000000000000005e-147 < b Initial program 55.9%
*-commutative55.9%
associate-*l*55.9%
associate-*l*55.9%
unpow255.9%
unpow255.9%
difference-of-squares59.0%
Simplified59.0%
difference-of-squares55.9%
*-commutative55.9%
prod-diff43.9%
fma-neg43.9%
distribute-lft-in43.9%
Applied egg-rr46.3%
*-commutative46.3%
distribute-rgt-out46.3%
*-commutative46.3%
Simplified68.6%
Taylor expanded in angle around 0 67.3%
associate-*r*67.3%
*-commutative67.3%
Simplified67.3%
Final simplification52.4%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* angle (* PI (* (+ a b) (- b a))))))
(if (or (<= angle -3.05e+237)
(and (not (<= angle -2e+173))
(or (<= angle -2.2e+69)
(and (not (<= angle -6600.0)) (<= angle 5.4e+169)))))
(* 0.011111111111111112 t_0)
(* t_0 -0.011111111111111112))))
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) * ((a + b) * (b - a)));
double tmp;
if ((angle <= -3.05e+237) || (!(angle <= -2e+173) && ((angle <= -2.2e+69) || (!(angle <= -6600.0) && (angle <= 5.4e+169))))) {
tmp = 0.011111111111111112 * t_0;
} else {
tmp = t_0 * -0.011111111111111112;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = angle * (Math.PI * ((a + b) * (b - a)));
double tmp;
if ((angle <= -3.05e+237) || (!(angle <= -2e+173) && ((angle <= -2.2e+69) || (!(angle <= -6600.0) && (angle <= 5.4e+169))))) {
tmp = 0.011111111111111112 * t_0;
} else {
tmp = t_0 * -0.011111111111111112;
}
return tmp;
}
def code(a, b, angle): t_0 = angle * (math.pi * ((a + b) * (b - a))) tmp = 0 if (angle <= -3.05e+237) or (not (angle <= -2e+173) and ((angle <= -2.2e+69) or (not (angle <= -6600.0) and (angle <= 5.4e+169)))): tmp = 0.011111111111111112 * t_0 else: tmp = t_0 * -0.011111111111111112 return tmp
function code(a, b, angle) t_0 = Float64(angle * Float64(pi * Float64(Float64(a + b) * Float64(b - a)))) tmp = 0.0 if ((angle <= -3.05e+237) || (!(angle <= -2e+173) && ((angle <= -2.2e+69) || (!(angle <= -6600.0) && (angle <= 5.4e+169))))) tmp = Float64(0.011111111111111112 * t_0); else tmp = Float64(t_0 * -0.011111111111111112); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = angle * (pi * ((a + b) * (b - a))); tmp = 0.0; if ((angle <= -3.05e+237) || (~((angle <= -2e+173)) && ((angle <= -2.2e+69) || (~((angle <= -6600.0)) && (angle <= 5.4e+169))))) tmp = 0.011111111111111112 * t_0; else tmp = t_0 * -0.011111111111111112; end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[angle, -3.05e+237], And[N[Not[LessEqual[angle, -2e+173]], $MachinePrecision], Or[LessEqual[angle, -2.2e+69], And[N[Not[LessEqual[angle, -6600.0]], $MachinePrecision], LessEqual[angle, 5.4e+169]]]]], N[(0.011111111111111112 * t$95$0), $MachinePrecision], N[(t$95$0 * -0.011111111111111112), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\\
\mathbf{if}\;angle \leq -3.05 \cdot 10^{+237} \lor \neg \left(angle \leq -2 \cdot 10^{+173}\right) \land \left(angle \leq -2.2 \cdot 10^{+69} \lor \neg \left(angle \leq -6600\right) \land angle \leq 5.4 \cdot 10^{+169}\right):\\
\;\;\;\;0.011111111111111112 \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot -0.011111111111111112\\
\end{array}
\end{array}
if angle < -3.0500000000000001e237 or -2e173 < angle < -2.2000000000000002e69 or -6600 < angle < 5.39999999999999981e169Initial program 65.1%
*-commutative65.1%
associate-*l*65.1%
associate-*l*65.1%
unpow265.1%
unpow265.1%
difference-of-squares68.1%
Simplified68.1%
Taylor expanded in angle around 0 70.6%
if -3.0500000000000001e237 < angle < -2e173 or -2.2000000000000002e69 < angle < -6600 or 5.39999999999999981e169 < angle Initial program 28.6%
*-commutative28.6%
associate-*l*28.6%
associate-*l*28.6%
unpow228.6%
unpow228.6%
difference-of-squares30.4%
Simplified30.4%
Taylor expanded in angle around 0 11.3%
add-sqr-sqrt6.7%
sqrt-unprod35.1%
pow235.1%
associate-*r*35.1%
*-commutative35.1%
+-commutative35.1%
*-commutative35.1%
Applied egg-rr35.1%
Taylor expanded in angle around -inf 47.5%
+-commutative47.5%
*-commutative47.5%
Simplified47.5%
Final simplification65.7%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* angle (* PI (* (+ a b) (- b a)))))
(t_1 (* t_0 -0.011111111111111112))
(t_2 (* 0.011111111111111112 t_0)))
(if (<= angle -3.05e+237)
t_2
(if (<= angle -2e+173)
t_1
(if (<= angle -2.2e+69)
t_2
(if (or (<= angle -6600.0) (not (<= angle 5.4e+169)))
t_1
(* 0.011111111111111112 (* (+ a b) (* (- b a) (* angle PI))))))))))
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) * ((a + b) * (b - a)));
double t_1 = t_0 * -0.011111111111111112;
double t_2 = 0.011111111111111112 * t_0;
double tmp;
if (angle <= -3.05e+237) {
tmp = t_2;
} else if (angle <= -2e+173) {
tmp = t_1;
} else if (angle <= -2.2e+69) {
tmp = t_2;
} else if ((angle <= -6600.0) || !(angle <= 5.4e+169)) {
tmp = t_1;
} else {
tmp = 0.011111111111111112 * ((a + b) * ((b - a) * (angle * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = angle * (Math.PI * ((a + b) * (b - a)));
double t_1 = t_0 * -0.011111111111111112;
double t_2 = 0.011111111111111112 * t_0;
double tmp;
if (angle <= -3.05e+237) {
tmp = t_2;
} else if (angle <= -2e+173) {
tmp = t_1;
} else if (angle <= -2.2e+69) {
tmp = t_2;
} else if ((angle <= -6600.0) || !(angle <= 5.4e+169)) {
tmp = t_1;
} else {
tmp = 0.011111111111111112 * ((a + b) * ((b - a) * (angle * Math.PI)));
}
return tmp;
}
def code(a, b, angle): t_0 = angle * (math.pi * ((a + b) * (b - a))) t_1 = t_0 * -0.011111111111111112 t_2 = 0.011111111111111112 * t_0 tmp = 0 if angle <= -3.05e+237: tmp = t_2 elif angle <= -2e+173: tmp = t_1 elif angle <= -2.2e+69: tmp = t_2 elif (angle <= -6600.0) or not (angle <= 5.4e+169): tmp = t_1 else: tmp = 0.011111111111111112 * ((a + b) * ((b - a) * (angle * math.pi))) return tmp
function code(a, b, angle) t_0 = Float64(angle * Float64(pi * Float64(Float64(a + b) * Float64(b - a)))) t_1 = Float64(t_0 * -0.011111111111111112) t_2 = Float64(0.011111111111111112 * t_0) tmp = 0.0 if (angle <= -3.05e+237) tmp = t_2; elseif (angle <= -2e+173) tmp = t_1; elseif (angle <= -2.2e+69) tmp = t_2; elseif ((angle <= -6600.0) || !(angle <= 5.4e+169)) tmp = t_1; else tmp = Float64(0.011111111111111112 * Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(angle * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = angle * (pi * ((a + b) * (b - a))); t_1 = t_0 * -0.011111111111111112; t_2 = 0.011111111111111112 * t_0; tmp = 0.0; if (angle <= -3.05e+237) tmp = t_2; elseif (angle <= -2e+173) tmp = t_1; elseif (angle <= -2.2e+69) tmp = t_2; elseif ((angle <= -6600.0) || ~((angle <= 5.4e+169))) tmp = t_1; else tmp = 0.011111111111111112 * ((a + b) * ((b - a) * (angle * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * -0.011111111111111112), $MachinePrecision]}, Block[{t$95$2 = N[(0.011111111111111112 * t$95$0), $MachinePrecision]}, If[LessEqual[angle, -3.05e+237], t$95$2, If[LessEqual[angle, -2e+173], t$95$1, If[LessEqual[angle, -2.2e+69], t$95$2, If[Or[LessEqual[angle, -6600.0], N[Not[LessEqual[angle, 5.4e+169]], $MachinePrecision]], t$95$1, N[(0.011111111111111112 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\\
t_1 := t_0 \cdot -0.011111111111111112\\
t_2 := 0.011111111111111112 \cdot t_0\\
\mathbf{if}\;angle \leq -3.05 \cdot 10^{+237}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;angle \leq -2 \cdot 10^{+173}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;angle \leq -2.2 \cdot 10^{+69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;angle \leq -6600 \lor \neg \left(angle \leq 5.4 \cdot 10^{+169}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if angle < -3.0500000000000001e237 or -2e173 < angle < -2.2000000000000002e69Initial program 31.8%
*-commutative31.8%
associate-*l*31.8%
associate-*l*31.8%
unpow231.8%
unpow231.8%
difference-of-squares31.8%
Simplified31.8%
Taylor expanded in angle around 0 43.7%
if -3.0500000000000001e237 < angle < -2e173 or -2.2000000000000002e69 < angle < -6600 or 5.39999999999999981e169 < angle Initial program 28.6%
*-commutative28.6%
associate-*l*28.6%
associate-*l*28.6%
unpow228.6%
unpow228.6%
difference-of-squares30.4%
Simplified30.4%
Taylor expanded in angle around 0 11.3%
add-sqr-sqrt6.7%
sqrt-unprod35.1%
pow235.1%
associate-*r*35.1%
*-commutative35.1%
+-commutative35.1%
*-commutative35.1%
Applied egg-rr35.1%
Taylor expanded in angle around -inf 47.5%
+-commutative47.5%
*-commutative47.5%
Simplified47.5%
if -6600 < angle < 5.39999999999999981e169Initial program 74.2%
*-commutative74.2%
associate-*l*74.2%
associate-*l*74.2%
unpow274.2%
unpow274.2%
difference-of-squares78.0%
Simplified78.0%
Taylor expanded in angle around 0 77.9%
add-sqr-sqrt42.5%
sqrt-unprod38.4%
pow238.4%
associate-*r*38.4%
*-commutative38.4%
+-commutative38.4%
*-commutative38.4%
Applied egg-rr38.4%
sqrt-pow177.8%
metadata-eval77.8%
pow177.8%
associate-*r*90.6%
Applied egg-rr90.6%
Final simplification73.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* angle (* PI (* (+ a b) (- b a)))))
(t_1 (* t_0 -0.011111111111111112))
(t_2 (* 0.011111111111111112 t_0)))
(if (<= angle -3.05e+237)
t_2
(if (<= angle -2e+173)
t_1
(if (<= angle -2.2e+69)
t_2
(if (or (<= angle -6600.0) (not (<= angle 5.4e+169)))
t_1
(* (+ a b) (* 0.011111111111111112 (* (- b a) (* angle PI))))))))))
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) * ((a + b) * (b - a)));
double t_1 = t_0 * -0.011111111111111112;
double t_2 = 0.011111111111111112 * t_0;
double tmp;
if (angle <= -3.05e+237) {
tmp = t_2;
} else if (angle <= -2e+173) {
tmp = t_1;
} else if (angle <= -2.2e+69) {
tmp = t_2;
} else if ((angle <= -6600.0) || !(angle <= 5.4e+169)) {
tmp = t_1;
} else {
tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = angle * (Math.PI * ((a + b) * (b - a)));
double t_1 = t_0 * -0.011111111111111112;
double t_2 = 0.011111111111111112 * t_0;
double tmp;
if (angle <= -3.05e+237) {
tmp = t_2;
} else if (angle <= -2e+173) {
tmp = t_1;
} else if (angle <= -2.2e+69) {
tmp = t_2;
} else if ((angle <= -6600.0) || !(angle <= 5.4e+169)) {
tmp = t_1;
} else {
tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * Math.PI)));
}
return tmp;
}
def code(a, b, angle): t_0 = angle * (math.pi * ((a + b) * (b - a))) t_1 = t_0 * -0.011111111111111112 t_2 = 0.011111111111111112 * t_0 tmp = 0 if angle <= -3.05e+237: tmp = t_2 elif angle <= -2e+173: tmp = t_1 elif angle <= -2.2e+69: tmp = t_2 elif (angle <= -6600.0) or not (angle <= 5.4e+169): tmp = t_1 else: tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * math.pi))) return tmp
function code(a, b, angle) t_0 = Float64(angle * Float64(pi * Float64(Float64(a + b) * Float64(b - a)))) t_1 = Float64(t_0 * -0.011111111111111112) t_2 = Float64(0.011111111111111112 * t_0) tmp = 0.0 if (angle <= -3.05e+237) tmp = t_2; elseif (angle <= -2e+173) tmp = t_1; elseif (angle <= -2.2e+69) tmp = t_2; elseif ((angle <= -6600.0) || !(angle <= 5.4e+169)) tmp = t_1; else tmp = Float64(Float64(a + b) * Float64(0.011111111111111112 * Float64(Float64(b - a) * Float64(angle * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = angle * (pi * ((a + b) * (b - a))); t_1 = t_0 * -0.011111111111111112; t_2 = 0.011111111111111112 * t_0; tmp = 0.0; if (angle <= -3.05e+237) tmp = t_2; elseif (angle <= -2e+173) tmp = t_1; elseif (angle <= -2.2e+69) tmp = t_2; elseif ((angle <= -6600.0) || ~((angle <= 5.4e+169))) tmp = t_1; else tmp = (a + b) * (0.011111111111111112 * ((b - a) * (angle * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * -0.011111111111111112), $MachinePrecision]}, Block[{t$95$2 = N[(0.011111111111111112 * t$95$0), $MachinePrecision]}, If[LessEqual[angle, -3.05e+237], t$95$2, If[LessEqual[angle, -2e+173], t$95$1, If[LessEqual[angle, -2.2e+69], t$95$2, If[Or[LessEqual[angle, -6600.0], N[Not[LessEqual[angle, 5.4e+169]], $MachinePrecision]], t$95$1, N[(N[(a + b), $MachinePrecision] * N[(0.011111111111111112 * N[(N[(b - a), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\\
t_1 := t_0 \cdot -0.011111111111111112\\
t_2 := 0.011111111111111112 \cdot t_0\\
\mathbf{if}\;angle \leq -3.05 \cdot 10^{+237}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;angle \leq -2 \cdot 10^{+173}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;angle \leq -2.2 \cdot 10^{+69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;angle \leq -6600 \lor \neg \left(angle \leq 5.4 \cdot 10^{+169}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(\left(b - a\right) \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if angle < -3.0500000000000001e237 or -2e173 < angle < -2.2000000000000002e69Initial program 31.8%
*-commutative31.8%
associate-*l*31.8%
associate-*l*31.8%
unpow231.8%
unpow231.8%
difference-of-squares31.8%
Simplified31.8%
Taylor expanded in angle around 0 43.7%
if -3.0500000000000001e237 < angle < -2e173 or -2.2000000000000002e69 < angle < -6600 or 5.39999999999999981e169 < angle Initial program 28.6%
*-commutative28.6%
associate-*l*28.6%
associate-*l*28.6%
unpow228.6%
unpow228.6%
difference-of-squares30.4%
Simplified30.4%
Taylor expanded in angle around 0 11.3%
add-sqr-sqrt6.7%
sqrt-unprod35.1%
pow235.1%
associate-*r*35.1%
*-commutative35.1%
+-commutative35.1%
*-commutative35.1%
Applied egg-rr35.1%
Taylor expanded in angle around -inf 47.5%
+-commutative47.5%
*-commutative47.5%
Simplified47.5%
if -6600 < angle < 5.39999999999999981e169Initial program 74.2%
*-commutative74.2%
associate-*l*74.2%
associate-*l*74.2%
unpow274.2%
unpow274.2%
difference-of-squares78.0%
Simplified78.0%
difference-of-squares74.2%
*-commutative74.2%
prod-diff59.9%
fma-neg59.9%
distribute-lft-in59.9%
Applied egg-rr62.9%
*-commutative62.9%
distribute-rgt-out62.9%
*-commutative62.9%
Simplified90.1%
Taylor expanded in angle around 0 90.6%
associate-*r*90.6%
Simplified90.6%
Final simplification73.6%
(FPCore (a b angle)
:precision binary64
(if (<= a 80000.0)
(* 0.011111111111111112 (* angle (* PI (* b b))))
(if (or (<= a 5.8e+208) (not (<= a 2.3e+233)))
(* -0.011111111111111112 (* PI (* angle (* a a))))
(* (* angle (* PI (* (+ a b) (- b a)))) -0.011111111111111112))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 80000.0) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
} else if ((a <= 5.8e+208) || !(a <= 2.3e+233)) {
tmp = -0.011111111111111112 * (((double) M_PI) * (angle * (a * a)));
} else {
tmp = (angle * (((double) M_PI) * ((a + b) * (b - a)))) * -0.011111111111111112;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 80000.0) {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
} else if ((a <= 5.8e+208) || !(a <= 2.3e+233)) {
tmp = -0.011111111111111112 * (Math.PI * (angle * (a * a)));
} else {
tmp = (angle * (Math.PI * ((a + b) * (b - a)))) * -0.011111111111111112;
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 80000.0: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) elif (a <= 5.8e+208) or not (a <= 2.3e+233): tmp = -0.011111111111111112 * (math.pi * (angle * (a * a))) else: tmp = (angle * (math.pi * ((a + b) * (b - a)))) * -0.011111111111111112 return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 80000.0) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); elseif ((a <= 5.8e+208) || !(a <= 2.3e+233)) tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(angle * Float64(a * a)))); else tmp = Float64(Float64(angle * Float64(pi * Float64(Float64(a + b) * Float64(b - a)))) * -0.011111111111111112); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 80000.0) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); elseif ((a <= 5.8e+208) || ~((a <= 2.3e+233))) tmp = -0.011111111111111112 * (pi * (angle * (a * a))); else tmp = (angle * (pi * ((a + b) * (b - a)))) * -0.011111111111111112; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 80000.0], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 5.8e+208], N[Not[LessEqual[a, 2.3e+233]], $MachinePrecision]], N[(-0.011111111111111112 * N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 80000:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{+208} \lor \neg \left(a \leq 2.3 \cdot 10^{+233}\right):\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right) \cdot -0.011111111111111112\\
\end{array}
\end{array}
if a < 8e4Initial program 58.9%
*-commutative58.9%
associate-*l*58.9%
associate-*l*58.9%
unpow258.9%
unpow258.9%
difference-of-squares59.4%
Simplified59.4%
Taylor expanded in angle around 0 56.7%
Taylor expanded in a around 0 42.3%
*-commutative42.3%
unpow242.3%
Simplified42.3%
if 8e4 < a < 5.80000000000000017e208 or 2.30000000000000001e233 < a Initial program 53.1%
*-commutative53.1%
associate-*l*53.1%
associate-*l*53.1%
unpow253.1%
unpow253.1%
difference-of-squares64.7%
Simplified64.7%
Taylor expanded in angle around 0 66.7%
Taylor expanded in a around inf 52.9%
*-commutative52.9%
associate-*r*53.0%
*-commutative53.0%
*-commutative53.0%
unpow253.0%
Simplified53.0%
if 5.80000000000000017e208 < a < 2.30000000000000001e233Initial program 50.0%
*-commutative50.0%
associate-*l*50.0%
associate-*l*50.0%
unpow250.0%
unpow250.0%
difference-of-squares50.0%
Simplified50.0%
Taylor expanded in angle around 0 37.5%
add-sqr-sqrt37.5%
sqrt-unprod62.5%
pow262.5%
associate-*r*62.5%
*-commutative62.5%
+-commutative62.5%
*-commutative62.5%
Applied egg-rr62.5%
Taylor expanded in angle around -inf 62.5%
+-commutative62.5%
*-commutative62.5%
Simplified62.5%
Final simplification45.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* angle (* PI (* b b)))))
(if (<= angle -7.2e+106)
(* -0.011111111111111112 t_0)
(* 0.011111111111111112 t_0))))
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) * (b * b));
double tmp;
if (angle <= -7.2e+106) {
tmp = -0.011111111111111112 * t_0;
} else {
tmp = 0.011111111111111112 * t_0;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = angle * (Math.PI * (b * b));
double tmp;
if (angle <= -7.2e+106) {
tmp = -0.011111111111111112 * t_0;
} else {
tmp = 0.011111111111111112 * t_0;
}
return tmp;
}
def code(a, b, angle): t_0 = angle * (math.pi * (b * b)) tmp = 0 if angle <= -7.2e+106: tmp = -0.011111111111111112 * t_0 else: tmp = 0.011111111111111112 * t_0 return tmp
function code(a, b, angle) t_0 = Float64(angle * Float64(pi * Float64(b * b))) tmp = 0.0 if (angle <= -7.2e+106) tmp = Float64(-0.011111111111111112 * t_0); else tmp = Float64(0.011111111111111112 * t_0); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = angle * (pi * (b * b)); tmp = 0.0; if (angle <= -7.2e+106) tmp = -0.011111111111111112 * t_0; else tmp = 0.011111111111111112 * t_0; end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, -7.2e+106], N[(-0.011111111111111112 * t$95$0), $MachinePrecision], N[(0.011111111111111112 * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\\
\mathbf{if}\;angle \leq -7.2 \cdot 10^{+106}:\\
\;\;\;\;-0.011111111111111112 \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot t_0\\
\end{array}
\end{array}
if angle < -7.2000000000000002e106Initial program 27.0%
*-commutative27.0%
associate-*l*27.0%
associate-*l*27.0%
unpow227.0%
unpow227.0%
difference-of-squares27.0%
Simplified27.0%
Taylor expanded in angle around 0 27.1%
add-sqr-sqrt15.5%
sqrt-unprod30.7%
pow230.7%
associate-*r*30.7%
*-commutative30.7%
+-commutative30.7%
*-commutative30.7%
Applied egg-rr30.7%
Taylor expanded in b around -inf 28.4%
*-commutative28.4%
*-commutative28.4%
unpow228.4%
Simplified28.4%
if -7.2000000000000002e106 < angle Initial program 64.4%
*-commutative64.4%
associate-*l*64.4%
associate-*l*64.4%
unpow264.4%
unpow264.4%
difference-of-squares67.8%
Simplified67.8%
Taylor expanded in angle around 0 65.3%
Taylor expanded in a around 0 40.1%
*-commutative40.1%
unpow240.1%
Simplified40.1%
Final simplification37.9%
(FPCore (a b angle) :precision binary64 (if (<= a 31000.0) (* 0.011111111111111112 (* angle (* PI (* b b)))) (* -0.011111111111111112 (* PI (* angle (* a a))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 31000.0) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (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 <= 31000.0) {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
} else {
tmp = -0.011111111111111112 * (Math.PI * (angle * (a * a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 31000.0: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) else: tmp = -0.011111111111111112 * (math.pi * (angle * (a * a))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 31000.0) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * 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 <= 31000.0) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); else tmp = -0.011111111111111112 * (pi * (angle * (a * a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 31000.0], N[(0.011111111111111112 * N[(angle * N[(Pi * 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 31000:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \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 < 31000Initial program 58.9%
*-commutative58.9%
associate-*l*58.9%
associate-*l*58.9%
unpow258.9%
unpow258.9%
difference-of-squares59.4%
Simplified59.4%
Taylor expanded in angle around 0 56.7%
Taylor expanded in a around 0 42.3%
*-commutative42.3%
unpow242.3%
Simplified42.3%
if 31000 < a Initial program 52.7%
*-commutative52.7%
associate-*l*52.7%
associate-*l*52.7%
unpow252.7%
unpow252.7%
difference-of-squares62.7%
Simplified62.7%
Taylor expanded in angle around 0 62.8%
Taylor expanded in a around inf 50.8%
*-commutative50.8%
associate-*r*50.9%
*-commutative50.9%
*-commutative50.9%
unpow250.9%
Simplified50.9%
Final simplification44.4%
(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 57.4%
*-commutative57.4%
associate-*l*57.4%
associate-*l*57.4%
unpow257.4%
unpow257.4%
difference-of-squares60.2%
Simplified60.2%
Taylor expanded in angle around 0 58.1%
Taylor expanded in a around 0 36.0%
*-commutative36.0%
unpow236.0%
Simplified36.0%
Final simplification36.0%
herbie shell --seed 2023293
(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)))))