
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556)))
(t_1 (cos t_0))
(t_2 (sin t_0)))
(if (<= (pow a 2.0) 5e+276)
(fma b (* 2.0 (* b (* t_2 t_1))) (* (pow a 2.0) (* t_1 (* t_2 -2.0))))
(*
(* (- b a) (+ a b))
(*
2.0
(*
(sin (* (/ (sqrt PI) 180.0) (/ (sqrt PI) (/ 1.0 angle))))
(cos (* PI (/ angle 180.0)))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_1 = cos(t_0);
double t_2 = sin(t_0);
double tmp;
if (pow(a, 2.0) <= 5e+276) {
tmp = fma(b, (2.0 * (b * (t_2 * t_1))), (pow(a, 2.0) * (t_1 * (t_2 * -2.0))));
} else {
tmp = ((b - a) * (a + b)) * (2.0 * (sin(((sqrt(((double) M_PI)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle)))) * cos((((double) M_PI) * (angle / 180.0)))));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) t_1 = cos(t_0) t_2 = sin(t_0) tmp = 0.0 if ((a ^ 2.0) <= 5e+276) tmp = fma(b, Float64(2.0 * Float64(b * Float64(t_2 * t_1))), Float64((a ^ 2.0) * Float64(t_1 * Float64(t_2 * -2.0)))); else tmp = Float64(Float64(Float64(b - a) * Float64(a + b)) * Float64(2.0 * Float64(sin(Float64(Float64(sqrt(pi) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle)))) * cos(Float64(pi * Float64(angle / 180.0)))))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+276], N[(b * N[(2.0 * N[(b * N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[a, 2.0], $MachinePrecision] * N[(t$95$1 * N[(t$95$2 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \cos t\_0\\
t_2 := \sin t\_0\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\mathsf{fma}\left(b, 2 \cdot \left(b \cdot \left(t\_2 \cdot t\_1\right)\right), {a}^{2} \cdot \left(t\_1 \cdot \left(t\_2 \cdot -2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(2 \cdot \left(\sin \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 5.00000000000000001e276Initial program 59.4%
associate-*l*59.4%
*-commutative59.4%
associate-*l*59.4%
Simplified59.4%
unpow259.4%
unpow259.4%
difference-of-squares59.4%
Applied egg-rr59.4%
add-sqr-sqrt59.1%
pow259.1%
Applied egg-rr59.1%
Taylor expanded in b around 0 65.3%
+-commutative65.3%
fma-define65.3%
Simplified67.5%
if 5.00000000000000001e276 < (pow.f64 a #s(literal 2 binary64)) Initial program 34.3%
associate-*l*34.3%
*-commutative34.3%
associate-*l*34.3%
Simplified34.3%
unpow234.3%
unpow234.3%
difference-of-squares52.5%
Applied egg-rr52.5%
add-sqr-sqrt60.9%
pow260.9%
Applied egg-rr67.8%
unpow267.8%
add-sqr-sqrt52.5%
clear-num55.3%
un-div-inv58.1%
Applied egg-rr58.1%
add-sqr-sqrt66.4%
div-inv66.4%
times-frac70.6%
Applied egg-rr70.6%
Final simplification68.3%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (/ angle 180.0))) (t_1 (* (- b a) (+ a b))))
(if (<= (- (pow b 2.0) (pow a 2.0)) 2e+136)
(*
t_1
(*
2.0
(*
(sin t_0)
(cos (pow (sqrt (* angle (* PI 0.005555555555555556))) 2.0)))))
(* t_1 (* 2.0 (* (cos t_0) (sin (pow (/ (/ 180.0 angle) PI) -1.0))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double t_1 = (b - a) * (a + b);
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= 2e+136) {
tmp = t_1 * (2.0 * (sin(t_0) * cos(pow(sqrt((angle * (((double) M_PI) * 0.005555555555555556))), 2.0))));
} else {
tmp = t_1 * (2.0 * (cos(t_0) * sin(pow(((180.0 / angle) / ((double) M_PI)), -1.0))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
double t_1 = (b - a) * (a + b);
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 2e+136) {
tmp = t_1 * (2.0 * (Math.sin(t_0) * Math.cos(Math.pow(Math.sqrt((angle * (Math.PI * 0.005555555555555556))), 2.0))));
} else {
tmp = t_1 * (2.0 * (Math.cos(t_0) * Math.sin(Math.pow(((180.0 / angle) / Math.PI), -1.0))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) t_1 = (b - a) * (a + b) tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= 2e+136: tmp = t_1 * (2.0 * (math.sin(t_0) * math.cos(math.pow(math.sqrt((angle * (math.pi * 0.005555555555555556))), 2.0)))) else: tmp = t_1 * (2.0 * (math.cos(t_0) * math.sin(math.pow(((180.0 / angle) / math.pi), -1.0)))) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) t_1 = Float64(Float64(b - a) * Float64(a + b)) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 2e+136) tmp = Float64(t_1 * Float64(2.0 * Float64(sin(t_0) * cos((sqrt(Float64(angle * Float64(pi * 0.005555555555555556))) ^ 2.0))))); else tmp = Float64(t_1 * Float64(2.0 * Float64(cos(t_0) * sin((Float64(Float64(180.0 / angle) / pi) ^ -1.0))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle / 180.0); t_1 = (b - a) * (a + b); tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= 2e+136) tmp = t_1 * (2.0 * (sin(t_0) * cos((sqrt((angle * (pi * 0.005555555555555556))) ^ 2.0)))); else tmp = t_1 * (2.0 * (cos(t_0) * sin((((180.0 / angle) / pi) ^ -1.0)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 2e+136], N[(t$95$1 * N[(2.0 * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[N[Power[N[Sqrt[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[N[Power[N[(N[(180.0 / angle), $MachinePrecision] / Pi), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
t_1 := \left(b - a\right) \cdot \left(a + b\right)\\
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{+136}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sin t\_0 \cdot \cos \left({\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos t\_0 \cdot \sin \left({\left(\frac{\frac{180}{angle}}{\pi}\right)}^{-1}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000012e136Initial program 61.0%
associate-*l*61.1%
*-commutative61.1%
associate-*l*61.1%
Simplified61.1%
unpow261.1%
unpow261.1%
difference-of-squares61.1%
Applied egg-rr61.1%
add-sqr-sqrt64.0%
pow264.0%
Applied egg-rr64.0%
unpow264.0%
add-sqr-sqrt61.1%
add-sqr-sqrt29.9%
pow229.9%
*-commutative29.9%
div-inv29.9%
metadata-eval29.9%
associate-*l*30.0%
Applied egg-rr30.0%
if 2.00000000000000012e136 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 38.3%
associate-*l*38.3%
*-commutative38.3%
associate-*l*38.3%
Simplified38.3%
unpow238.3%
unpow238.3%
difference-of-squares51.7%
Applied egg-rr51.7%
add-sqr-sqrt52.6%
pow252.6%
Applied egg-rr62.3%
unpow262.3%
add-sqr-sqrt51.7%
clear-num53.8%
un-div-inv52.5%
Applied egg-rr52.5%
clear-num58.9%
inv-pow58.9%
Applied egg-rr58.9%
Final simplification41.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556))))
(if (<= (pow a 2.0) 5e+276)
(+
(* b (* b (sin (* 2.0 t_0))))
(* (* (sin t_0) -2.0) (* (pow a 2.0) (cos t_0))))
(*
(* (- b a) (+ a b))
(*
2.0
(*
(sin (* (/ (sqrt PI) 180.0) (/ (sqrt PI) (/ 1.0 angle))))
(cos (* PI (/ angle 180.0)))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double tmp;
if (pow(a, 2.0) <= 5e+276) {
tmp = (b * (b * sin((2.0 * t_0)))) + ((sin(t_0) * -2.0) * (pow(a, 2.0) * cos(t_0)));
} else {
tmp = ((b - a) * (a + b)) * (2.0 * (sin(((sqrt(((double) M_PI)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle)))) * cos((((double) M_PI) * (angle / 180.0)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double tmp;
if (Math.pow(a, 2.0) <= 5e+276) {
tmp = (b * (b * Math.sin((2.0 * t_0)))) + ((Math.sin(t_0) * -2.0) * (Math.pow(a, 2.0) * Math.cos(t_0)));
} else {
tmp = ((b - a) * (a + b)) * (2.0 * (Math.sin(((Math.sqrt(Math.PI) / 180.0) * (Math.sqrt(Math.PI) / (1.0 / angle)))) * Math.cos((Math.PI * (angle / 180.0)))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle * 0.005555555555555556) tmp = 0 if math.pow(a, 2.0) <= 5e+276: tmp = (b * (b * math.sin((2.0 * t_0)))) + ((math.sin(t_0) * -2.0) * (math.pow(a, 2.0) * math.cos(t_0))) else: tmp = ((b - a) * (a + b)) * (2.0 * (math.sin(((math.sqrt(math.pi) / 180.0) * (math.sqrt(math.pi) / (1.0 / angle)))) * math.cos((math.pi * (angle / 180.0))))) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) tmp = 0.0 if ((a ^ 2.0) <= 5e+276) tmp = Float64(Float64(b * Float64(b * sin(Float64(2.0 * t_0)))) + Float64(Float64(sin(t_0) * -2.0) * Float64((a ^ 2.0) * cos(t_0)))); else tmp = Float64(Float64(Float64(b - a) * Float64(a + b)) * Float64(2.0 * Float64(sin(Float64(Float64(sqrt(pi) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle)))) * cos(Float64(pi * Float64(angle / 180.0)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle * 0.005555555555555556); tmp = 0.0; if ((a ^ 2.0) <= 5e+276) tmp = (b * (b * sin((2.0 * t_0)))) + ((sin(t_0) * -2.0) * ((a ^ 2.0) * cos(t_0))); else tmp = ((b - a) * (a + b)) * (2.0 * (sin(((sqrt(pi) / 180.0) * (sqrt(pi) / (1.0 / angle)))) * cos((pi * (angle / 180.0))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+276], N[(N[(b * N[(b * N[Sin[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sin[t$95$0], $MachinePrecision] * -2.0), $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+276}:\\
\;\;\;\;b \cdot \left(b \cdot \sin \left(2 \cdot t\_0\right)\right) + \left(\sin t\_0 \cdot -2\right) \cdot \left({a}^{2} \cdot \cos t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(2 \cdot \left(\sin \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle}}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 5.00000000000000001e276Initial program 59.4%
associate-*l*59.4%
*-commutative59.4%
associate-*l*59.4%
Simplified59.4%
unpow259.4%
unpow259.4%
difference-of-squares59.4%
Applied egg-rr59.4%
add-sqr-sqrt59.1%
pow259.1%
Applied egg-rr59.1%
Taylor expanded in b around 0 65.3%
+-commutative65.3%
fma-define65.3%
Simplified67.5%
fma-undefine67.5%
Applied egg-rr67.5%
if 5.00000000000000001e276 < (pow.f64 a #s(literal 2 binary64)) Initial program 34.3%
associate-*l*34.3%
*-commutative34.3%
associate-*l*34.3%
Simplified34.3%
unpow234.3%
unpow234.3%
difference-of-squares52.5%
Applied egg-rr52.5%
add-sqr-sqrt60.9%
pow260.9%
Applied egg-rr67.8%
unpow267.8%
add-sqr-sqrt52.5%
clear-num55.3%
un-div-inv58.1%
Applied egg-rr58.1%
add-sqr-sqrt66.4%
div-inv66.4%
times-frac70.6%
Applied egg-rr70.6%
Final simplification68.3%
(FPCore (a b angle)
:precision binary64
(*
(* (- b a) (+ a b))
(*
2.0
(*
(cos (* PI (/ angle 180.0)))
(sin (* (/ angle 180.0) (pow (sqrt PI) 2.0)))))))
double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * (2.0 * (cos((((double) M_PI) * (angle / 180.0))) * sin(((angle / 180.0) * pow(sqrt(((double) M_PI)), 2.0)))));
}
public static double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * (2.0 * (Math.cos((Math.PI * (angle / 180.0))) * Math.sin(((angle / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0)))));
}
def code(a, b, angle): return ((b - a) * (a + b)) * (2.0 * (math.cos((math.pi * (angle / 180.0))) * math.sin(((angle / 180.0) * math.pow(math.sqrt(math.pi), 2.0)))))
function code(a, b, angle) return Float64(Float64(Float64(b - a) * Float64(a + b)) * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle / 180.0))) * sin(Float64(Float64(angle / 180.0) * (sqrt(pi) ^ 2.0)))))) end
function tmp = code(a, b, angle) tmp = ((b - a) * (a + b)) * (2.0 * (cos((pi * (angle / 180.0))) * sin(((angle / 180.0) * (sqrt(pi) ^ 2.0))))); end
code[a_, b_, angle_] := N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\right)
\end{array}
Initial program 52.3%
associate-*l*52.3%
*-commutative52.3%
associate-*l*52.3%
Simplified52.3%
unpow252.3%
unpow252.3%
difference-of-squares57.5%
Applied egg-rr57.5%
add-sqr-sqrt59.6%
pow259.6%
Applied egg-rr63.1%
Final simplification63.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556))) (t_1 (* (- b a) (+ a b))))
(if (<= (/ angle 180.0) 2e+65)
(* t_1 (* (sin t_0) (* 2.0 (cos t_0))))
(*
t_1
(*
2.0
(*
(cos (* PI (/ angle 180.0)))
(sin (pow (/ (/ 180.0 angle) PI) -1.0))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_1 = (b - a) * (a + b);
double tmp;
if ((angle / 180.0) <= 2e+65) {
tmp = t_1 * (sin(t_0) * (2.0 * cos(t_0)));
} else {
tmp = t_1 * (2.0 * (cos((((double) M_PI) * (angle / 180.0))) * sin(pow(((180.0 / angle) / ((double) M_PI)), -1.0))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double t_1 = (b - a) * (a + b);
double tmp;
if ((angle / 180.0) <= 2e+65) {
tmp = t_1 * (Math.sin(t_0) * (2.0 * Math.cos(t_0)));
} else {
tmp = t_1 * (2.0 * (Math.cos((Math.PI * (angle / 180.0))) * Math.sin(Math.pow(((180.0 / angle) / Math.PI), -1.0))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle * 0.005555555555555556) t_1 = (b - a) * (a + b) tmp = 0 if (angle / 180.0) <= 2e+65: tmp = t_1 * (math.sin(t_0) * (2.0 * math.cos(t_0))) else: tmp = t_1 * (2.0 * (math.cos((math.pi * (angle / 180.0))) * math.sin(math.pow(((180.0 / angle) / math.pi), -1.0)))) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) t_1 = Float64(Float64(b - a) * Float64(a + b)) tmp = 0.0 if (Float64(angle / 180.0) <= 2e+65) tmp = Float64(t_1 * Float64(sin(t_0) * Float64(2.0 * cos(t_0)))); else tmp = Float64(t_1 * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle / 180.0))) * sin((Float64(Float64(180.0 / angle) / pi) ^ -1.0))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle * 0.005555555555555556); t_1 = (b - a) * (a + b); tmp = 0.0; if ((angle / 180.0) <= 2e+65) tmp = t_1 * (sin(t_0) * (2.0 * cos(t_0))); else tmp = t_1 * (2.0 * (cos((pi * (angle / 180.0))) * sin((((180.0 / angle) / pi) ^ -1.0)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+65], N[(t$95$1 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Power[N[(N[(180.0 / angle), $MachinePrecision] / Pi), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \left(b - a\right) \cdot \left(a + b\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+65}:\\
\;\;\;\;t\_1 \cdot \left(\sin t\_0 \cdot \left(2 \cdot \cos t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left({\left(\frac{\frac{180}{angle}}{\pi}\right)}^{-1}\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e65Initial program 58.8%
associate-*l*58.8%
*-commutative58.8%
associate-*l*58.8%
Simplified58.8%
unpow258.8%
unpow258.8%
difference-of-squares64.2%
Applied egg-rr64.2%
add-sqr-sqrt65.4%
pow265.4%
Applied egg-rr64.7%
Taylor expanded in angle around inf 61.9%
associate-*r*61.9%
*-commutative61.9%
associate-*r*63.0%
*-commutative63.0%
*-commutative63.0%
associate-*r*66.2%
*-commutative66.2%
*-commutative66.2%
Simplified66.2%
if 2e65 < (/.f64 angle #s(literal 180 binary64)) Initial program 25.8%
associate-*l*25.8%
*-commutative25.8%
associate-*l*25.8%
Simplified25.8%
unpow225.8%
unpow225.8%
difference-of-squares29.8%
Applied egg-rr29.8%
add-sqr-sqrt35.7%
pow235.7%
Applied egg-rr56.2%
unpow256.2%
add-sqr-sqrt29.8%
clear-num31.7%
un-div-inv35.8%
Applied egg-rr35.8%
clear-num42.2%
inv-pow42.2%
Applied egg-rr42.2%
Final simplification61.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556))) (t_1 (* (- b a) (+ a b))))
(if (<= (/ angle 180.0) 2e+65)
(* t_1 (* (sin t_0) (* 2.0 (cos t_0))))
(*
t_1
(*
2.0
(*
(cos (* PI (/ angle 180.0)))
(sin (/ 1.0 (/ 180.0 (* PI angle))))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_1 = (b - a) * (a + b);
double tmp;
if ((angle / 180.0) <= 2e+65) {
tmp = t_1 * (sin(t_0) * (2.0 * cos(t_0)));
} else {
tmp = t_1 * (2.0 * (cos((((double) M_PI) * (angle / 180.0))) * sin((1.0 / (180.0 / (((double) M_PI) * angle))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double t_1 = (b - a) * (a + b);
double tmp;
if ((angle / 180.0) <= 2e+65) {
tmp = t_1 * (Math.sin(t_0) * (2.0 * Math.cos(t_0)));
} else {
tmp = t_1 * (2.0 * (Math.cos((Math.PI * (angle / 180.0))) * Math.sin((1.0 / (180.0 / (Math.PI * angle))))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle * 0.005555555555555556) t_1 = (b - a) * (a + b) tmp = 0 if (angle / 180.0) <= 2e+65: tmp = t_1 * (math.sin(t_0) * (2.0 * math.cos(t_0))) else: tmp = t_1 * (2.0 * (math.cos((math.pi * (angle / 180.0))) * math.sin((1.0 / (180.0 / (math.pi * angle)))))) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) t_1 = Float64(Float64(b - a) * Float64(a + b)) tmp = 0.0 if (Float64(angle / 180.0) <= 2e+65) tmp = Float64(t_1 * Float64(sin(t_0) * Float64(2.0 * cos(t_0)))); else tmp = Float64(t_1 * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle / 180.0))) * sin(Float64(1.0 / Float64(180.0 / Float64(pi * angle))))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle * 0.005555555555555556); t_1 = (b - a) * (a + b); tmp = 0.0; if ((angle / 180.0) <= 2e+65) tmp = t_1 * (sin(t_0) * (2.0 * cos(t_0))); else tmp = t_1 * (2.0 * (cos((pi * (angle / 180.0))) * sin((1.0 / (180.0 / (pi * angle)))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+65], N[(t$95$1 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(1.0 / N[(180.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \left(b - a\right) \cdot \left(a + b\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+65}:\\
\;\;\;\;t\_1 \cdot \left(\sin t\_0 \cdot \left(2 \cdot \cos t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\frac{1}{\frac{180}{\pi \cdot angle}}\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e65Initial program 58.8%
associate-*l*58.8%
*-commutative58.8%
associate-*l*58.8%
Simplified58.8%
unpow258.8%
unpow258.8%
difference-of-squares64.2%
Applied egg-rr64.2%
add-sqr-sqrt65.4%
pow265.4%
Applied egg-rr64.7%
Taylor expanded in angle around inf 61.9%
associate-*r*61.9%
*-commutative61.9%
associate-*r*63.0%
*-commutative63.0%
*-commutative63.0%
associate-*r*66.2%
*-commutative66.2%
*-commutative66.2%
Simplified66.2%
if 2e65 < (/.f64 angle #s(literal 180 binary64)) Initial program 25.8%
associate-*l*25.8%
*-commutative25.8%
associate-*l*25.8%
Simplified25.8%
unpow225.8%
unpow225.8%
difference-of-squares29.8%
Applied egg-rr29.8%
add-sqr-sqrt35.7%
pow235.7%
Applied egg-rr56.2%
unpow256.2%
add-sqr-sqrt29.8%
associate-*r/41.9%
clear-num42.2%
Applied egg-rr42.2%
Final simplification61.5%
(FPCore (a b angle) :precision binary64 (* (* (- b a) (+ a b)) (* 2.0 (* (cos (* PI (/ angle 180.0))) (sin (/ (* PI angle) 180.0))))))
double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * (2.0 * (cos((((double) M_PI) * (angle / 180.0))) * sin(((((double) M_PI) * angle) / 180.0))));
}
public static double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * (2.0 * (Math.cos((Math.PI * (angle / 180.0))) * Math.sin(((Math.PI * angle) / 180.0))));
}
def code(a, b, angle): return ((b - a) * (a + b)) * (2.0 * (math.cos((math.pi * (angle / 180.0))) * math.sin(((math.pi * angle) / 180.0))))
function code(a, b, angle) return Float64(Float64(Float64(b - a) * Float64(a + b)) * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle / 180.0))) * sin(Float64(Float64(pi * angle) / 180.0))))) end
function tmp = code(a, b, angle) tmp = ((b - a) * (a + b)) * (2.0 * (cos((pi * (angle / 180.0))) * sin(((pi * angle) / 180.0)))); end
code[a_, b_, angle_] := N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)\right)
\end{array}
Initial program 52.3%
associate-*l*52.3%
*-commutative52.3%
associate-*l*52.3%
Simplified52.3%
unpow252.3%
unpow252.3%
difference-of-squares57.5%
Applied egg-rr57.5%
add-sqr-sqrt59.6%
pow259.6%
Applied egg-rr63.1%
unpow263.1%
add-sqr-sqrt57.5%
associate-*r/60.2%
Applied egg-rr60.2%
Final simplification60.2%
(FPCore (a b angle)
:precision binary64
(*
(* (- b a) (+ a b))
(*
2.0
(*
(cos (* PI (/ angle 180.0)))
(sin (* 0.005555555555555556 (* PI angle)))))))
double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * (2.0 * (cos((((double) M_PI) * (angle / 180.0))) * sin((0.005555555555555556 * (((double) M_PI) * angle)))));
}
public static double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * (2.0 * (Math.cos((Math.PI * (angle / 180.0))) * Math.sin((0.005555555555555556 * (Math.PI * angle)))));
}
def code(a, b, angle): return ((b - a) * (a + b)) * (2.0 * (math.cos((math.pi * (angle / 180.0))) * math.sin((0.005555555555555556 * (math.pi * angle)))))
function code(a, b, angle) return Float64(Float64(Float64(b - a) * Float64(a + b)) * Float64(2.0 * Float64(cos(Float64(pi * Float64(angle / 180.0))) * sin(Float64(0.005555555555555556 * Float64(pi * angle)))))) end
function tmp = code(a, b, angle) tmp = ((b - a) * (a + b)) * (2.0 * (cos((pi * (angle / 180.0))) * sin((0.005555555555555556 * (pi * angle))))); end
code[a_, b_, angle_] := N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)
\end{array}
Initial program 52.3%
associate-*l*52.3%
*-commutative52.3%
associate-*l*52.3%
Simplified52.3%
unpow252.3%
unpow252.3%
difference-of-squares57.5%
Applied egg-rr57.5%
Taylor expanded in angle around inf 59.4%
Final simplification59.4%
(FPCore (a b angle) :precision binary64 (* (* (- b a) (+ a b)) (sin (* PI (* angle 0.011111111111111112)))))
double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * sin((((double) M_PI) * (angle * 0.011111111111111112)));
}
public static double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * Math.sin((Math.PI * (angle * 0.011111111111111112)));
}
def code(a, b, angle): return ((b - a) * (a + b)) * math.sin((math.pi * (angle * 0.011111111111111112)))
function code(a, b, angle) return Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(pi * Float64(angle * 0.011111111111111112)))) end
function tmp = code(a, b, angle) tmp = ((b - a) * (a + b)) * sin((pi * (angle * 0.011111111111111112))); end
code[a_, b_, angle_] := N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)
\end{array}
Initial program 52.3%
associate-*l*52.3%
*-commutative52.3%
associate-*l*52.3%
Simplified52.3%
unpow252.3%
unpow252.3%
difference-of-squares57.5%
Applied egg-rr57.5%
add-sqr-sqrt59.6%
pow259.6%
Applied egg-rr63.1%
Applied egg-rr56.7%
distribute-lft-out56.7%
sin-056.7%
+-rgt-identity56.7%
metadata-eval56.7%
*-rgt-identity56.7%
associate-*l*58.6%
Simplified58.6%
Final simplification58.6%
(FPCore (a b angle) :precision binary64 (* (* (- b a) (+ a b)) (sin (* angle (* PI 0.011111111111111112)))))
double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * sin((angle * (((double) M_PI) * 0.011111111111111112)));
}
public static double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * Math.sin((angle * (Math.PI * 0.011111111111111112)));
}
def code(a, b, angle): return ((b - a) * (a + b)) * math.sin((angle * (math.pi * 0.011111111111111112)))
function code(a, b, angle) return Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(angle * Float64(pi * 0.011111111111111112)))) end
function tmp = code(a, b, angle) tmp = ((b - a) * (a + b)) * sin((angle * (pi * 0.011111111111111112))); end
code[a_, b_, angle_] := N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)
\end{array}
Initial program 52.3%
associate-*l*52.3%
*-commutative52.3%
associate-*l*52.3%
Simplified52.3%
unpow252.3%
unpow252.3%
difference-of-squares57.5%
Applied egg-rr57.5%
add-sqr-sqrt59.6%
pow259.6%
Applied egg-rr63.1%
log1p-expm1-u63.1%
log1p-undefine31.8%
sin-cos-mult27.8%
div-inv27.8%
Applied egg-rr25.2%
Taylor expanded in angle around inf 56.7%
associate-*r*58.6%
*-commutative58.6%
*-commutative58.6%
associate-*r*56.7%
*-commutative56.7%
associate-*r*57.8%
Simplified57.8%
Final simplification57.8%
(FPCore (a b angle) :precision binary64 (* (* (- b a) (+ a b)) (* (* PI angle) 0.011111111111111112)))
double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * ((((double) M_PI) * angle) * 0.011111111111111112);
}
public static double code(double a, double b, double angle) {
return ((b - a) * (a + b)) * ((Math.PI * angle) * 0.011111111111111112);
}
def code(a, b, angle): return ((b - a) * (a + b)) * ((math.pi * angle) * 0.011111111111111112)
function code(a, b, angle) return Float64(Float64(Float64(b - a) * Float64(a + b)) * Float64(Float64(pi * angle) * 0.011111111111111112)) end
function tmp = code(a, b, angle) tmp = ((b - a) * (a + b)) * ((pi * angle) * 0.011111111111111112); end
code[a_, b_, angle_] := N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)
\end{array}
Initial program 52.3%
associate-*l*52.3%
*-commutative52.3%
associate-*l*52.3%
Simplified52.3%
unpow252.3%
unpow252.3%
difference-of-squares57.5%
Applied egg-rr57.5%
add-sqr-sqrt59.6%
pow259.6%
Applied egg-rr63.1%
Taylor expanded in angle around 0 54.8%
Final simplification54.8%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* (- b a) (+ a b))))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * ((b - a) * (a + b))));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * ((b - a) * (a + b))));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * ((b - a) * (a + b))))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b - a) * Float64(a + b))))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * ((b - a) * (a + b)))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right)\right)
\end{array}
Initial program 52.3%
associate-*l*52.3%
*-commutative52.3%
associate-*l*52.3%
Simplified52.3%
unpow252.3%
unpow252.3%
difference-of-squares57.5%
Applied egg-rr57.5%
add-sqr-sqrt59.6%
pow259.6%
Applied egg-rr59.6%
Taylor expanded in angle around 0 54.8%
Final simplification54.8%
herbie shell --seed 2024111
(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)))))