
(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 19 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 (* PI (* angle (- b a))))
(t_1 (* (- b a) (+ b a)))
(t_2 (* t_1 (cos (* angle (/ PI -180.0)))))
(t_3 (cbrt (* angle PI))))
(if (<= (/ angle 180.0) -5e+282)
(* 2.0 (* (sin (/ (* angle PI) -180.0)) t_2))
(if (<= (/ angle 180.0) -5e+117)
(* 2.0 (* t_2 (sin (/ (pow t_3 2.0) (/ 180.0 t_3)))))
(if (<= (/ angle 180.0) -1e-115)
(*
2.0
(*
(sin (* PI (* angle 0.005555555555555556)))
(*
t_1
(pow
(cbrt
(cos
(*
(* (cbrt PI) (pow (cbrt PI) 2.0))
(* angle 0.005555555555555556))))
3.0))))
(if (<= (/ angle 180.0) 1e-39)
(* (+ (* b t_0) (* a t_0)) 0.011111111111111112)
(if (<= (/ angle 180.0) 1e+87)
(*
2.0
(*
(sin (pow (sqrt (* angle (* PI 0.005555555555555556))) 2.0))
(* t_1 (cos (* angle (/ (cbrt (* PI (pow PI 2.0))) -180.0))))))
(*
2.0
(*
(sin (/ PI (/ 180.0 angle)))
(*
t_1
(sqrt
(pow
(cos (* 0.005555555555555556 (* angle PI)))
2.0))))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * (b - a));
double t_1 = (b - a) * (b + a);
double t_2 = t_1 * cos((angle * (((double) M_PI) / -180.0)));
double t_3 = cbrt((angle * ((double) M_PI)));
double tmp;
if ((angle / 180.0) <= -5e+282) {
tmp = 2.0 * (sin(((angle * ((double) M_PI)) / -180.0)) * t_2);
} else if ((angle / 180.0) <= -5e+117) {
tmp = 2.0 * (t_2 * sin((pow(t_3, 2.0) / (180.0 / t_3))));
} else if ((angle / 180.0) <= -1e-115) {
tmp = 2.0 * (sin((((double) M_PI) * (angle * 0.005555555555555556))) * (t_1 * pow(cbrt(cos(((cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)) * (angle * 0.005555555555555556)))), 3.0)));
} else if ((angle / 180.0) <= 1e-39) {
tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112;
} else if ((angle / 180.0) <= 1e+87) {
tmp = 2.0 * (sin(pow(sqrt((angle * (((double) M_PI) * 0.005555555555555556))), 2.0)) * (t_1 * cos((angle * (cbrt((((double) M_PI) * pow(((double) M_PI), 2.0))) / -180.0)))));
} else {
tmp = 2.0 * (sin((((double) M_PI) / (180.0 / angle))) * (t_1 * sqrt(pow(cos((0.005555555555555556 * (angle * ((double) M_PI)))), 2.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 * (b - a));
double t_1 = (b - a) * (b + a);
double t_2 = t_1 * Math.cos((angle * (Math.PI / -180.0)));
double t_3 = Math.cbrt((angle * Math.PI));
double tmp;
if ((angle / 180.0) <= -5e+282) {
tmp = 2.0 * (Math.sin(((angle * Math.PI) / -180.0)) * t_2);
} else if ((angle / 180.0) <= -5e+117) {
tmp = 2.0 * (t_2 * Math.sin((Math.pow(t_3, 2.0) / (180.0 / t_3))));
} else if ((angle / 180.0) <= -1e-115) {
tmp = 2.0 * (Math.sin((Math.PI * (angle * 0.005555555555555556))) * (t_1 * Math.pow(Math.cbrt(Math.cos(((Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)) * (angle * 0.005555555555555556)))), 3.0)));
} else if ((angle / 180.0) <= 1e-39) {
tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112;
} else if ((angle / 180.0) <= 1e+87) {
tmp = 2.0 * (Math.sin(Math.pow(Math.sqrt((angle * (Math.PI * 0.005555555555555556))), 2.0)) * (t_1 * Math.cos((angle * (Math.cbrt((Math.PI * Math.pow(Math.PI, 2.0))) / -180.0)))));
} else {
tmp = 2.0 * (Math.sin((Math.PI / (180.0 / angle))) * (t_1 * Math.sqrt(Math.pow(Math.cos((0.005555555555555556 * (angle * Math.PI))), 2.0))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * Float64(b - a))) t_1 = Float64(Float64(b - a) * Float64(b + a)) t_2 = Float64(t_1 * cos(Float64(angle * Float64(pi / -180.0)))) t_3 = cbrt(Float64(angle * pi)) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+282) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle * pi) / -180.0)) * t_2)); elseif (Float64(angle / 180.0) <= -5e+117) tmp = Float64(2.0 * Float64(t_2 * sin(Float64((t_3 ^ 2.0) / Float64(180.0 / t_3))))); elseif (Float64(angle / 180.0) <= -1e-115) tmp = Float64(2.0 * Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * Float64(t_1 * (cbrt(cos(Float64(Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)) * Float64(angle * 0.005555555555555556)))) ^ 3.0)))); elseif (Float64(angle / 180.0) <= 1e-39) tmp = Float64(Float64(Float64(b * t_0) + Float64(a * t_0)) * 0.011111111111111112); elseif (Float64(angle / 180.0) <= 1e+87) tmp = Float64(2.0 * Float64(sin((sqrt(Float64(angle * Float64(pi * 0.005555555555555556))) ^ 2.0)) * Float64(t_1 * cos(Float64(angle * Float64(cbrt(Float64(pi * (pi ^ 2.0))) / -180.0)))))); else tmp = Float64(2.0 * Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(t_1 * sqrt((cos(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 2.0))))); 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[(Pi * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(angle * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+282], N[(2.0 * N[(N[Sin[N[(N[(angle * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+117], N[(2.0 * N[(t$95$2 * N[Sin[N[(N[Power[t$95$3, 2.0], $MachinePrecision] / N[(180.0 / t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], -1e-115], N[(2.0 * N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Power[N[Power[N[Cos[N[(N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-39], N[(N[(N[(b * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+87], N[(2.0 * N[(N[Sin[N[Power[N[Sqrt[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Cos[N[(angle * N[(N[Power[N[(Pi * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Sqrt[N[Power[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
t_1 := \left(b - a\right) \cdot \left(b + a\right)\\
t_2 := t_1 \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
t_3 := \sqrt[3]{angle \cdot \pi}\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot t_2\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq -5 \cdot 10^{+117}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \sin \left(\frac{{t_3}^{2}}{\frac{180}{t_3}}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq -1 \cdot 10^{-115}:\\
\;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left(t_1 \cdot {\left(\sqrt[3]{\cos \left(\left(\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}\right) \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}^{3}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{-39}:\\
\;\;\;\;\left(b \cdot t_0 + a \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+87}:\\
\;\;\;\;2 \cdot \left(\sin \left({\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{2}\right) \cdot \left(t_1 \cdot \cos \left(angle \cdot \frac{\sqrt[3]{\pi \cdot {\pi}^{2}}}{-180}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(t_1 \cdot \sqrt{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.99999999999999978e282Initial program 40.1%
Simplified40.1%
unpow240.1%
unpow240.1%
difference-of-squares40.1%
Applied egg-rr40.1%
*-commutative40.1%
div-inv40.1%
metadata-eval40.1%
*-commutative40.1%
associate-*r*40.1%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r*0.0%
associate-*r*0.0%
*-commutative0.0%
metadata-eval0.0%
div-inv0.0%
*-commutative0.0%
metadata-eval0.0%
div-inv0.0%
frac-times0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
*-commutative0.0%
associate-*l/0.0%
Applied egg-rr83.7%
if -4.99999999999999978e282 < (/.f64 angle 180) < -4.99999999999999983e117Initial program 22.2%
Simplified22.5%
unpow222.5%
unpow222.5%
difference-of-squares29.6%
Applied egg-rr29.6%
associate-*r/25.4%
*-commutative25.4%
add-cube-cbrt31.0%
associate-/l*41.3%
pow241.3%
*-commutative41.3%
*-commutative41.3%
Applied egg-rr41.3%
if -4.99999999999999983e117 < (/.f64 angle 180) < -1.0000000000000001e-115Initial program 61.7%
Simplified60.0%
unpow260.0%
unpow260.0%
difference-of-squares73.7%
Applied egg-rr73.7%
*-commutative73.7%
add-sqr-sqrt73.1%
sqrt-unprod73.7%
*-commutative73.7%
*-commutative73.7%
associate-*l/73.0%
associate-*l/73.1%
frac-times75.0%
metadata-eval75.0%
metadata-eval75.0%
frac-times73.1%
associate-*r/75.1%
associate-*r/75.4%
sqrt-unprod0.0%
add-sqr-sqrt75.4%
add-cube-cbrt75.4%
Applied egg-rr75.3%
add-cube-cbrt75.3%
pow275.3%
Applied egg-rr75.3%
Taylor expanded in angle around inf 75.7%
*-commutative75.7%
*-commutative75.7%
associate-*r*79.3%
*-commutative79.3%
Simplified79.3%
if -1.0000000000000001e-115 < (/.f64 angle 180) < 9.99999999999999929e-40Initial program 62.9%
Simplified63.0%
Taylor expanded in angle around 0 63.0%
unpow262.9%
unpow262.9%
difference-of-squares68.0%
Applied egg-rr68.1%
Taylor expanded in angle around 0 68.1%
*-commutative68.1%
associate-*r*68.1%
+-commutative68.1%
*-commutative68.1%
+-commutative68.1%
Simplified68.1%
associate-*r*99.4%
+-commutative99.4%
distribute-lft-in97.0%
*-commutative97.0%
associate-*l*96.9%
*-commutative96.9%
associate-*l*97.0%
Applied egg-rr97.0%
if 9.99999999999999929e-40 < (/.f64 angle 180) < 9.9999999999999996e86Initial program 48.0%
Simplified47.8%
unpow247.8%
unpow247.8%
difference-of-squares62.6%
Applied egg-rr62.6%
*-commutative62.6%
div-inv55.2%
metadata-eval55.2%
*-commutative55.2%
associate-*r*58.9%
add-sqr-sqrt50.9%
sqrt-unprod58.9%
associate-*r*55.2%
associate-*r*58.9%
*-commutative58.9%
metadata-eval58.9%
div-inv58.9%
*-commutative58.9%
metadata-eval58.9%
div-inv58.4%
frac-times62.7%
metadata-eval62.7%
metadata-eval62.7%
frac-times58.4%
*-commutative58.4%
associate-*l/58.3%
Applied egg-rr50.9%
add-cbrt-cube66.2%
*-commutative66.2%
pow266.2%
Applied egg-rr66.2%
if 9.9999999999999996e86 < (/.f64 angle 180) Initial program 23.1%
Simplified26.1%
unpow226.1%
unpow226.1%
difference-of-squares32.2%
Applied egg-rr32.2%
clear-num28.2%
un-div-inv28.2%
Applied egg-rr28.2%
Applied egg-rr44.6%
associate-*r*44.8%
*-commutative44.8%
*-commutative44.8%
Simplified44.8%
Final simplification70.8%
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 (* (- b a) (+ b a)))
(t_1 (* t_0 (cos (* angle (/ PI -180.0)))))
(t_2 (cbrt (* angle PI)))
(t_3 (sin (/ PI (/ 180.0 angle))))
(t_4 (* PI (* angle (- b a)))))
(if (<= (/ angle 180.0) -5e+282)
(* 2.0 (* (sin (/ (* angle PI) -180.0)) t_1))
(if (<= (/ angle 180.0) -2e+133)
(* 2.0 (* t_1 (sin (/ (pow t_2 2.0) (/ 180.0 t_2)))))
(if (<= (/ angle 180.0) -5e-83)
(*
2.0
(*
t_3
(*
t_0
(cos (* angle (/ (* (cbrt PI) (pow (cbrt PI) 2.0)) -180.0))))))
(if (<= (/ angle 180.0) 1e-39)
(* (+ (* b t_4) (* a t_4)) 0.011111111111111112)
(if (<= (/ angle 180.0) 1e+87)
(*
2.0
(*
(sin (pow (sqrt (* angle (* PI 0.005555555555555556))) 2.0))
(* t_0 (cos (* angle (/ (cbrt (* PI (pow PI 2.0))) -180.0))))))
(*
2.0
(*
t_3
(*
t_0
(sqrt
(pow
(cos (* 0.005555555555555556 (* angle PI)))
2.0))))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = t_0 * cos((angle * (((double) M_PI) / -180.0)));
double t_2 = cbrt((angle * ((double) M_PI)));
double t_3 = sin((((double) M_PI) / (180.0 / angle)));
double t_4 = ((double) M_PI) * (angle * (b - a));
double tmp;
if ((angle / 180.0) <= -5e+282) {
tmp = 2.0 * (sin(((angle * ((double) M_PI)) / -180.0)) * t_1);
} else if ((angle / 180.0) <= -2e+133) {
tmp = 2.0 * (t_1 * sin((pow(t_2, 2.0) / (180.0 / t_2))));
} else if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (t_3 * (t_0 * cos((angle * ((cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)) / -180.0)))));
} else if ((angle / 180.0) <= 1e-39) {
tmp = ((b * t_4) + (a * t_4)) * 0.011111111111111112;
} else if ((angle / 180.0) <= 1e+87) {
tmp = 2.0 * (sin(pow(sqrt((angle * (((double) M_PI) * 0.005555555555555556))), 2.0)) * (t_0 * cos((angle * (cbrt((((double) M_PI) * pow(((double) M_PI), 2.0))) / -180.0)))));
} else {
tmp = 2.0 * (t_3 * (t_0 * sqrt(pow(cos((0.005555555555555556 * (angle * ((double) M_PI)))), 2.0))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = t_0 * Math.cos((angle * (Math.PI / -180.0)));
double t_2 = Math.cbrt((angle * Math.PI));
double t_3 = Math.sin((Math.PI / (180.0 / angle)));
double t_4 = Math.PI * (angle * (b - a));
double tmp;
if ((angle / 180.0) <= -5e+282) {
tmp = 2.0 * (Math.sin(((angle * Math.PI) / -180.0)) * t_1);
} else if ((angle / 180.0) <= -2e+133) {
tmp = 2.0 * (t_1 * Math.sin((Math.pow(t_2, 2.0) / (180.0 / t_2))));
} else if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (t_3 * (t_0 * Math.cos((angle * ((Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)) / -180.0)))));
} else if ((angle / 180.0) <= 1e-39) {
tmp = ((b * t_4) + (a * t_4)) * 0.011111111111111112;
} else if ((angle / 180.0) <= 1e+87) {
tmp = 2.0 * (Math.sin(Math.pow(Math.sqrt((angle * (Math.PI * 0.005555555555555556))), 2.0)) * (t_0 * Math.cos((angle * (Math.cbrt((Math.PI * Math.pow(Math.PI, 2.0))) / -180.0)))));
} else {
tmp = 2.0 * (t_3 * (t_0 * Math.sqrt(Math.pow(Math.cos((0.005555555555555556 * (angle * Math.PI))), 2.0))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64(t_0 * cos(Float64(angle * Float64(pi / -180.0)))) t_2 = cbrt(Float64(angle * pi)) t_3 = sin(Float64(pi / Float64(180.0 / angle))) t_4 = Float64(pi * Float64(angle * Float64(b - a))) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+282) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle * pi) / -180.0)) * t_1)); elseif (Float64(angle / 180.0) <= -2e+133) tmp = Float64(2.0 * Float64(t_1 * sin(Float64((t_2 ^ 2.0) / Float64(180.0 / t_2))))); elseif (Float64(angle / 180.0) <= -5e-83) tmp = Float64(2.0 * Float64(t_3 * Float64(t_0 * cos(Float64(angle * Float64(Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)) / -180.0)))))); elseif (Float64(angle / 180.0) <= 1e-39) tmp = Float64(Float64(Float64(b * t_4) + Float64(a * t_4)) * 0.011111111111111112); elseif (Float64(angle / 180.0) <= 1e+87) tmp = Float64(2.0 * Float64(sin((sqrt(Float64(angle * Float64(pi * 0.005555555555555556))) ^ 2.0)) * Float64(t_0 * cos(Float64(angle * Float64(cbrt(Float64(pi * (pi ^ 2.0))) / -180.0)))))); else tmp = Float64(2.0 * Float64(t_3 * Float64(t_0 * sqrt((cos(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 2.0))))); 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(angle * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(Pi * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+282], N[(2.0 * N[(N[Sin[N[(N[(angle * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+133], N[(2.0 * N[(t$95$1 * N[Sin[N[(N[Power[t$95$2, 2.0], $MachinePrecision] / N[(180.0 / t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-83], N[(2.0 * N[(t$95$3 * N[(t$95$0 * N[Cos[N[(angle * N[(N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-39], N[(N[(N[(b * t$95$4), $MachinePrecision] + N[(a * t$95$4), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+87], N[(2.0 * N[(N[Sin[N[Power[N[Sqrt[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Cos[N[(angle * N[(N[Power[N[(Pi * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$3 * N[(t$95$0 * N[Sqrt[N[Power[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := t_0 \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
t_2 := \sqrt[3]{angle \cdot \pi}\\
t_3 := \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\\
t_4 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot t_1\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq -2 \cdot 10^{+133}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \sin \left(\frac{{t_2}^{2}}{\frac{180}{t_2}}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq -5 \cdot 10^{-83}:\\
\;\;\;\;2 \cdot \left(t_3 \cdot \left(t_0 \cdot \cos \left(angle \cdot \frac{\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}}{-180}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{-39}:\\
\;\;\;\;\left(b \cdot t_4 + a \cdot t_4\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+87}:\\
\;\;\;\;2 \cdot \left(\sin \left({\left(\sqrt{angle \cdot \left(\pi \cdot 0.005555555555555556\right)}\right)}^{2}\right) \cdot \left(t_0 \cdot \cos \left(angle \cdot \frac{\sqrt[3]{\pi \cdot {\pi}^{2}}}{-180}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_3 \cdot \left(t_0 \cdot \sqrt{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.99999999999999978e282Initial program 40.1%
Simplified40.1%
unpow240.1%
unpow240.1%
difference-of-squares40.1%
Applied egg-rr40.1%
*-commutative40.1%
div-inv40.1%
metadata-eval40.1%
*-commutative40.1%
associate-*r*40.1%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r*0.0%
associate-*r*0.0%
*-commutative0.0%
metadata-eval0.0%
div-inv0.0%
*-commutative0.0%
metadata-eval0.0%
div-inv0.0%
frac-times0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
*-commutative0.0%
associate-*l/0.0%
Applied egg-rr83.7%
if -4.99999999999999978e282 < (/.f64 angle 180) < -2e133Initial program 22.8%
Simplified23.1%
unpow223.1%
unpow223.1%
difference-of-squares31.0%
Applied egg-rr31.0%
associate-*r/26.4%
*-commutative26.4%
add-cube-cbrt33.8%
associate-/l*42.9%
pow242.9%
*-commutative42.9%
*-commutative42.9%
Applied egg-rr42.9%
if -2e133 < (/.f64 angle 180) < -5e-83Initial program 55.7%
Simplified53.8%
unpow253.8%
unpow253.8%
difference-of-squares64.4%
Applied egg-rr64.4%
clear-num62.7%
un-div-inv62.6%
Applied egg-rr62.6%
add-cube-cbrt65.3%
pow265.3%
Applied egg-rr69.7%
if -5e-83 < (/.f64 angle 180) < 9.99999999999999929e-40Initial program 64.0%
Simplified64.0%
Taylor expanded in angle around 0 64.0%
unpow263.9%
unpow263.9%
difference-of-squares70.7%
Applied egg-rr70.8%
Taylor expanded in angle around 0 70.8%
*-commutative70.8%
associate-*r*70.9%
+-commutative70.9%
*-commutative70.9%
+-commutative70.9%
Simplified70.9%
associate-*r*99.4%
+-commutative99.4%
distribute-lft-in96.1%
*-commutative96.1%
associate-*l*96.1%
*-commutative96.1%
associate-*l*96.1%
Applied egg-rr96.1%
if 9.99999999999999929e-40 < (/.f64 angle 180) < 9.9999999999999996e86Initial program 48.0%
Simplified47.8%
unpow247.8%
unpow247.8%
difference-of-squares62.6%
Applied egg-rr62.6%
*-commutative62.6%
div-inv55.2%
metadata-eval55.2%
*-commutative55.2%
associate-*r*58.9%
add-sqr-sqrt50.9%
sqrt-unprod58.9%
associate-*r*55.2%
associate-*r*58.9%
*-commutative58.9%
metadata-eval58.9%
div-inv58.9%
*-commutative58.9%
metadata-eval58.9%
div-inv58.4%
frac-times62.7%
metadata-eval62.7%
metadata-eval62.7%
frac-times58.4%
*-commutative58.4%
associate-*l/58.3%
Applied egg-rr50.9%
add-cbrt-cube66.2%
*-commutative66.2%
pow266.2%
Applied egg-rr66.2%
if 9.9999999999999996e86 < (/.f64 angle 180) Initial program 23.1%
Simplified26.1%
unpow226.1%
unpow226.1%
difference-of-squares32.2%
Applied egg-rr32.2%
clear-num28.2%
un-div-inv28.2%
Applied egg-rr28.2%
Applied egg-rr44.6%
associate-*r*44.8%
*-commutative44.8%
*-commutative44.8%
Simplified44.8%
Final simplification70.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 (* (- b a) (+ b a)))
(t_1 (* t_0 (cos (* angle (/ PI -180.0)))))
(t_2 (cbrt (* angle PI)))
(t_3 (sin (/ PI (/ 180.0 angle))))
(t_4 (* PI (* angle (- b a)))))
(if (<= (/ angle 180.0) -5e+282)
(* 2.0 (* (sin (/ (* angle PI) -180.0)) t_1))
(if (<= (/ angle 180.0) -2e+133)
(* 2.0 (* t_1 (sin (/ (pow t_2 2.0) (/ 180.0 t_2)))))
(if (<= (/ angle 180.0) -5e-83)
(*
2.0
(*
t_3
(*
t_0
(cos (* angle (/ (* (cbrt PI) (pow (cbrt PI) 2.0)) -180.0))))))
(if (<= (/ angle 180.0) 1e-39)
(* (+ (* b t_4) (* a t_4)) 0.011111111111111112)
(if (<= (/ angle 180.0) 1e+87)
(*
2.0
(*
(* t_0 (cos (* angle (/ (cbrt (* PI (pow PI 2.0))) -180.0))))
t_3))
(*
2.0
(*
t_3
(*
t_0
(sqrt
(pow
(cos (* 0.005555555555555556 (* angle PI)))
2.0))))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = t_0 * cos((angle * (((double) M_PI) / -180.0)));
double t_2 = cbrt((angle * ((double) M_PI)));
double t_3 = sin((((double) M_PI) / (180.0 / angle)));
double t_4 = ((double) M_PI) * (angle * (b - a));
double tmp;
if ((angle / 180.0) <= -5e+282) {
tmp = 2.0 * (sin(((angle * ((double) M_PI)) / -180.0)) * t_1);
} else if ((angle / 180.0) <= -2e+133) {
tmp = 2.0 * (t_1 * sin((pow(t_2, 2.0) / (180.0 / t_2))));
} else if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (t_3 * (t_0 * cos((angle * ((cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)) / -180.0)))));
} else if ((angle / 180.0) <= 1e-39) {
tmp = ((b * t_4) + (a * t_4)) * 0.011111111111111112;
} else if ((angle / 180.0) <= 1e+87) {
tmp = 2.0 * ((t_0 * cos((angle * (cbrt((((double) M_PI) * pow(((double) M_PI), 2.0))) / -180.0)))) * t_3);
} else {
tmp = 2.0 * (t_3 * (t_0 * sqrt(pow(cos((0.005555555555555556 * (angle * ((double) M_PI)))), 2.0))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = t_0 * Math.cos((angle * (Math.PI / -180.0)));
double t_2 = Math.cbrt((angle * Math.PI));
double t_3 = Math.sin((Math.PI / (180.0 / angle)));
double t_4 = Math.PI * (angle * (b - a));
double tmp;
if ((angle / 180.0) <= -5e+282) {
tmp = 2.0 * (Math.sin(((angle * Math.PI) / -180.0)) * t_1);
} else if ((angle / 180.0) <= -2e+133) {
tmp = 2.0 * (t_1 * Math.sin((Math.pow(t_2, 2.0) / (180.0 / t_2))));
} else if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (t_3 * (t_0 * Math.cos((angle * ((Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)) / -180.0)))));
} else if ((angle / 180.0) <= 1e-39) {
tmp = ((b * t_4) + (a * t_4)) * 0.011111111111111112;
} else if ((angle / 180.0) <= 1e+87) {
tmp = 2.0 * ((t_0 * Math.cos((angle * (Math.cbrt((Math.PI * Math.pow(Math.PI, 2.0))) / -180.0)))) * t_3);
} else {
tmp = 2.0 * (t_3 * (t_0 * Math.sqrt(Math.pow(Math.cos((0.005555555555555556 * (angle * Math.PI))), 2.0))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64(t_0 * cos(Float64(angle * Float64(pi / -180.0)))) t_2 = cbrt(Float64(angle * pi)) t_3 = sin(Float64(pi / Float64(180.0 / angle))) t_4 = Float64(pi * Float64(angle * Float64(b - a))) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+282) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle * pi) / -180.0)) * t_1)); elseif (Float64(angle / 180.0) <= -2e+133) tmp = Float64(2.0 * Float64(t_1 * sin(Float64((t_2 ^ 2.0) / Float64(180.0 / t_2))))); elseif (Float64(angle / 180.0) <= -5e-83) tmp = Float64(2.0 * Float64(t_3 * Float64(t_0 * cos(Float64(angle * Float64(Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)) / -180.0)))))); elseif (Float64(angle / 180.0) <= 1e-39) tmp = Float64(Float64(Float64(b * t_4) + Float64(a * t_4)) * 0.011111111111111112); elseif (Float64(angle / 180.0) <= 1e+87) tmp = Float64(2.0 * Float64(Float64(t_0 * cos(Float64(angle * Float64(cbrt(Float64(pi * (pi ^ 2.0))) / -180.0)))) * t_3)); else tmp = Float64(2.0 * Float64(t_3 * Float64(t_0 * sqrt((cos(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 2.0))))); 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(angle * Pi), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(Pi * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+282], N[(2.0 * N[(N[Sin[N[(N[(angle * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e+133], N[(2.0 * N[(t$95$1 * N[Sin[N[(N[Power[t$95$2, 2.0], $MachinePrecision] / N[(180.0 / t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-83], N[(2.0 * N[(t$95$3 * N[(t$95$0 * N[Cos[N[(angle * N[(N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-39], N[(N[(N[(b * t$95$4), $MachinePrecision] + N[(a * t$95$4), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+87], N[(2.0 * N[(N[(t$95$0 * N[Cos[N[(angle * N[(N[Power[N[(Pi * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$3 * N[(t$95$0 * N[Sqrt[N[Power[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := t_0 \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
t_2 := \sqrt[3]{angle \cdot \pi}\\
t_3 := \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\\
t_4 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot t_1\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq -2 \cdot 10^{+133}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \sin \left(\frac{{t_2}^{2}}{\frac{180}{t_2}}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq -5 \cdot 10^{-83}:\\
\;\;\;\;2 \cdot \left(t_3 \cdot \left(t_0 \cdot \cos \left(angle \cdot \frac{\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}}{-180}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{-39}:\\
\;\;\;\;\left(b \cdot t_4 + a \cdot t_4\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+87}:\\
\;\;\;\;2 \cdot \left(\left(t_0 \cdot \cos \left(angle \cdot \frac{\sqrt[3]{\pi \cdot {\pi}^{2}}}{-180}\right)\right) \cdot t_3\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_3 \cdot \left(t_0 \cdot \sqrt{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.99999999999999978e282Initial program 40.1%
Simplified40.1%
unpow240.1%
unpow240.1%
difference-of-squares40.1%
Applied egg-rr40.1%
*-commutative40.1%
div-inv40.1%
metadata-eval40.1%
*-commutative40.1%
associate-*r*40.1%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r*0.0%
associate-*r*0.0%
*-commutative0.0%
metadata-eval0.0%
div-inv0.0%
*-commutative0.0%
metadata-eval0.0%
div-inv0.0%
frac-times0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
*-commutative0.0%
associate-*l/0.0%
Applied egg-rr83.7%
if -4.99999999999999978e282 < (/.f64 angle 180) < -2e133Initial program 22.8%
Simplified23.1%
unpow223.1%
unpow223.1%
difference-of-squares31.0%
Applied egg-rr31.0%
associate-*r/26.4%
*-commutative26.4%
add-cube-cbrt33.8%
associate-/l*42.9%
pow242.9%
*-commutative42.9%
*-commutative42.9%
Applied egg-rr42.9%
if -2e133 < (/.f64 angle 180) < -5e-83Initial program 55.7%
Simplified53.8%
unpow253.8%
unpow253.8%
difference-of-squares64.4%
Applied egg-rr64.4%
clear-num62.7%
un-div-inv62.6%
Applied egg-rr62.6%
add-cube-cbrt65.3%
pow265.3%
Applied egg-rr69.7%
if -5e-83 < (/.f64 angle 180) < 9.99999999999999929e-40Initial program 64.0%
Simplified64.0%
Taylor expanded in angle around 0 64.0%
unpow263.9%
unpow263.9%
difference-of-squares70.7%
Applied egg-rr70.8%
Taylor expanded in angle around 0 70.8%
*-commutative70.8%
associate-*r*70.9%
+-commutative70.9%
*-commutative70.9%
+-commutative70.9%
Simplified70.9%
associate-*r*99.4%
+-commutative99.4%
distribute-lft-in96.1%
*-commutative96.1%
associate-*l*96.1%
*-commutative96.1%
associate-*l*96.1%
Applied egg-rr96.1%
if 9.99999999999999929e-40 < (/.f64 angle 180) < 9.9999999999999996e86Initial program 48.0%
Simplified47.8%
unpow247.8%
unpow247.8%
difference-of-squares62.6%
Applied egg-rr62.6%
clear-num58.9%
un-div-inv59.1%
Applied egg-rr59.1%
add-cbrt-cube66.2%
*-commutative66.2%
pow266.2%
Applied egg-rr65.5%
if 9.9999999999999996e86 < (/.f64 angle 180) Initial program 23.1%
Simplified26.1%
unpow226.1%
unpow226.1%
difference-of-squares32.2%
Applied egg-rr32.2%
clear-num28.2%
un-div-inv28.2%
Applied egg-rr28.2%
Applied egg-rr44.6%
associate-*r*44.8%
*-commutative44.8%
*-commutative44.8%
Simplified44.8%
Final simplification70.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 (* (- b a) (+ b a)))
(t_1 (* PI (* angle (- b a))))
(t_2 (sin (/ PI (/ 180.0 angle)))))
(if (<= (/ angle 180.0) -5e-83)
(*
2.0
(*
t_2
(* t_0 (cos (* angle (/ (* (cbrt PI) (pow (cbrt PI) 2.0)) -180.0))))))
(if (<= (/ angle 180.0) 1e-39)
(* (+ (* b t_1) (* a t_1)) 0.011111111111111112)
(if (<= (/ angle 180.0) 1e+87)
(*
2.0
(*
(* t_0 (cos (* angle (/ (cbrt (* PI (pow PI 2.0))) -180.0))))
t_2))
(*
2.0
(*
t_2
(*
t_0
(sqrt
(pow (cos (* 0.005555555555555556 (* angle PI))) 2.0))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = ((double) M_PI) * (angle * (b - a));
double t_2 = sin((((double) M_PI) / (180.0 / angle)));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (t_2 * (t_0 * cos((angle * ((cbrt(((double) M_PI)) * pow(cbrt(((double) M_PI)), 2.0)) / -180.0)))));
} else if ((angle / 180.0) <= 1e-39) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else if ((angle / 180.0) <= 1e+87) {
tmp = 2.0 * ((t_0 * cos((angle * (cbrt((((double) M_PI) * pow(((double) M_PI), 2.0))) / -180.0)))) * t_2);
} else {
tmp = 2.0 * (t_2 * (t_0 * sqrt(pow(cos((0.005555555555555556 * (angle * ((double) M_PI)))), 2.0))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = Math.PI * (angle * (b - a));
double t_2 = Math.sin((Math.PI / (180.0 / angle)));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (t_2 * (t_0 * Math.cos((angle * ((Math.cbrt(Math.PI) * Math.pow(Math.cbrt(Math.PI), 2.0)) / -180.0)))));
} else if ((angle / 180.0) <= 1e-39) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else if ((angle / 180.0) <= 1e+87) {
tmp = 2.0 * ((t_0 * Math.cos((angle * (Math.cbrt((Math.PI * Math.pow(Math.PI, 2.0))) / -180.0)))) * t_2);
} else {
tmp = 2.0 * (t_2 * (t_0 * Math.sqrt(Math.pow(Math.cos((0.005555555555555556 * (angle * Math.PI))), 2.0))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64(pi * Float64(angle * Float64(b - a))) t_2 = sin(Float64(pi / Float64(180.0 / angle))) tmp = 0.0 if (Float64(angle / 180.0) <= -5e-83) tmp = Float64(2.0 * Float64(t_2 * Float64(t_0 * cos(Float64(angle * Float64(Float64(cbrt(pi) * (cbrt(pi) ^ 2.0)) / -180.0)))))); elseif (Float64(angle / 180.0) <= 1e-39) tmp = Float64(Float64(Float64(b * t_1) + Float64(a * t_1)) * 0.011111111111111112); elseif (Float64(angle / 180.0) <= 1e+87) tmp = Float64(2.0 * Float64(Float64(t_0 * cos(Float64(angle * Float64(cbrt(Float64(pi * (pi ^ 2.0))) / -180.0)))) * t_2)); else tmp = Float64(2.0 * Float64(t_2 * Float64(t_0 * sqrt((cos(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 2.0))))); 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-83], N[(2.0 * N[(t$95$2 * N[(t$95$0 * N[Cos[N[(angle * N[(N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-39], N[(N[(N[(b * t$95$1), $MachinePrecision] + N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+87], N[(2.0 * N[(N[(t$95$0 * N[Cos[N[(angle * N[(N[Power[N[(Pi * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$2 * N[(t$95$0 * N[Sqrt[N[Power[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
t_2 := \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-83}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \left(t_0 \cdot \cos \left(angle \cdot \frac{\sqrt[3]{\pi} \cdot {\left(\sqrt[3]{\pi}\right)}^{2}}{-180}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{-39}:\\
\;\;\;\;\left(b \cdot t_1 + a \cdot t_1\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+87}:\\
\;\;\;\;2 \cdot \left(\left(t_0 \cdot \cos \left(angle \cdot \frac{\sqrt[3]{\pi \cdot {\pi}^{2}}}{-180}\right)\right) \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \left(t_0 \cdot \sqrt{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5e-83Initial program 40.9%
Simplified40.1%
unpow240.1%
unpow240.1%
difference-of-squares49.0%
Applied egg-rr49.0%
clear-num47.9%
un-div-inv47.7%
Applied egg-rr47.7%
add-cube-cbrt50.7%
pow250.7%
Applied egg-rr53.2%
if -5e-83 < (/.f64 angle 180) < 9.99999999999999929e-40Initial program 64.0%
Simplified64.0%
Taylor expanded in angle around 0 64.0%
unpow263.9%
unpow263.9%
difference-of-squares70.7%
Applied egg-rr70.8%
Taylor expanded in angle around 0 70.8%
*-commutative70.8%
associate-*r*70.9%
+-commutative70.9%
*-commutative70.9%
+-commutative70.9%
Simplified70.9%
associate-*r*99.4%
+-commutative99.4%
distribute-lft-in96.1%
*-commutative96.1%
associate-*l*96.1%
*-commutative96.1%
associate-*l*96.1%
Applied egg-rr96.1%
if 9.99999999999999929e-40 < (/.f64 angle 180) < 9.9999999999999996e86Initial program 48.0%
Simplified47.8%
unpow247.8%
unpow247.8%
difference-of-squares62.6%
Applied egg-rr62.6%
clear-num58.9%
un-div-inv59.1%
Applied egg-rr59.1%
add-cbrt-cube66.2%
*-commutative66.2%
pow266.2%
Applied egg-rr65.5%
if 9.9999999999999996e86 < (/.f64 angle 180) Initial program 23.1%
Simplified26.1%
unpow226.1%
unpow226.1%
difference-of-squares32.2%
Applied egg-rr32.2%
clear-num28.2%
un-div-inv28.2%
Applied egg-rr28.2%
Applied egg-rr44.6%
associate-*r*44.8%
*-commutative44.8%
*-commutative44.8%
Simplified44.8%
Final simplification67.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
(let* ((t_0 (* (- b a) (+ b a)))
(t_1 (* PI (* angle (- b a))))
(t_2 (sin (/ PI (/ 180.0 angle)))))
(if (<= (/ angle 180.0) -5e-83)
(*
2.0
(*
(sin (* (/ angle 180.0) PI))
(* t_0 (pow (cbrt (cos (* PI (* angle 0.005555555555555556)))) 3.0))))
(if (<= (/ angle 180.0) 1e-39)
(* (+ (* b t_1) (* a t_1)) 0.011111111111111112)
(if (<= (/ angle 180.0) 1e+87)
(*
2.0
(*
(* t_0 (cos (* angle (/ (cbrt (* PI (pow PI 2.0))) -180.0))))
t_2))
(*
2.0
(*
t_2
(*
t_0
(sqrt
(pow (cos (* 0.005555555555555556 (* angle PI))) 2.0))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = ((double) M_PI) * (angle * (b - a));
double t_2 = sin((((double) M_PI) / (180.0 / angle)));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (sin(((angle / 180.0) * ((double) M_PI))) * (t_0 * pow(cbrt(cos((((double) M_PI) * (angle * 0.005555555555555556)))), 3.0)));
} else if ((angle / 180.0) <= 1e-39) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else if ((angle / 180.0) <= 1e+87) {
tmp = 2.0 * ((t_0 * cos((angle * (cbrt((((double) M_PI) * pow(((double) M_PI), 2.0))) / -180.0)))) * t_2);
} else {
tmp = 2.0 * (t_2 * (t_0 * sqrt(pow(cos((0.005555555555555556 * (angle * ((double) M_PI)))), 2.0))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = Math.PI * (angle * (b - a));
double t_2 = Math.sin((Math.PI / (180.0 / angle)));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (Math.sin(((angle / 180.0) * Math.PI)) * (t_0 * Math.pow(Math.cbrt(Math.cos((Math.PI * (angle * 0.005555555555555556)))), 3.0)));
} else if ((angle / 180.0) <= 1e-39) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else if ((angle / 180.0) <= 1e+87) {
tmp = 2.0 * ((t_0 * Math.cos((angle * (Math.cbrt((Math.PI * Math.pow(Math.PI, 2.0))) / -180.0)))) * t_2);
} else {
tmp = 2.0 * (t_2 * (t_0 * Math.sqrt(Math.pow(Math.cos((0.005555555555555556 * (angle * Math.PI))), 2.0))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64(pi * Float64(angle * Float64(b - a))) t_2 = sin(Float64(pi / Float64(180.0 / angle))) tmp = 0.0 if (Float64(angle / 180.0) <= -5e-83) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle / 180.0) * pi)) * Float64(t_0 * (cbrt(cos(Float64(pi * Float64(angle * 0.005555555555555556)))) ^ 3.0)))); elseif (Float64(angle / 180.0) <= 1e-39) tmp = Float64(Float64(Float64(b * t_1) + Float64(a * t_1)) * 0.011111111111111112); elseif (Float64(angle / 180.0) <= 1e+87) tmp = Float64(2.0 * Float64(Float64(t_0 * cos(Float64(angle * Float64(cbrt(Float64(pi * (pi ^ 2.0))) / -180.0)))) * t_2)); else tmp = Float64(2.0 * Float64(t_2 * Float64(t_0 * sqrt((cos(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 2.0))))); 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-83], N[(2.0 * N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Power[N[Power[N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e-39], N[(N[(N[(b * t$95$1), $MachinePrecision] + N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+87], N[(2.0 * N[(N[(t$95$0 * N[Cos[N[(angle * N[(N[Power[N[(Pi * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$2 * N[(t$95$0 * N[Sqrt[N[Power[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
t_2 := \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-83}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(t_0 \cdot {\left(\sqrt[3]{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}^{3}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{-39}:\\
\;\;\;\;\left(b \cdot t_1 + a \cdot t_1\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+87}:\\
\;\;\;\;2 \cdot \left(\left(t_0 \cdot \cos \left(angle \cdot \frac{\sqrt[3]{\pi \cdot {\pi}^{2}}}{-180}\right)\right) \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_2 \cdot \left(t_0 \cdot \sqrt{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5e-83Initial program 40.9%
Simplified40.1%
unpow240.1%
unpow240.1%
difference-of-squares49.0%
Applied egg-rr49.0%
*-commutative49.0%
add-sqr-sqrt47.3%
sqrt-unprod33.9%
*-commutative33.9%
*-commutative33.9%
associate-*l/33.3%
associate-*l/33.3%
frac-times34.4%
metadata-eval34.4%
metadata-eval34.4%
frac-times33.3%
associate-*r/34.5%
associate-*r/34.9%
sqrt-unprod0.0%
add-sqr-sqrt49.8%
add-cube-cbrt49.8%
Applied egg-rr52.0%
if -5e-83 < (/.f64 angle 180) < 9.99999999999999929e-40Initial program 64.0%
Simplified64.0%
Taylor expanded in angle around 0 64.0%
unpow263.9%
unpow263.9%
difference-of-squares70.7%
Applied egg-rr70.8%
Taylor expanded in angle around 0 70.8%
*-commutative70.8%
associate-*r*70.9%
+-commutative70.9%
*-commutative70.9%
+-commutative70.9%
Simplified70.9%
associate-*r*99.4%
+-commutative99.4%
distribute-lft-in96.1%
*-commutative96.1%
associate-*l*96.1%
*-commutative96.1%
associate-*l*96.1%
Applied egg-rr96.1%
if 9.99999999999999929e-40 < (/.f64 angle 180) < 9.9999999999999996e86Initial program 48.0%
Simplified47.8%
unpow247.8%
unpow247.8%
difference-of-squares62.6%
Applied egg-rr62.6%
clear-num58.9%
un-div-inv59.1%
Applied egg-rr59.1%
add-cbrt-cube66.2%
*-commutative66.2%
pow266.2%
Applied egg-rr65.5%
if 9.9999999999999996e86 < (/.f64 angle 180) Initial program 23.1%
Simplified26.1%
unpow226.1%
unpow226.1%
difference-of-squares32.2%
Applied egg-rr32.2%
clear-num28.2%
un-div-inv28.2%
Applied egg-rr28.2%
Applied egg-rr44.6%
associate-*r*44.8%
*-commutative44.8%
*-commutative44.8%
Simplified44.8%
Final simplification67.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
(let* ((t_0 (* (- b a) (+ b a))) (t_1 (* PI (* angle (- b a)))))
(if (<= (/ angle 180.0) -5e-83)
(*
2.0
(*
(sin (* (/ angle 180.0) PI))
(* t_0 (pow (cbrt (cos (* PI (* angle 0.005555555555555556)))) 3.0))))
(if (<= (/ angle 180.0) 400000000000.0)
(* (+ (* b t_1) (* a t_1)) 0.011111111111111112)
(*
2.0
(*
(sin (/ PI (/ 180.0 angle)))
(*
t_0
(sqrt (pow (cos (* 0.005555555555555556 (* angle PI))) 2.0)))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = ((double) M_PI) * (angle * (b - a));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (sin(((angle / 180.0) * ((double) M_PI))) * (t_0 * pow(cbrt(cos((((double) M_PI) * (angle * 0.005555555555555556)))), 3.0)));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else {
tmp = 2.0 * (sin((((double) M_PI) / (180.0 / angle))) * (t_0 * sqrt(pow(cos((0.005555555555555556 * (angle * ((double) M_PI)))), 2.0))));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = Math.PI * (angle * (b - a));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (Math.sin(((angle / 180.0) * Math.PI)) * (t_0 * Math.pow(Math.cbrt(Math.cos((Math.PI * (angle * 0.005555555555555556)))), 3.0)));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else {
tmp = 2.0 * (Math.sin((Math.PI / (180.0 / angle))) * (t_0 * Math.sqrt(Math.pow(Math.cos((0.005555555555555556 * (angle * Math.PI))), 2.0))));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64(pi * Float64(angle * Float64(b - a))) tmp = 0.0 if (Float64(angle / 180.0) <= -5e-83) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle / 180.0) * pi)) * Float64(t_0 * (cbrt(cos(Float64(pi * Float64(angle * 0.005555555555555556)))) ^ 3.0)))); elseif (Float64(angle / 180.0) <= 400000000000.0) tmp = Float64(Float64(Float64(b * t_1) + Float64(a * t_1)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(t_0 * sqrt((cos(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 2.0))))); 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-83], N[(2.0 * N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Power[N[Power[N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 400000000000.0], N[(N[(N[(b * t$95$1), $MachinePrecision] + N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sqrt[N[Power[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-83}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(t_0 \cdot {\left(\sqrt[3]{\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)}\right)}^{3}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 400000000000:\\
\;\;\;\;\left(b \cdot t_1 + a \cdot t_1\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(t_0 \cdot \sqrt{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5e-83Initial program 40.9%
Simplified40.1%
unpow240.1%
unpow240.1%
difference-of-squares49.0%
Applied egg-rr49.0%
*-commutative49.0%
add-sqr-sqrt47.3%
sqrt-unprod33.9%
*-commutative33.9%
*-commutative33.9%
associate-*l/33.3%
associate-*l/33.3%
frac-times34.4%
metadata-eval34.4%
metadata-eval34.4%
frac-times33.3%
associate-*r/34.5%
associate-*r/34.9%
sqrt-unprod0.0%
add-sqr-sqrt49.8%
add-cube-cbrt49.8%
Applied egg-rr52.0%
if -5e-83 < (/.f64 angle 180) < 4e11Initial program 66.9%
Simplified66.9%
Taylor expanded in angle around 0 66.2%
unpow266.9%
unpow266.9%
difference-of-squares73.1%
Applied egg-rr72.4%
Taylor expanded in angle around 0 72.4%
*-commutative72.4%
associate-*r*72.5%
+-commutative72.5%
*-commutative72.5%
+-commutative72.5%
Simplified72.5%
associate-*r*98.7%
+-commutative98.7%
distribute-lft-in95.6%
*-commutative95.6%
associate-*l*95.6%
*-commutative95.6%
associate-*l*95.6%
Applied egg-rr95.6%
if 4e11 < (/.f64 angle 180) Initial program 24.0%
Simplified26.0%
unpow226.0%
unpow226.0%
difference-of-squares36.3%
Applied egg-rr36.3%
clear-num32.0%
un-div-inv32.1%
Applied egg-rr32.1%
Applied egg-rr41.6%
associate-*r*41.6%
*-commutative41.6%
*-commutative41.6%
Simplified41.6%
Final simplification65.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
(let* ((t_0 (* (- b a) (+ b a)))
(t_1 (* PI (* angle (- b a))))
(t_2 (cos (* PI (* angle 0.005555555555555556)))))
(if (<= (/ angle 180.0) -5e-83)
(* 2.0 (* (sin (* (/ angle 180.0) PI)) (* t_0 (pow (cbrt t_2) 3.0))))
(if (<= (/ angle 180.0) 400000000000.0)
(* (+ (* b t_1) (* a t_1)) 0.011111111111111112)
(* 2.0 (* (sin (/ PI (/ 180.0 angle))) (* t_0 (fabs t_2))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = ((double) M_PI) * (angle * (b - a));
double t_2 = cos((((double) M_PI) * (angle * 0.005555555555555556)));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (sin(((angle / 180.0) * ((double) M_PI))) * (t_0 * pow(cbrt(t_2), 3.0)));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else {
tmp = 2.0 * (sin((((double) M_PI) / (180.0 / angle))) * (t_0 * fabs(t_2)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = Math.PI * (angle * (b - a));
double t_2 = Math.cos((Math.PI * (angle * 0.005555555555555556)));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (Math.sin(((angle / 180.0) * Math.PI)) * (t_0 * Math.pow(Math.cbrt(t_2), 3.0)));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else {
tmp = 2.0 * (Math.sin((Math.PI / (180.0 / angle))) * (t_0 * Math.abs(t_2)));
}
return tmp;
}
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64(pi * Float64(angle * Float64(b - a))) t_2 = cos(Float64(pi * Float64(angle * 0.005555555555555556))) tmp = 0.0 if (Float64(angle / 180.0) <= -5e-83) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle / 180.0) * pi)) * Float64(t_0 * (cbrt(t_2) ^ 3.0)))); elseif (Float64(angle / 180.0) <= 400000000000.0) tmp = Float64(Float64(Float64(b * t_1) + Float64(a * t_1)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(t_0 * abs(t_2)))); 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-83], N[(2.0 * N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 400000000000.0], N[(N[(N[(b * t$95$1), $MachinePrecision] + N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
t_2 := \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-83}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(t_0 \cdot {\left(\sqrt[3]{t_2}\right)}^{3}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 400000000000:\\
\;\;\;\;\left(b \cdot t_1 + a \cdot t_1\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(t_0 \cdot \left|t_2\right|\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5e-83Initial program 40.9%
Simplified40.1%
unpow240.1%
unpow240.1%
difference-of-squares49.0%
Applied egg-rr49.0%
*-commutative49.0%
add-sqr-sqrt47.3%
sqrt-unprod33.9%
*-commutative33.9%
*-commutative33.9%
associate-*l/33.3%
associate-*l/33.3%
frac-times34.4%
metadata-eval34.4%
metadata-eval34.4%
frac-times33.3%
associate-*r/34.5%
associate-*r/34.9%
sqrt-unprod0.0%
add-sqr-sqrt49.8%
add-cube-cbrt49.8%
Applied egg-rr52.0%
if -5e-83 < (/.f64 angle 180) < 4e11Initial program 66.9%
Simplified66.9%
Taylor expanded in angle around 0 66.2%
unpow266.9%
unpow266.9%
difference-of-squares73.1%
Applied egg-rr72.4%
Taylor expanded in angle around 0 72.4%
*-commutative72.4%
associate-*r*72.5%
+-commutative72.5%
*-commutative72.5%
+-commutative72.5%
Simplified72.5%
associate-*r*98.7%
+-commutative98.7%
distribute-lft-in95.6%
*-commutative95.6%
associate-*l*95.6%
*-commutative95.6%
associate-*l*95.6%
Applied egg-rr95.6%
if 4e11 < (/.f64 angle 180) Initial program 24.0%
Simplified26.0%
unpow226.0%
unpow226.0%
difference-of-squares36.3%
Applied egg-rr36.3%
clear-num32.0%
un-div-inv32.1%
Applied egg-rr32.1%
Applied egg-rr41.6%
unpow241.6%
rem-sqrt-square41.6%
*-commutative41.6%
Simplified41.6%
Final simplification65.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
(let* ((t_0 (* (- b a) (+ b a)))
(t_1 (* PI (* angle (- b a))))
(t_2 (cos (* PI (* angle 0.005555555555555556)))))
(if (<= (/ angle 180.0) -5e-83)
(* 2.0 (* (sin (* (/ angle 180.0) PI)) (* t_0 (log1p (expm1 t_2)))))
(if (<= (/ angle 180.0) 400000000000.0)
(* (+ (* b t_1) (* a t_1)) 0.011111111111111112)
(* 2.0 (* (sin (/ PI (/ 180.0 angle))) (* t_0 (fabs t_2))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = ((double) M_PI) * (angle * (b - a));
double t_2 = cos((((double) M_PI) * (angle * 0.005555555555555556)));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (sin(((angle / 180.0) * ((double) M_PI))) * (t_0 * log1p(expm1(t_2))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else {
tmp = 2.0 * (sin((((double) M_PI) / (180.0 / angle))) * (t_0 * fabs(t_2)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = Math.PI * (angle * (b - a));
double t_2 = Math.cos((Math.PI * (angle * 0.005555555555555556)));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (Math.sin(((angle / 180.0) * Math.PI)) * (t_0 * Math.log1p(Math.expm1(t_2))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else {
tmp = 2.0 * (Math.sin((Math.PI / (180.0 / angle))) * (t_0 * Math.abs(t_2)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = (b - a) * (b + a) t_1 = math.pi * (angle * (b - a)) t_2 = math.cos((math.pi * (angle * 0.005555555555555556))) tmp = 0 if (angle / 180.0) <= -5e-83: tmp = 2.0 * (math.sin(((angle / 180.0) * math.pi)) * (t_0 * math.log1p(math.expm1(t_2)))) elif (angle / 180.0) <= 400000000000.0: tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112 else: tmp = 2.0 * (math.sin((math.pi / (180.0 / angle))) * (t_0 * math.fabs(t_2))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64(pi * Float64(angle * Float64(b - a))) t_2 = cos(Float64(pi * Float64(angle * 0.005555555555555556))) tmp = 0.0 if (Float64(angle / 180.0) <= -5e-83) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle / 180.0) * pi)) * Float64(t_0 * log1p(expm1(t_2))))); elseif (Float64(angle / 180.0) <= 400000000000.0) tmp = Float64(Float64(Float64(b * t_1) + Float64(a * t_1)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(t_0 * abs(t_2)))); 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-83], N[(2.0 * N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Log[1 + N[(Exp[t$95$2] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 400000000000.0], N[(N[(N[(b * t$95$1), $MachinePrecision] + N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
t_2 := \cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-83}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(t_0 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(t_2\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 400000000000:\\
\;\;\;\;\left(b \cdot t_1 + a \cdot t_1\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(t_0 \cdot \left|t_2\right|\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5e-83Initial program 40.9%
Simplified40.1%
unpow240.1%
unpow240.1%
difference-of-squares49.0%
Applied egg-rr49.0%
*-commutative49.0%
add-sqr-sqrt47.3%
sqrt-unprod33.9%
*-commutative33.9%
*-commutative33.9%
associate-*l/33.3%
associate-*l/33.3%
frac-times34.4%
metadata-eval34.4%
metadata-eval34.4%
frac-times33.3%
associate-*r/34.5%
associate-*r/34.9%
sqrt-unprod0.0%
add-sqr-sqrt49.8%
log1p-expm1-u49.8%
Applied egg-rr52.0%
if -5e-83 < (/.f64 angle 180) < 4e11Initial program 66.9%
Simplified66.9%
Taylor expanded in angle around 0 66.2%
unpow266.9%
unpow266.9%
difference-of-squares73.1%
Applied egg-rr72.4%
Taylor expanded in angle around 0 72.4%
*-commutative72.4%
associate-*r*72.5%
+-commutative72.5%
*-commutative72.5%
+-commutative72.5%
Simplified72.5%
associate-*r*98.7%
+-commutative98.7%
distribute-lft-in95.6%
*-commutative95.6%
associate-*l*95.6%
*-commutative95.6%
associate-*l*95.6%
Applied egg-rr95.6%
if 4e11 < (/.f64 angle 180) Initial program 24.0%
Simplified26.0%
unpow226.0%
unpow226.0%
difference-of-squares36.3%
Applied egg-rr36.3%
clear-num32.0%
un-div-inv32.1%
Applied egg-rr32.1%
Applied egg-rr41.6%
unpow241.6%
rem-sqrt-square41.6%
*-commutative41.6%
Simplified41.6%
Final simplification65.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
(let* ((t_0 (* PI (* angle (- b a)))) (t_1 (* (- b a) (+ b a))))
(if (<= (/ angle 180.0) -1e+20)
(*
2.0
(* (sin (/ (* angle PI) -180.0)) (* t_1 (cos (* angle (/ PI -180.0))))))
(if (<= (/ angle 180.0) 400000000000.0)
(* (+ (* b t_0) (* a t_0)) 0.011111111111111112)
(*
2.0
(*
(sin (/ PI (/ 180.0 angle)))
(* t_1 (fabs (cos (* PI (* angle 0.005555555555555556)))))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * (b - a));
double t_1 = (b - a) * (b + a);
double tmp;
if ((angle / 180.0) <= -1e+20) {
tmp = 2.0 * (sin(((angle * ((double) M_PI)) / -180.0)) * (t_1 * cos((angle * (((double) M_PI) / -180.0)))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112;
} else {
tmp = 2.0 * (sin((((double) M_PI) / (180.0 / angle))) * (t_1 * fabs(cos((((double) M_PI) * (angle * 0.005555555555555556))))));
}
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 * (b - a));
double t_1 = (b - a) * (b + a);
double tmp;
if ((angle / 180.0) <= -1e+20) {
tmp = 2.0 * (Math.sin(((angle * Math.PI) / -180.0)) * (t_1 * Math.cos((angle * (Math.PI / -180.0)))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112;
} else {
tmp = 2.0 * (Math.sin((Math.PI / (180.0 / angle))) * (t_1 * Math.abs(Math.cos((Math.PI * (angle * 0.005555555555555556))))));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = math.pi * (angle * (b - a)) t_1 = (b - a) * (b + a) tmp = 0 if (angle / 180.0) <= -1e+20: tmp = 2.0 * (math.sin(((angle * math.pi) / -180.0)) * (t_1 * math.cos((angle * (math.pi / -180.0))))) elif (angle / 180.0) <= 400000000000.0: tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112 else: tmp = 2.0 * (math.sin((math.pi / (180.0 / angle))) * (t_1 * math.fabs(math.cos((math.pi * (angle * 0.005555555555555556)))))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * Float64(b - a))) t_1 = Float64(Float64(b - a) * Float64(b + a)) tmp = 0.0 if (Float64(angle / 180.0) <= -1e+20) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle * pi) / -180.0)) * Float64(t_1 * cos(Float64(angle * Float64(pi / -180.0)))))); elseif (Float64(angle / 180.0) <= 400000000000.0) tmp = Float64(Float64(Float64(b * t_0) + Float64(a * t_0)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(t_1 * abs(cos(Float64(pi * Float64(angle * 0.005555555555555556))))))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) t_0 = pi * (angle * (b - a)); t_1 = (b - a) * (b + a); tmp = 0.0; if ((angle / 180.0) <= -1e+20) tmp = 2.0 * (sin(((angle * pi) / -180.0)) * (t_1 * cos((angle * (pi / -180.0))))); elseif ((angle / 180.0) <= 400000000000.0) tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112; else tmp = 2.0 * (sin((pi / (180.0 / angle))) * (t_1 * abs(cos((pi * (angle * 0.005555555555555556)))))); 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 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -1e+20], N[(2.0 * N[(N[Sin[N[(N[(angle * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 400000000000.0], N[(N[(N[(b * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Abs[N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
t_1 := \left(b - a\right) \cdot \left(b + a\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{+20}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot \left(t_1 \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 400000000000:\\
\;\;\;\;\left(b \cdot t_0 + a \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(t_1 \cdot \left|\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right|\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -1e20Initial program 24.9%
Simplified23.7%
unpow223.7%
unpow223.7%
difference-of-squares28.4%
Applied egg-rr28.4%
*-commutative28.4%
div-inv28.9%
metadata-eval28.9%
*-commutative28.9%
associate-*r*26.4%
add-sqr-sqrt0.0%
sqrt-unprod9.1%
associate-*r*10.6%
associate-*r*9.1%
*-commutative9.1%
metadata-eval9.1%
div-inv8.7%
*-commutative8.7%
metadata-eval8.7%
div-inv10.3%
frac-times10.3%
metadata-eval10.3%
metadata-eval10.3%
frac-times10.3%
*-commutative10.3%
associate-*l/9.1%
Applied egg-rr34.6%
if -1e20 < (/.f64 angle 180) < 4e11Initial program 69.7%
Simplified69.8%
Taylor expanded in angle around 0 67.7%
unpow269.7%
unpow269.7%
difference-of-squares78.7%
Applied egg-rr76.7%
Taylor expanded in angle around 0 76.7%
*-commutative76.7%
associate-*r*76.7%
+-commutative76.7%
*-commutative76.7%
+-commutative76.7%
Simplified76.7%
associate-*r*97.4%
+-commutative97.4%
distribute-lft-in92.6%
*-commutative92.6%
associate-*l*92.5%
*-commutative92.5%
associate-*l*92.5%
Applied egg-rr92.5%
if 4e11 < (/.f64 angle 180) Initial program 24.0%
Simplified26.0%
unpow226.0%
unpow226.0%
difference-of-squares36.3%
Applied egg-rr36.3%
clear-num32.0%
un-div-inv32.1%
Applied egg-rr32.1%
Applied egg-rr41.6%
unpow241.6%
rem-sqrt-square41.6%
*-commutative41.6%
Simplified41.6%
Final simplification64.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
(let* ((t_0 (* PI (* angle (- b a)))) (t_1 (* (- b a) (+ b a))))
(if (<= (/ angle 180.0) -2e-97)
(*
2.0
(*
(cos (* (* angle PI) -0.005555555555555556))
(* t_1 (sin (* 0.005555555555555556 (* angle PI))))))
(if (<= (/ angle 180.0) 400000000000.0)
(* (+ (* b t_0) (* a t_0)) 0.011111111111111112)
(* 2.0 (* t_1 (sin (/ PI (/ 180.0 angle)))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * (b - a));
double t_1 = (b - a) * (b + a);
double tmp;
if ((angle / 180.0) <= -2e-97) {
tmp = 2.0 * (cos(((angle * ((double) M_PI)) * -0.005555555555555556)) * (t_1 * sin((0.005555555555555556 * (angle * ((double) M_PI))))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112;
} else {
tmp = 2.0 * (t_1 * sin((((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 = Math.PI * (angle * (b - a));
double t_1 = (b - a) * (b + a);
double tmp;
if ((angle / 180.0) <= -2e-97) {
tmp = 2.0 * (Math.cos(((angle * Math.PI) * -0.005555555555555556)) * (t_1 * Math.sin((0.005555555555555556 * (angle * Math.PI)))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112;
} else {
tmp = 2.0 * (t_1 * Math.sin((Math.PI / (180.0 / angle))));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = math.pi * (angle * (b - a)) t_1 = (b - a) * (b + a) tmp = 0 if (angle / 180.0) <= -2e-97: tmp = 2.0 * (math.cos(((angle * math.pi) * -0.005555555555555556)) * (t_1 * math.sin((0.005555555555555556 * (angle * math.pi))))) elif (angle / 180.0) <= 400000000000.0: tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112 else: tmp = 2.0 * (t_1 * math.sin((math.pi / (180.0 / angle)))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * Float64(b - a))) t_1 = Float64(Float64(b - a) * Float64(b + a)) tmp = 0.0 if (Float64(angle / 180.0) <= -2e-97) tmp = Float64(2.0 * Float64(cos(Float64(Float64(angle * pi) * -0.005555555555555556)) * Float64(t_1 * sin(Float64(0.005555555555555556 * Float64(angle * pi)))))); elseif (Float64(angle / 180.0) <= 400000000000.0) tmp = Float64(Float64(Float64(b * t_0) + Float64(a * t_0)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(t_1 * sin(Float64(pi / Float64(180.0 / angle))))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) t_0 = pi * (angle * (b - a)); t_1 = (b - a) * (b + a); tmp = 0.0; if ((angle / 180.0) <= -2e-97) tmp = 2.0 * (cos(((angle * pi) * -0.005555555555555556)) * (t_1 * sin((0.005555555555555556 * (angle * pi))))); elseif ((angle / 180.0) <= 400000000000.0) tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112; else tmp = 2.0 * (t_1 * sin((pi / (180.0 / angle)))); 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 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -2e-97], N[(2.0 * N[(N[Cos[N[(N[(angle * Pi), $MachinePrecision] * -0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 400000000000.0], N[(N[(N[(b * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
t_1 := \left(b - a\right) \cdot \left(b + a\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -2 \cdot 10^{-97}:\\
\;\;\;\;2 \cdot \left(\cos \left(\left(angle \cdot \pi\right) \cdot -0.005555555555555556\right) \cdot \left(t_1 \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 400000000000:\\
\;\;\;\;\left(b \cdot t_0 + a \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -2.00000000000000007e-97Initial program 43.4%
Simplified42.6%
unpow242.6%
unpow242.6%
difference-of-squares51.1%
Applied egg-rr51.1%
Taylor expanded in angle around inf 51.6%
if -2.00000000000000007e-97 < (/.f64 angle 180) < 4e11Initial program 65.5%
Simplified65.5%
Taylor expanded in angle around 0 64.8%
unpow265.5%
unpow265.5%
difference-of-squares72.0%
Applied egg-rr71.3%
Taylor expanded in angle around 0 71.3%
*-commutative71.3%
associate-*r*71.3%
+-commutative71.3%
*-commutative71.3%
+-commutative71.3%
Simplified71.3%
associate-*r*98.6%
+-commutative98.6%
distribute-lft-in95.5%
*-commutative95.5%
associate-*l*95.4%
*-commutative95.4%
associate-*l*95.4%
Applied egg-rr95.4%
if 4e11 < (/.f64 angle 180) Initial program 24.0%
Simplified26.0%
unpow226.0%
unpow226.0%
difference-of-squares36.3%
Applied egg-rr36.3%
clear-num32.0%
un-div-inv32.1%
Applied egg-rr32.1%
Taylor expanded in angle around 0 41.3%
Final simplification65.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 (* (- b a) (+ b a))) (t_1 (* PI (* angle (- b a)))))
(if (<= (/ angle 180.0) -5e-83)
(*
2.0
(*
(sin (* (/ angle 180.0) PI))
(* t_0 (cos (* (* angle PI) -0.005555555555555556)))))
(if (<= (/ angle 180.0) 400000000000.0)
(* (+ (* b t_1) (* a t_1)) 0.011111111111111112)
(* 2.0 (* t_0 (sin (/ PI (/ 180.0 angle)))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double t_1 = ((double) M_PI) * (angle * (b - a));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (sin(((angle / 180.0) * ((double) M_PI))) * (t_0 * cos(((angle * ((double) M_PI)) * -0.005555555555555556))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else {
tmp = 2.0 * (t_0 * sin((((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 = (b - a) * (b + a);
double t_1 = Math.PI * (angle * (b - a));
double tmp;
if ((angle / 180.0) <= -5e-83) {
tmp = 2.0 * (Math.sin(((angle / 180.0) * Math.PI)) * (t_0 * Math.cos(((angle * Math.PI) * -0.005555555555555556))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112;
} else {
tmp = 2.0 * (t_0 * Math.sin((Math.PI / (180.0 / angle))));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = (b - a) * (b + a) t_1 = math.pi * (angle * (b - a)) tmp = 0 if (angle / 180.0) <= -5e-83: tmp = 2.0 * (math.sin(((angle / 180.0) * math.pi)) * (t_0 * math.cos(((angle * math.pi) * -0.005555555555555556)))) elif (angle / 180.0) <= 400000000000.0: tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112 else: tmp = 2.0 * (t_0 * math.sin((math.pi / (180.0 / angle)))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(b - a) * Float64(b + a)) t_1 = Float64(pi * Float64(angle * Float64(b - a))) tmp = 0.0 if (Float64(angle / 180.0) <= -5e-83) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle / 180.0) * pi)) * Float64(t_0 * cos(Float64(Float64(angle * pi) * -0.005555555555555556))))); elseif (Float64(angle / 180.0) <= 400000000000.0) tmp = Float64(Float64(Float64(b * t_1) + Float64(a * t_1)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(t_0 * sin(Float64(pi / Float64(180.0 / angle))))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) t_0 = (b - a) * (b + a); t_1 = pi * (angle * (b - a)); tmp = 0.0; if ((angle / 180.0) <= -5e-83) tmp = 2.0 * (sin(((angle / 180.0) * pi)) * (t_0 * cos(((angle * pi) * -0.005555555555555556)))); elseif ((angle / 180.0) <= 400000000000.0) tmp = ((b * t_1) + (a * t_1)) * 0.011111111111111112; else tmp = 2.0 * (t_0 * sin((pi / (180.0 / angle)))); 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-83], N[(2.0 * N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Cos[N[(N[(angle * Pi), $MachinePrecision] * -0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 400000000000.0], N[(N[(N[(b * t$95$1), $MachinePrecision] + N[(a * t$95$1), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
t_1 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-83}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(t_0 \cdot \cos \left(\left(angle \cdot \pi\right) \cdot -0.005555555555555556\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 400000000000:\\
\;\;\;\;\left(b \cdot t_1 + a \cdot t_1\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_0 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5e-83Initial program 40.9%
Simplified40.1%
unpow240.1%
unpow240.1%
difference-of-squares49.0%
Applied egg-rr49.0%
Taylor expanded in angle around inf 49.8%
*-commutative49.8%
Simplified49.8%
if -5e-83 < (/.f64 angle 180) < 4e11Initial program 66.9%
Simplified66.9%
Taylor expanded in angle around 0 66.2%
unpow266.9%
unpow266.9%
difference-of-squares73.1%
Applied egg-rr72.4%
Taylor expanded in angle around 0 72.4%
*-commutative72.4%
associate-*r*72.5%
+-commutative72.5%
*-commutative72.5%
+-commutative72.5%
Simplified72.5%
associate-*r*98.7%
+-commutative98.7%
distribute-lft-in95.6%
*-commutative95.6%
associate-*l*95.6%
*-commutative95.6%
associate-*l*95.6%
Applied egg-rr95.6%
if 4e11 < (/.f64 angle 180) Initial program 24.0%
Simplified26.0%
unpow226.0%
unpow226.0%
difference-of-squares36.3%
Applied egg-rr36.3%
clear-num32.0%
un-div-inv32.1%
Applied egg-rr32.1%
Taylor expanded in angle around 0 41.3%
Final simplification65.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 (- b a)))) (t_1 (* (- b a) (+ b a))))
(if (<= (/ angle 180.0) -1e+20)
(*
2.0
(* (sin (/ (* angle PI) -180.0)) (* t_1 (cos (* angle (/ PI -180.0))))))
(if (<= (/ angle 180.0) 400000000000.0)
(* (+ (* b t_0) (* a t_0)) 0.011111111111111112)
(* 2.0 (* t_1 (sin (/ PI (/ 180.0 angle)))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * (b - a));
double t_1 = (b - a) * (b + a);
double tmp;
if ((angle / 180.0) <= -1e+20) {
tmp = 2.0 * (sin(((angle * ((double) M_PI)) / -180.0)) * (t_1 * cos((angle * (((double) M_PI) / -180.0)))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112;
} else {
tmp = 2.0 * (t_1 * sin((((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 = Math.PI * (angle * (b - a));
double t_1 = (b - a) * (b + a);
double tmp;
if ((angle / 180.0) <= -1e+20) {
tmp = 2.0 * (Math.sin(((angle * Math.PI) / -180.0)) * (t_1 * Math.cos((angle * (Math.PI / -180.0)))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112;
} else {
tmp = 2.0 * (t_1 * Math.sin((Math.PI / (180.0 / angle))));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = math.pi * (angle * (b - a)) t_1 = (b - a) * (b + a) tmp = 0 if (angle / 180.0) <= -1e+20: tmp = 2.0 * (math.sin(((angle * math.pi) / -180.0)) * (t_1 * math.cos((angle * (math.pi / -180.0))))) elif (angle / 180.0) <= 400000000000.0: tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112 else: tmp = 2.0 * (t_1 * math.sin((math.pi / (180.0 / angle)))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * Float64(b - a))) t_1 = Float64(Float64(b - a) * Float64(b + a)) tmp = 0.0 if (Float64(angle / 180.0) <= -1e+20) tmp = Float64(2.0 * Float64(sin(Float64(Float64(angle * pi) / -180.0)) * Float64(t_1 * cos(Float64(angle * Float64(pi / -180.0)))))); elseif (Float64(angle / 180.0) <= 400000000000.0) tmp = Float64(Float64(Float64(b * t_0) + Float64(a * t_0)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(t_1 * sin(Float64(pi / Float64(180.0 / angle))))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) t_0 = pi * (angle * (b - a)); t_1 = (b - a) * (b + a); tmp = 0.0; if ((angle / 180.0) <= -1e+20) tmp = 2.0 * (sin(((angle * pi) / -180.0)) * (t_1 * cos((angle * (pi / -180.0))))); elseif ((angle / 180.0) <= 400000000000.0) tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112; else tmp = 2.0 * (t_1 * sin((pi / (180.0 / angle)))); 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 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -1e+20], N[(2.0 * N[(N[Sin[N[(N[(angle * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 400000000000.0], N[(N[(N[(b * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
t_1 := \left(b - a\right) \cdot \left(b + a\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{+20}:\\
\;\;\;\;2 \cdot \left(\sin \left(\frac{angle \cdot \pi}{-180}\right) \cdot \left(t_1 \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 400000000000:\\
\;\;\;\;\left(b \cdot t_0 + a \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -1e20Initial program 24.9%
Simplified23.7%
unpow223.7%
unpow223.7%
difference-of-squares28.4%
Applied egg-rr28.4%
*-commutative28.4%
div-inv28.9%
metadata-eval28.9%
*-commutative28.9%
associate-*r*26.4%
add-sqr-sqrt0.0%
sqrt-unprod9.1%
associate-*r*10.6%
associate-*r*9.1%
*-commutative9.1%
metadata-eval9.1%
div-inv8.7%
*-commutative8.7%
metadata-eval8.7%
div-inv10.3%
frac-times10.3%
metadata-eval10.3%
metadata-eval10.3%
frac-times10.3%
*-commutative10.3%
associate-*l/9.1%
Applied egg-rr34.6%
if -1e20 < (/.f64 angle 180) < 4e11Initial program 69.7%
Simplified69.8%
Taylor expanded in angle around 0 67.7%
unpow269.7%
unpow269.7%
difference-of-squares78.7%
Applied egg-rr76.7%
Taylor expanded in angle around 0 76.7%
*-commutative76.7%
associate-*r*76.7%
+-commutative76.7%
*-commutative76.7%
+-commutative76.7%
Simplified76.7%
associate-*r*97.4%
+-commutative97.4%
distribute-lft-in92.6%
*-commutative92.6%
associate-*l*92.5%
*-commutative92.5%
associate-*l*92.5%
Applied egg-rr92.5%
if 4e11 < (/.f64 angle 180) Initial program 24.0%
Simplified26.0%
unpow226.0%
unpow226.0%
difference-of-squares36.3%
Applied egg-rr36.3%
clear-num32.0%
un-div-inv32.1%
Applied egg-rr32.1%
Taylor expanded in angle around 0 41.3%
Final simplification64.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
(let* ((t_0 (* PI (* angle (- b a)))) (t_1 (* (- b a) (+ b a))))
(if (<= (/ angle 180.0) -1e+87)
(* 0.011111111111111112 (* t_1 (fabs (* angle PI))))
(if (<= (/ angle 180.0) 400000000000.0)
(* (+ (* b t_0) (* a t_0)) 0.011111111111111112)
(* 2.0 (* t_1 (sin (/ PI (/ 180.0 angle)))))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * (b - a));
double t_1 = (b - a) * (b + a);
double tmp;
if ((angle / 180.0) <= -1e+87) {
tmp = 0.011111111111111112 * (t_1 * fabs((angle * ((double) M_PI))));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112;
} else {
tmp = 2.0 * (t_1 * sin((((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 = Math.PI * (angle * (b - a));
double t_1 = (b - a) * (b + a);
double tmp;
if ((angle / 180.0) <= -1e+87) {
tmp = 0.011111111111111112 * (t_1 * Math.abs((angle * Math.PI)));
} else if ((angle / 180.0) <= 400000000000.0) {
tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112;
} else {
tmp = 2.0 * (t_1 * Math.sin((Math.PI / (180.0 / angle))));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = math.pi * (angle * (b - a)) t_1 = (b - a) * (b + a) tmp = 0 if (angle / 180.0) <= -1e+87: tmp = 0.011111111111111112 * (t_1 * math.fabs((angle * math.pi))) elif (angle / 180.0) <= 400000000000.0: tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112 else: tmp = 2.0 * (t_1 * math.sin((math.pi / (180.0 / angle)))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(angle * Float64(b - a))) t_1 = Float64(Float64(b - a) * Float64(b + a)) tmp = 0.0 if (Float64(angle / 180.0) <= -1e+87) tmp = Float64(0.011111111111111112 * Float64(t_1 * abs(Float64(angle * pi)))); elseif (Float64(angle / 180.0) <= 400000000000.0) tmp = Float64(Float64(Float64(b * t_0) + Float64(a * t_0)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(t_1 * sin(Float64(pi / Float64(180.0 / angle))))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) t_0 = pi * (angle * (b - a)); t_1 = (b - a) * (b + a); tmp = 0.0; if ((angle / 180.0) <= -1e+87) tmp = 0.011111111111111112 * (t_1 * abs((angle * pi))); elseif ((angle / 180.0) <= 400000000000.0) tmp = ((b * t_0) + (a * t_0)) * 0.011111111111111112; else tmp = 2.0 * (t_1 * sin((pi / (180.0 / angle)))); 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 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -1e+87], N[(0.011111111111111112 * N[(t$95$1 * N[Abs[N[(angle * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 400000000000.0], N[(N[(N[(b * t$95$0), $MachinePrecision] + N[(a * t$95$0), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot \left(b - a\right)\right)\\
t_1 := \left(b - a\right) \cdot \left(b + a\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{+87}:\\
\;\;\;\;0.011111111111111112 \cdot \left(t_1 \cdot \left|angle \cdot \pi\right|\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 400000000000:\\
\;\;\;\;\left(b \cdot t_0 + a \cdot t_0\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -9.9999999999999996e86Initial program 24.6%
Simplified24.3%
Taylor expanded in angle around 0 13.3%
unpow224.8%
unpow224.8%
difference-of-squares30.7%
Applied egg-rr19.2%
Taylor expanded in angle around 0 19.2%
*-commutative19.2%
associate-*r*19.2%
+-commutative19.2%
*-commutative19.2%
+-commutative19.2%
Simplified19.2%
add-sqr-sqrt0.0%
sqrt-unprod29.3%
pow129.3%
pow129.3%
pow-sqr29.3%
*-commutative29.3%
metadata-eval29.3%
Applied egg-rr29.3%
unpow229.3%
rem-sqrt-square31.4%
*-commutative31.4%
Simplified31.4%
if -9.9999999999999996e86 < (/.f64 angle 180) < 4e11Initial program 65.6%
Simplified64.6%
Taylor expanded in angle around 0 63.8%
unpow264.9%
unpow264.9%
difference-of-squares73.0%
Applied egg-rr71.9%
Taylor expanded in angle around 0 71.9%
*-commutative71.9%
associate-*r*71.9%
+-commutative71.9%
*-commutative71.9%
+-commutative71.9%
Simplified71.9%
associate-*r*90.6%
+-commutative90.6%
distribute-lft-in86.3%
*-commutative86.3%
associate-*l*86.2%
*-commutative86.2%
associate-*l*86.2%
Applied egg-rr86.2%
if 4e11 < (/.f64 angle 180) Initial program 24.0%
Simplified26.0%
unpow226.0%
unpow226.0%
difference-of-squares36.3%
Applied egg-rr36.3%
clear-num32.0%
un-div-inv32.1%
Applied egg-rr32.1%
Taylor expanded in angle around 0 41.3%
Final simplification63.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 (<= b 1e+229) (* 2.0 (* (* (- b a) (+ b a)) (sin (/ 1.0 (/ 180.0 (* angle PI)))))) (* 0.011111111111111112 (* angle (* PI (pow b 2.0))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 1e+229) {
tmp = 2.0 * (((b - a) * (b + a)) * sin((1.0 / (180.0 / (angle * ((double) M_PI))))));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * pow(b, 2.0)));
}
return tmp;
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1e+229) {
tmp = 2.0 * (((b - a) * (b + a)) * Math.sin((1.0 / (180.0 / (angle * Math.PI)))));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * Math.pow(b, 2.0)));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): tmp = 0 if b <= 1e+229: tmp = 2.0 * (((b - a) * (b + a)) * math.sin((1.0 / (180.0 / (angle * math.pi))))) else: tmp = 0.011111111111111112 * (angle * (math.pi * math.pow(b, 2.0))) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 1e+229) tmp = Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(1.0 / Float64(180.0 / Float64(angle * pi)))))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * (b ^ 2.0)))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1e+229) tmp = 2.0 * (((b - a) * (b + a)) * sin((1.0 / (180.0 / (angle * pi))))); else tmp = 0.011111111111111112 * (angle * (pi * (b ^ 2.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_] := If[LessEqual[b, 1e+229], N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(1.0 / N[(180.0 / N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 10^{+229}:\\
\;\;\;\;2 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\frac{1}{\frac{180}{angle \cdot \pi}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot {b}^{2}\right)\right)\\
\end{array}
\end{array}
if b < 9.9999999999999999e228Initial program 47.5%
Simplified47.7%
unpow247.7%
unpow247.7%
difference-of-squares53.3%
Applied egg-rr53.3%
*-commutative53.3%
associate-*l/51.5%
clear-num50.1%
*-commutative50.1%
Applied egg-rr50.1%
Taylor expanded in angle around 0 52.7%
if 9.9999999999999999e228 < b Initial program 34.0%
Simplified34.0%
Taylor expanded in angle around 0 34.0%
Taylor expanded in b around inf 72.5%
Final simplification54.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
(let* ((t_0 (* (- b a) (+ b a))))
(if (<= angle -3.8e+85)
(* 0.011111111111111112 (* t_0 (fabs (* angle PI))))
(* 2.0 (* (* angle 0.005555555555555556) (* PI t_0))))))a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (b - a) * (b + a);
double tmp;
if (angle <= -3.8e+85) {
tmp = 0.011111111111111112 * (t_0 * fabs((angle * ((double) M_PI))));
} else {
tmp = 2.0 * ((angle * 0.005555555555555556) * (((double) M_PI) * 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 = (b - a) * (b + a);
double tmp;
if (angle <= -3.8e+85) {
tmp = 0.011111111111111112 * (t_0 * Math.abs((angle * Math.PI)));
} else {
tmp = 2.0 * ((angle * 0.005555555555555556) * (Math.PI * t_0));
}
return tmp;
}
a = abs(a) b = abs(b) def code(a, b, angle): t_0 = (b - a) * (b + a) tmp = 0 if angle <= -3.8e+85: tmp = 0.011111111111111112 * (t_0 * math.fabs((angle * math.pi))) else: tmp = 2.0 * ((angle * 0.005555555555555556) * (math.pi * t_0)) return tmp
a = abs(a) b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(b - a) * Float64(b + a)) tmp = 0.0 if (angle <= -3.8e+85) tmp = Float64(0.011111111111111112 * Float64(t_0 * abs(Float64(angle * pi)))); else tmp = Float64(2.0 * Float64(Float64(angle * 0.005555555555555556) * Float64(pi * t_0))); end return tmp end
a = abs(a) b = abs(b) function tmp_2 = code(a, b, angle) t_0 = (b - a) * (b + a); tmp = 0.0; if (angle <= -3.8e+85) tmp = 0.011111111111111112 * (t_0 * abs((angle * pi))); else tmp = 2.0 * ((angle * 0.005555555555555556) * (pi * 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, -3.8e+85], N[(0.011111111111111112 * N[(t$95$0 * N[Abs[N[(angle * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(b + a\right)\\
\mathbf{if}\;angle \leq -3.8 \cdot 10^{+85}:\\
\;\;\;\;0.011111111111111112 \cdot \left(t_0 \cdot \left|angle \cdot \pi\right|\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(\pi \cdot t_0\right)\right)\\
\end{array}
\end{array}
if angle < -3.79999999999999992e85Initial program 24.6%
Simplified24.3%
Taylor expanded in angle around 0 13.3%
unpow224.8%
unpow224.8%
difference-of-squares30.7%
Applied egg-rr19.2%
Taylor expanded in angle around 0 19.2%
*-commutative19.2%
associate-*r*19.2%
+-commutative19.2%
*-commutative19.2%
+-commutative19.2%
Simplified19.2%
add-sqr-sqrt0.0%
sqrt-unprod29.3%
pow129.3%
pow129.3%
pow-sqr29.3%
*-commutative29.3%
metadata-eval29.3%
Applied egg-rr29.3%
unpow229.3%
rem-sqrt-square31.4%
*-commutative31.4%
Simplified31.4%
if -3.79999999999999992e85 < angle Initial program 51.8%
Simplified52.0%
unpow252.0%
unpow252.0%
difference-of-squares60.9%
Applied egg-rr60.9%
Taylor expanded in angle around 0 56.9%
associate-*r*56.9%
Simplified56.9%
Final simplification51.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 (* 2.0 (* (* (- b a) (+ b a)) (sin (* (/ angle 180.0) PI)))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 2.0 * (((b - a) * (b + a)) * sin(((angle / 180.0) * ((double) M_PI))));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 2.0 * (((b - a) * (b + a)) * Math.sin(((angle / 180.0) * Math.PI)));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 2.0 * (((b - a) * (b + a)) * math.sin(((angle / 180.0) * math.pi)))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(2.0 * Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(angle / 180.0) * pi)))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 2.0 * (((b - a) * (b + a)) * sin(((angle / 180.0) * pi))); end
NOTE: a should be positive before calling this function NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(2.0 * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
2 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)
\end{array}
Initial program 46.4%
Simplified46.6%
unpow246.6%
unpow246.6%
difference-of-squares54.9%
Applied egg-rr54.9%
Taylor expanded in angle around 0 53.0%
Final simplification53.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 (* 2.0 (* (* angle 0.005555555555555556) (* PI (* (- b a) (+ b a))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 2.0 * ((angle * 0.005555555555555556) * (((double) M_PI) * ((b - a) * (b + a))));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 2.0 * ((angle * 0.005555555555555556) * (Math.PI * ((b - a) * (b + a))));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 2.0 * ((angle * 0.005555555555555556) * (math.pi * ((b - a) * (b + a))))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(2.0 * Float64(Float64(angle * 0.005555555555555556) * Float64(pi * Float64(Float64(b - a) * Float64(b + a))))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 2.0 * ((angle * 0.005555555555555556) * (pi * ((b - a) * (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[(2.0 * N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Initial program 46.4%
Simplified46.6%
unpow246.6%
unpow246.6%
difference-of-squares54.9%
Applied egg-rr54.9%
Taylor expanded in angle around 0 49.4%
associate-*r*49.4%
Simplified49.4%
Final simplification49.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 (* PI (* (- b a) (+ b a))))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * ((b - a) * (b + a))));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * ((b - a) * (b + a))));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * ((b - a) * (b + a))))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b - a) * Float64(b + a))))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * ((b - a) * (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[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Initial program 46.4%
Simplified46.1%
Taylor expanded in angle around 0 41.2%
unpow246.6%
unpow246.6%
difference-of-squares54.9%
Applied egg-rr49.4%
Final simplification49.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 (* (* (- b a) (+ b a)) (* angle PI))))
a = abs(a);
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * (((b - a) * (b + a)) * (angle * ((double) M_PI)));
}
a = Math.abs(a);
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (((b - a) * (b + a)) * (angle * Math.PI));
}
a = abs(a) b = abs(b) def code(a, b, angle): return 0.011111111111111112 * (((b - a) * (b + a)) * (angle * math.pi))
a = abs(a) b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * Float64(b + a)) * Float64(angle * pi))) end
a = abs(a) b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (((b - a) * (b + a)) * (angle * pi)); 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[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a = |a|\\
b = |b|\\
\\
0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \pi\right)\right)
\end{array}
Initial program 46.4%
Simplified46.1%
Taylor expanded in angle around 0 41.2%
unpow246.6%
unpow246.6%
difference-of-squares54.9%
Applied egg-rr49.4%
Taylor expanded in angle around 0 49.4%
*-commutative49.4%
associate-*r*49.4%
+-commutative49.4%
*-commutative49.4%
+-commutative49.4%
Simplified49.4%
Final simplification49.4%
herbie shell --seed 2023305
(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)))))