
(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 21 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}
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (fma PI (* angle_m 0.005555555555555556) 1.0))
(t_1 (* (+ a b) (- b a)))
(t_2 (cos (* (/ angle_m 180.0) PI)))
(t_3 (* PI (* angle_m 0.005555555555555556)))
(t_4 (sin t_3)))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+36)
(*
(* 2.0 (fma (cos t_0) (cos 1.0) (* (sin t_0) (sin 1.0))))
(* (* t_4 (+ a b)) (- b a)))
(if (<= (/ angle_m 180.0) 5e+186)
(* t_1 (* 2.0 (* (sqrt (pow t_4 2.0)) t_2)))
(* t_1 (* 2.0 (* t_2 (sin (pow (cbrt t_3) 3.0))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = fma(((double) M_PI), (angle_m * 0.005555555555555556), 1.0);
double t_1 = (a + b) * (b - a);
double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
double t_3 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_4 = sin(t_3);
double tmp;
if ((angle_m / 180.0) <= 2e+36) {
tmp = (2.0 * fma(cos(t_0), cos(1.0), (sin(t_0) * sin(1.0)))) * ((t_4 * (a + b)) * (b - a));
} else if ((angle_m / 180.0) <= 5e+186) {
tmp = t_1 * (2.0 * (sqrt(pow(t_4, 2.0)) * t_2));
} else {
tmp = t_1 * (2.0 * (t_2 * sin(pow(cbrt(t_3), 3.0))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = fma(pi, Float64(angle_m * 0.005555555555555556), 1.0) t_1 = Float64(Float64(a + b) * Float64(b - a)) t_2 = cos(Float64(Float64(angle_m / 180.0) * pi)) t_3 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_4 = sin(t_3) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e+36) tmp = Float64(Float64(2.0 * fma(cos(t_0), cos(1.0), Float64(sin(t_0) * sin(1.0)))) * Float64(Float64(t_4 * Float64(a + b)) * Float64(b - a))); elseif (Float64(angle_m / 180.0) <= 5e+186) tmp = Float64(t_1 * Float64(2.0 * Float64(sqrt((t_4 ^ 2.0)) * t_2))); else tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin((cbrt(t_3) ^ 3.0))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$3], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+36], N[(N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[Cos[1.0], $MachinePrecision] + N[(N[Sin[t$95$0], $MachinePrecision] * N[Sin[1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$4 * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+186], N[(t$95$1 * N[(2.0 * N[(N[Sqrt[N[Power[t$95$4, 2.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$3, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\pi, angle\_m \cdot 0.005555555555555556, 1\right)\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_3 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_4 := \sin t\_3\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+36}:\\
\;\;\;\;\left(2 \cdot \mathsf{fma}\left(\cos t\_0, \cos 1, \sin t\_0 \cdot \sin 1\right)\right) \cdot \left(\left(t\_4 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+186}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sqrt{{t\_4}^{2}} \cdot t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left({\left(\sqrt[3]{t\_3}\right)}^{3}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000008e36Initial program 61.3%
associate-*l*61.3%
*-commutative61.3%
associate-*l*61.3%
Simplified61.3%
unpow261.3%
unpow261.3%
difference-of-squares64.9%
Applied egg-rr64.9%
Taylor expanded in angle around inf 65.1%
associate-*r*65.2%
*-commutative65.2%
*-commutative65.2%
associate-*r*66.1%
associate-*r*76.0%
*-commutative76.0%
*-commutative76.0%
associate-*r*73.6%
Simplified73.6%
metadata-eval73.6%
div-inv74.2%
expm1-log1p-u64.1%
expm1-undefine63.6%
*-commutative63.6%
div-inv63.6%
metadata-eval63.6%
associate-*r*63.6%
*-commutative63.6%
Applied egg-rr63.6%
expm1-define64.1%
Simplified64.1%
expm1-undefine63.6%
cos-diff64.1%
log1p-expm1-u64.1%
log1p-undefine64.1%
rem-exp-log63.6%
expm1-log1p-u63.6%
log1p-expm1-u63.6%
log1p-undefine63.6%
rem-exp-log64.1%
expm1-log1p-u76.5%
Applied egg-rr76.5%
fma-define76.4%
+-commutative76.4%
associate-*r*76.9%
*-commutative76.9%
associate-*r*76.4%
fma-define76.9%
+-commutative76.9%
associate-*r*77.7%
*-commutative77.7%
associate-*r*78.8%
fma-define78.8%
Simplified78.8%
if 2.00000000000000008e36 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999954e186Initial program 26.6%
associate-*l*26.6%
*-commutative26.6%
associate-*l*26.6%
Simplified26.6%
unpow226.6%
unpow226.6%
difference-of-squares29.5%
Applied egg-rr29.5%
add-sqr-sqrt18.7%
sqrt-unprod43.6%
pow243.6%
div-inv43.5%
metadata-eval43.5%
Applied egg-rr43.5%
if 4.99999999999999954e186 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.8%
associate-*l*24.8%
*-commutative24.8%
associate-*l*24.8%
Simplified24.8%
unpow224.8%
unpow224.8%
difference-of-squares24.8%
Applied egg-rr24.8%
add-sqr-sqrt28.2%
pow228.2%
Applied egg-rr28.2%
unpow228.2%
add-sqr-sqrt24.8%
add-cube-cbrt37.4%
pow341.4%
div-inv45.9%
metadata-eval45.9%
Applied egg-rr45.9%
Final simplification71.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (* (+ a b) (- b a)))
(t_2 (cos (* (/ angle_m 180.0) PI)))
(t_3 (sin t_0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+98)
(*
(* (* t_3 (+ a b)) (- b a))
(*
2.0
(cos
(*
PI
(pow
(pow (* angle_m 0.005555555555555556) 3.0)
0.3333333333333333)))))
(if (<= (/ angle_m 180.0) 5e+186)
(* t_1 (* 2.0 (* (sqrt (pow t_3 2.0)) t_2)))
(* t_1 (* 2.0 (* t_2 (sin (pow (cbrt t_0) 3.0))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = (a + b) * (b - a);
double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
double t_3 = sin(t_0);
double tmp;
if ((angle_m / 180.0) <= 5e+98) {
tmp = ((t_3 * (a + b)) * (b - a)) * (2.0 * cos((((double) M_PI) * pow(pow((angle_m * 0.005555555555555556), 3.0), 0.3333333333333333))));
} else if ((angle_m / 180.0) <= 5e+186) {
tmp = t_1 * (2.0 * (sqrt(pow(t_3, 2.0)) * t_2));
} else {
tmp = t_1 * (2.0 * (t_2 * sin(pow(cbrt(t_0), 3.0))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double t_1 = (a + b) * (b - a);
double t_2 = Math.cos(((angle_m / 180.0) * Math.PI));
double t_3 = Math.sin(t_0);
double tmp;
if ((angle_m / 180.0) <= 5e+98) {
tmp = ((t_3 * (a + b)) * (b - a)) * (2.0 * Math.cos((Math.PI * Math.pow(Math.pow((angle_m * 0.005555555555555556), 3.0), 0.3333333333333333))));
} else if ((angle_m / 180.0) <= 5e+186) {
tmp = t_1 * (2.0 * (Math.sqrt(Math.pow(t_3, 2.0)) * t_2));
} else {
tmp = t_1 * (2.0 * (t_2 * Math.sin(Math.pow(Math.cbrt(t_0), 3.0))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64(Float64(a + b) * Float64(b - a)) t_2 = cos(Float64(Float64(angle_m / 180.0) * pi)) t_3 = sin(t_0) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e+98) tmp = Float64(Float64(Float64(t_3 * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(Float64(pi * ((Float64(angle_m * 0.005555555555555556) ^ 3.0) ^ 0.3333333333333333))))); elseif (Float64(angle_m / 180.0) <= 5e+186) tmp = Float64(t_1 * Float64(2.0 * Float64(sqrt((t_3 ^ 2.0)) * t_2))); else tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin((cbrt(t_0) ^ 3.0))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+98], N[(N[(N[(t$95$3 * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[N[(Pi * N[Power[N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+186], N[(t$95$1 * N[(2.0 * N[(N[Sqrt[N[Power[t$95$3, 2.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_3 := \sin t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+98}:\\
\;\;\;\;\left(\left(t\_3 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos \left(\pi \cdot {\left({\left(angle\_m \cdot 0.005555555555555556\right)}^{3}\right)}^{0.3333333333333333}\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+186}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\sqrt{{t\_3}^{2}} \cdot t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999998e98Initial program 58.5%
associate-*l*58.5%
*-commutative58.5%
associate-*l*58.5%
Simplified58.5%
unpow258.5%
unpow258.5%
difference-of-squares62.2%
Applied egg-rr62.2%
Taylor expanded in angle around inf 61.9%
associate-*r*61.9%
*-commutative61.9%
*-commutative61.9%
associate-*r*62.2%
associate-*r*71.3%
*-commutative71.3%
*-commutative71.3%
associate-*r*70.1%
Simplified70.1%
metadata-eval70.1%
div-inv70.7%
add-cbrt-cube65.5%
pow1/348.8%
pow348.8%
div-inv48.7%
metadata-eval48.7%
Applied egg-rr48.7%
if 4.9999999999999998e98 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999954e186Initial program 26.0%
associate-*l*26.0%
*-commutative26.0%
associate-*l*26.0%
Simplified26.0%
unpow226.0%
unpow226.0%
difference-of-squares26.0%
Applied egg-rr26.0%
add-sqr-sqrt13.6%
sqrt-unprod44.4%
pow244.4%
div-inv44.4%
metadata-eval44.4%
Applied egg-rr44.4%
if 4.99999999999999954e186 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.8%
associate-*l*24.8%
*-commutative24.8%
associate-*l*24.8%
Simplified24.8%
unpow224.8%
unpow224.8%
difference-of-squares24.8%
Applied egg-rr24.8%
add-sqr-sqrt28.2%
pow228.2%
Applied egg-rr28.2%
unpow228.2%
add-sqr-sqrt24.8%
add-cube-cbrt37.4%
pow341.4%
div-inv45.9%
metadata-eval45.9%
Applied egg-rr45.9%
Final simplification48.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (cos (* (/ angle_m 180.0) PI)))
(t_2 (sin t_0))
(t_3 (* (+ a b) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+20)
(* (* (* t_2 (+ a b)) (- b a)) (* 2.0 (cos t_0)))
(if (<= (/ angle_m 180.0) 5e+186)
(* t_3 (* 2.0 (* (sqrt (pow t_2 2.0)) t_1)))
(* t_3 (* 2.0 (* t_1 (sin (pow (cbrt t_0) 3.0))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = cos(((angle_m / 180.0) * ((double) M_PI)));
double t_2 = sin(t_0);
double t_3 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = ((t_2 * (a + b)) * (b - a)) * (2.0 * cos(t_0));
} else if ((angle_m / 180.0) <= 5e+186) {
tmp = t_3 * (2.0 * (sqrt(pow(t_2, 2.0)) * t_1));
} else {
tmp = t_3 * (2.0 * (t_1 * sin(pow(cbrt(t_0), 3.0))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double t_1 = Math.cos(((angle_m / 180.0) * Math.PI));
double t_2 = Math.sin(t_0);
double t_3 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = ((t_2 * (a + b)) * (b - a)) * (2.0 * Math.cos(t_0));
} else if ((angle_m / 180.0) <= 5e+186) {
tmp = t_3 * (2.0 * (Math.sqrt(Math.pow(t_2, 2.0)) * t_1));
} else {
tmp = t_3 * (2.0 * (t_1 * Math.sin(Math.pow(Math.cbrt(t_0), 3.0))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = cos(Float64(Float64(angle_m / 180.0) * pi)) t_2 = sin(t_0) t_3 = Float64(Float64(a + b) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+20) tmp = Float64(Float64(Float64(t_2 * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(t_0))); elseif (Float64(angle_m / 180.0) <= 5e+186) tmp = Float64(t_3 * Float64(2.0 * Float64(sqrt((t_2 ^ 2.0)) * t_1))); else tmp = Float64(t_3 * Float64(2.0 * Float64(t_1 * sin((cbrt(t_0) ^ 3.0))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(N[(t$95$2 * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+186], N[(t$95$3 * N[(2.0 * N[(N[Sqrt[N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(2.0 * N[(t$95$1 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
t_2 := \sin t\_0\\
t_3 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(\left(t\_2 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos t\_0\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+186}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(\sqrt{{t\_2}^{2}} \cdot t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(2 \cdot \left(t\_1 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4e20Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares65.6%
Applied egg-rr65.6%
Taylor expanded in angle around inf 65.3%
associate-*r*65.3%
*-commutative65.3%
*-commutative65.3%
associate-*r*66.7%
associate-*r*76.7%
*-commutative76.7%
*-commutative76.7%
associate-*r*74.4%
Simplified74.4%
if 4e20 < (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999954e186Initial program 25.2%
associate-*l*25.2%
*-commutative25.2%
associate-*l*25.2%
Simplified25.2%
unpow225.2%
unpow225.2%
difference-of-squares27.9%
Applied egg-rr27.9%
add-sqr-sqrt17.7%
sqrt-unprod43.9%
pow243.9%
div-inv43.9%
metadata-eval43.9%
Applied egg-rr43.9%
if 4.99999999999999954e186 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.8%
associate-*l*24.8%
*-commutative24.8%
associate-*l*24.8%
Simplified24.8%
unpow224.8%
unpow224.8%
difference-of-squares24.8%
Applied egg-rr24.8%
add-sqr-sqrt28.2%
pow228.2%
Applied egg-rr28.2%
unpow228.2%
add-sqr-sqrt24.8%
add-cube-cbrt37.4%
pow341.4%
div-inv45.9%
metadata-eval45.9%
Applied egg-rr45.9%
Final simplification67.4%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (* (+ a b) (- b a)))
(t_2 (cos (* (/ angle_m 180.0) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+24)
(*
(* (* (sin t_0) (+ a b)) (- b a))
(* 2.0 (cos (* PI (cbrt (pow (* angle_m 0.005555555555555556) 3.0))))))
(if (<= (/ angle_m 180.0) 2e+172)
(* t_1 (* 2.0 (* t_2 (* angle_m (* PI 0.005555555555555556)))))
(* t_1 (* 2.0 (* t_2 (sin (pow (cbrt t_0) 3.0))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = (a + b) * (b - a);
double t_2 = cos(((angle_m / 180.0) * ((double) M_PI)));
double tmp;
if ((angle_m / 180.0) <= 1e+24) {
tmp = ((sin(t_0) * (a + b)) * (b - a)) * (2.0 * cos((((double) M_PI) * cbrt(pow((angle_m * 0.005555555555555556), 3.0)))));
} else if ((angle_m / 180.0) <= 2e+172) {
tmp = t_1 * (2.0 * (t_2 * (angle_m * (((double) M_PI) * 0.005555555555555556))));
} else {
tmp = t_1 * (2.0 * (t_2 * sin(pow(cbrt(t_0), 3.0))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double t_1 = (a + b) * (b - a);
double t_2 = Math.cos(((angle_m / 180.0) * Math.PI));
double tmp;
if ((angle_m / 180.0) <= 1e+24) {
tmp = ((Math.sin(t_0) * (a + b)) * (b - a)) * (2.0 * Math.cos((Math.PI * Math.cbrt(Math.pow((angle_m * 0.005555555555555556), 3.0)))));
} else if ((angle_m / 180.0) <= 2e+172) {
tmp = t_1 * (2.0 * (t_2 * (angle_m * (Math.PI * 0.005555555555555556))));
} else {
tmp = t_1 * (2.0 * (t_2 * Math.sin(Math.pow(Math.cbrt(t_0), 3.0))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64(Float64(a + b) * Float64(b - a)) t_2 = cos(Float64(Float64(angle_m / 180.0) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+24) tmp = Float64(Float64(Float64(sin(t_0) * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(Float64(pi * cbrt((Float64(angle_m * 0.005555555555555556) ^ 3.0)))))); elseif (Float64(angle_m / 180.0) <= 2e+172) tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * Float64(angle_m * Float64(pi * 0.005555555555555556))))); else tmp = Float64(t_1 * Float64(2.0 * Float64(t_2 * sin((cbrt(t_0) ^ 3.0))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+24], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[N[(Pi * N[Power[N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+172], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(t$95$2 * N[Sin[N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
t_2 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+24}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos \left(\pi \cdot \sqrt[3]{{\left(angle\_m \cdot 0.005555555555555556\right)}^{3}}\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+172}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_2 \cdot \sin \left({\left(\sqrt[3]{t\_0}\right)}^{3}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e23Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares65.6%
Applied egg-rr65.6%
Taylor expanded in angle around inf 65.3%
associate-*r*65.3%
*-commutative65.3%
*-commutative65.3%
associate-*r*66.7%
associate-*r*76.7%
*-commutative76.7%
*-commutative76.7%
associate-*r*74.4%
Simplified74.4%
metadata-eval74.4%
div-inv75.0%
add-cbrt-cube69.5%
pow368.9%
div-inv69.4%
metadata-eval69.4%
Applied egg-rr69.4%
if 9.9999999999999998e23 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000002e172Initial program 26.7%
associate-*l*26.7%
*-commutative26.7%
associate-*l*26.7%
Simplified26.7%
unpow226.7%
unpow226.7%
difference-of-squares29.6%
Applied egg-rr29.6%
Taylor expanded in angle around 0 44.0%
associate-*r*44.0%
*-commutative44.0%
associate-*r*44.0%
Simplified44.0%
if 2.0000000000000002e172 < (/.f64 angle #s(literal 180 binary64)) Initial program 22.8%
associate-*l*22.8%
*-commutative22.8%
associate-*l*22.8%
Simplified22.8%
unpow222.8%
unpow222.8%
difference-of-squares22.8%
Applied egg-rr22.8%
add-sqr-sqrt25.8%
pow225.8%
Applied egg-rr25.8%
unpow225.8%
add-sqr-sqrt22.8%
add-cube-cbrt33.8%
pow337.2%
div-inv41.2%
metadata-eval41.2%
Applied egg-rr41.2%
Final simplification63.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+24)
(*
(* (* (sin t_0) (+ a b)) (- b a))
(* 2.0 (cos (* PI (cbrt (pow (* angle_m 0.005555555555555556) 3.0))))))
(if (<= (/ angle_m 180.0) 1.5e+186)
(*
(* (+ a b) (- b a))
(*
2.0
(*
(cos (* (/ angle_m 180.0) PI))
(* angle_m (* PI 0.005555555555555556)))))
(*
(* 2.0 (cos t_0))
(*
(- b a)
(*
(+ a b)
(sin (* PI (exp (log (* angle_m 0.005555555555555556)))))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e+24) {
tmp = ((sin(t_0) * (a + b)) * (b - a)) * (2.0 * cos((((double) M_PI) * cbrt(pow((angle_m * 0.005555555555555556), 3.0)))));
} else if ((angle_m / 180.0) <= 1.5e+186) {
tmp = ((a + b) * (b - a)) * (2.0 * (cos(((angle_m / 180.0) * ((double) M_PI))) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
} else {
tmp = (2.0 * cos(t_0)) * ((b - a) * ((a + b) * sin((((double) M_PI) * exp(log((angle_m * 0.005555555555555556)))))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e+24) {
tmp = ((Math.sin(t_0) * (a + b)) * (b - a)) * (2.0 * Math.cos((Math.PI * Math.cbrt(Math.pow((angle_m * 0.005555555555555556), 3.0)))));
} else if ((angle_m / 180.0) <= 1.5e+186) {
tmp = ((a + b) * (b - a)) * (2.0 * (Math.cos(((angle_m / 180.0) * Math.PI)) * (angle_m * (Math.PI * 0.005555555555555556))));
} else {
tmp = (2.0 * Math.cos(t_0)) * ((b - a) * ((a + b) * Math.sin((Math.PI * Math.exp(Math.log((angle_m * 0.005555555555555556)))))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+24) tmp = Float64(Float64(Float64(sin(t_0) * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(Float64(pi * cbrt((Float64(angle_m * 0.005555555555555556) ^ 3.0)))))); elseif (Float64(angle_m / 180.0) <= 1.5e+186) tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(angle_m * Float64(pi * 0.005555555555555556))))); else tmp = Float64(Float64(2.0 * cos(t_0)) * Float64(Float64(b - a) * Float64(Float64(a + b) * sin(Float64(pi * exp(log(Float64(angle_m * 0.005555555555555556)))))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+24], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[N[(Pi * N[Power[N[Power[N[(angle$95$m * 0.005555555555555556), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e+186], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[Sin[N[(Pi * N[Exp[N[Log[N[(angle$95$m * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+24}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos \left(\pi \cdot \sqrt[3]{{\left(angle\_m \cdot 0.005555555555555556\right)}^{3}}\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{+186}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \cos t\_0\right) \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin \left(\pi \cdot e^{\log \left(angle\_m \cdot 0.005555555555555556\right)}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e23Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares65.6%
Applied egg-rr65.6%
Taylor expanded in angle around inf 65.3%
associate-*r*65.3%
*-commutative65.3%
*-commutative65.3%
associate-*r*66.7%
associate-*r*76.7%
*-commutative76.7%
*-commutative76.7%
associate-*r*74.4%
Simplified74.4%
metadata-eval74.4%
div-inv75.0%
add-cbrt-cube69.5%
pow368.9%
div-inv69.4%
metadata-eval69.4%
Applied egg-rr69.4%
if 9.9999999999999998e23 < (/.f64 angle #s(literal 180 binary64)) < 1.49999999999999991e186Initial program 25.2%
associate-*l*25.2%
*-commutative25.2%
associate-*l*25.2%
Simplified25.2%
unpow225.2%
unpow225.2%
difference-of-squares27.9%
Applied egg-rr27.9%
Taylor expanded in angle around 0 40.9%
associate-*r*40.9%
*-commutative40.9%
associate-*r*40.9%
Simplified40.9%
if 1.49999999999999991e186 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.8%
associate-*l*24.8%
*-commutative24.8%
associate-*l*24.8%
Simplified24.8%
unpow224.8%
unpow224.8%
difference-of-squares24.8%
Applied egg-rr24.8%
Taylor expanded in angle around inf 28.2%
associate-*r*28.2%
*-commutative28.2%
*-commutative28.2%
associate-*r*20.0%
associate-*r*20.0%
*-commutative20.0%
*-commutative20.0%
associate-*r*21.1%
Simplified21.1%
add-exp-log40.4%
Applied egg-rr40.4%
Final simplification62.7%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556))) (t_1 (* 2.0 (cos t_0))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+20)
(* (* (* (sin t_0) (+ a b)) (- b a)) t_1)
(if (<= (/ angle_m 180.0) 1.5e+186)
(*
(* (+ a b) (- b a))
(*
2.0
(*
(cos (* (/ angle_m 180.0) PI))
(* angle_m (* PI 0.005555555555555556)))))
(*
t_1
(*
(- b a)
(*
(+ a b)
(sin (* PI (exp (log (* angle_m 0.005555555555555556)))))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = 2.0 * cos(t_0);
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = ((sin(t_0) * (a + b)) * (b - a)) * t_1;
} else if ((angle_m / 180.0) <= 1.5e+186) {
tmp = ((a + b) * (b - a)) * (2.0 * (cos(((angle_m / 180.0) * ((double) M_PI))) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
} else {
tmp = t_1 * ((b - a) * ((a + b) * sin((((double) M_PI) * exp(log((angle_m * 0.005555555555555556)))))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double t_1 = 2.0 * Math.cos(t_0);
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = ((Math.sin(t_0) * (a + b)) * (b - a)) * t_1;
} else if ((angle_m / 180.0) <= 1.5e+186) {
tmp = ((a + b) * (b - a)) * (2.0 * (Math.cos(((angle_m / 180.0) * Math.PI)) * (angle_m * (Math.PI * 0.005555555555555556))));
} else {
tmp = t_1 * ((b - a) * ((a + b) * Math.sin((Math.PI * Math.exp(Math.log((angle_m * 0.005555555555555556)))))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.pi * (angle_m * 0.005555555555555556) t_1 = 2.0 * math.cos(t_0) tmp = 0 if (angle_m / 180.0) <= 4e+20: tmp = ((math.sin(t_0) * (a + b)) * (b - a)) * t_1 elif (angle_m / 180.0) <= 1.5e+186: tmp = ((a + b) * (b - a)) * (2.0 * (math.cos(((angle_m / 180.0) * math.pi)) * (angle_m * (math.pi * 0.005555555555555556)))) else: tmp = t_1 * ((b - a) * ((a + b) * math.sin((math.pi * math.exp(math.log((angle_m * 0.005555555555555556))))))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64(2.0 * cos(t_0)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+20) tmp = Float64(Float64(Float64(sin(t_0) * Float64(a + b)) * Float64(b - a)) * t_1); elseif (Float64(angle_m / 180.0) <= 1.5e+186) tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(angle_m * Float64(pi * 0.005555555555555556))))); else tmp = Float64(t_1 * Float64(Float64(b - a) * Float64(Float64(a + b) * sin(Float64(pi * exp(log(Float64(angle_m * 0.005555555555555556)))))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = pi * (angle_m * 0.005555555555555556); t_1 = 2.0 * cos(t_0); tmp = 0.0; if ((angle_m / 180.0) <= 4e+20) tmp = ((sin(t_0) * (a + b)) * (b - a)) * t_1; elseif ((angle_m / 180.0) <= 1.5e+186) tmp = ((a + b) * (b - a)) * (2.0 * (cos(((angle_m / 180.0) * pi)) * (angle_m * (pi * 0.005555555555555556)))); else tmp = t_1 * ((b - a) * ((a + b) * sin((pi * exp(log((angle_m * 0.005555555555555556))))))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1.5e+186], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(b - a), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[Sin[N[(Pi * N[Exp[N[Log[N[(angle$95$m * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := 2 \cdot \cos t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot t\_1\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 1.5 \cdot 10^{+186}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin \left(\pi \cdot e^{\log \left(angle\_m \cdot 0.005555555555555556\right)}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4e20Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares65.6%
Applied egg-rr65.6%
Taylor expanded in angle around inf 65.3%
associate-*r*65.3%
*-commutative65.3%
*-commutative65.3%
associate-*r*66.7%
associate-*r*76.7%
*-commutative76.7%
*-commutative76.7%
associate-*r*74.4%
Simplified74.4%
if 4e20 < (/.f64 angle #s(literal 180 binary64)) < 1.49999999999999991e186Initial program 25.2%
associate-*l*25.2%
*-commutative25.2%
associate-*l*25.2%
Simplified25.2%
unpow225.2%
unpow225.2%
difference-of-squares27.9%
Applied egg-rr27.9%
Taylor expanded in angle around 0 40.9%
associate-*r*40.9%
*-commutative40.9%
associate-*r*40.9%
Simplified40.9%
if 1.49999999999999991e186 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.8%
associate-*l*24.8%
*-commutative24.8%
associate-*l*24.8%
Simplified24.8%
unpow224.8%
unpow224.8%
difference-of-squares24.8%
Applied egg-rr24.8%
Taylor expanded in angle around inf 28.2%
associate-*r*28.2%
*-commutative28.2%
*-commutative28.2%
associate-*r*20.0%
associate-*r*20.0%
*-commutative20.0%
*-commutative20.0%
associate-*r*21.1%
Simplified21.1%
add-exp-log40.4%
Applied egg-rr40.4%
Final simplification66.5%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (* (+ a b) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+20)
(* (* (* (sin t_0) (+ a b)) (- b a)) (* 2.0 (cos t_0)))
(if (<= (/ angle_m 180.0) 5e+166)
(*
t_1
(*
2.0
(*
(cos (* (/ angle_m 180.0) PI))
(* angle_m (* PI 0.005555555555555556)))))
(* t_1 (* 2.0 (sin (* (/ angle_m 180.0) (pow (sqrt PI) 2.0))))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = ((sin(t_0) * (a + b)) * (b - a)) * (2.0 * cos(t_0));
} else if ((angle_m / 180.0) <= 5e+166) {
tmp = t_1 * (2.0 * (cos(((angle_m / 180.0) * ((double) M_PI))) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
} else {
tmp = t_1 * (2.0 * sin(((angle_m / 180.0) * pow(sqrt(((double) M_PI)), 2.0))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double t_1 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = ((Math.sin(t_0) * (a + b)) * (b - a)) * (2.0 * Math.cos(t_0));
} else if ((angle_m / 180.0) <= 5e+166) {
tmp = t_1 * (2.0 * (Math.cos(((angle_m / 180.0) * Math.PI)) * (angle_m * (Math.PI * 0.005555555555555556))));
} else {
tmp = t_1 * (2.0 * Math.sin(((angle_m / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.pi * (angle_m * 0.005555555555555556) t_1 = (a + b) * (b - a) tmp = 0 if (angle_m / 180.0) <= 4e+20: tmp = ((math.sin(t_0) * (a + b)) * (b - a)) * (2.0 * math.cos(t_0)) elif (angle_m / 180.0) <= 5e+166: tmp = t_1 * (2.0 * (math.cos(((angle_m / 180.0) * math.pi)) * (angle_m * (math.pi * 0.005555555555555556)))) else: tmp = t_1 * (2.0 * math.sin(((angle_m / 180.0) * math.pow(math.sqrt(math.pi), 2.0)))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64(Float64(a + b) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+20) tmp = Float64(Float64(Float64(sin(t_0) * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(t_0))); elseif (Float64(angle_m / 180.0) <= 5e+166) tmp = Float64(t_1 * Float64(2.0 * Float64(cos(Float64(Float64(angle_m / 180.0) * pi)) * Float64(angle_m * Float64(pi * 0.005555555555555556))))); else tmp = Float64(t_1 * Float64(2.0 * sin(Float64(Float64(angle_m / 180.0) * (sqrt(pi) ^ 2.0))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = pi * (angle_m * 0.005555555555555556); t_1 = (a + b) * (b - a); tmp = 0.0; if ((angle_m / 180.0) <= 4e+20) tmp = ((sin(t_0) * (a + b)) * (b - a)) * (2.0 * cos(t_0)); elseif ((angle_m / 180.0) <= 5e+166) tmp = t_1 * (2.0 * (cos(((angle_m / 180.0) * pi)) * (angle_m * (pi * 0.005555555555555556)))); else tmp = t_1 * (2.0 * sin(((angle_m / 180.0) * (sqrt(pi) ^ 2.0)))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+166], N[(t$95$1 * N[(2.0 * N[(N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos t\_0\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+166}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos \left(\frac{angle\_m}{180} \cdot \pi\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4e20Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares65.6%
Applied egg-rr65.6%
Taylor expanded in angle around inf 65.3%
associate-*r*65.3%
*-commutative65.3%
*-commutative65.3%
associate-*r*66.7%
associate-*r*76.7%
*-commutative76.7%
*-commutative76.7%
associate-*r*74.4%
Simplified74.4%
if 4e20 < (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000002e166Initial program 24.5%
associate-*l*24.5%
*-commutative24.5%
associate-*l*24.5%
Simplified24.5%
unpow224.5%
unpow224.5%
difference-of-squares27.5%
Applied egg-rr27.5%
Taylor expanded in angle around 0 42.4%
associate-*r*42.4%
*-commutative42.4%
associate-*r*42.4%
Simplified42.4%
if 5.0000000000000002e166 < (/.f64 angle #s(literal 180 binary64)) Initial program 25.8%
associate-*l*25.8%
*-commutative25.8%
associate-*l*25.8%
Simplified25.8%
unpow225.8%
unpow225.8%
difference-of-squares25.8%
Applied egg-rr25.8%
add-sqr-sqrt28.6%
pow228.6%
Applied egg-rr28.6%
Taylor expanded in angle around 0 36.4%
Final simplification66.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (* (/ angle_m 180.0) PI))
(t_2 (* (+ a b) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+20)
(* (* (* (sin t_0) (+ a b)) (- b a)) (* 2.0 (cos t_0)))
(if (<= (/ angle_m 180.0) 2e+222)
(* t_2 (* 2.0 (* (cos t_1) (* angle_m (* PI 0.005555555555555556)))))
(* t_2 (* 2.0 (sin t_1))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = (angle_m / 180.0) * ((double) M_PI);
double t_2 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = ((sin(t_0) * (a + b)) * (b - a)) * (2.0 * cos(t_0));
} else if ((angle_m / 180.0) <= 2e+222) {
tmp = t_2 * (2.0 * (cos(t_1) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
} else {
tmp = t_2 * (2.0 * sin(t_1));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double t_1 = (angle_m / 180.0) * Math.PI;
double t_2 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = ((Math.sin(t_0) * (a + b)) * (b - a)) * (2.0 * Math.cos(t_0));
} else if ((angle_m / 180.0) <= 2e+222) {
tmp = t_2 * (2.0 * (Math.cos(t_1) * (angle_m * (Math.PI * 0.005555555555555556))));
} else {
tmp = t_2 * (2.0 * Math.sin(t_1));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.pi * (angle_m * 0.005555555555555556) t_1 = (angle_m / 180.0) * math.pi t_2 = (a + b) * (b - a) tmp = 0 if (angle_m / 180.0) <= 4e+20: tmp = ((math.sin(t_0) * (a + b)) * (b - a)) * (2.0 * math.cos(t_0)) elif (angle_m / 180.0) <= 2e+222: tmp = t_2 * (2.0 * (math.cos(t_1) * (angle_m * (math.pi * 0.005555555555555556)))) else: tmp = t_2 * (2.0 * math.sin(t_1)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64(Float64(angle_m / 180.0) * pi) t_2 = Float64(Float64(a + b) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+20) tmp = Float64(Float64(Float64(sin(t_0) * Float64(a + b)) * Float64(b - a)) * Float64(2.0 * cos(t_0))); elseif (Float64(angle_m / 180.0) <= 2e+222) tmp = Float64(t_2 * Float64(2.0 * Float64(cos(t_1) * Float64(angle_m * Float64(pi * 0.005555555555555556))))); else tmp = Float64(t_2 * Float64(2.0 * sin(t_1))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = pi * (angle_m * 0.005555555555555556); t_1 = (angle_m / 180.0) * pi; t_2 = (a + b) * (b - a); tmp = 0.0; if ((angle_m / 180.0) <= 4e+20) tmp = ((sin(t_0) * (a + b)) * (b - a)) * (2.0 * cos(t_0)); elseif ((angle_m / 180.0) <= 2e+222) tmp = t_2 * (2.0 * (cos(t_1) * (angle_m * (pi * 0.005555555555555556)))); else tmp = t_2 * (2.0 * sin(t_1)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+222], N[(t$95$2 * N[(2.0 * N[(N[Cos[t$95$1], $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(2.0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \frac{angle\_m}{180} \cdot \pi\\
t_2 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \cos t\_0\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+222}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \left(\cos t\_1 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \sin t\_1\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4e20Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares65.6%
Applied egg-rr65.6%
Taylor expanded in angle around inf 65.3%
associate-*r*65.3%
*-commutative65.3%
*-commutative65.3%
associate-*r*66.7%
associate-*r*76.7%
*-commutative76.7%
*-commutative76.7%
associate-*r*74.4%
Simplified74.4%
if 4e20 < (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000001e222Initial program 25.1%
associate-*l*25.1%
*-commutative25.1%
associate-*l*25.1%
Simplified25.1%
unpow225.1%
unpow225.1%
difference-of-squares27.2%
Applied egg-rr27.2%
Taylor expanded in angle around 0 38.3%
associate-*r*38.3%
*-commutative38.3%
associate-*r*38.3%
Simplified38.3%
if 2.0000000000000001e222 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.9%
associate-*l*24.9%
*-commutative24.9%
associate-*l*24.9%
Simplified24.9%
unpow224.9%
unpow224.9%
difference-of-squares24.9%
Applied egg-rr24.9%
Taylor expanded in angle around 0 41.5%
Final simplification66.1%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow b 2.0) 2e+303)
(* (* (+ a b) (- b a)) (sin (* angle_m (* PI 0.011111111111111112))))
(* b (* (- b a) (sin (* 0.011111111111111112 (* angle_m PI))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (pow(b, 2.0) <= 2e+303) {
tmp = ((a + b) * (b - a)) * sin((angle_m * (((double) M_PI) * 0.011111111111111112)));
} else {
tmp = b * ((b - a) * sin((0.011111111111111112 * (angle_m * ((double) M_PI)))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (Math.pow(b, 2.0) <= 2e+303) {
tmp = ((a + b) * (b - a)) * Math.sin((angle_m * (Math.PI * 0.011111111111111112)));
} else {
tmp = b * ((b - a) * Math.sin((0.011111111111111112 * (angle_m * Math.PI))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if math.pow(b, 2.0) <= 2e+303: tmp = ((a + b) * (b - a)) * math.sin((angle_m * (math.pi * 0.011111111111111112))) else: tmp = b * ((b - a) * math.sin((0.011111111111111112 * (angle_m * math.pi)))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if ((b ^ 2.0) <= 2e+303) tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * sin(Float64(angle_m * Float64(pi * 0.011111111111111112)))); else tmp = Float64(b * Float64(Float64(b - a) * sin(Float64(0.011111111111111112 * Float64(angle_m * pi))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((b ^ 2.0) <= 2e+303) tmp = ((a + b) * (b - a)) * sin((angle_m * (pi * 0.011111111111111112))); else tmp = b * ((b - a) * sin((0.011111111111111112 * (angle_m * pi)))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e+303], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+303}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 2e303Initial program 57.5%
associate-*l*57.5%
*-commutative57.5%
associate-*l*57.5%
Simplified57.5%
unpow257.5%
unpow257.5%
difference-of-squares57.5%
Applied egg-rr57.5%
add-sqr-sqrt59.6%
pow259.6%
Applied egg-rr59.6%
expm1-log1p-u57.9%
expm1-undefine28.7%
Applied egg-rr25.5%
log1p-undefine25.5%
rem-exp-log25.5%
+-commutative25.5%
associate--l+55.0%
metadata-eval55.0%
+-rgt-identity55.0%
associate-*r*55.4%
*-commutative55.4%
associate-*r*56.3%
count-256.3%
*-commutative56.3%
*-commutative56.3%
distribute-lft-out56.3%
distribute-rgt-out56.3%
metadata-eval56.3%
Simplified56.3%
if 2e303 < (pow.f64 b #s(literal 2 binary64)) Initial program 42.8%
associate-*l*42.8%
*-commutative42.8%
associate-*l*42.8%
Simplified42.8%
unpow242.8%
unpow242.8%
difference-of-squares53.8%
Applied egg-rr53.8%
Taylor expanded in b around inf 55.2%
add-sqr-sqrt51.0%
sqrt-unprod53.7%
pow253.7%
Applied egg-rr53.7%
unpow253.7%
rem-sqrt-square53.7%
Simplified53.7%
pow153.7%
add-sqr-sqrt51.0%
fabs-sqr51.0%
add-sqr-sqrt55.2%
2-sin55.2%
div-inv55.4%
metadata-eval55.4%
Applied egg-rr55.4%
unpow155.4%
associate-*l*67.4%
associate-*r*71.2%
*-commutative71.2%
associate-*r*65.8%
count-265.8%
associate-*r*68.5%
*-commutative68.5%
associate-*r*71.2%
*-commutative71.2%
distribute-lft-out71.2%
metadata-eval71.2%
*-commutative71.2%
*-commutative71.2%
Simplified71.2%
Final simplification60.6%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI)) (t_1 (* (+ a b) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+20)
(*
(+ a b)
(* (- b a) (sin (* (* angle_m 0.005555555555555556) (* 2.0 PI)))))
(if (<= (/ angle_m 180.0) 1e+223)
(* t_1 (* 2.0 (* (cos t_0) (* angle_m (* PI 0.005555555555555556)))))
(* t_1 (* 2.0 (sin t_0))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double t_1 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = (a + b) * ((b - a) * sin(((angle_m * 0.005555555555555556) * (2.0 * ((double) M_PI)))));
} else if ((angle_m / 180.0) <= 1e+223) {
tmp = t_1 * (2.0 * (cos(t_0) * (angle_m * (((double) M_PI) * 0.005555555555555556))));
} else {
tmp = t_1 * (2.0 * sin(t_0));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
double t_1 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = (a + b) * ((b - a) * Math.sin(((angle_m * 0.005555555555555556) * (2.0 * Math.PI))));
} else if ((angle_m / 180.0) <= 1e+223) {
tmp = t_1 * (2.0 * (Math.cos(t_0) * (angle_m * (Math.PI * 0.005555555555555556))));
} else {
tmp = t_1 * (2.0 * Math.sin(t_0));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (angle_m / 180.0) * math.pi t_1 = (a + b) * (b - a) tmp = 0 if (angle_m / 180.0) <= 4e+20: tmp = (a + b) * ((b - a) * math.sin(((angle_m * 0.005555555555555556) * (2.0 * math.pi)))) elif (angle_m / 180.0) <= 1e+223: tmp = t_1 * (2.0 * (math.cos(t_0) * (angle_m * (math.pi * 0.005555555555555556)))) else: tmp = t_1 * (2.0 * math.sin(t_0)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) t_1 = Float64(Float64(a + b) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+20) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * 0.005555555555555556) * Float64(2.0 * pi))))); elseif (Float64(angle_m / 180.0) <= 1e+223) tmp = Float64(t_1 * Float64(2.0 * Float64(cos(t_0) * Float64(angle_m * Float64(pi * 0.005555555555555556))))); else tmp = Float64(t_1 * Float64(2.0 * sin(t_0))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (angle_m / 180.0) * pi; t_1 = (a + b) * (b - a); tmp = 0.0; if ((angle_m / 180.0) <= 4e+20) tmp = (a + b) * ((b - a) * sin(((angle_m * 0.005555555555555556) * (2.0 * pi)))); elseif ((angle_m / 180.0) <= 1e+223) tmp = t_1 * (2.0 * (cos(t_0) * (angle_m * (pi * 0.005555555555555556)))); else tmp = t_1 * (2.0 * sin(t_0)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+223], N[(t$95$1 * N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
t_1 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+223}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\cos t\_0 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \sin t\_0\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4e20Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares65.6%
Applied egg-rr65.6%
add-sqr-sqrt68.3%
pow268.3%
Applied egg-rr68.3%
pow168.3%
Applied egg-rr64.4%
unpow164.4%
associate-*r*74.4%
associate-*r*74.4%
Simplified74.4%
if 4e20 < (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000005e223Initial program 25.1%
associate-*l*25.1%
*-commutative25.1%
associate-*l*25.1%
Simplified25.1%
unpow225.1%
unpow225.1%
difference-of-squares27.2%
Applied egg-rr27.2%
Taylor expanded in angle around 0 38.3%
associate-*r*38.3%
*-commutative38.3%
associate-*r*38.3%
Simplified38.3%
if 1.00000000000000005e223 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.9%
associate-*l*24.9%
*-commutative24.9%
associate-*l*24.9%
Simplified24.9%
unpow224.9%
unpow224.9%
difference-of-squares24.9%
Applied egg-rr24.9%
Taylor expanded in angle around 0 41.5%
Final simplification66.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+20)
(*
(+ a b)
(* (- b a) (sin (* (* angle_m 0.005555555555555556) (* 2.0 PI)))))
(* (* (+ a b) (- b a)) (* 2.0 (sin (* (/ angle_m 180.0) PI)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = (a + b) * ((b - a) * sin(((angle_m * 0.005555555555555556) * (2.0 * ((double) M_PI)))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * sin(((angle_m / 180.0) * ((double) M_PI))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = (a + b) * ((b - a) * Math.sin(((angle_m * 0.005555555555555556) * (2.0 * Math.PI))));
} else {
tmp = ((a + b) * (b - a)) * (2.0 * Math.sin(((angle_m / 180.0) * Math.PI)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 4e+20: tmp = (a + b) * ((b - a) * math.sin(((angle_m * 0.005555555555555556) * (2.0 * math.pi)))) else: tmp = ((a + b) * (b - a)) * (2.0 * math.sin(((angle_m / 180.0) * math.pi))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+20) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * 0.005555555555555556) * Float64(2.0 * pi))))); else tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(2.0 * sin(Float64(Float64(angle_m / 180.0) * pi)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 4e+20) tmp = (a + b) * ((b - a) * sin(((angle_m * 0.005555555555555556) * (2.0 * pi)))); else tmp = ((a + b) * (b - a)) * (2.0 * sin(((angle_m / 180.0) * pi))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4e20Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares65.6%
Applied egg-rr65.6%
add-sqr-sqrt68.3%
pow268.3%
Applied egg-rr68.3%
pow168.3%
Applied egg-rr64.4%
unpow164.4%
associate-*r*74.4%
associate-*r*74.4%
Simplified74.4%
if 4e20 < (/.f64 angle #s(literal 180 binary64)) Initial program 25.1%
associate-*l*25.1%
*-commutative25.1%
associate-*l*25.1%
Simplified25.1%
unpow225.1%
unpow225.1%
difference-of-squares26.8%
Applied egg-rr26.8%
Taylor expanded in angle around 0 35.5%
Final simplification65.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+20)
(*
(+ a b)
(* (- b a) (sin (* (* angle_m 0.005555555555555556) (* 2.0 PI)))))
(*
2.0
(* (* (sin (* PI (* angle_m 0.005555555555555556))) (+ a b)) (- b a))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = (a + b) * ((b - a) * sin(((angle_m * 0.005555555555555556) * (2.0 * ((double) M_PI)))));
} else {
tmp = 2.0 * ((sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 4e+20) {
tmp = (a + b) * ((b - a) * Math.sin(((angle_m * 0.005555555555555556) * (2.0 * Math.PI))));
} else {
tmp = 2.0 * ((Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 4e+20: tmp = (a + b) * ((b - a) * math.sin(((angle_m * 0.005555555555555556) * (2.0 * math.pi)))) else: tmp = 2.0 * ((math.sin((math.pi * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+20) tmp = Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * 0.005555555555555556) * Float64(2.0 * pi))))); else tmp = Float64(2.0 * Float64(Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * Float64(a + b)) * Float64(b - a))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 4e+20) tmp = (a + b) * ((b - a) * sin(((angle_m * 0.005555555555555556) * (2.0 * pi)))); else tmp = 2.0 * ((sin((pi * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+20], N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(2.0 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+20}:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(2 \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4e20Initial program 61.9%
associate-*l*61.9%
*-commutative61.9%
associate-*l*61.9%
Simplified61.9%
unpow261.9%
unpow261.9%
difference-of-squares65.6%
Applied egg-rr65.6%
add-sqr-sqrt68.3%
pow268.3%
Applied egg-rr68.3%
pow168.3%
Applied egg-rr64.4%
unpow164.4%
associate-*r*74.4%
associate-*r*74.4%
Simplified74.4%
if 4e20 < (/.f64 angle #s(literal 180 binary64)) Initial program 25.1%
associate-*l*25.1%
*-commutative25.1%
associate-*l*25.1%
Simplified25.1%
unpow225.1%
unpow225.1%
difference-of-squares26.8%
Applied egg-rr26.8%
Taylor expanded in angle around inf 29.3%
associate-*r*29.3%
*-commutative29.3%
*-commutative29.3%
associate-*r*20.7%
associate-*r*20.7%
*-commutative20.7%
*-commutative20.7%
associate-*r*23.1%
Simplified23.1%
Taylor expanded in angle around 0 35.0%
Final simplification65.1%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sin (* 0.011111111111111112 (* angle_m PI)))))
(*
angle_s
(if (<= b 6.8e+99)
(* (* (+ a b) (- b a)) t_0)
(if (<= b 1.3e+155)
(* 0.011111111111111112 (* (* angle_m b) (* PI (- b a))))
(* b (* (- b a) t_0)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sin((0.011111111111111112 * (angle_m * ((double) M_PI))));
double tmp;
if (b <= 6.8e+99) {
tmp = ((a + b) * (b - a)) * t_0;
} else if (b <= 1.3e+155) {
tmp = 0.011111111111111112 * ((angle_m * b) * (((double) M_PI) * (b - a)));
} else {
tmp = b * ((b - a) * t_0);
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.sin((0.011111111111111112 * (angle_m * Math.PI)));
double tmp;
if (b <= 6.8e+99) {
tmp = ((a + b) * (b - a)) * t_0;
} else if (b <= 1.3e+155) {
tmp = 0.011111111111111112 * ((angle_m * b) * (Math.PI * (b - a)));
} else {
tmp = b * ((b - a) * t_0);
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.sin((0.011111111111111112 * (angle_m * math.pi))) tmp = 0 if b <= 6.8e+99: tmp = ((a + b) * (b - a)) * t_0 elif b <= 1.3e+155: tmp = 0.011111111111111112 * ((angle_m * b) * (math.pi * (b - a))) else: tmp = b * ((b - a) * t_0) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sin(Float64(0.011111111111111112 * Float64(angle_m * pi))) tmp = 0.0 if (b <= 6.8e+99) tmp = Float64(Float64(Float64(a + b) * Float64(b - a)) * t_0); elseif (b <= 1.3e+155) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * Float64(pi * Float64(b - a)))); else tmp = Float64(b * Float64(Float64(b - a) * t_0)); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = sin((0.011111111111111112 * (angle_m * pi))); tmp = 0.0; if (b <= 6.8e+99) tmp = ((a + b) * (b - a)) * t_0; elseif (b <= 1.3e+155) tmp = 0.011111111111111112 * ((angle_m * b) * (pi * (b - a))); else tmp = b * ((b - a) * t_0); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 6.8e+99], N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[b, 1.3e+155], N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(b - a), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 6.8 \cdot 10^{+99}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot t\_0\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{+155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(b - a\right) \cdot t\_0\right)\\
\end{array}
\end{array}
\end{array}
if b < 6.79999999999999968e99Initial program 57.9%
associate-*l*57.9%
*-commutative57.9%
associate-*l*57.9%
Simplified57.9%
unpow257.9%
unpow257.9%
difference-of-squares58.9%
Applied egg-rr58.9%
add-sqr-sqrt59.5%
pow259.5%
Applied egg-rr59.5%
pow159.5%
Applied egg-rr57.2%
unpow157.2%
*-commutative57.2%
*-commutative57.2%
associate-*r*58.4%
*-commutative58.4%
associate-*r*57.2%
count-257.2%
associate-*r*58.3%
*-commutative58.3%
associate-*r*58.4%
*-commutative58.4%
distribute-lft-out58.4%
metadata-eval58.4%
*-commutative58.4%
*-commutative58.4%
Simplified58.4%
if 6.79999999999999968e99 < b < 1.3000000000000001e155Initial program 38.4%
associate-*l*38.4%
*-commutative38.4%
associate-*l*38.4%
Simplified38.4%
unpow238.4%
unpow238.4%
difference-of-squares38.4%
Applied egg-rr38.4%
Taylor expanded in b around inf 48.9%
Taylor expanded in angle around 0 41.7%
associate-*r*47.0%
Simplified47.0%
if 1.3000000000000001e155 < b Initial program 36.8%
associate-*l*36.8%
*-commutative36.8%
associate-*l*36.8%
Simplified36.8%
unpow236.8%
unpow236.8%
difference-of-squares52.2%
Applied egg-rr52.2%
Taylor expanded in b around inf 54.8%
add-sqr-sqrt47.1%
sqrt-unprod49.7%
pow249.7%
Applied egg-rr49.7%
unpow249.7%
rem-sqrt-square49.7%
Simplified49.7%
pow149.7%
add-sqr-sqrt47.1%
fabs-sqr47.1%
add-sqr-sqrt54.8%
2-sin54.8%
div-inv52.2%
metadata-eval52.2%
Applied egg-rr52.2%
unpow152.2%
associate-*l*62.3%
associate-*r*67.5%
*-commutative67.5%
associate-*r*64.9%
count-264.9%
associate-*r*64.9%
*-commutative64.9%
associate-*r*67.5%
*-commutative67.5%
distribute-lft-out67.5%
metadata-eval67.5%
*-commutative67.5%
*-commutative67.5%
Simplified67.5%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= b 1.02e+155)
(* angle_m (* (* (+ a b) (- b a)) (* PI 0.011111111111111112)))
(* b (* (- b a) (sin (* 0.011111111111111112 (* angle_m PI))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 1.02e+155) {
tmp = angle_m * (((a + b) * (b - a)) * (((double) M_PI) * 0.011111111111111112));
} else {
tmp = b * ((b - a) * sin((0.011111111111111112 * (angle_m * ((double) M_PI)))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 1.02e+155) {
tmp = angle_m * (((a + b) * (b - a)) * (Math.PI * 0.011111111111111112));
} else {
tmp = b * ((b - a) * Math.sin((0.011111111111111112 * (angle_m * Math.PI))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if b <= 1.02e+155: tmp = angle_m * (((a + b) * (b - a)) * (math.pi * 0.011111111111111112)) else: tmp = b * ((b - a) * math.sin((0.011111111111111112 * (angle_m * math.pi)))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (b <= 1.02e+155) tmp = Float64(angle_m * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(pi * 0.011111111111111112))); else tmp = Float64(b * Float64(Float64(b - a) * sin(Float64(0.011111111111111112 * Float64(angle_m * pi))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (b <= 1.02e+155) tmp = angle_m * (((a + b) * (b - a)) * (pi * 0.011111111111111112)); else tmp = b * ((b - a) * sin((0.011111111111111112 * (angle_m * pi)))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 1.02e+155], N[(angle$95$m * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 1.02 \cdot 10^{+155}:\\
\;\;\;\;angle\_m \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(b - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.02e155Initial program 56.2%
associate-*l*56.2%
*-commutative56.2%
associate-*l*56.2%
Simplified56.2%
unpow256.2%
unpow256.2%
difference-of-squares57.2%
Applied egg-rr57.2%
Taylor expanded in angle around 0 36.1%
fma-define36.1%
+-commutative36.1%
*-commutative36.1%
+-commutative36.1%
distribute-rgt-out36.1%
Simplified36.1%
Taylor expanded in angle around 0 54.9%
associate-*r*55.0%
Simplified55.0%
if 1.02e155 < b Initial program 36.8%
associate-*l*36.8%
*-commutative36.8%
associate-*l*36.8%
Simplified36.8%
unpow236.8%
unpow236.8%
difference-of-squares52.2%
Applied egg-rr52.2%
Taylor expanded in b around inf 54.8%
add-sqr-sqrt47.1%
sqrt-unprod49.7%
pow249.7%
Applied egg-rr49.7%
unpow249.7%
rem-sqrt-square49.7%
Simplified49.7%
pow149.7%
add-sqr-sqrt47.1%
fabs-sqr47.1%
add-sqr-sqrt54.8%
2-sin54.8%
div-inv52.2%
metadata-eval52.2%
Applied egg-rr52.2%
unpow152.2%
associate-*l*62.3%
associate-*r*67.5%
*-commutative67.5%
associate-*r*64.9%
count-264.9%
associate-*r*64.9%
*-commutative64.9%
associate-*r*67.5%
*-commutative67.5%
distribute-lft-out67.5%
metadata-eval67.5%
*-commutative67.5%
*-commutative67.5%
Simplified67.5%
Final simplification56.9%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 2.0 (* (* (sin (* PI (* angle_m 0.005555555555555556))) (+ a b)) (- b a)))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * ((sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a)));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (2.0 * ((Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a)));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (2.0 * ((math.sin((math.pi * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a)))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(2.0 * Float64(Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * Float64(a + b)) * Float64(b - a)))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (2.0 * ((sin((pi * (angle_m * 0.005555555555555556))) * (a + b)) * (b - a))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(2 \cdot \left(\left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\right)
\end{array}
Initial program 53.3%
associate-*l*53.3%
*-commutative53.3%
associate-*l*53.3%
Simplified53.3%
unpow253.3%
unpow253.3%
difference-of-squares56.5%
Applied egg-rr56.5%
Taylor expanded in angle around inf 56.9%
associate-*r*56.9%
*-commutative56.9%
*-commutative56.9%
associate-*r*55.9%
associate-*r*63.6%
*-commutative63.6%
*-commutative63.6%
associate-*r*62.4%
Simplified62.4%
Taylor expanded in angle around 0 63.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= b 2.9e+149)
(* angle_m (* (* (+ a b) (- b a)) (* PI 0.011111111111111112)))
(* 0.011111111111111112 (* (* angle_m b) (* PI (- b a)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 2.9e+149) {
tmp = angle_m * (((a + b) * (b - a)) * (((double) M_PI) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * ((angle_m * b) * (((double) M_PI) * (b - a)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 2.9e+149) {
tmp = angle_m * (((a + b) * (b - a)) * (Math.PI * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * ((angle_m * b) * (Math.PI * (b - a)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if b <= 2.9e+149: tmp = angle_m * (((a + b) * (b - a)) * (math.pi * 0.011111111111111112)) else: tmp = 0.011111111111111112 * ((angle_m * b) * (math.pi * (b - a))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (b <= 2.9e+149) tmp = Float64(angle_m * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(pi * 0.011111111111111112))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * Float64(pi * Float64(b - a)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (b <= 2.9e+149) tmp = angle_m * (((a + b) * (b - a)) * (pi * 0.011111111111111112)); else tmp = 0.011111111111111112 * ((angle_m * b) * (pi * (b - a))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 2.9e+149], N[(angle$95$m * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.9 \cdot 10^{+149}:\\
\;\;\;\;angle\_m \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.9000000000000002e149Initial program 56.7%
associate-*l*56.7%
*-commutative56.7%
associate-*l*56.7%
Simplified56.7%
unpow256.7%
unpow256.7%
difference-of-squares57.7%
Applied egg-rr57.7%
Taylor expanded in angle around 0 36.4%
fma-define36.4%
+-commutative36.4%
*-commutative36.4%
+-commutative36.4%
distribute-rgt-out36.4%
Simplified36.4%
Taylor expanded in angle around 0 55.3%
associate-*r*55.4%
Simplified55.4%
if 2.9000000000000002e149 < b Initial program 35.1%
associate-*l*35.1%
*-commutative35.1%
associate-*l*35.1%
Simplified35.1%
unpow235.1%
unpow235.1%
difference-of-squares49.8%
Applied egg-rr49.8%
Taylor expanded in b around inf 52.2%
Taylor expanded in angle around 0 52.7%
associate-*r*68.7%
Simplified68.7%
Final simplification57.5%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= b 2.5e+117)
(* angle_m (* 0.011111111111111112 (* PI (* (+ a b) (- b a)))))
(* 0.011111111111111112 (* (* angle_m b) (* PI (- b a)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 2.5e+117) {
tmp = angle_m * (0.011111111111111112 * (((double) M_PI) * ((a + b) * (b - a))));
} else {
tmp = 0.011111111111111112 * ((angle_m * b) * (((double) M_PI) * (b - a)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 2.5e+117) {
tmp = angle_m * (0.011111111111111112 * (Math.PI * ((a + b) * (b - a))));
} else {
tmp = 0.011111111111111112 * ((angle_m * b) * (Math.PI * (b - a)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if b <= 2.5e+117: tmp = angle_m * (0.011111111111111112 * (math.pi * ((a + b) * (b - a)))) else: tmp = 0.011111111111111112 * ((angle_m * b) * (math.pi * (b - a))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (b <= 2.5e+117) tmp = Float64(angle_m * Float64(0.011111111111111112 * Float64(pi * Float64(Float64(a + b) * Float64(b - a))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * Float64(pi * Float64(b - a)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (b <= 2.5e+117) tmp = angle_m * (0.011111111111111112 * (pi * ((a + b) * (b - a)))); else tmp = 0.011111111111111112 * ((angle_m * b) * (pi * (b - a))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 2.5e+117], N[(angle$95$m * N[(0.011111111111111112 * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.5 \cdot 10^{+117}:\\
\;\;\;\;angle\_m \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.49999999999999992e117Initial program 57.5%
associate-*l*57.5%
*-commutative57.5%
associate-*l*57.5%
Simplified57.5%
unpow257.5%
unpow257.5%
difference-of-squares58.6%
Applied egg-rr58.6%
Taylor expanded in angle around 0 36.9%
fma-define36.9%
+-commutative36.9%
*-commutative36.9%
+-commutative36.9%
distribute-rgt-out36.9%
Simplified36.9%
Taylor expanded in angle around 0 56.2%
if 2.49999999999999992e117 < b Initial program 36.7%
associate-*l*36.7%
*-commutative36.7%
associate-*l*36.7%
Simplified36.7%
unpow236.7%
unpow236.7%
difference-of-squares48.3%
Applied egg-rr48.3%
Taylor expanded in b around inf 50.2%
Taylor expanded in angle around 0 49.8%
associate-*r*62.4%
Simplified62.4%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= b 4.1e+117)
(* 0.011111111111111112 (* angle_m (* PI (* (+ a b) (- b a)))))
(* 0.011111111111111112 (* (* angle_m b) (* PI (- b a)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 4.1e+117) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((a + b) * (b - a))));
} else {
tmp = 0.011111111111111112 * ((angle_m * b) * (((double) M_PI) * (b - a)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 4.1e+117) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((a + b) * (b - a))));
} else {
tmp = 0.011111111111111112 * ((angle_m * b) * (Math.PI * (b - a)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if b <= 4.1e+117: tmp = 0.011111111111111112 * (angle_m * (math.pi * ((a + b) * (b - a)))) else: tmp = 0.011111111111111112 * ((angle_m * b) * (math.pi * (b - a))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (b <= 4.1e+117) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(a + b) * Float64(b - a))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * Float64(pi * Float64(b - a)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (b <= 4.1e+117) tmp = 0.011111111111111112 * (angle_m * (pi * ((a + b) * (b - a)))); else tmp = 0.011111111111111112 * ((angle_m * b) * (pi * (b - a))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 4.1e+117], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 4.1 \cdot 10^{+117}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if b < 4.0999999999999999e117Initial program 57.5%
Taylor expanded in angle around 0 55.2%
unpow257.5%
unpow257.5%
difference-of-squares58.6%
Applied egg-rr55.8%
if 4.0999999999999999e117 < b Initial program 36.7%
associate-*l*36.7%
*-commutative36.7%
associate-*l*36.7%
Simplified36.7%
unpow236.7%
unpow236.7%
difference-of-squares48.3%
Applied egg-rr48.3%
Taylor expanded in b around inf 50.2%
Taylor expanded in angle around 0 49.8%
associate-*r*62.4%
Simplified62.4%
Final simplification57.1%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* (* angle_m b) (* PI (- b a))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * ((angle_m * b) * (((double) M_PI) * (b - a))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * ((angle_m * b) * (Math.PI * (b - a))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (0.011111111111111112 * ((angle_m * b) * (math.pi * (b - a))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(angle_m * b) * Float64(pi * Float64(b - a))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (0.011111111111111112 * ((angle_m * b) * (pi * (b - a)))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(angle$95$m * b), $MachinePrecision] * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(\left(angle\_m \cdot b\right) \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)
\end{array}
Initial program 53.3%
associate-*l*53.3%
*-commutative53.3%
associate-*l*53.3%
Simplified53.3%
unpow253.3%
unpow253.3%
difference-of-squares56.5%
Applied egg-rr56.5%
Taylor expanded in b around inf 38.9%
Taylor expanded in angle around 0 39.7%
associate-*r*42.7%
Simplified42.7%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* b (* PI (- b a)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (b * (((double) M_PI) * (b - a)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (b * (Math.PI * (b - a)))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (0.011111111111111112 * (angle_m * (b * (math.pi * (b - a)))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(b * Float64(pi * Float64(b - a)))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * (b * (pi * (b - a))))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(b * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\right)
\end{array}
Initial program 53.3%
associate-*l*53.3%
*-commutative53.3%
associate-*l*53.3%
Simplified53.3%
unpow253.3%
unpow253.3%
difference-of-squares56.5%
Applied egg-rr56.5%
Taylor expanded in b around inf 38.9%
Taylor expanded in angle around 0 39.7%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s 0.0))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * 0.0;
}
angle\_m = abs(angle)
angle\_s = copysign(1.0d0, angle)
real(8) function code(angle_s, a, b, angle_m)
real(8), intent (in) :: angle_s
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle_m
code = angle_s * 0.0d0
end function
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * 0.0;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * 0.0
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * 0.0) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * 0.0; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * 0.0), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot 0
\end{array}
Initial program 53.3%
expm1-log1p-u36.4%
expm1-undefine23.4%
Applied egg-rr22.9%
Taylor expanded in angle around 0 11.8%
metadata-eval11.8%
Applied egg-rr11.8%
herbie shell --seed 2024146
(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)))))