
(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}
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* (/ angle 180.0) PI)))
(if (<= (/ angle 180.0) -2e+178)
(*
(fabs
(*
2.0
(* (sin (* angle (* 0.005555555555555556 PI))) (pow (hypot b a) 2.0))))
(cos t_1))
(if (<= (/ angle 180.0) 2e+118)
(* 2.0 (* (- b a) (* (cos t_0) (* (sin t_0) (+ b a)))))
(*
(sin t_1)
(*
(* 2.0 (+ (* b b) (* a a)))
(cos (* (pow (cbrt PI) 2.0) (/ (cbrt PI) (/ 180.0 angle))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = (angle / 180.0) * ((double) M_PI);
double tmp;
if ((angle / 180.0) <= -2e+178) {
tmp = fabs((2.0 * (sin((angle * (0.005555555555555556 * ((double) M_PI)))) * pow(hypot(b, a), 2.0)))) * cos(t_1);
} else if ((angle / 180.0) <= 2e+118) {
tmp = 2.0 * ((b - a) * (cos(t_0) * (sin(t_0) * (b + a))));
} else {
tmp = sin(t_1) * ((2.0 * ((b * b) + (a * a))) * cos((pow(cbrt(((double) M_PI)), 2.0) * (cbrt(((double) M_PI)) / (180.0 / angle)))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = (angle / 180.0) * Math.PI;
double tmp;
if ((angle / 180.0) <= -2e+178) {
tmp = Math.abs((2.0 * (Math.sin((angle * (0.005555555555555556 * Math.PI))) * Math.pow(Math.hypot(b, a), 2.0)))) * Math.cos(t_1);
} else if ((angle / 180.0) <= 2e+118) {
tmp = 2.0 * ((b - a) * (Math.cos(t_0) * (Math.sin(t_0) * (b + a))));
} else {
tmp = Math.sin(t_1) * ((2.0 * ((b * b) + (a * a))) * Math.cos((Math.pow(Math.cbrt(Math.PI), 2.0) * (Math.cbrt(Math.PI) / (180.0 / angle)))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(Float64(angle / 180.0) * pi) tmp = 0.0 if (Float64(angle / 180.0) <= -2e+178) tmp = Float64(abs(Float64(2.0 * Float64(sin(Float64(angle * Float64(0.005555555555555556 * pi))) * (hypot(b, a) ^ 2.0)))) * cos(t_1)); elseif (Float64(angle / 180.0) <= 2e+118) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(t_0) * Float64(sin(t_0) * Float64(b + a))))); else tmp = Float64(sin(t_1) * Float64(Float64(2.0 * Float64(Float64(b * b) + Float64(a * a))) * cos(Float64((cbrt(pi) ^ 2.0) * Float64(cbrt(pi) / Float64(180.0 / angle)))))); end return tmp end
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+178], N[(N[Abs[N[(2.0 * N[(N[Sin[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[b ^ 2 + a ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+118], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[(2.0 * N[(N[(b * b), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \frac{angle}{180} \cdot \pi\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{+178}:\\
\;\;\;\;\left|2 \cdot \left(\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot {\left(\mathsf{hypot}\left(b, a\right)\right)}^{2}\right)\right| \cdot \cos t_1\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+118}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos t_0 \cdot \left(\sin t_0 \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin t_1 \cdot \left(\left(2 \cdot \left(b \cdot b + a \cdot a\right)\right) \cdot \cos \left({\left(\sqrt[3]{\pi}\right)}^{2} \cdot \frac{\sqrt[3]{\pi}}{\frac{180}{angle}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2.0000000000000001e178Initial program 30.1%
*-commutative30.1%
associate-*l*30.1%
unpow230.1%
fma-neg34.6%
unpow234.6%
distribute-rgt-neg-in34.6%
Simplified34.6%
clear-num39.1%
un-div-inv35.4%
Applied egg-rr35.4%
add-sqr-sqrt31.9%
sqrt-unprod61.3%
pow261.3%
Applied egg-rr61.1%
unpow261.1%
rem-sqrt-square61.1%
*-commutative61.1%
*-commutative61.1%
associate-*l*61.1%
*-commutative61.1%
associate-*l*61.1%
Simplified61.1%
if -2.0000000000000001e178 < (/.f64 angle 180) < 1.99999999999999993e118Initial program 65.4%
associate-*l*65.4%
unpow265.4%
unpow265.4%
difference-of-squares70.4%
Simplified70.4%
Taylor expanded in angle around inf 83.6%
if 1.99999999999999993e118 < (/.f64 angle 180) Initial program 31.2%
*-commutative31.2%
associate-*l*31.2%
unpow231.2%
fma-neg34.1%
unpow234.1%
Simplified34.1%
fma-udef31.2%
add-sqr-sqrt13.5%
sqrt-unprod39.9%
sqr-neg39.9%
sqrt-unprod40.1%
add-sqr-sqrt40.1%
Applied egg-rr40.1%
add-cbrt-cube0.0%
pow1/30.0%
pow30.0%
div-inv0.0%
metadata-eval0.0%
Applied egg-rr0.0%
unpow1/30.0%
rem-cbrt-cube46.3%
metadata-eval46.3%
div-inv40.1%
clear-num45.5%
div-inv39.7%
add-cube-cbrt44.9%
*-un-lft-identity44.9%
times-frac49.0%
pow249.0%
Applied egg-rr49.0%
Final simplification77.1%
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556)))
(t_1 (sin t_0))
(t_2 (* (/ angle 180.0) PI)))
(if (<=
(* (cos t_2) (* (sin t_2) (* 2.0 (- (pow b 2.0) (pow a 2.0)))))
-2e+154)
(*
2.0
(*
(* (- b a) (cos (* (pow (sqrt PI) 2.0) (* angle 0.005555555555555556))))
(* t_1 (+ b a))))
(* 2.0 (* (- b a) (* t_1 (* (+ b a) (cos t_0))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_1 = sin(t_0);
double t_2 = (angle / 180.0) * ((double) M_PI);
double tmp;
if ((cos(t_2) * (sin(t_2) * (2.0 * (pow(b, 2.0) - pow(a, 2.0))))) <= -2e+154) {
tmp = 2.0 * (((b - a) * cos((pow(sqrt(((double) M_PI)), 2.0) * (angle * 0.005555555555555556)))) * (t_1 * (b + a)));
} else {
tmp = 2.0 * ((b - a) * (t_1 * ((b + a) * cos(t_0))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double t_1 = Math.sin(t_0);
double t_2 = (angle / 180.0) * Math.PI;
double tmp;
if ((Math.cos(t_2) * (Math.sin(t_2) * (2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))))) <= -2e+154) {
tmp = 2.0 * (((b - a) * Math.cos((Math.pow(Math.sqrt(Math.PI), 2.0) * (angle * 0.005555555555555556)))) * (t_1 * (b + a)));
} else {
tmp = 2.0 * ((b - a) * (t_1 * ((b + a) * Math.cos(t_0))));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = math.pi * (angle * 0.005555555555555556) t_1 = math.sin(t_0) t_2 = (angle / 180.0) * math.pi tmp = 0 if (math.cos(t_2) * (math.sin(t_2) * (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))))) <= -2e+154: tmp = 2.0 * (((b - a) * math.cos((math.pow(math.sqrt(math.pi), 2.0) * (angle * 0.005555555555555556)))) * (t_1 * (b + a))) else: tmp = 2.0 * ((b - a) * (t_1 * ((b + a) * math.cos(t_0)))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) t_1 = sin(t_0) t_2 = Float64(Float64(angle / 180.0) * pi) tmp = 0.0 if (Float64(cos(t_2) * Float64(sin(t_2) * Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))))) <= -2e+154) tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * cos(Float64((sqrt(pi) ^ 2.0) * Float64(angle * 0.005555555555555556)))) * Float64(t_1 * Float64(b + a)))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(t_1 * Float64(Float64(b + a) * cos(t_0))))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) t_0 = pi * (angle * 0.005555555555555556); t_1 = sin(t_0); t_2 = (angle / 180.0) * pi; tmp = 0.0; if ((cos(t_2) * (sin(t_2) * (2.0 * ((b ^ 2.0) - (a ^ 2.0))))) <= -2e+154) tmp = 2.0 * (((b - a) * cos(((sqrt(pi) ^ 2.0) * (angle * 0.005555555555555556)))) * (t_1 * (b + a))); else tmp = 2.0 * ((b - a) * (t_1 * ((b + a) * cos(t_0)))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[N[(N[Cos[t$95$2], $MachinePrecision] * N[(N[Sin[t$95$2], $MachinePrecision] * N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e+154], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[Cos[N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[(N[(b + a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \sin t_0\\
t_2 := \frac{angle}{180} \cdot \pi\\
\mathbf{if}\;\cos t_2 \cdot \left(\sin t_2 \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \leq -2 \cdot 10^{+154}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \cos \left({\left(\sqrt{\pi}\right)}^{2} \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(t_1 \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \left(\left(b + a\right) \cdot \cos t_0\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < -2.00000000000000007e154Initial program 40.6%
associate-*l*40.6%
unpow240.6%
unpow240.6%
difference-of-squares40.6%
Simplified40.6%
Taylor expanded in angle around inf 64.6%
associate-*r*64.6%
*-commutative64.6%
*-commutative64.6%
associate-*r*63.3%
*-commutative63.3%
*-commutative63.3%
*-commutative63.3%
associate-*r*61.3%
*-commutative61.3%
+-commutative61.3%
Simplified61.3%
add-sqr-sqrt68.0%
pow268.0%
Applied egg-rr68.0%
if -2.00000000000000007e154 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) Initial program 63.9%
associate-*l*63.9%
unpow263.9%
unpow263.9%
difference-of-squares70.3%
Simplified70.3%
add-cube-cbrt69.7%
pow369.8%
div-inv69.9%
metadata-eval69.9%
Applied egg-rr69.9%
Taylor expanded in angle around inf 74.1%
associate-*r*74.1%
*-commutative74.1%
associate-*r*74.8%
*-commutative74.8%
associate-*r*77.1%
*-commutative77.1%
associate-*l*77.1%
*-commutative77.1%
*-commutative77.1%
+-commutative77.1%
Simplified77.1%
Final simplification74.7%
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= (pow a 2.0) 2e+297)
(*
2.0
(*
(* (sin (* PI (* angle 0.005555555555555556))) (+ b a))
(* (- b a) (cos (* 0.005555555555555556 (* angle PI))))))
(* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (pow(a, 2.0) <= 2e+297) {
tmp = 2.0 * ((sin((((double) M_PI) * (angle * 0.005555555555555556))) * (b + a)) * ((b - a) * cos((0.005555555555555556 * (angle * ((double) M_PI))))));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(a, 2.0) <= 2e+297) {
tmp = 2.0 * ((Math.sin((Math.PI * (angle * 0.005555555555555556))) * (b + a)) * ((b - a) * Math.cos((0.005555555555555556 * (angle * Math.PI)))));
} else {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if math.pow(a, 2.0) <= 2e+297: tmp = 2.0 * ((math.sin((math.pi * (angle * 0.005555555555555556))) * (b + a)) * ((b - a) * math.cos((0.005555555555555556 * (angle * math.pi))))) else: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if ((a ^ 2.0) <= 2e+297) tmp = Float64(2.0 * Float64(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * Float64(b + a)) * Float64(Float64(b - a) * cos(Float64(0.005555555555555556 * Float64(angle * pi)))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a ^ 2.0) <= 2e+297) tmp = 2.0 * ((sin((pi * (angle * 0.005555555555555556))) * (b + a)) * ((b - a) * cos((0.005555555555555556 * (angle * pi))))); else tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e+297], N[(2.0 * N[(N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $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}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+297}:\\
\;\;\;\;2 \cdot \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\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 (pow.f64 a 2) < 2e297Initial program 69.8%
associate-*l*69.8%
unpow269.8%
unpow269.8%
difference-of-squares69.8%
Simplified69.8%
Taylor expanded in angle around inf 71.9%
associate-*r*71.9%
*-commutative71.9%
*-commutative71.9%
associate-*r*72.2%
*-commutative72.2%
*-commutative72.2%
*-commutative72.2%
associate-*r*71.5%
*-commutative71.5%
+-commutative71.5%
Simplified71.5%
Taylor expanded in angle around inf 70.9%
if 2e297 < (pow.f64 a 2) Initial program 29.3%
associate-*l*29.3%
unpow229.3%
unpow229.3%
difference-of-squares45.3%
Simplified45.3%
Taylor expanded in angle around 0 50.8%
associate-*r*77.9%
*-commutative77.9%
+-commutative77.9%
Simplified77.9%
Final simplification73.0%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (* angle 0.005555555555555556)))) (* 2.0 (* (* (sin t_0) (+ b a)) (* (- b a) (cos t_0))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
return 2.0 * ((sin(t_0) * (b + a)) * ((b - a) * cos(t_0)));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
return 2.0 * ((Math.sin(t_0) * (b + a)) * ((b - a) * Math.cos(t_0)));
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = math.pi * (angle * 0.005555555555555556) return 2.0 * ((math.sin(t_0) * (b + a)) * ((b - a) * math.cos(t_0)))
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) return Float64(2.0 * Float64(Float64(sin(t_0) * Float64(b + a)) * Float64(Float64(b - a) * cos(t_0)))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) t_0 = pi * (angle * 0.005555555555555556); tmp = 2.0 * ((sin(t_0) * (b + a)) * ((b - a) * cos(t_0))); end
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(2.0 * N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
2 \cdot \left(\left(\sin t_0 \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot \cos t_0\right)\right)
\end{array}
\end{array}
Initial program 57.8%
associate-*l*57.8%
unpow257.8%
unpow257.8%
difference-of-squares62.5%
Simplified62.5%
Taylor expanded in angle around inf 71.6%
associate-*r*71.6%
*-commutative71.6%
*-commutative71.6%
associate-*r*73.4%
*-commutative73.4%
*-commutative73.4%
*-commutative73.4%
associate-*r*73.0%
*-commutative73.0%
+-commutative73.0%
Simplified73.0%
Final simplification73.0%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (* angle 0.005555555555555556)))) (* 2.0 (* (- b a) (* (sin t_0) (* (+ b a) (cos t_0)))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
return 2.0 * ((b - a) * (sin(t_0) * ((b + a) * cos(t_0))));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
return 2.0 * ((b - a) * (Math.sin(t_0) * ((b + a) * Math.cos(t_0))));
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = math.pi * (angle * 0.005555555555555556) return 2.0 * ((b - a) * (math.sin(t_0) * ((b + a) * math.cos(t_0))))
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) return Float64(2.0 * Float64(Float64(b - a) * Float64(sin(t_0) * Float64(Float64(b + a) * cos(t_0))))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) t_0 = pi * (angle * 0.005555555555555556); tmp = 2.0 * ((b - a) * (sin(t_0) * ((b + a) * cos(t_0)))); end
NOTE: a should be positive before calling this function
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
2 \cdot \left(\left(b - a\right) \cdot \left(\sin t_0 \cdot \left(\left(b + a\right) \cdot \cos t_0\right)\right)\right)
\end{array}
\end{array}
Initial program 57.8%
associate-*l*57.8%
unpow257.8%
unpow257.8%
difference-of-squares62.5%
Simplified62.5%
add-cube-cbrt62.1%
pow362.1%
div-inv62.2%
metadata-eval62.2%
Applied egg-rr62.2%
Taylor expanded in angle around inf 71.6%
associate-*r*71.6%
*-commutative71.6%
associate-*r*71.0%
*-commutative71.0%
associate-*r*72.9%
*-commutative72.9%
associate-*l*73.0%
*-commutative73.0%
*-commutative73.0%
+-commutative73.0%
Simplified73.0%
Final simplification73.0%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= (pow a 2.0) 2e-223) (* 2.0 (* (- b a) (* (sin (* PI (* angle 0.005555555555555556))) (+ b a)))) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (pow(a, 2.0) <= 2e-223) {
tmp = 2.0 * ((b - a) * (sin((((double) M_PI) * (angle * 0.005555555555555556))) * (b + a)));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(a, 2.0) <= 2e-223) {
tmp = 2.0 * ((b - a) * (Math.sin((Math.PI * (angle * 0.005555555555555556))) * (b + a)));
} else {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if math.pow(a, 2.0) <= 2e-223: tmp = 2.0 * ((b - a) * (math.sin((math.pi * (angle * 0.005555555555555556))) * (b + a))) else: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if ((a ^ 2.0) <= 2e-223) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * Float64(b + a)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a ^ 2.0) <= 2e-223) tmp = 2.0 * ((b - a) * (sin((pi * (angle * 0.005555555555555556))) * (b + a))); else tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e-223], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $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}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{-223}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(b + a\right)\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 (pow.f64 a 2) < 1.9999999999999999e-223Initial program 74.8%
associate-*l*74.8%
unpow274.8%
unpow274.8%
difference-of-squares74.8%
Simplified74.8%
Taylor expanded in angle around inf 78.4%
associate-*r*78.4%
*-commutative78.4%
*-commutative78.4%
associate-*r*77.1%
*-commutative77.1%
*-commutative77.1%
*-commutative77.1%
associate-*r*78.0%
*-commutative78.0%
+-commutative78.0%
Simplified78.0%
Taylor expanded in angle around 0 74.6%
if 1.9999999999999999e-223 < (pow.f64 a 2) Initial program 51.1%
associate-*l*51.1%
unpow251.1%
unpow251.1%
difference-of-squares57.7%
Simplified57.7%
Taylor expanded in angle around 0 57.9%
associate-*r*70.1%
*-commutative70.1%
+-commutative70.1%
Simplified70.1%
Final simplification71.4%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 4.2e-93) (* 2.0 (* (sin (* angle (* 0.005555555555555556 PI))) (* b b))) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (a <= 4.2e-93) {
tmp = 2.0 * (sin((angle * (0.005555555555555556 * ((double) M_PI)))) * (b * b));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 4.2e-93) {
tmp = 2.0 * (Math.sin((angle * (0.005555555555555556 * Math.PI))) * (b * b));
} else {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if a <= 4.2e-93: tmp = 2.0 * (math.sin((angle * (0.005555555555555556 * math.pi))) * (b * b)) else: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (a <= 4.2e-93) tmp = Float64(2.0 * Float64(sin(Float64(angle * Float64(0.005555555555555556 * pi))) * Float64(b * b))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 4.2e-93) tmp = 2.0 * (sin((angle * (0.005555555555555556 * pi))) * (b * b)); else tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 4.2e-93], N[(2.0 * N[(N[Sin[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b * b), $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}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.2 \cdot 10^{-93}:\\
\;\;\;\;2 \cdot \left(\sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(b \cdot b\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 < 4.2000000000000002e-93Initial program 61.5%
*-commutative61.5%
associate-*l*61.5%
unpow261.5%
fma-neg63.4%
unpow263.4%
distribute-rgt-neg-in63.4%
Simplified63.4%
clear-num62.6%
un-div-inv61.7%
Applied egg-rr61.7%
Taylor expanded in angle around 0 57.0%
Taylor expanded in b around inf 43.2%
unpow243.2%
*-commutative43.2%
*-commutative43.2%
associate-*r*45.5%
*-commutative45.5%
Simplified45.5%
if 4.2000000000000002e-93 < a Initial program 50.8%
associate-*l*50.8%
unpow250.8%
unpow250.8%
difference-of-squares58.7%
Simplified58.7%
Taylor expanded in angle around 0 60.8%
associate-*r*71.5%
*-commutative71.5%
+-commutative71.5%
Simplified71.5%
Final simplification54.5%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= angle 7.8e+148) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a)))) (* angle (fabs (* PI (* (* a a) -0.011111111111111112))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (angle <= 7.8e+148) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
} else {
tmp = angle * fabs((((double) M_PI) * ((a * a) * -0.011111111111111112)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 7.8e+148) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
} else {
tmp = angle * Math.abs((Math.PI * ((a * a) * -0.011111111111111112)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if angle <= 7.8e+148: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) else: tmp = angle * math.fabs((math.pi * ((a * a) * -0.011111111111111112))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (angle <= 7.8e+148) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); else tmp = Float64(angle * abs(Float64(pi * Float64(Float64(a * a) * -0.011111111111111112)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 7.8e+148) tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); else tmp = angle * abs((pi * ((a * a) * -0.011111111111111112))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[angle, 7.8e+148], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(angle * N[Abs[N[(Pi * N[(N[(a * a), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 7.8 \cdot 10^{+148}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\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 angle < 7.80000000000000004e148Initial program 61.2%
associate-*l*61.2%
unpow261.2%
unpow261.2%
difference-of-squares66.5%
Simplified66.5%
Taylor expanded in angle around 0 63.5%
associate-*r*73.7%
*-commutative73.7%
+-commutative73.7%
Simplified73.7%
if 7.80000000000000004e148 < angle Initial program 27.6%
associate-*l*27.6%
unpow227.6%
unpow227.6%
difference-of-squares27.6%
Simplified27.6%
Taylor expanded in angle around 0 28.6%
Taylor expanded in b around 0 25.0%
*-commutative25.0%
associate-*l*25.0%
*-commutative25.0%
unpow225.0%
Simplified25.0%
Taylor expanded in angle around 0 25.0%
*-commutative25.0%
unpow225.0%
*-commutative25.0%
associate-*r*25.0%
associate-*r*25.0%
associate-*l*25.0%
*-commutative25.0%
Simplified25.0%
add-sqr-sqrt11.6%
sqrt-unprod39.8%
pow239.8%
*-commutative39.8%
Applied egg-rr39.8%
unpow239.8%
rem-sqrt-square39.7%
associate-*r*39.7%
*-commutative39.7%
Simplified39.7%
Final simplification70.2%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= angle 1.02e+135) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a)))) (* (* PI (+ (* b b) (* a a))) (* angle 0.011111111111111112))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (angle <= 1.02e+135) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
} else {
tmp = (((double) M_PI) * ((b * b) + (a * a))) * (angle * 0.011111111111111112);
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 1.02e+135) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
} else {
tmp = (Math.PI * ((b * b) + (a * a))) * (angle * 0.011111111111111112);
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if angle <= 1.02e+135: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) else: tmp = (math.pi * ((b * b) + (a * a))) * (angle * 0.011111111111111112) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (angle <= 1.02e+135) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); else tmp = Float64(Float64(pi * Float64(Float64(b * b) + Float64(a * a))) * Float64(angle * 0.011111111111111112)); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 1.02e+135) tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); else tmp = (pi * ((b * b) + (a * a))) * (angle * 0.011111111111111112); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[angle, 1.02e+135], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * N[(N[(b * b), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 1.02 \cdot 10^{+135}:\\
\;\;\;\;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(\pi \cdot \left(b \cdot b + a \cdot a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if angle < 1.01999999999999993e135Initial program 61.1%
associate-*l*61.1%
unpow261.1%
unpow261.1%
difference-of-squares66.5%
Simplified66.5%
Taylor expanded in angle around 0 63.0%
associate-*r*73.3%
*-commutative73.3%
+-commutative73.3%
Simplified73.3%
if 1.01999999999999993e135 < angle Initial program 31.7%
*-commutative31.7%
associate-*l*31.7%
unpow231.7%
fma-neg35.1%
unpow235.1%
Simplified35.1%
fma-udef31.7%
add-sqr-sqrt14.3%
sqrt-unprod41.9%
sqr-neg41.9%
sqrt-unprod42.1%
add-sqr-sqrt42.1%
Applied egg-rr42.1%
Taylor expanded in angle around 0 45.8%
associate-*r*45.8%
*-commutative45.8%
+-commutative45.8%
unpow245.8%
unpow245.8%
Simplified45.8%
Final simplification70.2%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 2e+18) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* 0.011111111111111112 (* angle (* (- b a) (* PI a))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (a <= 2e+18) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * a)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2e+18) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (Math.PI * a)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if a <= 2e+18: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (math.pi * a))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (a <= 2e+18) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * a)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2e+18) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * a))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 2e+18], 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[(Pi * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2 \cdot 10^{+18}:\\
\;\;\;\;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(\pi \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if a < 2e18Initial program 62.5%
associate-*l*62.5%
unpow262.5%
unpow262.5%
difference-of-squares65.2%
Simplified65.2%
Taylor expanded in angle around 0 60.5%
Taylor expanded in b around inf 45.8%
*-commutative45.8%
associate-*r*45.9%
unpow245.9%
Simplified45.9%
if 2e18 < a Initial program 43.9%
associate-*l*43.9%
unpow243.9%
unpow243.9%
difference-of-squares54.8%
Simplified54.8%
Taylor expanded in angle around 0 58.2%
Taylor expanded in a around inf 47.8%
*-commutative47.8%
Simplified47.8%
Final simplification46.3%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 5.6e-30) (* 0.011111111111111112 (* angle (* (- b a) (* PI a)))) (* 0.011111111111111112 (* angle (* (- b a) (* PI b))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 5.6e-30) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * a)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * b)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 5.6e-30) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (Math.PI * a)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (Math.PI * b)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if b <= 5.6e-30: tmp = 0.011111111111111112 * (angle * ((b - a) * (math.pi * a))) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (math.pi * b))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 5.6e-30) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * a)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * b)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 5.6e-30) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * a))); else tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * b))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 5.6e-30], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.6 \cdot 10^{-30}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 5.59999999999999977e-30Initial program 58.2%
associate-*l*58.2%
unpow258.2%
unpow258.2%
difference-of-squares61.3%
Simplified61.3%
Taylor expanded in angle around 0 61.3%
Taylor expanded in a around inf 46.5%
*-commutative46.5%
Simplified46.5%
if 5.59999999999999977e-30 < b Initial program 56.6%
associate-*l*56.6%
unpow256.6%
unpow256.6%
difference-of-squares66.1%
Simplified66.1%
Taylor expanded in angle around 0 55.8%
Taylor expanded in a around 0 54.3%
*-commutative54.3%
Simplified54.3%
Final simplification48.4%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* (- b a) (* PI (+ b a))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (b + a))));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (b + a))));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 0.011111111111111112 * (angle * ((b - a) * (math.pi * (b + a))))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(b + a))))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (b + a)))); end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function 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}
a = |a|\\
b = |b|\\
\\
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 57.8%
associate-*l*57.8%
unpow257.8%
unpow257.8%
difference-of-squares62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.9%
Final simplification59.9%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a)))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function 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}
a = |a|\\
b = |b|\\
\\
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 57.8%
associate-*l*57.8%
unpow257.8%
unpow257.8%
difference-of-squares62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.9%
associate-*r*68.3%
*-commutative68.3%
+-commutative68.3%
Simplified68.3%
Final simplification68.3%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 5e+49) (* (* PI (* b b)) (* angle 0.011111111111111112)) (* angle (* PI (* a (* a -0.011111111111111112))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (a <= 5e+49) {
tmp = (((double) M_PI) * (b * b)) * (angle * 0.011111111111111112);
} else {
tmp = angle * (((double) M_PI) * (a * (a * -0.011111111111111112)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 5e+49) {
tmp = (Math.PI * (b * b)) * (angle * 0.011111111111111112);
} else {
tmp = angle * (Math.PI * (a * (a * -0.011111111111111112)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if a <= 5e+49: tmp = (math.pi * (b * b)) * (angle * 0.011111111111111112) else: tmp = angle * (math.pi * (a * (a * -0.011111111111111112))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (a <= 5e+49) tmp = Float64(Float64(pi * Float64(b * b)) * Float64(angle * 0.011111111111111112)); else tmp = Float64(angle * Float64(pi * Float64(a * Float64(a * -0.011111111111111112)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 5e+49) tmp = (pi * (b * b)) * (angle * 0.011111111111111112); else tmp = angle * (pi * (a * (a * -0.011111111111111112))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 5e+49], N[(N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision] * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(angle * N[(Pi * N[(a * N[(a * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5 \cdot 10^{+49}:\\
\;\;\;\;\left(\pi \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\pi \cdot \left(a \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if a < 5.0000000000000004e49Initial program 62.1%
associate-*l*62.1%
unpow262.1%
unpow262.1%
difference-of-squares64.7%
Simplified64.7%
Taylor expanded in angle around 0 60.2%
Taylor expanded in b around inf 45.6%
*-commutative45.6%
*-commutative45.6%
associate-*l*45.6%
*-commutative45.6%
unpow245.6%
Simplified45.6%
if 5.0000000000000004e49 < a Initial program 42.7%
associate-*l*42.7%
unpow242.7%
unpow242.7%
difference-of-squares55.1%
Simplified55.1%
Taylor expanded in angle around 0 59.1%
Taylor expanded in b around 0 50.6%
*-commutative50.6%
associate-*l*50.6%
*-commutative50.6%
unpow250.6%
Simplified50.6%
Taylor expanded in angle around 0 50.6%
*-commutative50.6%
unpow250.6%
*-commutative50.6%
associate-*r*50.6%
associate-*r*50.7%
associate-*l*50.6%
*-commutative50.6%
Simplified50.6%
Final simplification46.7%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 1.62e+50) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* angle (* PI (* a (* a -0.011111111111111112))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.62e+50) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = angle * (((double) M_PI) * (a * (a * -0.011111111111111112)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 1.62e+50) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = angle * (Math.PI * (a * (a * -0.011111111111111112)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if a <= 1.62e+50: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = angle * (math.pi * (a * (a * -0.011111111111111112))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (a <= 1.62e+50) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(angle * Float64(pi * Float64(a * Float64(a * -0.011111111111111112)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1.62e+50) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = angle * (pi * (a * (a * -0.011111111111111112))); end tmp_2 = tmp; end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 1.62e+50], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(angle * N[(Pi * N[(a * N[(a * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.62 \cdot 10^{+50}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\pi \cdot \left(a \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.61999999999999996e50Initial program 62.1%
associate-*l*62.1%
unpow262.1%
unpow262.1%
difference-of-squares64.7%
Simplified64.7%
Taylor expanded in angle around 0 60.2%
Taylor expanded in b around inf 45.6%
*-commutative45.6%
associate-*r*45.6%
unpow245.6%
Simplified45.6%
if 1.61999999999999996e50 < a Initial program 42.7%
associate-*l*42.7%
unpow242.7%
unpow242.7%
difference-of-squares55.1%
Simplified55.1%
Taylor expanded in angle around 0 59.1%
Taylor expanded in b around 0 50.6%
*-commutative50.6%
associate-*l*50.6%
*-commutative50.6%
unpow250.6%
Simplified50.6%
Taylor expanded in angle around 0 50.6%
*-commutative50.6%
unpow250.6%
*-commutative50.6%
associate-*r*50.6%
associate-*r*50.7%
associate-*l*50.6%
*-commutative50.6%
Simplified50.6%
Final simplification46.7%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* angle (* PI (* a (* a -0.011111111111111112)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return angle * (((double) M_PI) * (a * (a * -0.011111111111111112)));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return angle * (Math.PI * (a * (a * -0.011111111111111112)));
}
a = abs(a) b = abs(b) def code(a, b, angle): return angle * (math.pi * (a * (a * -0.011111111111111112)))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(angle * Float64(pi * Float64(a * Float64(a * -0.011111111111111112)))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = angle * (pi * (a * (a * -0.011111111111111112))); end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(angle * N[(Pi * N[(a * N[(a * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
angle \cdot \left(\pi \cdot \left(a \cdot \left(a \cdot -0.011111111111111112\right)\right)\right)
\end{array}
Initial program 57.8%
associate-*l*57.8%
unpow257.8%
unpow257.8%
difference-of-squares62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.9%
Taylor expanded in b around 0 37.0%
*-commutative37.0%
associate-*l*37.0%
*-commutative37.0%
unpow237.0%
Simplified37.0%
Taylor expanded in angle around 0 37.0%
*-commutative37.0%
unpow237.0%
*-commutative37.0%
associate-*r*37.0%
associate-*r*37.0%
associate-*l*37.0%
*-commutative37.0%
Simplified37.0%
Final simplification37.0%
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* angle (* -0.011111111111111112 (* PI (* a a)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return angle * (-0.011111111111111112 * (((double) M_PI) * (a * a)));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return angle * (-0.011111111111111112 * (Math.PI * (a * a)));
}
a = abs(a) b = abs(b) def code(a, b, angle): return angle * (-0.011111111111111112 * (math.pi * (a * a)))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(angle * Float64(-0.011111111111111112 * Float64(pi * Float64(a * a)))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = angle * (-0.011111111111111112 * (pi * (a * a))); end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(angle * N[(-0.011111111111111112 * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
angle \cdot \left(-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)
\end{array}
Initial program 57.8%
associate-*l*57.8%
unpow257.8%
unpow257.8%
difference-of-squares62.5%
Simplified62.5%
Taylor expanded in angle around 0 59.9%
Taylor expanded in b around 0 37.0%
*-commutative37.0%
associate-*l*37.0%
*-commutative37.0%
unpow237.0%
Simplified37.0%
Final simplification37.0%
herbie shell --seed 2023240
(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)))))