
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t_0\right) \cdot \cos t_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t_0\right) \cdot \cos t_0
\end{array}
\end{array}
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 1e+94)
(*
2.0
(*
(- b a)
(*
(cos (* 0.005555555555555556 (* angle PI)))
(*
(sin (* 0.005555555555555556 (* angle (pow (sqrt PI) 2.0))))
(+ b a)))))
(*
(* 2.0 (* (- b a) (+ b a)))
(*
(sin (* (/ angle 180.0) PI))
(cos (pow (cbrt (* PI (* angle 0.005555555555555556))) 3.0))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+94) {
tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * (sin((0.005555555555555556 * (angle * pow(sqrt(((double) M_PI)), 2.0)))) * (b + a))));
} else {
tmp = (2.0 * ((b - a) * (b + a))) * (sin(((angle / 180.0) * ((double) M_PI))) * cos(pow(cbrt((((double) M_PI) * (angle * 0.005555555555555556))), 3.0)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+94) {
tmp = 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * (Math.sin((0.005555555555555556 * (angle * Math.pow(Math.sqrt(Math.PI), 2.0)))) * (b + a))));
} else {
tmp = (2.0 * ((b - a) * (b + a))) * (Math.sin(((angle / 180.0) * Math.PI)) * Math.cos(Math.pow(Math.cbrt((Math.PI * (angle * 0.005555555555555556))), 3.0)));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 1e+94) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(sin(Float64(0.005555555555555556 * Float64(angle * (sqrt(pi) ^ 2.0)))) * Float64(b + a))))); else tmp = Float64(Float64(2.0 * Float64(Float64(b - a) * Float64(b + a))) * Float64(sin(Float64(Float64(angle / 180.0) * pi)) * cos((cbrt(Float64(pi * Float64(angle * 0.005555555555555556))) ^ 3.0)))); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+94], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Cos[N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 10^{+94}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \cos \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{3}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 1e94Initial program 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares60.3%
Simplified60.3%
Taylor expanded in angle around inf 71.0%
add-sqr-sqrt72.8%
Applied egg-rr72.8%
pow272.8%
Applied egg-rr72.8%
if 1e94 < (/.f64 angle 180) Initial program 25.7%
associate-*l*25.7%
unpow225.7%
unpow225.7%
difference-of-squares28.6%
Simplified28.6%
add-cube-cbrt34.1%
pow333.8%
div-inv36.3%
metadata-eval36.3%
Applied egg-rr36.3%
Final simplification68.0%
(FPCore (a b angle)
:precision binary64
(*
2.0
(*
(- b a)
(*
(cos (* 0.005555555555555556 (* angle PI)))
(*
(sin (* 0.005555555555555556 (* angle (pow (sqrt PI) 2.0))))
(+ b a))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * (sin((0.005555555555555556 * (angle * pow(sqrt(((double) M_PI)), 2.0)))) * (b + a))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * (Math.sin((0.005555555555555556 * (angle * Math.pow(Math.sqrt(Math.PI), 2.0)))) * (b + a))));
}
def code(a, b, angle): return 2.0 * ((b - a) * (math.cos((0.005555555555555556 * (angle * math.pi))) * (math.sin((0.005555555555555556 * (angle * math.pow(math.sqrt(math.pi), 2.0)))) * (b + a))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(sin(Float64(0.005555555555555556 * Float64(angle * (sqrt(pi) ^ 2.0)))) * Float64(b + a))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * pi))) * (sin((0.005555555555555556 * (angle * (sqrt(pi) ^ 2.0)))) * (b + a)))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(angle * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Initial program 51.8%
associate-*l*51.8%
unpow251.8%
unpow251.8%
difference-of-squares56.1%
Simplified56.1%
Taylor expanded in angle around inf 65.3%
add-sqr-sqrt66.2%
Applied egg-rr66.2%
pow266.2%
Applied egg-rr66.2%
Final simplification66.2%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (* angle 0.005555555555555556)))) (* 2.0 (* (* (- b a) (cos t_0)) (* (+ b a) (sin t_0))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
return 2.0 * (((b - a) * cos(t_0)) * ((b + a) * sin(t_0)));
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
return 2.0 * (((b - a) * Math.cos(t_0)) * ((b + a) * Math.sin(t_0)));
}
def code(a, b, angle): t_0 = math.pi * (angle * 0.005555555555555556) return 2.0 * (((b - a) * math.cos(t_0)) * ((b + a) * math.sin(t_0)))
function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) return Float64(2.0 * Float64(Float64(Float64(b - a) * cos(t_0)) * Float64(Float64(b + a) * sin(t_0)))) end
function tmp = code(a, b, angle) t_0 = pi * (angle * 0.005555555555555556); tmp = 2.0 * (((b - a) * cos(t_0)) * ((b + a) * sin(t_0))); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
2 \cdot \left(\left(\left(b - a\right) \cdot \cos t_0\right) \cdot \left(\left(b + a\right) \cdot \sin t_0\right)\right)
\end{array}
\end{array}
Initial program 51.8%
associate-*l*51.8%
unpow251.8%
unpow251.8%
difference-of-squares56.1%
Simplified56.1%
Taylor expanded in angle around inf 65.3%
associate-*r*65.3%
*-commutative65.3%
*-commutative65.3%
associate-*r*64.5%
*-commutative64.5%
*-commutative64.5%
*-commutative64.5%
associate-*r*65.1%
*-commutative65.1%
+-commutative65.1%
Simplified65.1%
Final simplification65.1%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* angle PI)))) (* 2.0 (* (- b a) (* (cos t_0) (* (+ b a) (sin t_0)))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
return 2.0 * ((b - a) * (cos(t_0) * ((b + a) * sin(t_0))));
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
return 2.0 * ((b - a) * (Math.cos(t_0) * ((b + a) * Math.sin(t_0))));
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) return 2.0 * ((b - a) * (math.cos(t_0) * ((b + a) * math.sin(t_0))))
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) return Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(Float64(b + a) * sin(t_0))))) end
function tmp = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); tmp = 2.0 * ((b - a) * (cos(t_0) * ((b + a) * sin(t_0)))); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\left(b + a\right) \cdot \sin t_0\right)\right)\right)
\end{array}
\end{array}
Initial program 51.8%
associate-*l*51.8%
unpow251.8%
unpow251.8%
difference-of-squares56.1%
Simplified56.1%
Taylor expanded in angle around inf 65.3%
Final simplification65.3%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) -1e+88)
(* 2.0 (* (- b a) (* (+ b a) (sin (* 0.005555555555555556 (* angle PI))))))
(if (<= (/ angle 180.0) 1e+52)
(* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))
(*
(* 2.0 (pow (+ b a) 2.0))
(* 0.5 (sin (* PI (* angle 0.011111111111111112))))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -1e+88) {
tmp = 2.0 * ((b - a) * ((b + a) * sin((0.005555555555555556 * (angle * ((double) M_PI))))));
} else if ((angle / 180.0) <= 1e+52) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
} else {
tmp = (2.0 * pow((b + a), 2.0)) * (0.5 * 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) <= -1e+88) {
tmp = 2.0 * ((b - a) * ((b + a) * Math.sin((0.005555555555555556 * (angle * Math.PI)))));
} else if ((angle / 180.0) <= 1e+52) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
} else {
tmp = (2.0 * Math.pow((b + a), 2.0)) * (0.5 * Math.sin((Math.PI * (angle * 0.011111111111111112))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -1e+88: tmp = 2.0 * ((b - a) * ((b + a) * math.sin((0.005555555555555556 * (angle * math.pi))))) elif (angle / 180.0) <= 1e+52: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) else: tmp = (2.0 * math.pow((b + a), 2.0)) * (0.5 * math.sin((math.pi * (angle * 0.011111111111111112)))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -1e+88) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(angle * pi)))))); elseif (Float64(angle / 180.0) <= 1e+52) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); else tmp = Float64(Float64(2.0 * (Float64(b + a) ^ 2.0)) * Float64(0.5 * 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) <= -1e+88) tmp = 2.0 * ((b - a) * ((b + a) * sin((0.005555555555555556 * (angle * pi))))); elseif ((angle / 180.0) <= 1e+52) tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); else tmp = (2.0 * ((b + a) ^ 2.0)) * (0.5 * sin((pi * (angle * 0.011111111111111112)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -1e+88], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+52], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(0.5 * 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 -1 \cdot 10^{+88}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+52}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot {\left(b + a\right)}^{2}\right) \cdot \left(0.5 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -9.99999999999999959e87Initial program 22.8%
associate-*l*22.8%
unpow222.8%
unpow222.8%
difference-of-squares26.5%
Simplified26.5%
Taylor expanded in angle around inf 29.2%
Taylor expanded in angle around 0 32.4%
if -9.99999999999999959e87 < (/.f64 angle 180) < 9.9999999999999999e51Initial program 68.8%
associate-*l*68.9%
unpow268.9%
unpow268.9%
difference-of-squares72.7%
Simplified72.7%
Taylor expanded in angle around 0 72.6%
associate-*r*85.5%
*-commutative85.5%
+-commutative85.5%
Simplified85.5%
if 9.9999999999999999e51 < (/.f64 angle 180) Initial program 25.3%
*-commutative25.3%
associate-*l*25.3%
unpow225.3%
fma-neg27.5%
unpow227.5%
Simplified27.5%
Applied egg-rr29.7%
log-pow33.0%
sin-033.0%
+-lft-identity33.0%
associate-*l*33.0%
*-commutative33.0%
*-commutative33.0%
Simplified33.0%
pow1/233.0%
log-pow33.0%
add-log-exp33.0%
associate-*r*33.0%
metadata-eval33.0%
Applied egg-rr33.0%
Final simplification65.5%
(FPCore (a b angle) :precision binary64 (* 2.0 (* (- b a) (* (+ b a) (sin (* 0.005555555555555556 (* angle PI)))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((b + a) * sin((0.005555555555555556 * (angle * ((double) M_PI))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((b + a) * Math.sin((0.005555555555555556 * (angle * Math.PI)))));
}
def code(a, b, angle): return 2.0 * ((b - a) * ((b + a) * math.sin((0.005555555555555556 * (angle * math.pi)))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(angle * pi)))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * ((b + a) * sin((0.005555555555555556 * (angle * pi))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $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(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 51.8%
associate-*l*51.8%
unpow251.8%
unpow251.8%
difference-of-squares56.1%
Simplified56.1%
Taylor expanded in angle around inf 65.3%
Taylor expanded in angle around 0 62.3%
Final simplification62.3%
(FPCore (a b angle) :precision binary64 (if (<= angle -8e+89) (* (* 2.0 (* b b)) (sin (* angle (* 0.005555555555555556 PI)))) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= -8e+89) {
tmp = (2.0 * (b * b)) * sin((angle * (0.005555555555555556 * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= -8e+89) {
tmp = (2.0 * (b * b)) * Math.sin((angle * (0.005555555555555556 * Math.PI)));
} else {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= -8e+89: tmp = (2.0 * (b * b)) * math.sin((angle * (0.005555555555555556 * math.pi))) else: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= -8e+89) tmp = Float64(Float64(2.0 * Float64(b * b)) * sin(Float64(angle * Float64(0.005555555555555556 * pi)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= -8e+89) tmp = (2.0 * (b * b)) * sin((angle * (0.005555555555555556 * pi))); else tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, -8e+89], N[(N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq -8 \cdot 10^{+89}:\\
\;\;\;\;\left(2 \cdot \left(b \cdot b\right)\right) \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if angle < -7.99999999999999996e89Initial program 22.8%
associate-*l*22.8%
unpow222.8%
unpow222.8%
difference-of-squares26.5%
Simplified26.5%
Taylor expanded in angle around inf 26.8%
*-commutative26.8%
*-commutative26.8%
associate-*r*24.9%
*-commutative24.9%
Simplified24.9%
Taylor expanded in b around inf 17.4%
associate-*r*17.4%
unpow217.4%
*-commutative17.4%
*-commutative17.4%
associate-*r*16.3%
*-commutative16.3%
*-commutative16.3%
*-commutative16.3%
*-commutative16.3%
associate-*r*18.3%
*-commutative18.3%
*-commutative18.3%
*-commutative18.3%
Simplified18.3%
Taylor expanded in angle around 0 21.2%
if -7.99999999999999996e89 < angle Initial program 59.4%
associate-*l*59.4%
unpow259.4%
unpow259.4%
difference-of-squares63.9%
Simplified63.9%
Taylor expanded in angle around 0 61.3%
associate-*r*71.0%
*-commutative71.0%
+-commutative71.0%
Simplified71.0%
Final simplification60.7%
(FPCore (a b angle) :precision binary64 (if (<= a 2.5e-172) (* (* b b) (sin (* angle (* PI 0.011111111111111112)))) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.5e-172) {
tmp = (b * b) * sin((angle * (((double) M_PI) * 0.011111111111111112)));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.5e-172) {
tmp = (b * b) * Math.sin((angle * (Math.PI * 0.011111111111111112)));
} else {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.5e-172: tmp = (b * b) * math.sin((angle * (math.pi * 0.011111111111111112))) else: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.5e-172) tmp = Float64(Float64(b * b) * sin(Float64(angle * Float64(pi * 0.011111111111111112)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.5e-172) tmp = (b * b) * sin((angle * (pi * 0.011111111111111112))); else tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.5e-172], N[(N[(b * b), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.5 \cdot 10^{-172}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.5e-172Initial program 55.0%
*-commutative55.0%
associate-*l*55.0%
unpow255.0%
fma-neg56.7%
unpow256.7%
Simplified56.7%
Applied egg-rr26.7%
log-pow30.1%
sin-030.1%
+-lft-identity30.1%
associate-*l*30.1%
*-commutative30.1%
*-commutative30.1%
Simplified30.1%
Taylor expanded in b around inf 25.9%
associate-*r*25.9%
*-commutative25.9%
unpow225.9%
associate-*r*27.0%
*-commutative27.0%
unpow1/227.0%
log-pow27.0%
rem-log-exp43.0%
count-243.0%
distribute-rgt-out43.0%
metadata-eval43.0%
*-rgt-identity43.0%
associate-*r*43.0%
*-commutative43.0%
Simplified43.0%
if 2.5e-172 < a Initial program 44.8%
associate-*l*44.8%
unpow244.8%
unpow244.8%
difference-of-squares52.4%
Simplified52.4%
Taylor expanded in angle around 0 54.6%
associate-*r*64.0%
*-commutative64.0%
+-commutative64.0%
Simplified64.0%
Final simplification49.5%
(FPCore (a b angle) :precision binary64 (if (<= a 19000000000.0) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* 0.011111111111111112 (* angle (* (- b a) (* a PI))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 19000000000.0) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 19000000000.0) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 19000000000.0: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 19000000000.0) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 19000000000.0) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 19000000000.0], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 19000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.9e10Initial program 54.6%
associate-*l*54.6%
unpow254.6%
unpow254.6%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 57.5%
*-commutative57.5%
*-commutative57.5%
associate-*r*56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in b around inf 42.9%
associate-*r*42.9%
unpow242.9%
*-commutative42.9%
*-commutative42.9%
associate-*r*43.3%
*-commutative43.3%
*-commutative43.3%
*-commutative43.3%
*-commutative43.3%
associate-*r*43.5%
*-commutative43.5%
*-commutative43.5%
*-commutative43.5%
Simplified43.5%
Taylor expanded in angle around 0 38.5%
associate-*r*38.5%
*-commutative38.5%
unpow238.5%
Simplified38.5%
if 1.9e10 < a Initial program 40.5%
associate-*l*40.5%
unpow240.5%
unpow240.5%
difference-of-squares52.6%
Simplified52.6%
Taylor expanded in angle around 0 53.6%
Taylor expanded in a around inf 49.5%
*-commutative49.5%
Simplified49.5%
Final simplification40.6%
(FPCore (a b angle) :precision binary64 (if (<= a 25500000000.0) (* 0.011111111111111112 (* angle (* (- b a) (* b PI)))) (* 0.011111111111111112 (* angle (* (- b a) (* a PI))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 25500000000.0) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 25500000000.0) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * Math.PI)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 25500000000.0: tmp = 0.011111111111111112 * (angle * ((b - a) * (b * math.pi))) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 25500000000.0) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(b * pi)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 25500000000.0) tmp = 0.011111111111111112 * (angle * ((b - a) * (b * pi))); else tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 25500000000.0], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 25500000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.55e10Initial program 54.6%
associate-*l*54.6%
unpow254.6%
unpow254.6%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around 0 50.9%
Taylor expanded in a around 0 40.4%
*-commutative40.4%
Simplified40.4%
if 2.55e10 < a Initial program 40.5%
associate-*l*40.5%
unpow240.5%
unpow240.5%
difference-of-squares52.6%
Simplified52.6%
Taylor expanded in angle around 0 53.6%
Taylor expanded in a around inf 49.5%
*-commutative49.5%
Simplified49.5%
Final simplification42.2%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* (- b a) (* PI (+ b a))))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (b + a))));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (b + a))));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * ((b - a) * (math.pi * (b + a))))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(b + a))))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (b + a)))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Initial program 51.8%
associate-*l*51.8%
unpow251.8%
unpow251.8%
difference-of-squares56.1%
Simplified56.1%
Taylor expanded in angle around 0 51.4%
Final simplification51.4%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
def code(a, b, angle): return 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)
\end{array}
Initial program 51.8%
associate-*l*51.8%
unpow251.8%
unpow251.8%
difference-of-squares56.1%
Simplified56.1%
Taylor expanded in angle around 0 51.4%
associate-*r*58.7%
*-commutative58.7%
+-commutative58.7%
Simplified58.7%
Final simplification58.7%
(FPCore (a b angle) :precision binary64 (if (<= a 600000000000.0) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* angle (* PI (* (* a a) -0.011111111111111112)))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 600000000000.0) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = angle * (((double) M_PI) * ((a * a) * -0.011111111111111112));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 600000000000.0) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = angle * (Math.PI * ((a * a) * -0.011111111111111112));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 600000000000.0: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = angle * (math.pi * ((a * a) * -0.011111111111111112)) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 600000000000.0) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(angle * Float64(pi * Float64(Float64(a * a) * -0.011111111111111112))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 600000000000.0) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = angle * (pi * ((a * a) * -0.011111111111111112)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 600000000000.0], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(angle * N[(Pi * N[(N[(a * a), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 600000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\pi \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if a < 6e11Initial program 54.6%
associate-*l*54.6%
unpow254.6%
unpow254.6%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 57.5%
*-commutative57.5%
*-commutative57.5%
associate-*r*56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in b around inf 42.9%
associate-*r*42.9%
unpow242.9%
*-commutative42.9%
*-commutative42.9%
associate-*r*43.3%
*-commutative43.3%
*-commutative43.3%
*-commutative43.3%
*-commutative43.3%
associate-*r*43.5%
*-commutative43.5%
*-commutative43.5%
*-commutative43.5%
Simplified43.5%
Taylor expanded in angle around 0 38.5%
associate-*r*38.5%
*-commutative38.5%
unpow238.5%
Simplified38.5%
if 6e11 < a Initial program 40.5%
associate-*l*40.5%
unpow240.5%
unpow240.5%
difference-of-squares52.6%
Simplified52.6%
Taylor expanded in angle around 0 53.6%
Taylor expanded in b around 0 43.8%
*-commutative43.8%
*-commutative43.8%
unpow243.8%
Simplified43.8%
Taylor expanded in angle around 0 43.8%
*-commutative43.8%
*-commutative43.8%
unpow243.8%
associate-*r*43.8%
unpow243.8%
associate-*l*43.8%
unpow243.8%
Simplified43.8%
Final simplification39.5%
(FPCore (a b angle) :precision binary64 (if (<= a 95000000000.0) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* -0.011111111111111112 (* angle (* PI (* a a))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 95000000000.0) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = -0.011111111111111112 * (angle * (((double) M_PI) * (a * a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 95000000000.0) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = -0.011111111111111112 * (angle * (Math.PI * (a * a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 95000000000.0: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = -0.011111111111111112 * (angle * (math.pi * (a * a))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 95000000000.0) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(a * a)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 95000000000.0) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = -0.011111111111111112 * (angle * (pi * (a * a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 95000000000.0], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(angle * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 95000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if a < 9.5e10Initial program 54.6%
associate-*l*54.6%
unpow254.6%
unpow254.6%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 57.5%
*-commutative57.5%
*-commutative57.5%
associate-*r*56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in b around inf 42.9%
associate-*r*42.9%
unpow242.9%
*-commutative42.9%
*-commutative42.9%
associate-*r*43.3%
*-commutative43.3%
*-commutative43.3%
*-commutative43.3%
*-commutative43.3%
associate-*r*43.5%
*-commutative43.5%
*-commutative43.5%
*-commutative43.5%
Simplified43.5%
Taylor expanded in angle around 0 38.5%
associate-*r*38.5%
*-commutative38.5%
unpow238.5%
Simplified38.5%
if 9.5e10 < a Initial program 40.5%
associate-*l*40.5%
unpow240.5%
unpow240.5%
difference-of-squares52.6%
Simplified52.6%
Taylor expanded in angle around 0 53.6%
Taylor expanded in b around 0 43.8%
*-commutative43.8%
*-commutative43.8%
unpow243.8%
Simplified43.8%
Final simplification39.5%
(FPCore (a b angle) :precision binary64 (if (<= a 88000000000.0) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* (* PI (* a a)) (* angle -0.011111111111111112))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 88000000000.0) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} 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 (a <= 88000000000.0) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = (Math.PI * (a * a)) * (angle * -0.011111111111111112);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 88000000000.0: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = (math.pi * (a * a)) * (angle * -0.011111111111111112) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 88000000000.0) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); 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 (a <= 88000000000.0) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = (pi * (a * a)) * (angle * -0.011111111111111112); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 88000000000.0], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $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}\;a \leq 88000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\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 a < 8.8e10Initial program 54.6%
associate-*l*54.6%
unpow254.6%
unpow254.6%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 57.5%
*-commutative57.5%
*-commutative57.5%
associate-*r*56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in b around inf 42.9%
associate-*r*42.9%
unpow242.9%
*-commutative42.9%
*-commutative42.9%
associate-*r*43.3%
*-commutative43.3%
*-commutative43.3%
*-commutative43.3%
*-commutative43.3%
associate-*r*43.5%
*-commutative43.5%
*-commutative43.5%
*-commutative43.5%
Simplified43.5%
Taylor expanded in angle around 0 38.5%
associate-*r*38.5%
*-commutative38.5%
unpow238.5%
Simplified38.5%
if 8.8e10 < a Initial program 40.5%
associate-*l*40.5%
unpow240.5%
unpow240.5%
difference-of-squares52.6%
Simplified52.6%
Taylor expanded in angle around 0 53.6%
Taylor expanded in b around 0 43.8%
associate-*r*43.8%
*-commutative43.8%
*-commutative43.8%
unpow243.8%
*-commutative43.8%
Simplified43.8%
Final simplification39.5%
(FPCore (a b angle) :precision binary64 (if (<= a 1250000000000.0) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* (* PI (* angle (* a a))) -0.011111111111111112)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1250000000000.0) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = (((double) M_PI) * (angle * (a * a))) * -0.011111111111111112;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 1250000000000.0) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = (Math.PI * (angle * (a * a))) * -0.011111111111111112;
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 1250000000000.0: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = (math.pi * (angle * (a * a))) * -0.011111111111111112 return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 1250000000000.0) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(Float64(pi * Float64(angle * Float64(a * a))) * -0.011111111111111112); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1250000000000.0) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = (pi * (angle * (a * a))) * -0.011111111111111112; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 1250000000000.0], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1250000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\
\end{array}
\end{array}
if a < 1.25e12Initial program 54.6%
associate-*l*54.6%
unpow254.6%
unpow254.6%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 57.5%
*-commutative57.5%
*-commutative57.5%
associate-*r*56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in b around inf 42.9%
associate-*r*42.9%
unpow242.9%
*-commutative42.9%
*-commutative42.9%
associate-*r*43.3%
*-commutative43.3%
*-commutative43.3%
*-commutative43.3%
*-commutative43.3%
associate-*r*43.5%
*-commutative43.5%
*-commutative43.5%
*-commutative43.5%
Simplified43.5%
Taylor expanded in angle around 0 38.5%
associate-*r*38.5%
*-commutative38.5%
unpow238.5%
Simplified38.5%
if 1.25e12 < a Initial program 40.5%
associate-*l*40.5%
unpow240.5%
unpow240.5%
difference-of-squares52.6%
Simplified52.6%
Taylor expanded in angle around 0 53.6%
Taylor expanded in b around 0 43.8%
*-commutative43.8%
*-commutative43.8%
unpow243.8%
Simplified43.8%
Taylor expanded in angle around 0 43.8%
associate-*r*43.8%
*-commutative43.8%
unpow243.8%
Simplified43.8%
Final simplification39.5%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* PI (* angle (* b b)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (Math.PI * (angle * (b * b)));
}
def code(a, b, angle): return 0.011111111111111112 * (math.pi * (angle * (b * b)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 51.8%
associate-*l*51.8%
unpow251.8%
unpow251.8%
difference-of-squares56.1%
Simplified56.1%
Taylor expanded in angle around inf 56.8%
*-commutative56.8%
*-commutative56.8%
associate-*r*56.2%
*-commutative56.2%
Simplified56.2%
Taylor expanded in b around inf 37.8%
associate-*r*37.8%
unpow237.8%
*-commutative37.8%
*-commutative37.8%
associate-*r*37.8%
*-commutative37.8%
*-commutative37.8%
*-commutative37.8%
*-commutative37.8%
associate-*r*38.3%
*-commutative38.3%
*-commutative38.3%
*-commutative38.3%
Simplified38.3%
Taylor expanded in angle around 0 33.7%
associate-*r*33.7%
*-commutative33.7%
unpow233.7%
Simplified33.7%
Final simplification33.7%
herbie shell --seed 2023229
(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)))))