
(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 16 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 (* 2.0 (pow (+ a b) 2.0)))
(t_1 (* 0.005555555555555556 (* angle PI)))
(t_2 (* (+ a b) (sin t_1))))
(if (<= (/ angle 180.0) -5e+132)
(*
(* (sin (* (* (sqrt PI) (sqrt PI)) (* 0.005555555555555556 angle))) t_0)
(cos (* PI (/ angle 180.0))))
(if (<= (/ angle 180.0) -2e+25)
(* 2.0 (* (- b a) t_2))
(if (<= (/ angle 180.0) 1e+28)
(* 2.0 (* (- b a) (* (cos t_1) t_2)))
(* t_0 (sin (* PI (* 0.005555555555555556 angle)))))))))
double code(double a, double b, double angle) {
double t_0 = 2.0 * pow((a + b), 2.0);
double t_1 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_2 = (a + b) * sin(t_1);
double tmp;
if ((angle / 180.0) <= -5e+132) {
tmp = (sin(((sqrt(((double) M_PI)) * sqrt(((double) M_PI))) * (0.005555555555555556 * angle))) * t_0) * cos((((double) M_PI) * (angle / 180.0)));
} else if ((angle / 180.0) <= -2e+25) {
tmp = 2.0 * ((b - a) * t_2);
} else if ((angle / 180.0) <= 1e+28) {
tmp = 2.0 * ((b - a) * (cos(t_1) * t_2));
} else {
tmp = t_0 * sin((((double) M_PI) * (0.005555555555555556 * angle)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 2.0 * Math.pow((a + b), 2.0);
double t_1 = 0.005555555555555556 * (angle * Math.PI);
double t_2 = (a + b) * Math.sin(t_1);
double tmp;
if ((angle / 180.0) <= -5e+132) {
tmp = (Math.sin(((Math.sqrt(Math.PI) * Math.sqrt(Math.PI)) * (0.005555555555555556 * angle))) * t_0) * Math.cos((Math.PI * (angle / 180.0)));
} else if ((angle / 180.0) <= -2e+25) {
tmp = 2.0 * ((b - a) * t_2);
} else if ((angle / 180.0) <= 1e+28) {
tmp = 2.0 * ((b - a) * (Math.cos(t_1) * t_2));
} else {
tmp = t_0 * Math.sin((Math.PI * (0.005555555555555556 * angle)));
}
return tmp;
}
def code(a, b, angle): t_0 = 2.0 * math.pow((a + b), 2.0) t_1 = 0.005555555555555556 * (angle * math.pi) t_2 = (a + b) * math.sin(t_1) tmp = 0 if (angle / 180.0) <= -5e+132: tmp = (math.sin(((math.sqrt(math.pi) * math.sqrt(math.pi)) * (0.005555555555555556 * angle))) * t_0) * math.cos((math.pi * (angle / 180.0))) elif (angle / 180.0) <= -2e+25: tmp = 2.0 * ((b - a) * t_2) elif (angle / 180.0) <= 1e+28: tmp = 2.0 * ((b - a) * (math.cos(t_1) * t_2)) else: tmp = t_0 * math.sin((math.pi * (0.005555555555555556 * angle))) return tmp
function code(a, b, angle) t_0 = Float64(2.0 * (Float64(a + b) ^ 2.0)) t_1 = Float64(0.005555555555555556 * Float64(angle * pi)) t_2 = Float64(Float64(a + b) * sin(t_1)) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+132) tmp = Float64(Float64(sin(Float64(Float64(sqrt(pi) * sqrt(pi)) * Float64(0.005555555555555556 * angle))) * t_0) * cos(Float64(pi * Float64(angle / 180.0)))); elseif (Float64(angle / 180.0) <= -2e+25) tmp = Float64(2.0 * Float64(Float64(b - a) * t_2)); elseif (Float64(angle / 180.0) <= 1e+28) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_1) * t_2))); else tmp = Float64(t_0 * sin(Float64(pi * Float64(0.005555555555555556 * angle)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 2.0 * ((a + b) ^ 2.0); t_1 = 0.005555555555555556 * (angle * pi); t_2 = (a + b) * sin(t_1); tmp = 0.0; if ((angle / 180.0) <= -5e+132) tmp = (sin(((sqrt(pi) * sqrt(pi)) * (0.005555555555555556 * angle))) * t_0) * cos((pi * (angle / 180.0))); elseif ((angle / 180.0) <= -2e+25) tmp = 2.0 * ((b - a) * t_2); elseif ((angle / 180.0) <= 1e+28) tmp = 2.0 * ((b - a) * (cos(t_1) * t_2)); else tmp = t_0 * sin((pi * (0.005555555555555556 * angle))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(2.0 * N[Power[N[(a + b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + b), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+132], N[(N[(N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+25], N[(2.0 * N[(N[(b - a), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+28], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$1], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot {\left(a + b\right)}^{2}\\
t_1 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_2 := \left(a + b\right) \cdot \sin t_1\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+132}:\\
\;\;\;\;\left(\sin \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot t_0\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq -2 \cdot 10^{+25}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot t_2\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+28}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_1 \cdot t_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5.0000000000000001e132Initial program 28.7%
*-commutative28.7%
associate-*l*28.7%
unpow228.7%
fma-neg36.2%
unpow236.2%
distribute-rgt-neg-in36.2%
Simplified36.2%
*-commutative36.2%
*-commutative36.2%
distribute-rgt-neg-in36.2%
associate-*r*36.2%
pow136.2%
Applied egg-rr41.4%
add-sqr-sqrt54.6%
Applied egg-rr54.6%
if -5.0000000000000001e132 < (/.f64 angle 180) < -2.00000000000000018e25Initial program 18.7%
associate-*l*18.7%
associate-*l*18.7%
unpow218.7%
unpow218.7%
difference-of-squares18.7%
Simplified18.7%
Taylor expanded in angle around inf 15.6%
Taylor expanded in angle around 0 45.4%
if -2.00000000000000018e25 < (/.f64 angle 180) < 9.99999999999999958e27Initial program 71.8%
associate-*l*71.8%
associate-*l*71.8%
unpow271.8%
unpow271.8%
difference-of-squares76.3%
Simplified76.3%
Taylor expanded in angle around inf 96.9%
if 9.99999999999999958e27 < (/.f64 angle 180) Initial program 24.3%
*-commutative24.3%
associate-*l*24.3%
unpow224.3%
fma-neg24.3%
unpow224.3%
distribute-rgt-neg-in24.3%
Simplified24.3%
*-commutative24.3%
*-commutative24.3%
distribute-rgt-neg-in24.3%
associate-*r*24.3%
pow124.3%
Applied egg-rr31.3%
Taylor expanded in angle around 0 42.1%
Final simplification73.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle (* (sqrt PI) (sqrt PI))))))
(if (<= (pow a 2.0) 5e+306)
(* 2.0 (* (- b a) (* (cos t_0) (* (sin t_0) (+ a b)))))
(*
2.0
(*
(- b a)
(*
(cos (* 0.005555555555555556 (* angle PI)))
(* angle (* 0.005555555555555556 (* PI (+ a b))))))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * (sqrt(((double) M_PI)) * sqrt(((double) M_PI))));
double tmp;
if (pow(a, 2.0) <= 5e+306) {
tmp = 2.0 * ((b - a) * (cos(t_0) * (sin(t_0) * (a + b))));
} else {
tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * (angle * (0.005555555555555556 * (((double) M_PI) * (a + b))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * (Math.sqrt(Math.PI) * Math.sqrt(Math.PI)));
double tmp;
if (Math.pow(a, 2.0) <= 5e+306) {
tmp = 2.0 * ((b - a) * (Math.cos(t_0) * (Math.sin(t_0) * (a + b))));
} else {
tmp = 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * (angle * (0.005555555555555556 * (Math.PI * (a + b))))));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * (math.sqrt(math.pi) * math.sqrt(math.pi))) tmp = 0 if math.pow(a, 2.0) <= 5e+306: tmp = 2.0 * ((b - a) * (math.cos(t_0) * (math.sin(t_0) * (a + b)))) else: tmp = 2.0 * ((b - a) * (math.cos((0.005555555555555556 * (angle * math.pi))) * (angle * (0.005555555555555556 * (math.pi * (a + b)))))) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * Float64(sqrt(pi) * sqrt(pi)))) tmp = 0.0 if ((a ^ 2.0) <= 5e+306) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(sin(t_0) * Float64(a + b))))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(angle * Float64(0.005555555555555556 * Float64(pi * Float64(a + b))))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * (sqrt(pi) * sqrt(pi))); tmp = 0.0; if ((a ^ 2.0) <= 5e+306) tmp = 2.0 * ((b - a) * (cos(t_0) * (sin(t_0) * (a + b)))); else tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * pi))) * (angle * (0.005555555555555556 * (pi * (a + b)))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+306], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(angle * N[(0.005555555555555556 * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+306}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\sin t_0 \cdot \left(a + b\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 4.99999999999999993e306Initial program 58.3%
associate-*l*58.3%
associate-*l*58.3%
unpow258.3%
unpow258.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around inf 64.4%
add-sqr-sqrt44.2%
Applied egg-rr65.2%
add-sqr-sqrt44.2%
Applied egg-rr66.8%
if 4.99999999999999993e306 < (pow.f64 a 2) Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
unpow230.2%
unpow230.2%
difference-of-squares42.6%
Simplified42.6%
Taylor expanded in angle around inf 71.4%
Taylor expanded in angle around 0 83.6%
*-commutative83.6%
*-commutative83.6%
associate-*l*83.7%
Simplified83.7%
Final simplification71.7%
(FPCore (a b angle)
:precision binary64
(if (<= (pow a 2.0) 5e+306)
(*
2.0
(*
(- b a)
(*
(*
(sin (* 0.005555555555555556 (* angle (* (sqrt PI) (sqrt PI)))))
(+ a b))
(pow (cbrt (cos (* angle (* 0.005555555555555556 PI)))) 3.0))))
(*
2.0
(*
(- b a)
(*
(cos (* 0.005555555555555556 (* angle PI)))
(* angle (* 0.005555555555555556 (* PI (+ a b)))))))))
double code(double a, double b, double angle) {
double tmp;
if (pow(a, 2.0) <= 5e+306) {
tmp = 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * (sqrt(((double) M_PI)) * sqrt(((double) M_PI)))))) * (a + b)) * pow(cbrt(cos((angle * (0.005555555555555556 * ((double) M_PI))))), 3.0)));
} else {
tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * (angle * (0.005555555555555556 * (((double) M_PI) * (a + b))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(a, 2.0) <= 5e+306) {
tmp = 2.0 * ((b - a) * ((Math.sin((0.005555555555555556 * (angle * (Math.sqrt(Math.PI) * Math.sqrt(Math.PI))))) * (a + b)) * Math.pow(Math.cbrt(Math.cos((angle * (0.005555555555555556 * Math.PI)))), 3.0)));
} else {
tmp = 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * (angle * (0.005555555555555556 * (Math.PI * (a + b))))));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if ((a ^ 2.0) <= 5e+306) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(0.005555555555555556 * Float64(angle * Float64(sqrt(pi) * sqrt(pi))))) * Float64(a + b)) * (cbrt(cos(Float64(angle * Float64(0.005555555555555556 * pi)))) ^ 3.0)))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(angle * Float64(0.005555555555555556 * Float64(pi * Float64(a + b))))))); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+306], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(0.005555555555555556 * N[(angle * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[Cos[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(angle * N[(0.005555555555555556 * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+306}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)\right) \cdot \left(a + b\right)\right) \cdot {\left(\sqrt[3]{\cos \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)}\right)}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 4.99999999999999993e306Initial program 58.3%
associate-*l*58.3%
associate-*l*58.3%
unpow258.3%
unpow258.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around inf 64.4%
add-sqr-sqrt44.2%
Applied egg-rr65.2%
add-cbrt-cube64.5%
Applied egg-rr64.5%
add-cbrt-cube65.2%
add-cube-cbrt65.2%
pow365.2%
*-commutative65.2%
associate-*l*65.7%
Applied egg-rr65.7%
if 4.99999999999999993e306 < (pow.f64 a 2) Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
unpow230.2%
unpow230.2%
difference-of-squares42.6%
Simplified42.6%
Taylor expanded in angle around inf 71.4%
Taylor expanded in angle around 0 83.6%
*-commutative83.6%
*-commutative83.6%
associate-*l*83.7%
Simplified83.7%
Final simplification70.9%
(FPCore (a b angle)
:precision binary64
(if (<= (pow a 2.0) 5e+306)
(*
2.0
(*
(- b a)
(*
(*
(sin (* 0.005555555555555556 (* angle (* (sqrt PI) (sqrt PI)))))
(+ a b))
(log (exp (cos (* PI (* 0.005555555555555556 angle))))))))
(*
2.0
(*
(- b a)
(*
(cos (* 0.005555555555555556 (* angle PI)))
(* angle (* 0.005555555555555556 (* PI (+ a b)))))))))
double code(double a, double b, double angle) {
double tmp;
if (pow(a, 2.0) <= 5e+306) {
tmp = 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * (sqrt(((double) M_PI)) * sqrt(((double) M_PI)))))) * (a + b)) * log(exp(cos((((double) M_PI) * (0.005555555555555556 * angle)))))));
} else {
tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * (angle * (0.005555555555555556 * (((double) M_PI) * (a + b))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(a, 2.0) <= 5e+306) {
tmp = 2.0 * ((b - a) * ((Math.sin((0.005555555555555556 * (angle * (Math.sqrt(Math.PI) * Math.sqrt(Math.PI))))) * (a + b)) * Math.log(Math.exp(Math.cos((Math.PI * (0.005555555555555556 * angle)))))));
} else {
tmp = 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * (angle * (0.005555555555555556 * (Math.PI * (a + b))))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if math.pow(a, 2.0) <= 5e+306: tmp = 2.0 * ((b - a) * ((math.sin((0.005555555555555556 * (angle * (math.sqrt(math.pi) * math.sqrt(math.pi))))) * (a + b)) * math.log(math.exp(math.cos((math.pi * (0.005555555555555556 * angle))))))) else: tmp = 2.0 * ((b - a) * (math.cos((0.005555555555555556 * (angle * math.pi))) * (angle * (0.005555555555555556 * (math.pi * (a + b)))))) return tmp
function code(a, b, angle) tmp = 0.0 if ((a ^ 2.0) <= 5e+306) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(0.005555555555555556 * Float64(angle * Float64(sqrt(pi) * sqrt(pi))))) * Float64(a + b)) * log(exp(cos(Float64(pi * Float64(0.005555555555555556 * angle)))))))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(angle * Float64(0.005555555555555556 * Float64(pi * Float64(a + b))))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a ^ 2.0) <= 5e+306) tmp = 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * (sqrt(pi) * sqrt(pi))))) * (a + b)) * log(exp(cos((pi * (0.005555555555555556 * angle))))))); else tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * pi))) * (angle * (0.005555555555555556 * (pi * (a + b)))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+306], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(0.005555555555555556 * N[(angle * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(angle * N[(0.005555555555555556 * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+306}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)\right) \cdot \left(a + b\right)\right) \cdot \log \left(e^{\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 4.99999999999999993e306Initial program 58.3%
associate-*l*58.3%
associate-*l*58.3%
unpow258.3%
unpow258.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around inf 64.4%
add-sqr-sqrt44.2%
Applied egg-rr65.2%
associate-*r*65.6%
*-commutative65.6%
metadata-eval65.6%
div-inv66.0%
*-commutative66.0%
add-log-exp66.0%
*-commutative66.0%
div-inv65.6%
metadata-eval65.6%
*-commutative65.6%
associate-*r*65.2%
*-commutative65.2%
*-commutative65.2%
associate-*r*65.6%
*-commutative65.6%
Applied egg-rr65.6%
if 4.99999999999999993e306 < (pow.f64 a 2) Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
unpow230.2%
unpow230.2%
difference-of-squares42.6%
Simplified42.6%
Taylor expanded in angle around inf 71.4%
Taylor expanded in angle around 0 83.6%
*-commutative83.6%
*-commutative83.6%
associate-*l*83.7%
Simplified83.7%
Final simplification70.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cos (* 0.005555555555555556 (* angle PI)))))
(if (<= (pow a 2.0) 5e+306)
(*
2.0
(*
(- b a)
(*
(*
(sin (* 0.005555555555555556 (* angle (* (sqrt PI) (sqrt PI)))))
(+ a b))
t_0)))
(*
2.0
(* (- b a) (* t_0 (* angle (* 0.005555555555555556 (* PI (+ a b))))))))))
double code(double a, double b, double angle) {
double t_0 = cos((0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (pow(a, 2.0) <= 5e+306) {
tmp = 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * (sqrt(((double) M_PI)) * sqrt(((double) M_PI)))))) * (a + b)) * t_0));
} else {
tmp = 2.0 * ((b - a) * (t_0 * (angle * (0.005555555555555556 * (((double) M_PI) * (a + b))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.cos((0.005555555555555556 * (angle * Math.PI)));
double tmp;
if (Math.pow(a, 2.0) <= 5e+306) {
tmp = 2.0 * ((b - a) * ((Math.sin((0.005555555555555556 * (angle * (Math.sqrt(Math.PI) * Math.sqrt(Math.PI))))) * (a + b)) * t_0));
} else {
tmp = 2.0 * ((b - a) * (t_0 * (angle * (0.005555555555555556 * (Math.PI * (a + b))))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.cos((0.005555555555555556 * (angle * math.pi))) tmp = 0 if math.pow(a, 2.0) <= 5e+306: tmp = 2.0 * ((b - a) * ((math.sin((0.005555555555555556 * (angle * (math.sqrt(math.pi) * math.sqrt(math.pi))))) * (a + b)) * t_0)) else: tmp = 2.0 * ((b - a) * (t_0 * (angle * (0.005555555555555556 * (math.pi * (a + b)))))) return tmp
function code(a, b, angle) t_0 = cos(Float64(0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if ((a ^ 2.0) <= 5e+306) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(0.005555555555555556 * Float64(angle * Float64(sqrt(pi) * sqrt(pi))))) * Float64(a + b)) * t_0))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(t_0 * Float64(angle * Float64(0.005555555555555556 * Float64(pi * Float64(a + b))))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = cos((0.005555555555555556 * (angle * pi))); tmp = 0.0; if ((a ^ 2.0) <= 5e+306) tmp = 2.0 * ((b - a) * ((sin((0.005555555555555556 * (angle * (sqrt(pi) * sqrt(pi))))) * (a + b)) * t_0)); else tmp = 2.0 * ((b - a) * (t_0 * (angle * (0.005555555555555556 * (pi * (a + b)))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+306], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(0.005555555555555556 * N[(angle * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(t$95$0 * N[(angle * N[(0.005555555555555556 * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+306}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)\right) \cdot \left(a + b\right)\right) \cdot t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(t_0 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 4.99999999999999993e306Initial program 58.3%
associate-*l*58.3%
associate-*l*58.3%
unpow258.3%
unpow258.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around inf 64.4%
add-sqr-sqrt44.2%
Applied egg-rr65.2%
if 4.99999999999999993e306 < (pow.f64 a 2) Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
unpow230.2%
unpow230.2%
difference-of-squares42.6%
Simplified42.6%
Taylor expanded in angle around inf 71.4%
Taylor expanded in angle around 0 83.6%
*-commutative83.6%
*-commutative83.6%
associate-*l*83.7%
Simplified83.7%
Final simplification70.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (sin (* PI (* 0.005555555555555556 angle)))))
(if (<= (/ angle 180.0) -2e+25)
(*
(cos (* PI (/ angle 180.0)))
(pow (* (+ a b) (sqrt (* 2.0 (fabs t_1)))) 2.0))
(if (<= (/ angle 180.0) 1e+28)
(* 2.0 (* (- b a) (* (cos t_0) (* (+ a b) (sin t_0)))))
(* (* 2.0 (pow (+ a b) 2.0)) t_1)))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin((((double) M_PI) * (0.005555555555555556 * angle)));
double tmp;
if ((angle / 180.0) <= -2e+25) {
tmp = cos((((double) M_PI) * (angle / 180.0))) * pow(((a + b) * sqrt((2.0 * fabs(t_1)))), 2.0);
} else if ((angle / 180.0) <= 1e+28) {
tmp = 2.0 * ((b - a) * (cos(t_0) * ((a + b) * sin(t_0))));
} else {
tmp = (2.0 * pow((a + b), 2.0)) * t_1;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.sin((Math.PI * (0.005555555555555556 * angle)));
double tmp;
if ((angle / 180.0) <= -2e+25) {
tmp = Math.cos((Math.PI * (angle / 180.0))) * Math.pow(((a + b) * Math.sqrt((2.0 * Math.abs(t_1)))), 2.0);
} else if ((angle / 180.0) <= 1e+28) {
tmp = 2.0 * ((b - a) * (Math.cos(t_0) * ((a + b) * Math.sin(t_0))));
} else {
tmp = (2.0 * Math.pow((a + b), 2.0)) * t_1;
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.sin((math.pi * (0.005555555555555556 * angle))) tmp = 0 if (angle / 180.0) <= -2e+25: tmp = math.cos((math.pi * (angle / 180.0))) * math.pow(((a + b) * math.sqrt((2.0 * math.fabs(t_1)))), 2.0) elif (angle / 180.0) <= 1e+28: tmp = 2.0 * ((b - a) * (math.cos(t_0) * ((a + b) * math.sin(t_0)))) else: tmp = (2.0 * math.pow((a + b), 2.0)) * t_1 return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(Float64(pi * Float64(0.005555555555555556 * angle))) tmp = 0.0 if (Float64(angle / 180.0) <= -2e+25) tmp = Float64(cos(Float64(pi * Float64(angle / 180.0))) * (Float64(Float64(a + b) * sqrt(Float64(2.0 * abs(t_1)))) ^ 2.0)); elseif (Float64(angle / 180.0) <= 1e+28) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(Float64(a + b) * sin(t_0))))); else tmp = Float64(Float64(2.0 * (Float64(a + b) ^ 2.0)) * t_1); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); t_1 = sin((pi * (0.005555555555555556 * angle))); tmp = 0.0; if ((angle / 180.0) <= -2e+25) tmp = cos((pi * (angle / 180.0))) * (((a + b) * sqrt((2.0 * abs(t_1)))) ^ 2.0); elseif ((angle / 180.0) <= 1e+28) tmp = 2.0 * ((b - a) * (cos(t_0) * ((a + b) * sin(t_0)))); else tmp = (2.0 * ((a + b) ^ 2.0)) * t_1; end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+25], N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[(N[(a + b), $MachinePrecision] * N[Sqrt[N[(2.0 * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+28], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Power[N[(a + b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+25}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot {\left(\left(a + b\right) \cdot \sqrt{2 \cdot \left|t_1\right|}\right)}^{2}\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+28}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\left(a + b\right) \cdot \sin t_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot {\left(a + b\right)}^{2}\right) \cdot t_1\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2.00000000000000018e25Initial program 25.4%
*-commutative25.4%
associate-*l*25.4%
unpow225.4%
fma-neg32.0%
unpow232.0%
distribute-rgt-neg-in32.0%
Simplified32.0%
add-sqr-sqrt25.9%
pow225.9%
Applied egg-rr17.6%
associate-*r*18.4%
*-commutative18.4%
add-cbrt-cube19.7%
*-commutative19.7%
add-sqr-sqrt19.7%
sqrt-unprod43.2%
pow243.2%
add-cbrt-cube43.4%
*-commutative43.4%
associate-*l*43.4%
Applied egg-rr43.4%
unpow243.4%
rem-sqrt-square43.4%
associate-*r*43.4%
*-commutative43.4%
associate-*l*43.4%
Simplified43.4%
if -2.00000000000000018e25 < (/.f64 angle 180) < 9.99999999999999958e27Initial program 71.8%
associate-*l*71.8%
associate-*l*71.8%
unpow271.8%
unpow271.8%
difference-of-squares76.3%
Simplified76.3%
Taylor expanded in angle around inf 96.9%
if 9.99999999999999958e27 < (/.f64 angle 180) Initial program 24.3%
*-commutative24.3%
associate-*l*24.3%
unpow224.3%
fma-neg24.3%
unpow224.3%
distribute-rgt-neg-in24.3%
Simplified24.3%
*-commutative24.3%
*-commutative24.3%
distribute-rgt-neg-in24.3%
associate-*r*24.3%
pow124.3%
Applied egg-rr31.3%
Taylor expanded in angle around 0 42.1%
Final simplification71.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))) (t_1 (cos t_0)))
(if (<= (pow a 2.0) 5e+306)
(* 2.0 (* (- b a) (* t_1 (* (+ a b) (sin t_0)))))
(*
2.0
(* (- b a) (* t_1 (* angle (* 0.005555555555555556 (* PI (+ a b))))))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = cos(t_0);
double tmp;
if (pow(a, 2.0) <= 5e+306) {
tmp = 2.0 * ((b - a) * (t_1 * ((a + b) * sin(t_0))));
} else {
tmp = 2.0 * ((b - a) * (t_1 * (angle * (0.005555555555555556 * (((double) M_PI) * (a + b))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.cos(t_0);
double tmp;
if (Math.pow(a, 2.0) <= 5e+306) {
tmp = 2.0 * ((b - a) * (t_1 * ((a + b) * Math.sin(t_0))));
} else {
tmp = 2.0 * ((b - a) * (t_1 * (angle * (0.005555555555555556 * (Math.PI * (a + b))))));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.cos(t_0) tmp = 0 if math.pow(a, 2.0) <= 5e+306: tmp = 2.0 * ((b - a) * (t_1 * ((a + b) * math.sin(t_0)))) else: tmp = 2.0 * ((b - a) * (t_1 * (angle * (0.005555555555555556 * (math.pi * (a + b)))))) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = cos(t_0) tmp = 0.0 if ((a ^ 2.0) <= 5e+306) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(t_1 * Float64(Float64(a + b) * sin(t_0))))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(t_1 * Float64(angle * Float64(0.005555555555555556 * Float64(pi * Float64(a + b))))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); t_1 = cos(t_0); tmp = 0.0; if ((a ^ 2.0) <= 5e+306) tmp = 2.0 * ((b - a) * (t_1 * ((a + b) * sin(t_0)))); else tmp = 2.0 * ((b - a) * (t_1 * (angle * (0.005555555555555556 * (pi * (a + b)))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+306], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[(N[(a + b), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[(angle * N[(0.005555555555555556 * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \cos t_0\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+306}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \left(\left(a + b\right) \cdot \sin t_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 4.99999999999999993e306Initial program 58.3%
associate-*l*58.3%
associate-*l*58.3%
unpow258.3%
unpow258.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around inf 64.4%
if 4.99999999999999993e306 < (pow.f64 a 2) Initial program 30.2%
associate-*l*30.2%
associate-*l*30.2%
unpow230.2%
unpow230.2%
difference-of-squares42.6%
Simplified42.6%
Taylor expanded in angle around inf 71.4%
Taylor expanded in angle around 0 83.6%
*-commutative83.6%
*-commutative83.6%
associate-*l*83.7%
Simplified83.7%
Final simplification70.0%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI))))
(if (<= (pow a 2.0) 5e+122)
(* 2.0 (* (- b a) (* (+ a b) (sin t_0))))
(*
2.0
(*
(- b a)
(* (cos t_0) (* angle (* 0.005555555555555556 (* PI (+ a b))))))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (pow(a, 2.0) <= 5e+122) {
tmp = 2.0 * ((b - a) * ((a + b) * sin(t_0)));
} else {
tmp = 2.0 * ((b - a) * (cos(t_0) * (angle * (0.005555555555555556 * (((double) M_PI) * (a + b))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (Math.pow(a, 2.0) <= 5e+122) {
tmp = 2.0 * ((b - a) * ((a + b) * Math.sin(t_0)));
} else {
tmp = 2.0 * ((b - a) * (Math.cos(t_0) * (angle * (0.005555555555555556 * (Math.PI * (a + b))))));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if math.pow(a, 2.0) <= 5e+122: tmp = 2.0 * ((b - a) * ((a + b) * math.sin(t_0))) else: tmp = 2.0 * ((b - a) * (math.cos(t_0) * (angle * (0.005555555555555556 * (math.pi * (a + b)))))) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if ((a ^ 2.0) <= 5e+122) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(a + b) * sin(t_0)))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(angle * Float64(0.005555555555555556 * Float64(pi * Float64(a + b))))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if ((a ^ 2.0) <= 5e+122) tmp = 2.0 * ((b - a) * ((a + b) * sin(t_0))); else tmp = 2.0 * ((b - a) * (cos(t_0) * (angle * (0.005555555555555556 * (pi * (a + b)))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+122], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(angle * N[(0.005555555555555556 * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+122}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 4.99999999999999989e122Initial program 58.6%
associate-*l*58.6%
associate-*l*58.6%
unpow258.6%
unpow258.6%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around inf 65.1%
Taylor expanded in angle around 0 64.7%
if 4.99999999999999989e122 < (pow.f64 a 2) Initial program 39.5%
associate-*l*39.5%
associate-*l*39.5%
unpow239.5%
unpow239.5%
difference-of-squares47.6%
Simplified47.6%
Taylor expanded in angle around inf 68.2%
Taylor expanded in angle around 0 73.9%
*-commutative73.9%
*-commutative73.9%
associate-*l*73.9%
Simplified73.9%
Final simplification68.8%
(FPCore (a b angle) :precision binary64 (if (<= (/ angle 180.0) 5e+95) (* 2.0 (* 0.005555555555555556 (* (* PI (+ a b)) (* (- b a) angle)))) (* 2.0 (* (* (- b a) (+ a b)) (sin (* PI (/ angle 180.0)))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+95) {
tmp = 2.0 * (0.005555555555555556 * ((((double) M_PI) * (a + b)) * ((b - a) * angle)));
} else {
tmp = 2.0 * (((b - a) * (a + b)) * sin((((double) M_PI) * (angle / 180.0))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+95) {
tmp = 2.0 * (0.005555555555555556 * ((Math.PI * (a + b)) * ((b - a) * angle)));
} else {
tmp = 2.0 * (((b - a) * (a + b)) * Math.sin((Math.PI * (angle / 180.0))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 5e+95: tmp = 2.0 * (0.005555555555555556 * ((math.pi * (a + b)) * ((b - a) * angle))) else: tmp = 2.0 * (((b - a) * (a + b)) * math.sin((math.pi * (angle / 180.0)))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+95) tmp = Float64(2.0 * Float64(0.005555555555555556 * Float64(Float64(pi * Float64(a + b)) * Float64(Float64(b - a) * angle)))); else tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(pi * Float64(angle / 180.0))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 5e+95) tmp = 2.0 * (0.005555555555555556 * ((pi * (a + b)) * ((b - a) * angle))); else tmp = 2.0 * (((b - a) * (a + b)) * sin((pi * (angle / 180.0)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+95], N[(2.0 * N[(0.005555555555555556 * N[(N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+95}:\\
\;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 5.00000000000000025e95Initial program 55.6%
associate-*l*55.6%
associate-*l*55.6%
unpow255.6%
unpow255.6%
difference-of-squares59.9%
Simplified59.9%
Taylor expanded in angle around 0 59.4%
associate-*r*71.4%
*-commutative71.4%
Simplified71.4%
if 5.00000000000000025e95 < (/.f64 angle 180) Initial program 20.7%
associate-*l*20.7%
associate-*l*20.7%
unpow220.7%
unpow220.7%
difference-of-squares20.7%
Simplified20.7%
Taylor expanded in angle around 0 31.7%
Final simplification65.2%
(FPCore (a b angle) :precision binary64 (if (<= (/ angle 180.0) 5e+95) (* 2.0 (* 0.005555555555555556 (* (* PI (+ a b)) (* (- b a) angle)))) (* 2.0 (* (* (- b a) (+ a b)) (sin (/ PI (/ 180.0 angle)))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+95) {
tmp = 2.0 * (0.005555555555555556 * ((((double) M_PI) * (a + b)) * ((b - a) * angle)));
} else {
tmp = 2.0 * (((b - a) * (a + b)) * sin((((double) M_PI) / (180.0 / angle))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+95) {
tmp = 2.0 * (0.005555555555555556 * ((Math.PI * (a + b)) * ((b - a) * angle)));
} else {
tmp = 2.0 * (((b - a) * (a + b)) * Math.sin((Math.PI / (180.0 / angle))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 5e+95: tmp = 2.0 * (0.005555555555555556 * ((math.pi * (a + b)) * ((b - a) * angle))) else: tmp = 2.0 * (((b - a) * (a + b)) * math.sin((math.pi / (180.0 / angle)))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+95) tmp = Float64(2.0 * Float64(0.005555555555555556 * Float64(Float64(pi * Float64(a + b)) * Float64(Float64(b - a) * angle)))); else tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(pi / Float64(180.0 / angle))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 5e+95) tmp = 2.0 * (0.005555555555555556 * ((pi * (a + b)) * ((b - a) * angle))); else tmp = 2.0 * (((b - a) * (a + b)) * sin((pi / (180.0 / angle)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+95], N[(2.0 * N[(0.005555555555555556 * N[(N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+95}:\\
\;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 5.00000000000000025e95Initial program 55.6%
associate-*l*55.6%
associate-*l*55.6%
unpow255.6%
unpow255.6%
difference-of-squares59.9%
Simplified59.9%
Taylor expanded in angle around 0 59.4%
associate-*r*71.4%
*-commutative71.4%
Simplified71.4%
if 5.00000000000000025e95 < (/.f64 angle 180) Initial program 20.7%
associate-*l*20.7%
associate-*l*20.7%
unpow220.7%
unpow220.7%
difference-of-squares20.7%
Simplified20.7%
clear-num22.6%
un-div-inv30.1%
Applied egg-rr30.1%
Taylor expanded in angle around 0 32.1%
Final simplification65.2%
(FPCore (a b angle) :precision binary64 (* 2.0 (* (- b a) (* (+ a b) (sin (* 0.005555555555555556 (* angle PI)))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((a + b) * sin((0.005555555555555556 * (angle * ((double) M_PI))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((a + b) * Math.sin((0.005555555555555556 * (angle * Math.PI)))));
}
def code(a, b, angle): return 2.0 * ((b - a) * ((a + b) * math.sin((0.005555555555555556 * (angle * math.pi)))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(a + b) * sin(Float64(0.005555555555555556 * Float64(angle * pi)))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * ((a + b) * sin((0.005555555555555556 * (angle * pi))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 50.2%
associate-*l*50.2%
associate-*l*50.2%
unpow250.2%
unpow250.2%
difference-of-squares53.7%
Simplified53.7%
Taylor expanded in angle around inf 66.5%
Taylor expanded in angle around 0 64.8%
Final simplification64.8%
(FPCore (a b angle) :precision binary64 (if (or (<= b -8.6e+145) (not (<= b 5.5e+147))) (* 0.011111111111111112 (* (* b angle) (* b PI))) (* 0.011111111111111112 (* PI (* angle (- (* b b) (* a a)))))))
double code(double a, double b, double angle) {
double tmp;
if ((b <= -8.6e+145) || !(b <= 5.5e+147)) {
tmp = 0.011111111111111112 * ((b * angle) * (b * ((double) M_PI)));
} else {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * ((b * b) - (a * a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((b <= -8.6e+145) || !(b <= 5.5e+147)) {
tmp = 0.011111111111111112 * ((b * angle) * (b * Math.PI));
} else {
tmp = 0.011111111111111112 * (Math.PI * (angle * ((b * b) - (a * a))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (b <= -8.6e+145) or not (b <= 5.5e+147): tmp = 0.011111111111111112 * ((b * angle) * (b * math.pi)) else: tmp = 0.011111111111111112 * (math.pi * (angle * ((b * b) - (a * a)))) return tmp
function code(a, b, angle) tmp = 0.0 if ((b <= -8.6e+145) || !(b <= 5.5e+147)) tmp = Float64(0.011111111111111112 * Float64(Float64(b * angle) * Float64(b * pi))); else tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(Float64(b * b) - Float64(a * a))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b <= -8.6e+145) || ~((b <= 5.5e+147))) tmp = 0.011111111111111112 * ((b * angle) * (b * pi)); else tmp = 0.011111111111111112 * (pi * (angle * ((b * b) - (a * a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[b, -8.6e+145], N[Not[LessEqual[b, 5.5e+147]], $MachinePrecision]], N[(0.011111111111111112 * N[(N[(b * angle), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(N[(b * b), $MachinePrecision] - N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.6 \cdot 10^{+145} \lor \neg \left(b \leq 5.5 \cdot 10^{+147}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b - a \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if b < -8.59999999999999996e145 or 5.4999999999999997e147 < b Initial program 37.2%
*-commutative37.2%
associate-*l*37.2%
unpow237.2%
fma-neg47.6%
unpow247.6%
Simplified47.6%
Taylor expanded in angle around 0 44.5%
associate-*r*44.5%
*-commutative44.5%
*-commutative44.5%
unpow244.5%
unpow244.5%
*-commutative44.5%
Simplified44.5%
Taylor expanded in b around inf 54.5%
associate-*r*54.5%
unpow254.5%
Simplified54.5%
Taylor expanded in angle around 0 54.5%
unpow254.5%
associate-*l*54.5%
associate-*r*68.0%
*-commutative68.0%
Simplified68.0%
if -8.59999999999999996e145 < b < 5.4999999999999997e147Initial program 54.9%
*-commutative54.9%
associate-*l*54.9%
unpow254.9%
fma-neg54.9%
unpow254.9%
Simplified54.9%
Taylor expanded in angle around 0 52.0%
associate-*r*52.0%
*-commutative52.0%
*-commutative52.0%
unpow252.0%
unpow252.0%
*-commutative52.0%
Simplified52.0%
Taylor expanded in angle around 0 52.0%
associate-*r*52.0%
unpow252.0%
unpow252.0%
Simplified52.0%
Final simplification56.3%
(FPCore (a b angle) :precision binary64 (if (<= b -1.3e+161) (* 0.011111111111111112 (* (* b angle) (* b PI))) (* 2.0 (* 0.005555555555555556 (* angle (* (- b a) (* PI (+ a b))))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= -1.3e+161) {
tmp = 0.011111111111111112 * ((b * angle) * (b * ((double) M_PI)));
} else {
tmp = 2.0 * (0.005555555555555556 * (angle * ((b - a) * (((double) M_PI) * (a + b)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= -1.3e+161) {
tmp = 0.011111111111111112 * ((b * angle) * (b * Math.PI));
} else {
tmp = 2.0 * (0.005555555555555556 * (angle * ((b - a) * (Math.PI * (a + b)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= -1.3e+161: tmp = 0.011111111111111112 * ((b * angle) * (b * math.pi)) else: tmp = 2.0 * (0.005555555555555556 * (angle * ((b - a) * (math.pi * (a + b))))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= -1.3e+161) tmp = Float64(0.011111111111111112 * Float64(Float64(b * angle) * Float64(b * pi))); else tmp = Float64(2.0 * Float64(0.005555555555555556 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(a + b)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= -1.3e+161) tmp = 0.011111111111111112 * ((b * angle) * (b * pi)); else tmp = 2.0 * (0.005555555555555556 * (angle * ((b - a) * (pi * (a + b))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, -1.3e+161], N[(0.011111111111111112 * N[(N[(b * angle), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(0.005555555555555556 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{+161}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < -1.2999999999999999e161Initial program 51.1%
*-commutative51.1%
associate-*l*51.1%
unpow251.1%
fma-neg56.6%
unpow256.6%
Simplified56.6%
Taylor expanded in angle around 0 53.8%
associate-*r*53.8%
*-commutative53.8%
*-commutative53.8%
unpow253.8%
unpow253.8%
*-commutative53.8%
Simplified53.8%
Taylor expanded in b around inf 64.9%
associate-*r*64.9%
unpow264.9%
Simplified64.9%
Taylor expanded in angle around 0 64.9%
unpow264.9%
associate-*l*64.9%
associate-*r*77.7%
*-commutative77.7%
Simplified77.7%
if -1.2999999999999999e161 < b Initial program 50.0%
associate-*l*50.0%
associate-*l*50.0%
unpow250.0%
unpow250.0%
difference-of-squares52.4%
Simplified52.4%
Taylor expanded in angle around 0 52.6%
Final simplification56.1%
(FPCore (a b angle) :precision binary64 (* 2.0 (* 0.005555555555555556 (* (* PI (+ a b)) (* (- b a) angle)))))
double code(double a, double b, double angle) {
return 2.0 * (0.005555555555555556 * ((((double) M_PI) * (a + b)) * ((b - a) * angle)));
}
public static double code(double a, double b, double angle) {
return 2.0 * (0.005555555555555556 * ((Math.PI * (a + b)) * ((b - a) * angle)));
}
def code(a, b, angle): return 2.0 * (0.005555555555555556 * ((math.pi * (a + b)) * ((b - a) * angle)))
function code(a, b, angle) return Float64(2.0 * Float64(0.005555555555555556 * Float64(Float64(pi * Float64(a + b)) * Float64(Float64(b - a) * angle)))) end
function tmp = code(a, b, angle) tmp = 2.0 * (0.005555555555555556 * ((pi * (a + b)) * ((b - a) * angle))); end
code[a_, b_, angle_] := N[(2.0 * N[(0.005555555555555556 * N[(N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(0.005555555555555556 \cdot \left(\left(\pi \cdot \left(a + b\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\right)
\end{array}
Initial program 50.2%
associate-*l*50.2%
associate-*l*50.2%
unpow250.2%
unpow250.2%
difference-of-squares53.7%
Simplified53.7%
Taylor expanded in angle around 0 53.9%
associate-*r*63.6%
*-commutative63.6%
Simplified63.6%
Final simplification63.6%
(FPCore (a b angle) :precision binary64 (if (or (<= b -3.45e+72) (not (<= b 225000000.0))) (* 0.011111111111111112 (* (* b angle) (* b PI))) (* (* PI (* a a)) (* angle -0.011111111111111112))))
double code(double a, double b, double angle) {
double tmp;
if ((b <= -3.45e+72) || !(b <= 225000000.0)) {
tmp = 0.011111111111111112 * ((b * angle) * (b * ((double) M_PI)));
} else {
tmp = (((double) M_PI) * (a * a)) * (angle * -0.011111111111111112);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((b <= -3.45e+72) || !(b <= 225000000.0)) {
tmp = 0.011111111111111112 * ((b * angle) * (b * Math.PI));
} else {
tmp = (Math.PI * (a * a)) * (angle * -0.011111111111111112);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (b <= -3.45e+72) or not (b <= 225000000.0): tmp = 0.011111111111111112 * ((b * angle) * (b * math.pi)) else: tmp = (math.pi * (a * a)) * (angle * -0.011111111111111112) return tmp
function code(a, b, angle) tmp = 0.0 if ((b <= -3.45e+72) || !(b <= 225000000.0)) tmp = Float64(0.011111111111111112 * Float64(Float64(b * angle) * Float64(b * pi))); else tmp = Float64(Float64(pi * Float64(a * a)) * Float64(angle * -0.011111111111111112)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b <= -3.45e+72) || ~((b <= 225000000.0))) tmp = 0.011111111111111112 * ((b * angle) * (b * pi)); else tmp = (pi * (a * a)) * (angle * -0.011111111111111112); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[b, -3.45e+72], N[Not[LessEqual[b, 225000000.0]], $MachinePrecision]], N[(0.011111111111111112 * N[(N[(b * angle), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(angle * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.45 \cdot 10^{+72} \lor \neg \left(b \leq 225000000\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot -0.011111111111111112\right)\\
\end{array}
\end{array}
if b < -3.45000000000000017e72 or 2.25e8 < b Initial program 42.1%
*-commutative42.1%
associate-*l*42.1%
unpow242.1%
fma-neg48.5%
unpow248.5%
Simplified48.5%
Taylor expanded in angle around 0 45.2%
associate-*r*45.2%
*-commutative45.2%
*-commutative45.2%
unpow245.2%
unpow245.2%
*-commutative45.2%
Simplified45.2%
Taylor expanded in b around inf 47.9%
associate-*r*48.0%
unpow248.0%
Simplified48.0%
Taylor expanded in angle around 0 47.9%
unpow247.9%
associate-*l*47.9%
associate-*r*56.3%
*-commutative56.3%
Simplified56.3%
if -3.45000000000000017e72 < b < 2.25e8Initial program 56.3%
*-commutative56.3%
associate-*l*56.3%
unpow256.3%
fma-neg56.3%
unpow256.3%
Simplified56.3%
Taylor expanded in angle around 0 53.6%
associate-*r*53.6%
*-commutative53.6%
*-commutative53.6%
unpow253.6%
unpow253.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in b around 0 50.8%
*-commutative50.8%
*-commutative50.8%
associate-*l*50.8%
*-commutative50.8%
unpow250.8%
Simplified50.8%
Final simplification53.2%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* (* b angle) (* b PI))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * ((b * angle) * (b * ((double) M_PI)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * ((b * angle) * (b * Math.PI));
}
def code(a, b, angle): return 0.011111111111111112 * ((b * angle) * (b * math.pi))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(b * angle) * Float64(b * pi))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * ((b * angle) * (b * pi)); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(b * angle), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\left(b \cdot angle\right) \cdot \left(b \cdot \pi\right)\right)
\end{array}
Initial program 50.2%
*-commutative50.2%
associate-*l*50.2%
unpow250.2%
fma-neg53.0%
unpow253.0%
Simplified53.0%
Taylor expanded in angle around 0 50.0%
associate-*r*50.0%
*-commutative50.0%
*-commutative50.0%
unpow250.0%
unpow250.0%
*-commutative50.0%
Simplified50.0%
Taylor expanded in b around inf 33.7%
associate-*r*33.7%
unpow233.7%
Simplified33.7%
Taylor expanded in angle around 0 33.7%
unpow233.7%
associate-*l*33.7%
associate-*r*35.0%
*-commutative35.0%
Simplified35.0%
Final simplification35.0%
herbie shell --seed 2023193
(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)))))