
(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
(let* ((t_0 (* (/ angle 180.0) PI)))
(if (<= (/ angle 180.0) 2000000000000.0)
(* (+ a b) (* (- b a) (sin (* 2.0 t_0))))
(if (<= (/ angle 180.0) 4e+98)
(* (* (* 2.0 (- (* a a) (* b b))) (sin t_0)) (cos t_0))
(*
(+ a b)
(* (- b a) (sin (* 2.0 (* angle (* PI 0.005555555555555556))))))))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
double tmp;
if ((angle / 180.0) <= 2000000000000.0) {
tmp = (a + b) * ((b - a) * sin((2.0 * t_0)));
} else if ((angle / 180.0) <= 4e+98) {
tmp = ((2.0 * ((a * a) - (b * b))) * sin(t_0)) * cos(t_0);
} else {
tmp = (a + b) * ((b - a) * sin((2.0 * (angle * (((double) M_PI) * 0.005555555555555556)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
double tmp;
if ((angle / 180.0) <= 2000000000000.0) {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * t_0)));
} else if ((angle / 180.0) <= 4e+98) {
tmp = ((2.0 * ((a * a) - (b * b))) * Math.sin(t_0)) * Math.cos(t_0);
} else {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * (angle * (Math.PI * 0.005555555555555556)))));
}
return tmp;
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi tmp = 0 if (angle / 180.0) <= 2000000000000.0: tmp = (a + b) * ((b - a) * math.sin((2.0 * t_0))) elif (angle / 180.0) <= 4e+98: tmp = ((2.0 * ((a * a) - (b * b))) * math.sin(t_0)) * math.cos(t_0) else: tmp = (a + b) * ((b - a) * math.sin((2.0 * (angle * (math.pi * 0.005555555555555556))))) return tmp
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) tmp = 0.0 if (Float64(angle / 180.0) <= 2000000000000.0) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * t_0)))); elseif (Float64(angle / 180.0) <= 4e+98) tmp = Float64(Float64(Float64(2.0 * Float64(Float64(a * a) - Float64(b * b))) * sin(t_0)) * cos(t_0)); else tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = 0.0; if ((angle / 180.0) <= 2000000000000.0) tmp = (a + b) * ((b - a) * sin((2.0 * t_0))); elseif ((angle / 180.0) <= 4e+98) tmp = ((2.0 * ((a * a) - (b * b))) * sin(t_0)) * cos(t_0); else tmp = (a + b) * ((b - a) * sin((2.0 * (angle * (pi * 0.005555555555555556))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2000000000000.0], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e+98], N[(N[(N[(2.0 * N[(N[(a * a), $MachinePrecision] - N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
\mathbf{if}\;\frac{angle}{180} \leq 2000000000000:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot t_0\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 4 \cdot 10^{+98}:\\
\;\;\;\;\left(\left(2 \cdot \left(a \cdot a - b \cdot b\right)\right) \cdot \sin t_0\right) \cdot \cos t_0\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 2e12Initial program 64.5%
*-commutative64.5%
associate-*l*64.5%
associate-*l*64.4%
unpow264.4%
unpow264.4%
difference-of-squares70.6%
Simplified70.6%
difference-of-squares64.4%
*-commutative64.4%
prod-diff53.8%
fma-neg53.8%
distribute-lft-in53.8%
Applied egg-rr56.4%
*-commutative56.4%
distribute-lft-in56.4%
*-commutative56.4%
Simplified79.6%
*-commutative79.6%
metadata-eval79.6%
div-inv80.0%
Applied egg-rr80.0%
if 2e12 < (/.f64 angle 180) < 3.99999999999999999e98Initial program 11.0%
sub-neg11.0%
unpow211.0%
sqr-neg11.0%
unpow211.0%
unpow211.0%
sqr-neg11.0%
unpow211.0%
unpow211.0%
sqr-neg11.0%
unpow211.0%
sub-neg11.0%
Simplified11.0%
add-sqr-sqrt5.5%
sqrt-unprod33.5%
pow233.5%
difference-of-squares33.5%
Applied egg-rr33.5%
Taylor expanded in b around -inf 57.8%
associate-+r+57.8%
mul-1-neg57.8%
unsub-neg57.8%
*-commutative57.8%
distribute-rgt1-in57.8%
metadata-eval57.8%
mul0-lft57.8%
mul0-lft57.8%
metadata-eval57.8%
neg-sub057.8%
mul-1-neg57.8%
+-commutative57.8%
mul-1-neg57.8%
sub-neg57.8%
unpow257.8%
unpow257.8%
Simplified57.8%
if 3.99999999999999999e98 < (/.f64 angle 180) Initial program 48.3%
*-commutative48.3%
associate-*l*48.3%
associate-*l*48.3%
unpow248.3%
unpow248.3%
difference-of-squares51.3%
Simplified51.3%
difference-of-squares48.3%
*-commutative48.3%
prod-diff21.9%
fma-neg21.9%
distribute-lft-in21.9%
Applied egg-rr20.9%
*-commutative20.9%
distribute-lft-in20.9%
*-commutative20.9%
Simplified44.4%
Taylor expanded in angle around 0 45.3%
associate-*r*44.4%
*-commutative44.4%
associate-*r*51.7%
*-commutative51.7%
Simplified51.7%
Final simplification74.0%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 2000000000000.0)
(* (+ a b) (* (- b a) (sin (* 2.0 (* (/ angle 180.0) PI)))))
(if (<= (/ angle 180.0) 5e+91)
(* (+ a b) (* (- b a) (sin (* angle (* PI -0.011111111111111112)))))
(*
(+ a b)
(* (- b a) (sin (* 2.0 (* angle (* PI 0.005555555555555556)))))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2000000000000.0) {
tmp = (a + b) * ((b - a) * sin((2.0 * ((angle / 180.0) * ((double) M_PI)))));
} else if ((angle / 180.0) <= 5e+91) {
tmp = (a + b) * ((b - a) * sin((angle * (((double) M_PI) * -0.011111111111111112))));
} else {
tmp = (a + b) * ((b - a) * sin((2.0 * (angle * (((double) M_PI) * 0.005555555555555556)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2000000000000.0) {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * ((angle / 180.0) * Math.PI))));
} else if ((angle / 180.0) <= 5e+91) {
tmp = (a + b) * ((b - a) * Math.sin((angle * (Math.PI * -0.011111111111111112))));
} else {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * (angle * (Math.PI * 0.005555555555555556)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 2000000000000.0: tmp = (a + b) * ((b - a) * math.sin((2.0 * ((angle / 180.0) * math.pi)))) elif (angle / 180.0) <= 5e+91: tmp = (a + b) * ((b - a) * math.sin((angle * (math.pi * -0.011111111111111112)))) else: tmp = (a + b) * ((b - a) * math.sin((2.0 * (angle * (math.pi * 0.005555555555555556))))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 2000000000000.0) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(Float64(angle / 180.0) * pi))))); elseif (Float64(angle / 180.0) <= 5e+91) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(angle * Float64(pi * -0.011111111111111112))))); else tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 2000000000000.0) tmp = (a + b) * ((b - a) * sin((2.0 * ((angle / 180.0) * pi)))); elseif ((angle / 180.0) <= 5e+91) tmp = (a + b) * ((b - a) * sin((angle * (pi * -0.011111111111111112)))); else tmp = (a + b) * ((b - a) * sin((2.0 * (angle * (pi * 0.005555555555555556))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2000000000000.0], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+91], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2000000000000:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(\frac{angle}{180} \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+91}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(\pi \cdot -0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 2e12Initial program 64.5%
*-commutative64.5%
associate-*l*64.5%
associate-*l*64.4%
unpow264.4%
unpow264.4%
difference-of-squares70.6%
Simplified70.6%
difference-of-squares64.4%
*-commutative64.4%
prod-diff53.8%
fma-neg53.8%
distribute-lft-in53.8%
Applied egg-rr56.4%
*-commutative56.4%
distribute-lft-in56.4%
*-commutative56.4%
Simplified79.6%
*-commutative79.6%
metadata-eval79.6%
div-inv80.0%
Applied egg-rr80.0%
if 2e12 < (/.f64 angle 180) < 5.0000000000000002e91Initial program 11.9%
*-commutative11.9%
associate-*l*11.9%
associate-*l*11.9%
unpow211.9%
unpow211.9%
difference-of-squares11.9%
Simplified11.9%
difference-of-squares11.9%
*-commutative11.9%
prod-diff7.7%
fma-neg7.7%
distribute-lft-in7.7%
Applied egg-rr13.2%
*-commutative13.2%
distribute-lft-in13.2%
*-commutative13.2%
Simplified17.4%
*-commutative17.4%
metadata-eval17.4%
div-inv11.9%
add-sqr-sqrt25.4%
sqrt-unprod11.9%
pow211.9%
div-inv17.4%
metadata-eval17.4%
*-commutative17.4%
Applied egg-rr17.4%
Taylor expanded in angle around -inf 40.7%
*-commutative40.7%
*-commutative40.7%
*-commutative40.7%
associate-*l*56.8%
Simplified56.8%
if 5.0000000000000002e91 < (/.f64 angle 180) Initial program 45.7%
*-commutative45.7%
associate-*l*45.7%
associate-*l*45.7%
unpow245.7%
unpow245.7%
difference-of-squares48.4%
Simplified48.4%
difference-of-squares45.7%
*-commutative45.7%
prod-diff20.7%
fma-neg20.7%
distribute-lft-in20.7%
Applied egg-rr19.7%
*-commutative19.7%
distribute-lft-in19.7%
*-commutative19.7%
Simplified44.7%
Taylor expanded in angle around 0 45.6%
associate-*r*44.7%
*-commutative44.7%
associate-*r*51.6%
*-commutative51.6%
Simplified51.6%
Final simplification73.8%
(FPCore (a b angle) :precision binary64 (if (or (<= angle 8.2e+17) (not (<= angle 7.6e+97))) (* (+ a b) (* (- b a) (sin (* 2.0 (* angle (* PI 0.005555555555555556)))))) (* (+ a b) (* (- b a) (sin (* angle (* PI -0.011111111111111112)))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle <= 8.2e+17) || !(angle <= 7.6e+97)) {
tmp = (a + b) * ((b - a) * sin((2.0 * (angle * (((double) M_PI) * 0.005555555555555556)))));
} else {
tmp = (a + b) * ((b - a) * sin((angle * (((double) M_PI) * -0.011111111111111112))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle <= 8.2e+17) || !(angle <= 7.6e+97)) {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * (angle * (Math.PI * 0.005555555555555556)))));
} else {
tmp = (a + b) * ((b - a) * Math.sin((angle * (Math.PI * -0.011111111111111112))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle <= 8.2e+17) or not (angle <= 7.6e+97): tmp = (a + b) * ((b - a) * math.sin((2.0 * (angle * (math.pi * 0.005555555555555556))))) else: tmp = (a + b) * ((b - a) * math.sin((angle * (math.pi * -0.011111111111111112)))) return tmp
function code(a, b, angle) tmp = 0.0 if ((angle <= 8.2e+17) || !(angle <= 7.6e+97)) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556)))))); else tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(angle * Float64(pi * -0.011111111111111112))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle <= 8.2e+17) || ~((angle <= 7.6e+97))) tmp = (a + b) * ((b - a) * sin((2.0 * (angle * (pi * 0.005555555555555556))))); else tmp = (a + b) * ((b - a) * sin((angle * (pi * -0.011111111111111112)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[angle, 8.2e+17], N[Not[LessEqual[angle, 7.6e+97]], $MachinePrecision]], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 8.2 \cdot 10^{+17} \lor \neg \left(angle \leq 7.6 \cdot 10^{+97}\right):\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(\pi \cdot -0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if angle < 8.2e17 or 7.60000000000000071e97 < angle Initial program 61.5%
*-commutative61.5%
associate-*l*61.5%
associate-*l*61.5%
unpow261.5%
unpow261.5%
difference-of-squares67.2%
Simplified67.2%
difference-of-squares61.5%
*-commutative61.5%
prod-diff48.6%
fma-neg48.6%
distribute-lft-in48.6%
Applied egg-rr50.7%
*-commutative50.7%
distribute-lft-in50.7%
*-commutative50.7%
Simplified74.2%
Taylor expanded in angle around 0 73.8%
associate-*r*74.2%
*-commutative74.2%
associate-*r*74.7%
*-commutative74.7%
Simplified74.7%
if 8.2e17 < angle < 7.60000000000000071e97Initial program 11.9%
*-commutative11.9%
associate-*l*11.9%
associate-*l*11.9%
unpow211.9%
unpow211.9%
difference-of-squares11.9%
Simplified11.9%
difference-of-squares11.9%
*-commutative11.9%
prod-diff7.7%
fma-neg7.7%
distribute-lft-in7.7%
Applied egg-rr13.2%
*-commutative13.2%
distribute-lft-in13.2%
*-commutative13.2%
Simplified17.4%
*-commutative17.4%
metadata-eval17.4%
div-inv11.9%
add-sqr-sqrt25.4%
sqrt-unprod11.9%
pow211.9%
div-inv17.4%
metadata-eval17.4%
*-commutative17.4%
Applied egg-rr17.4%
Taylor expanded in angle around -inf 40.7%
*-commutative40.7%
*-commutative40.7%
*-commutative40.7%
associate-*l*56.8%
Simplified56.8%
Final simplification73.0%
(FPCore (a b angle)
:precision binary64
(if (<= angle 9.8e+17)
(* (+ a b) (* (- b a) (sin (* 2.0 (* PI (* angle 0.005555555555555556))))))
(if (<= angle 7.6e+97)
(* (+ a b) (* (- b a) (sin (* angle (* PI -0.011111111111111112)))))
(*
(+ a b)
(* (- b a) (sin (* 2.0 (* angle (* PI 0.005555555555555556)))))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 9.8e+17) {
tmp = (a + b) * ((b - a) * sin((2.0 * (((double) M_PI) * (angle * 0.005555555555555556)))));
} else if (angle <= 7.6e+97) {
tmp = (a + b) * ((b - a) * sin((angle * (((double) M_PI) * -0.011111111111111112))));
} else {
tmp = (a + b) * ((b - a) * sin((2.0 * (angle * (((double) M_PI) * 0.005555555555555556)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 9.8e+17) {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * (Math.PI * (angle * 0.005555555555555556)))));
} else if (angle <= 7.6e+97) {
tmp = (a + b) * ((b - a) * Math.sin((angle * (Math.PI * -0.011111111111111112))));
} else {
tmp = (a + b) * ((b - a) * Math.sin((2.0 * (angle * (Math.PI * 0.005555555555555556)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 9.8e+17: tmp = (a + b) * ((b - a) * math.sin((2.0 * (math.pi * (angle * 0.005555555555555556))))) elif angle <= 7.6e+97: tmp = (a + b) * ((b - a) * math.sin((angle * (math.pi * -0.011111111111111112)))) else: tmp = (a + b) * ((b - a) * math.sin((2.0 * (angle * (math.pi * 0.005555555555555556))))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 9.8e+17) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(pi * Float64(angle * 0.005555555555555556)))))); elseif (angle <= 7.6e+97) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(angle * Float64(pi * -0.011111111111111112))))); else tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 9.8e+17) tmp = (a + b) * ((b - a) * sin((2.0 * (pi * (angle * 0.005555555555555556))))); elseif (angle <= 7.6e+97) tmp = (a + b) * ((b - a) * sin((angle * (pi * -0.011111111111111112)))); else tmp = (a + b) * ((b - a) * sin((2.0 * (angle * (pi * 0.005555555555555556))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 9.8e+17], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 7.6e+97], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 9.8 \cdot 10^{+17}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{elif}\;angle \leq 7.6 \cdot 10^{+97}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(angle \cdot \left(\pi \cdot -0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 9.8e17Initial program 64.5%
*-commutative64.5%
associate-*l*64.5%
associate-*l*64.4%
unpow264.4%
unpow264.4%
difference-of-squares70.6%
Simplified70.6%
difference-of-squares64.4%
*-commutative64.4%
prod-diff53.8%
fma-neg53.8%
distribute-lft-in53.8%
Applied egg-rr56.4%
*-commutative56.4%
distribute-lft-in56.4%
*-commutative56.4%
Simplified79.6%
if 9.8e17 < angle < 7.60000000000000071e97Initial program 11.9%
*-commutative11.9%
associate-*l*11.9%
associate-*l*11.9%
unpow211.9%
unpow211.9%
difference-of-squares11.9%
Simplified11.9%
difference-of-squares11.9%
*-commutative11.9%
prod-diff7.7%
fma-neg7.7%
distribute-lft-in7.7%
Applied egg-rr13.2%
*-commutative13.2%
distribute-lft-in13.2%
*-commutative13.2%
Simplified17.4%
*-commutative17.4%
metadata-eval17.4%
div-inv11.9%
add-sqr-sqrt25.4%
sqrt-unprod11.9%
pow211.9%
div-inv17.4%
metadata-eval17.4%
*-commutative17.4%
Applied egg-rr17.4%
Taylor expanded in angle around -inf 40.7%
*-commutative40.7%
*-commutative40.7%
*-commutative40.7%
associate-*l*56.8%
Simplified56.8%
if 7.60000000000000071e97 < angle Initial program 45.7%
*-commutative45.7%
associate-*l*45.7%
associate-*l*45.7%
unpow245.7%
unpow245.7%
difference-of-squares48.4%
Simplified48.4%
difference-of-squares45.7%
*-commutative45.7%
prod-diff20.7%
fma-neg20.7%
distribute-lft-in20.7%
Applied egg-rr19.7%
*-commutative19.7%
distribute-lft-in19.7%
*-commutative19.7%
Simplified44.7%
Taylor expanded in angle around 0 45.6%
associate-*r*44.7%
*-commutative44.7%
associate-*r*51.6%
*-commutative51.6%
Simplified51.6%
Final simplification73.5%
(FPCore (a b angle) :precision binary64 (if (<= angle 5.5e+177) (* (+ a b) (* (- b a) (* PI (* angle 0.011111111111111112)))) (* 2.0 (* (* b b) (sin (* angle (/ PI 180.0)))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 5.5e+177) {
tmp = (a + b) * ((b - a) * (((double) M_PI) * (angle * 0.011111111111111112)));
} else {
tmp = 2.0 * ((b * b) * sin((angle * (((double) M_PI) / 180.0))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 5.5e+177) {
tmp = (a + b) * ((b - a) * (Math.PI * (angle * 0.011111111111111112)));
} else {
tmp = 2.0 * ((b * b) * Math.sin((angle * (Math.PI / 180.0))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 5.5e+177: tmp = (a + b) * ((b - a) * (math.pi * (angle * 0.011111111111111112))) else: tmp = 2.0 * ((b * b) * math.sin((angle * (math.pi / 180.0)))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 5.5e+177) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(pi * Float64(angle * 0.011111111111111112)))); else tmp = Float64(2.0 * Float64(Float64(b * b) * sin(Float64(angle * Float64(pi / 180.0))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 5.5e+177) tmp = (a + b) * ((b - a) * (pi * (angle * 0.011111111111111112))); else tmp = 2.0 * ((b * b) * sin((angle * (pi / 180.0)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 5.5e+177], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b * b), $MachinePrecision] * N[Sin[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 5.5 \cdot 10^{+177}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b \cdot b\right) \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)\\
\end{array}
\end{array}
if angle < 5.49999999999999993e177Initial program 57.9%
*-commutative57.9%
associate-*l*57.9%
associate-*l*57.9%
unpow257.9%
unpow257.9%
difference-of-squares63.0%
Simplified63.0%
difference-of-squares57.9%
*-commutative57.9%
prod-diff46.1%
fma-neg46.0%
distribute-lft-in46.1%
Applied egg-rr48.8%
*-commutative48.8%
distribute-lft-in48.8%
*-commutative48.8%
Simplified71.4%
Taylor expanded in angle around 0 69.6%
associate-*r*69.7%
Simplified69.7%
if 5.49999999999999993e177 < angle Initial program 45.0%
*-commutative45.0%
associate-*l*45.0%
associate-*l*45.0%
unpow245.0%
unpow245.0%
difference-of-squares50.0%
Simplified50.0%
Taylor expanded in b around inf 36.0%
unpow236.0%
associate-*r*36.0%
*-commutative36.0%
*-commutative36.0%
*-commutative36.0%
associate-*r*25.1%
*-commutative25.1%
associate-*r*30.1%
*-commutative30.1%
*-commutative30.1%
*-commutative30.1%
*-commutative30.1%
Simplified30.1%
Taylor expanded in angle around 0 30.1%
Taylor expanded in angle around inf 31.1%
unpow231.1%
*-commutative31.1%
*-commutative31.1%
associate-*r*30.1%
associate-*r*31.1%
*-commutative31.1%
metadata-eval31.1%
associate-/r/36.1%
associate-/l*36.0%
*-lft-identity36.0%
associate-*l/36.1%
*-commutative36.1%
Simplified36.1%
Final simplification67.0%
(FPCore (a b angle) :precision binary64 (if (<= angle 5.5e+177) (* (+ a b) (* (- b a) (* PI (* angle 0.011111111111111112)))) (* (+ a b) (* b (sin (* 0.011111111111111112 (* angle PI)))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 5.5e+177) {
tmp = (a + b) * ((b - a) * (((double) M_PI) * (angle * 0.011111111111111112)));
} else {
tmp = (a + b) * (b * sin((0.011111111111111112 * (angle * ((double) M_PI)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 5.5e+177) {
tmp = (a + b) * ((b - a) * (Math.PI * (angle * 0.011111111111111112)));
} else {
tmp = (a + b) * (b * Math.sin((0.011111111111111112 * (angle * Math.PI))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 5.5e+177: tmp = (a + b) * ((b - a) * (math.pi * (angle * 0.011111111111111112))) else: tmp = (a + b) * (b * math.sin((0.011111111111111112 * (angle * math.pi)))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 5.5e+177) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(pi * Float64(angle * 0.011111111111111112)))); else tmp = Float64(Float64(a + b) * Float64(b * sin(Float64(0.011111111111111112 * Float64(angle * pi))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 5.5e+177) tmp = (a + b) * ((b - a) * (pi * (angle * 0.011111111111111112))); else tmp = (a + b) * (b * sin((0.011111111111111112 * (angle * pi)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 5.5e+177], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + b), $MachinePrecision] * N[(b * N[Sin[N[(0.011111111111111112 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 5.5 \cdot 10^{+177}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + b\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if angle < 5.49999999999999993e177Initial program 57.9%
*-commutative57.9%
associate-*l*57.9%
associate-*l*57.9%
unpow257.9%
unpow257.9%
difference-of-squares63.0%
Simplified63.0%
difference-of-squares57.9%
*-commutative57.9%
prod-diff46.1%
fma-neg46.0%
distribute-lft-in46.1%
Applied egg-rr48.8%
*-commutative48.8%
distribute-lft-in48.8%
*-commutative48.8%
Simplified71.4%
Taylor expanded in angle around 0 69.6%
associate-*r*69.7%
Simplified69.7%
if 5.49999999999999993e177 < angle Initial program 45.0%
*-commutative45.0%
associate-*l*45.0%
associate-*l*45.0%
unpow245.0%
unpow245.0%
difference-of-squares50.0%
Simplified50.0%
difference-of-squares45.0%
*-commutative45.0%
prod-diff30.0%
fma-neg30.0%
distribute-lft-in30.0%
Applied egg-rr29.1%
*-commutative29.1%
distribute-lft-in29.1%
*-commutative29.1%
Simplified39.1%
Taylor expanded in b around inf 36.0%
Final simplification67.0%
(FPCore (a b angle) :precision binary64 (if (<= angle 5.5e+177) (* (+ a b) (* (- b a) (* PI (* angle 0.011111111111111112)))) (* b (* b (sin (* 0.011111111111111112 (* angle PI)))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 5.5e+177) {
tmp = (a + b) * ((b - a) * (((double) M_PI) * (angle * 0.011111111111111112)));
} else {
tmp = b * (b * sin((0.011111111111111112 * (angle * ((double) M_PI)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 5.5e+177) {
tmp = (a + b) * ((b - a) * (Math.PI * (angle * 0.011111111111111112)));
} else {
tmp = b * (b * Math.sin((0.011111111111111112 * (angle * Math.PI))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 5.5e+177: tmp = (a + b) * ((b - a) * (math.pi * (angle * 0.011111111111111112))) else: tmp = b * (b * math.sin((0.011111111111111112 * (angle * math.pi)))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 5.5e+177) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(pi * Float64(angle * 0.011111111111111112)))); else tmp = Float64(b * Float64(b * sin(Float64(0.011111111111111112 * Float64(angle * pi))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 5.5e+177) tmp = (a + b) * ((b - a) * (pi * (angle * 0.011111111111111112))); else tmp = b * (b * sin((0.011111111111111112 * (angle * pi)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 5.5e+177], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[Sin[N[(0.011111111111111112 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 5.5 \cdot 10^{+177}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if angle < 5.49999999999999993e177Initial program 57.9%
*-commutative57.9%
associate-*l*57.9%
associate-*l*57.9%
unpow257.9%
unpow257.9%
difference-of-squares63.0%
Simplified63.0%
difference-of-squares57.9%
*-commutative57.9%
prod-diff46.1%
fma-neg46.0%
distribute-lft-in46.1%
Applied egg-rr48.8%
*-commutative48.8%
distribute-lft-in48.8%
*-commutative48.8%
Simplified71.4%
Taylor expanded in angle around 0 69.6%
associate-*r*69.7%
Simplified69.7%
if 5.49999999999999993e177 < angle Initial program 45.0%
*-commutative45.0%
associate-*l*45.0%
associate-*l*45.0%
unpow245.0%
unpow245.0%
difference-of-squares50.0%
Simplified50.0%
difference-of-squares45.0%
*-commutative45.0%
prod-diff30.0%
fma-neg30.0%
distribute-lft-in30.0%
Applied egg-rr29.1%
*-commutative29.1%
distribute-lft-in29.1%
*-commutative29.1%
Simplified39.1%
*-commutative39.1%
metadata-eval39.1%
div-inv50.0%
associate-*r/45.0%
associate-/l*44.1%
Applied egg-rr44.1%
Taylor expanded in a around 0 36.0%
unpow236.0%
associate-*l*36.0%
Simplified36.0%
Final simplification67.0%
(FPCore (a b angle) :precision binary64 (if (<= b 8.6e-19) (* (* angle PI) (* (* a a) -0.011111111111111112)) (* 2.0 (* PI (* (* b b) (* angle 0.005555555555555556))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 8.6e-19) {
tmp = (angle * ((double) M_PI)) * ((a * a) * -0.011111111111111112);
} else {
tmp = 2.0 * (((double) M_PI) * ((b * b) * (angle * 0.005555555555555556)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 8.6e-19) {
tmp = (angle * Math.PI) * ((a * a) * -0.011111111111111112);
} else {
tmp = 2.0 * (Math.PI * ((b * b) * (angle * 0.005555555555555556)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 8.6e-19: tmp = (angle * math.pi) * ((a * a) * -0.011111111111111112) else: tmp = 2.0 * (math.pi * ((b * b) * (angle * 0.005555555555555556))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 8.6e-19) tmp = Float64(Float64(angle * pi) * Float64(Float64(a * a) * -0.011111111111111112)); else tmp = Float64(2.0 * Float64(pi * Float64(Float64(b * b) * Float64(angle * 0.005555555555555556)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 8.6e-19) tmp = (angle * pi) * ((a * a) * -0.011111111111111112); else tmp = 2.0 * (pi * ((b * b) * (angle * 0.005555555555555556))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 8.6e-19], N[(N[(angle * Pi), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(Pi * N[(N[(b * b), $MachinePrecision] * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8.6 \cdot 10^{-19}:\\
\;\;\;\;\left(angle \cdot \pi\right) \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
if b < 8.6e-19Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares59.4%
Simplified59.4%
Taylor expanded in angle around 0 57.0%
Taylor expanded in a around inf 37.8%
associate-*r*37.8%
unpow237.8%
Simplified37.8%
if 8.6e-19 < b Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares69.6%
Simplified69.6%
Taylor expanded in b around inf 59.7%
unpow259.7%
associate-*r*59.7%
*-commutative59.7%
*-commutative59.7%
*-commutative59.7%
associate-*r*57.9%
*-commutative57.9%
associate-*r*56.3%
*-commutative56.3%
*-commutative56.3%
*-commutative56.3%
*-commutative56.3%
Simplified56.3%
add-cube-cbrt54.7%
pow356.6%
Applied egg-rr56.6%
Taylor expanded in angle around 0 55.4%
associate-*r*55.5%
*-commutative55.5%
unpow255.5%
associate-*r*55.4%
Simplified55.4%
Final simplification42.2%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* (+ a b) (- b a))))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * ((a + b) * (b - a))));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * ((a + b) * (b - a))));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * ((a + b) * (b - a))))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(a + b) * Float64(b - a))))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * ((a + b) * (b - a)))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)
\end{array}
Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares62.0%
Simplified62.0%
Taylor expanded in angle around 0 58.6%
Final simplification58.6%
(FPCore (a b angle) :precision binary64 (* (* angle 0.011111111111111112) (* (- b a) (* (+ a b) PI))))
double code(double a, double b, double angle) {
return (angle * 0.011111111111111112) * ((b - a) * ((a + b) * ((double) M_PI)));
}
public static double code(double a, double b, double angle) {
return (angle * 0.011111111111111112) * ((b - a) * ((a + b) * Math.PI));
}
def code(a, b, angle): return (angle * 0.011111111111111112) * ((b - a) * ((a + b) * math.pi))
function code(a, b, angle) return Float64(Float64(angle * 0.011111111111111112) * Float64(Float64(b - a) * Float64(Float64(a + b) * pi))) end
function tmp = code(a, b, angle) tmp = (angle * 0.011111111111111112) * ((b - a) * ((a + b) * pi)); end
code[a_, b_, angle_] := N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(angle \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \pi\right)\right)
\end{array}
Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares62.0%
Simplified62.0%
difference-of-squares56.9%
*-commutative56.9%
prod-diff44.8%
fma-neg44.8%
distribute-lft-in44.8%
Applied egg-rr47.2%
*-commutative47.2%
distribute-lft-in47.2%
*-commutative47.2%
Simplified68.8%
*-commutative68.8%
metadata-eval68.8%
div-inv69.1%
associate-*r/69.3%
associate-/l*68.5%
Applied egg-rr68.5%
Taylor expanded in angle around 0 58.6%
associate-*r*58.7%
associate-*r*58.7%
Simplified58.7%
Final simplification58.7%
(FPCore (a b angle) :precision binary64 (* (+ a b) (* 0.011111111111111112 (* angle (* (- b a) PI)))))
double code(double a, double b, double angle) {
return (a + b) * (0.011111111111111112 * (angle * ((b - a) * ((double) M_PI))));
}
public static double code(double a, double b, double angle) {
return (a + b) * (0.011111111111111112 * (angle * ((b - a) * Math.PI)));
}
def code(a, b, angle): return (a + b) * (0.011111111111111112 * (angle * ((b - a) * math.pi)))
function code(a, b, angle) return Float64(Float64(a + b) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * pi)))) end
function tmp = code(a, b, angle) tmp = (a + b) * (0.011111111111111112 * (angle * ((b - a) * pi))); end
code[a_, b_, angle_] := N[(N[(a + b), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)
\end{array}
Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares62.0%
Simplified62.0%
difference-of-squares56.9%
*-commutative56.9%
prod-diff44.8%
fma-neg44.8%
distribute-lft-in44.8%
Applied egg-rr47.2%
*-commutative47.2%
distribute-lft-in47.2%
*-commutative47.2%
Simplified68.8%
Taylor expanded in angle around 0 65.1%
Final simplification65.1%
(FPCore (a b angle) :precision binary64 (* (+ a b) (* (- b a) (* PI (* angle 0.011111111111111112)))))
double code(double a, double b, double angle) {
return (a + b) * ((b - a) * (((double) M_PI) * (angle * 0.011111111111111112)));
}
public static double code(double a, double b, double angle) {
return (a + b) * ((b - a) * (Math.PI * (angle * 0.011111111111111112)));
}
def code(a, b, angle): return (a + b) * ((b - a) * (math.pi * (angle * 0.011111111111111112)))
function code(a, b, angle) return Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(pi * Float64(angle * 0.011111111111111112)))) end
function tmp = code(a, b, angle) tmp = (a + b) * ((b - a) * (pi * (angle * 0.011111111111111112))); end
code[a_, b_, angle_] := N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)
\end{array}
Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares62.0%
Simplified62.0%
difference-of-squares56.9%
*-commutative56.9%
prod-diff44.8%
fma-neg44.8%
distribute-lft-in44.8%
Applied egg-rr47.2%
*-commutative47.2%
distribute-lft-in47.2%
*-commutative47.2%
Simplified68.8%
Taylor expanded in angle around 0 65.0%
associate-*r*65.1%
Simplified65.1%
Final simplification65.1%
(FPCore (a b angle) :precision binary64 (if (<= b 8.5e-19) (* (* angle PI) (* (* a a) -0.011111111111111112)) (* 0.011111111111111112 (* PI (* angle (* b b))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 8.5e-19) {
tmp = (angle * ((double) M_PI)) * ((a * a) * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 8.5e-19) {
tmp = (angle * Math.PI) * ((a * a) * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 8.5e-19: tmp = (angle * math.pi) * ((a * a) * -0.011111111111111112) else: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 8.5e-19) tmp = Float64(Float64(angle * pi) * Float64(Float64(a * a) * -0.011111111111111112)); else tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 8.5e-19) tmp = (angle * pi) * ((a * a) * -0.011111111111111112); else tmp = 0.011111111111111112 * (pi * (angle * (b * b))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 8.5e-19], N[(N[(angle * Pi), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8.5 \cdot 10^{-19}:\\
\;\;\;\;\left(angle \cdot \pi\right) \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 8.50000000000000003e-19Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares59.4%
Simplified59.4%
Taylor expanded in angle around 0 57.0%
Taylor expanded in a around inf 37.8%
associate-*r*37.8%
unpow237.8%
Simplified37.8%
if 8.50000000000000003e-19 < b Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares69.6%
Simplified69.6%
Taylor expanded in angle around 0 63.5%
Taylor expanded in a around 0 55.4%
*-commutative55.4%
unpow255.4%
Simplified55.4%
Taylor expanded in angle around 0 55.4%
unpow255.4%
associate-*r*55.5%
*-commutative55.5%
Simplified55.5%
Final simplification42.2%
(FPCore (a b angle) :precision binary64 (if (<= b 7.8e-19) (* (* angle PI) (* (* a a) -0.011111111111111112)) (* (* angle 0.011111111111111112) (* PI (* b b)))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 7.8e-19) {
tmp = (angle * ((double) M_PI)) * ((a * a) * -0.011111111111111112);
} else {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * (b * b));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 7.8e-19) {
tmp = (angle * Math.PI) * ((a * a) * -0.011111111111111112);
} else {
tmp = (angle * 0.011111111111111112) * (Math.PI * (b * b));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 7.8e-19: tmp = (angle * math.pi) * ((a * a) * -0.011111111111111112) else: tmp = (angle * 0.011111111111111112) * (math.pi * (b * b)) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 7.8e-19) tmp = Float64(Float64(angle * pi) * Float64(Float64(a * a) * -0.011111111111111112)); else tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 7.8e-19) tmp = (angle * pi) * ((a * a) * -0.011111111111111112); else tmp = (angle * 0.011111111111111112) * (pi * (b * b)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 7.8e-19], N[(N[(angle * Pi), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.8 \cdot 10^{-19}:\\
\;\;\;\;\left(angle \cdot \pi\right) \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if b < 7.7999999999999999e-19Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares59.4%
Simplified59.4%
Taylor expanded in angle around 0 57.0%
Taylor expanded in a around inf 37.8%
associate-*r*37.8%
unpow237.8%
Simplified37.8%
if 7.7999999999999999e-19 < b Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares69.6%
Simplified69.6%
Taylor expanded in angle around 0 63.5%
Taylor expanded in a around 0 55.4%
associate-*r*55.5%
*-commutative55.5%
unpow255.5%
Simplified55.5%
Final simplification42.2%
(FPCore (a b angle) :precision binary64 (if (<= b 8.6e-19) (* (* angle PI) (* (* a a) -0.011111111111111112)) (* (* PI 0.011111111111111112) (* angle (* b b)))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 8.6e-19) {
tmp = (angle * ((double) M_PI)) * ((a * a) * -0.011111111111111112);
} else {
tmp = (((double) M_PI) * 0.011111111111111112) * (angle * (b * b));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 8.6e-19) {
tmp = (angle * Math.PI) * ((a * a) * -0.011111111111111112);
} else {
tmp = (Math.PI * 0.011111111111111112) * (angle * (b * b));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 8.6e-19: tmp = (angle * math.pi) * ((a * a) * -0.011111111111111112) else: tmp = (math.pi * 0.011111111111111112) * (angle * (b * b)) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 8.6e-19) tmp = Float64(Float64(angle * pi) * Float64(Float64(a * a) * -0.011111111111111112)); else tmp = Float64(Float64(pi * 0.011111111111111112) * Float64(angle * Float64(b * b))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 8.6e-19) tmp = (angle * pi) * ((a * a) * -0.011111111111111112); else tmp = (pi * 0.011111111111111112) * (angle * (b * b)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 8.6e-19], N[(N[(angle * Pi), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * 0.011111111111111112), $MachinePrecision] * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8.6 \cdot 10^{-19}:\\
\;\;\;\;\left(angle \cdot \pi\right) \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot 0.011111111111111112\right) \cdot \left(angle \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if b < 8.6e-19Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.8%
unpow256.8%
unpow256.8%
difference-of-squares59.4%
Simplified59.4%
Taylor expanded in angle around 0 57.0%
Taylor expanded in a around inf 37.8%
associate-*r*37.8%
unpow237.8%
Simplified37.8%
if 8.6e-19 < b Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares69.6%
Simplified69.6%
Taylor expanded in angle around 0 63.5%
Taylor expanded in a around 0 55.4%
*-commutative55.4%
unpow255.4%
Simplified55.4%
Taylor expanded in angle around 0 55.4%
unpow255.4%
associate-*r*55.5%
*-commutative55.5%
Simplified55.5%
Taylor expanded in angle around 0 55.4%
associate-*r*55.5%
unpow255.5%
associate-*l*61.4%
*-commutative61.4%
associate-*r*61.4%
associate-*l*55.5%
Simplified55.5%
Final simplification42.2%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* b b)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * (b * b)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares62.0%
Simplified62.0%
Taylor expanded in angle around 0 58.6%
Taylor expanded in a around 0 38.2%
*-commutative38.2%
unpow238.2%
Simplified38.2%
Final simplification38.2%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* PI (* angle (* b b)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (Math.PI * (angle * (b * b)));
}
def code(a, b, angle): return 0.011111111111111112 * (math.pi * (angle * (b * b)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 56.9%
*-commutative56.9%
associate-*l*56.9%
associate-*l*56.9%
unpow256.9%
unpow256.9%
difference-of-squares62.0%
Simplified62.0%
Taylor expanded in angle around 0 58.6%
Taylor expanded in a around 0 38.2%
*-commutative38.2%
unpow238.2%
Simplified38.2%
Taylor expanded in angle around 0 38.2%
unpow238.2%
associate-*r*38.2%
*-commutative38.2%
Simplified38.2%
Final simplification38.2%
herbie shell --seed 2023275
(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)))))