
(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 18 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 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* PI 0.005555555555555556)))
(t_1 (sin (/ (* angle_m PI) 180.0))))
(*
angle_s
(if (<= (pow a 2.0) 2e+218)
(* 2.0 (* (+ a b) (* (- b a) (* (cos t_0) t_1))))
(* 2.0 (* (+ a b) (* (- b a) (* t_1 (cos (expm1 (log1p 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 * (((double) M_PI) * 0.005555555555555556);
double t_1 = sin(((angle_m * ((double) M_PI)) / 180.0));
double tmp;
if (pow(a, 2.0) <= 2e+218) {
tmp = 2.0 * ((a + b) * ((b - a) * (cos(t_0) * t_1)));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * (t_1 * cos(expm1(log1p(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 * (Math.PI * 0.005555555555555556);
double t_1 = Math.sin(((angle_m * Math.PI) / 180.0));
double tmp;
if (Math.pow(a, 2.0) <= 2e+218) {
tmp = 2.0 * ((a + b) * ((b - a) * (Math.cos(t_0) * t_1)));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * (t_1 * Math.cos(Math.expm1(Math.log1p(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 * (math.pi * 0.005555555555555556) t_1 = math.sin(((angle_m * math.pi) / 180.0)) tmp = 0 if math.pow(a, 2.0) <= 2e+218: tmp = 2.0 * ((a + b) * ((b - a) * (math.cos(t_0) * t_1))) else: tmp = 2.0 * ((a + b) * ((b - a) * (t_1 * math.cos(math.expm1(math.log1p(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(angle_m * Float64(pi * 0.005555555555555556)) t_1 = sin(Float64(Float64(angle_m * pi) / 180.0)) tmp = 0.0 if ((a ^ 2.0) <= 2e+218) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(cos(t_0) * t_1)))); else tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(t_1 * cos(expm1(log1p(t_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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e+218], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[Cos[N[(Exp[N[Log[1 + t$95$0], $MachinePrecision]] - 1), $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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_1 := \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+218}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos t\_0 \cdot t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(t\_1 \cdot \cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(t\_0\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a 2) < 2.00000000000000017e218Initial program 57.3%
Simplified56.8%
unpow256.8%
unpow256.8%
difference-of-squares56.8%
Applied egg-rr56.8%
add-log-exp28.8%
associate-*l*28.8%
exp-prod27.3%
*-commutative27.3%
Applied egg-rr27.8%
log-pow27.9%
+-commutative27.9%
rem-log-exp62.5%
*-commutative62.5%
associate-*r*61.4%
*-commutative61.4%
associate-*r*62.7%
associate-*r*61.9%
*-commutative61.9%
associate-*r*62.8%
Simplified62.8%
associate-*r*61.9%
metadata-eval61.9%
div-inv63.0%
Applied egg-rr63.0%
if 2.00000000000000017e218 < (pow.f64 a 2) Initial program 40.9%
Simplified44.4%
unpow244.4%
unpow244.4%
difference-of-squares52.8%
Applied egg-rr52.8%
add-log-exp42.7%
associate-*l*42.7%
exp-prod40.9%
*-commutative40.9%
Applied egg-rr38.5%
log-pow38.5%
+-commutative38.5%
rem-log-exp67.8%
*-commutative67.8%
associate-*r*66.7%
*-commutative66.7%
associate-*r*68.2%
associate-*r*70.1%
*-commutative70.1%
associate-*r*67.9%
Simplified67.9%
associate-*r*70.1%
metadata-eval70.1%
div-inv71.6%
Applied egg-rr71.6%
expm1-log1p-u67.7%
expm1-undefine68.9%
Applied egg-rr68.9%
expm1-define67.7%
Simplified67.7%
Final simplification64.6%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* PI 0.005555555555555556))))
(*
angle_s
(if (<= (pow a 2.0) 2e+218)
(* 2.0 (* (+ a b) (* (cos t_0) (* (- b a) (sin t_0)))))
(* 2.0 (* (+ a b) (* (- b a) (sin (/ (* angle_m PI) 180.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 * (((double) M_PI) * 0.005555555555555556);
double tmp;
if (pow(a, 2.0) <= 2e+218) {
tmp = 2.0 * ((a + b) * (cos(t_0) * ((b - a) * sin(t_0))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * sin(((angle_m * ((double) M_PI)) / 180.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 * (Math.PI * 0.005555555555555556);
double tmp;
if (Math.pow(a, 2.0) <= 2e+218) {
tmp = 2.0 * ((a + b) * (Math.cos(t_0) * ((b - a) * Math.sin(t_0))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * Math.sin(((angle_m * Math.PI) / 180.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 * (math.pi * 0.005555555555555556) tmp = 0 if math.pow(a, 2.0) <= 2e+218: tmp = 2.0 * ((a + b) * (math.cos(t_0) * ((b - a) * math.sin(t_0)))) else: tmp = 2.0 * ((a + b) * ((b - a) * math.sin(((angle_m * math.pi) / 180.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(angle_m * Float64(pi * 0.005555555555555556)) tmp = 0.0 if ((a ^ 2.0) <= 2e+218) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(cos(t_0) * Float64(Float64(b - a) * sin(t_0))))); else tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * pi) / 180.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 * (pi * 0.005555555555555556); tmp = 0.0; if ((a ^ 2.0) <= 2e+218) tmp = 2.0 * ((a + b) * (cos(t_0) * ((b - a) * sin(t_0)))); else tmp = 2.0 * ((a + b) * ((b - a) * sin(((angle_m * pi) / 180.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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e+218], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+218}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\cos t\_0 \cdot \left(\left(b - a\right) \cdot \sin t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a 2) < 2.00000000000000017e218Initial program 57.3%
Simplified56.8%
unpow256.8%
unpow256.8%
difference-of-squares56.8%
Applied egg-rr56.8%
add-log-exp28.8%
associate-*l*28.8%
exp-prod27.3%
*-commutative27.3%
Applied egg-rr27.8%
log-pow27.9%
+-commutative27.9%
rem-log-exp62.5%
*-commutative62.5%
associate-*r*61.4%
*-commutative61.4%
associate-*r*62.7%
associate-*r*61.9%
*-commutative61.9%
associate-*r*62.8%
Simplified62.8%
Taylor expanded in b around 0 62.1%
+-commutative62.1%
*-commutative62.1%
*-commutative62.1%
*-commutative62.1%
associate-*r*61.1%
*-commutative61.1%
associate-*r*62.7%
mul-1-neg62.7%
Simplified62.8%
if 2.00000000000000017e218 < (pow.f64 a 2) Initial program 40.9%
Simplified44.4%
unpow244.4%
unpow244.4%
difference-of-squares52.8%
Applied egg-rr52.8%
add-log-exp42.7%
associate-*l*42.7%
exp-prod40.9%
*-commutative40.9%
Applied egg-rr38.5%
log-pow38.5%
+-commutative38.5%
rem-log-exp67.8%
*-commutative67.8%
associate-*r*66.7%
*-commutative66.7%
associate-*r*68.2%
associate-*r*70.1%
*-commutative70.1%
associate-*r*67.9%
Simplified67.9%
associate-*r*70.1%
metadata-eval70.1%
div-inv71.6%
Applied egg-rr71.6%
Taylor expanded in angle around 0 75.6%
Final simplification67.1%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* PI 0.005555555555555556))))
(*
angle_s
(if (<= (pow a 2.0) 2e+218)
(* 2.0 (* (+ a b) (* (- b a) (* (cos t_0) (sin t_0)))))
(* 2.0 (* (+ a b) (* (- b a) (sin (/ (* angle_m PI) 180.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 * (((double) M_PI) * 0.005555555555555556);
double tmp;
if (pow(a, 2.0) <= 2e+218) {
tmp = 2.0 * ((a + b) * ((b - a) * (cos(t_0) * sin(t_0))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * sin(((angle_m * ((double) M_PI)) / 180.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 * (Math.PI * 0.005555555555555556);
double tmp;
if (Math.pow(a, 2.0) <= 2e+218) {
tmp = 2.0 * ((a + b) * ((b - a) * (Math.cos(t_0) * Math.sin(t_0))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * Math.sin(((angle_m * Math.PI) / 180.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 * (math.pi * 0.005555555555555556) tmp = 0 if math.pow(a, 2.0) <= 2e+218: tmp = 2.0 * ((a + b) * ((b - a) * (math.cos(t_0) * math.sin(t_0)))) else: tmp = 2.0 * ((a + b) * ((b - a) * math.sin(((angle_m * math.pi) / 180.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(angle_m * Float64(pi * 0.005555555555555556)) tmp = 0.0 if ((a ^ 2.0) <= 2e+218) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(cos(t_0) * sin(t_0))))); else tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * pi) / 180.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 * (pi * 0.005555555555555556); tmp = 0.0; if ((a ^ 2.0) <= 2e+218) tmp = 2.0 * ((a + b) * ((b - a) * (cos(t_0) * sin(t_0)))); else tmp = 2.0 * ((a + b) * ((b - a) * sin(((angle_m * pi) / 180.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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 2e+218], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 2 \cdot 10^{+218}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos t\_0 \cdot \sin t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a 2) < 2.00000000000000017e218Initial program 57.3%
Simplified56.8%
unpow256.8%
unpow256.8%
difference-of-squares56.8%
Applied egg-rr56.8%
add-log-exp28.8%
associate-*l*28.8%
exp-prod27.3%
*-commutative27.3%
Applied egg-rr27.8%
log-pow27.9%
+-commutative27.9%
rem-log-exp62.5%
*-commutative62.5%
associate-*r*61.4%
*-commutative61.4%
associate-*r*62.7%
associate-*r*61.9%
*-commutative61.9%
associate-*r*62.8%
Simplified62.8%
if 2.00000000000000017e218 < (pow.f64 a 2) Initial program 40.9%
Simplified44.4%
unpow244.4%
unpow244.4%
difference-of-squares52.8%
Applied egg-rr52.8%
add-log-exp42.7%
associate-*l*42.7%
exp-prod40.9%
*-commutative40.9%
Applied egg-rr38.5%
log-pow38.5%
+-commutative38.5%
rem-log-exp67.8%
*-commutative67.8%
associate-*r*66.7%
*-commutative66.7%
associate-*r*68.2%
associate-*r*70.1%
*-commutative70.1%
associate-*r*67.9%
Simplified67.9%
associate-*r*70.1%
metadata-eval70.1%
div-inv71.6%
Applied egg-rr71.6%
Taylor expanded in angle around 0 75.6%
Final simplification67.1%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle_m PI))))
(*
angle_s
(if (<= (pow a 2.0) 5e-114)
(* 2.0 (* (+ a b) (* b (* (sin t_0) (cos t_0)))))
(* 2.0 (* (+ a b) (* (- b a) (sin (/ (* angle_m PI) 180.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 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double tmp;
if (pow(a, 2.0) <= 5e-114) {
tmp = 2.0 * ((a + b) * (b * (sin(t_0) * cos(t_0))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * sin(((angle_m * ((double) M_PI)) / 180.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 = 0.005555555555555556 * (angle_m * Math.PI);
double tmp;
if (Math.pow(a, 2.0) <= 5e-114) {
tmp = 2.0 * ((a + b) * (b * (Math.sin(t_0) * Math.cos(t_0))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * Math.sin(((angle_m * Math.PI) / 180.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 = 0.005555555555555556 * (angle_m * math.pi) tmp = 0 if math.pow(a, 2.0) <= 5e-114: tmp = 2.0 * ((a + b) * (b * (math.sin(t_0) * math.cos(t_0)))) else: tmp = 2.0 * ((a + b) * ((b - a) * math.sin(((angle_m * math.pi) / 180.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(0.005555555555555556 * Float64(angle_m * pi)) tmp = 0.0 if ((a ^ 2.0) <= 5e-114) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(b * Float64(sin(t_0) * cos(t_0))))); else tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * pi) / 180.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 = 0.005555555555555556 * (angle_m * pi); tmp = 0.0; if ((a ^ 2.0) <= 5e-114) tmp = 2.0 * ((a + b) * (b * (sin(t_0) * cos(t_0)))); else tmp = 2.0 * ((a + b) * ((b - a) * sin(((angle_m * pi) / 180.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[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e-114], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.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 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{-114}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(b \cdot \left(\sin t\_0 \cdot \cos t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a 2) < 4.99999999999999989e-114Initial program 57.1%
Simplified56.1%
unpow256.1%
unpow256.1%
difference-of-squares56.1%
Applied egg-rr56.1%
add-log-exp34.8%
associate-*l*34.8%
exp-prod34.0%
*-commutative34.0%
Applied egg-rr34.8%
log-pow35.1%
+-commutative35.1%
rem-log-exp63.9%
*-commutative63.9%
associate-*r*61.7%
*-commutative61.7%
associate-*r*63.7%
associate-*r*62.2%
*-commutative62.2%
associate-*r*63.7%
Simplified63.7%
Taylor expanded in b around inf 61.5%
if 4.99999999999999989e-114 < (pow.f64 a 2) Initial program 48.0%
Simplified50.2%
unpow250.2%
unpow250.2%
difference-of-squares55.0%
Applied egg-rr55.0%
add-log-exp32.4%
associate-*l*32.4%
exp-prod30.3%
*-commutative30.3%
Applied egg-rr28.8%
log-pow28.8%
+-commutative28.8%
rem-log-exp64.5%
*-commutative64.5%
associate-*r*64.2%
*-commutative64.2%
associate-*r*65.1%
associate-*r*66.4%
*-commutative66.4%
associate-*r*65.2%
Simplified65.2%
associate-*r*66.4%
metadata-eval66.4%
div-inv67.3%
Applied egg-rr67.3%
Taylor expanded in angle around 0 66.5%
Final simplification64.4%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-13)
(* 2.0 (* (+ a b) (* (* angle_m 0.005555555555555556) (* (- b a) PI))))
(if (<= (/ angle_m 180.0) 5e+95)
(*
2.0
(*
(cos (* (* angle_m PI) -0.005555555555555556))
(* t_0 (sin (* 0.005555555555555556 (* angle_m PI))))))
(* 2.0 (* t_0 (sin (* PI (/ angle_m 180.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 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 2e-13) {
tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 5e+95) {
tmp = 2.0 * (cos(((angle_m * ((double) M_PI)) * -0.005555555555555556)) * (t_0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = 2.0 * (t_0 * sin((((double) M_PI) * (angle_m / 180.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 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 2e-13) {
tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * Math.PI)));
} else if ((angle_m / 180.0) <= 5e+95) {
tmp = 2.0 * (Math.cos(((angle_m * Math.PI) * -0.005555555555555556)) * (t_0 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = 2.0 * (t_0 * Math.sin((Math.PI * (angle_m / 180.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 = (a + b) * (b - a) tmp = 0 if (angle_m / 180.0) <= 2e-13: tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * math.pi))) elif (angle_m / 180.0) <= 5e+95: tmp = 2.0 * (math.cos(((angle_m * math.pi) * -0.005555555555555556)) * (t_0 * math.sin((0.005555555555555556 * (angle_m * math.pi))))) else: tmp = 2.0 * (t_0 * math.sin((math.pi * (angle_m / 180.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(a + b) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-13) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(angle_m * 0.005555555555555556) * Float64(Float64(b - a) * pi)))); elseif (Float64(angle_m / 180.0) <= 5e+95) tmp = Float64(2.0 * Float64(cos(Float64(Float64(angle_m * pi) * -0.005555555555555556)) * Float64(t_0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = Float64(2.0 * Float64(t_0 * sin(Float64(pi * Float64(angle_m / 180.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 = (a + b) * (b - a); tmp = 0.0; if ((angle_m / 180.0) <= 2e-13) tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * pi))); elseif ((angle_m / 180.0) <= 5e+95) tmp = 2.0 * (cos(((angle_m * pi) * -0.005555555555555556)) * (t_0 * sin((0.005555555555555556 * (angle_m * pi))))); else tmp = 2.0 * (t_0 * sin((pi * (angle_m / 180.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[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-13], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+95], N[(2.0 * N[(N[Cos[N[(N[(angle$95$m * Pi), $MachinePrecision] * -0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[Sin[N[(Pi * N[(angle$95$m / 180.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 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-13}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+95}:\\
\;\;\;\;2 \cdot \left(\cos \left(\left(angle\_m \cdot \pi\right) \cdot -0.005555555555555556\right) \cdot \left(t\_0 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 2.0000000000000001e-13Initial program 60.4%
Simplified61.8%
unpow261.8%
unpow261.8%
difference-of-squares65.7%
Applied egg-rr65.7%
add-log-exp38.5%
associate-*l*38.5%
exp-prod36.3%
*-commutative36.3%
Applied egg-rr35.7%
log-pow35.9%
+-commutative35.9%
rem-log-exp78.5%
*-commutative78.5%
associate-*r*77.7%
*-commutative77.7%
associate-*r*78.1%
associate-*r*78.8%
*-commutative78.8%
associate-*r*78.6%
Simplified78.6%
associate-*r*78.8%
metadata-eval78.8%
div-inv78.7%
Applied egg-rr78.7%
Taylor expanded in angle around 0 69.3%
associate-*r*69.3%
Simplified69.3%
if 2.0000000000000001e-13 < (/.f64 angle 180) < 5.00000000000000025e95Initial program 44.1%
Simplified40.7%
unpow240.7%
unpow240.7%
difference-of-squares40.7%
Applied egg-rr40.7%
Taylor expanded in angle around inf 48.5%
if 5.00000000000000025e95 < (/.f64 angle 180) Initial program 23.3%
Simplified24.3%
unpow224.3%
unpow224.3%
difference-of-squares24.3%
Applied egg-rr24.3%
Taylor expanded in angle around 0 32.2%
Final simplification60.3%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (/ PI -180.0))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-50)
(* 2.0 (* (+ a b) (* (* angle_m 0.005555555555555556) (* (- b a) PI))))
(if (<= (/ angle_m 180.0) 4e+96)
(* 2.0 (* (cos t_0) (* (sin t_0) (* (+ a b) (- a b)))))
(* 2.0 (* (* (+ a b) (- b a)) (sin (* PI (/ angle_m 180.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 * (((double) M_PI) / -180.0);
double tmp;
if ((angle_m / 180.0) <= 1e-50) {
tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 4e+96) {
tmp = 2.0 * (cos(t_0) * (sin(t_0) * ((a + b) * (a - b))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * sin((((double) M_PI) * (angle_m / 180.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 * (Math.PI / -180.0);
double tmp;
if ((angle_m / 180.0) <= 1e-50) {
tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * Math.PI)));
} else if ((angle_m / 180.0) <= 4e+96) {
tmp = 2.0 * (Math.cos(t_0) * (Math.sin(t_0) * ((a + b) * (a - b))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * Math.sin((Math.PI * (angle_m / 180.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 * (math.pi / -180.0) tmp = 0 if (angle_m / 180.0) <= 1e-50: tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * math.pi))) elif (angle_m / 180.0) <= 4e+96: tmp = 2.0 * (math.cos(t_0) * (math.sin(t_0) * ((a + b) * (a - b)))) else: tmp = 2.0 * (((a + b) * (b - a)) * math.sin((math.pi * (angle_m / 180.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(angle_m * Float64(pi / -180.0)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-50) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(angle_m * 0.005555555555555556) * Float64(Float64(b - a) * pi)))); elseif (Float64(angle_m / 180.0) <= 4e+96) tmp = Float64(2.0 * Float64(cos(t_0) * Float64(sin(t_0) * Float64(Float64(a + b) * Float64(a - b))))); else tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * sin(Float64(pi * Float64(angle_m / 180.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 * (pi / -180.0); tmp = 0.0; if ((angle_m / 180.0) <= 1e-50) tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * pi))); elseif ((angle_m / 180.0) <= 4e+96) tmp = 2.0 * (cos(t_0) * (sin(t_0) * ((a + b) * (a - b)))); else tmp = 2.0 * (((a + b) * (b - a)) * sin((pi * (angle_m / 180.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[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-50], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+96], N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m / 180.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 := angle\_m \cdot \frac{\pi}{-180}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-50}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+96}:\\
\;\;\;\;2 \cdot \left(\cos t\_0 \cdot \left(\sin t\_0 \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 1.00000000000000001e-50Initial program 59.0%
Simplified60.4%
unpow260.4%
unpow260.4%
difference-of-squares63.9%
Applied egg-rr63.9%
add-log-exp37.6%
associate-*l*37.6%
exp-prod35.7%
*-commutative35.7%
Applied egg-rr35.1%
log-pow35.3%
+-commutative35.3%
rem-log-exp77.4%
*-commutative77.4%
associate-*r*76.6%
*-commutative76.6%
associate-*r*76.9%
associate-*r*77.7%
*-commutative77.7%
associate-*r*77.5%
Simplified77.5%
associate-*r*77.7%
metadata-eval77.7%
div-inv77.6%
Applied egg-rr77.6%
Taylor expanded in angle around 0 67.7%
associate-*r*67.7%
Simplified67.7%
if 1.00000000000000001e-50 < (/.f64 angle 180) < 4.0000000000000002e96Initial program 55.8%
Simplified56.5%
unpow256.5%
unpow256.5%
difference-of-squares59.4%
Applied egg-rr59.4%
if 4.0000000000000002e96 < (/.f64 angle 180) Initial program 23.3%
Simplified24.3%
unpow224.3%
unpow224.3%
difference-of-squares24.3%
Applied egg-rr24.3%
Taylor expanded in angle around 0 32.2%
Final simplification60.0%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (+ a b) (- b a))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e-14)
(* 2.0 (* (+ a b) (* (* angle_m 0.005555555555555556) (* (- b a) PI))))
(if (<= (/ angle_m 180.0) 5e+95)
(*
2.0
(*
t_0
(* (sin (/ (* angle_m PI) 180.0)) (cos (/ (* angle_m PI) -180.0)))))
(* 2.0 (* t_0 (sin (* PI (/ angle_m 180.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 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 1e-14) {
tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * ((double) M_PI))));
} else if ((angle_m / 180.0) <= 5e+95) {
tmp = 2.0 * (t_0 * (sin(((angle_m * ((double) M_PI)) / 180.0)) * cos(((angle_m * ((double) M_PI)) / -180.0))));
} else {
tmp = 2.0 * (t_0 * sin((((double) M_PI) * (angle_m / 180.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 = (a + b) * (b - a);
double tmp;
if ((angle_m / 180.0) <= 1e-14) {
tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * Math.PI)));
} else if ((angle_m / 180.0) <= 5e+95) {
tmp = 2.0 * (t_0 * (Math.sin(((angle_m * Math.PI) / 180.0)) * Math.cos(((angle_m * Math.PI) / -180.0))));
} else {
tmp = 2.0 * (t_0 * Math.sin((Math.PI * (angle_m / 180.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 = (a + b) * (b - a) tmp = 0 if (angle_m / 180.0) <= 1e-14: tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * math.pi))) elif (angle_m / 180.0) <= 5e+95: tmp = 2.0 * (t_0 * (math.sin(((angle_m * math.pi) / 180.0)) * math.cos(((angle_m * math.pi) / -180.0)))) else: tmp = 2.0 * (t_0 * math.sin((math.pi * (angle_m / 180.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(a + b) * Float64(b - a)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e-14) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(angle_m * 0.005555555555555556) * Float64(Float64(b - a) * pi)))); elseif (Float64(angle_m / 180.0) <= 5e+95) tmp = Float64(2.0 * Float64(t_0 * Float64(sin(Float64(Float64(angle_m * pi) / 180.0)) * cos(Float64(Float64(angle_m * pi) / -180.0))))); else tmp = Float64(2.0 * Float64(t_0 * sin(Float64(pi * Float64(angle_m / 180.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 = (a + b) * (b - a); tmp = 0.0; if ((angle_m / 180.0) <= 1e-14) tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * pi))); elseif ((angle_m / 180.0) <= 5e+95) tmp = 2.0 * (t_0 * (sin(((angle_m * pi) / 180.0)) * cos(((angle_m * pi) / -180.0)))); else tmp = 2.0 * (t_0 * sin((pi * (angle_m / 180.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[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e-14], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+95], N[(2.0 * N[(t$95$0 * N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(angle$95$m * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[Sin[N[(Pi * N[(angle$95$m / 180.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 := \left(a + b\right) \cdot \left(b - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{-14}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+95}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \left(\sin \left(\frac{angle\_m \cdot \pi}{180}\right) \cdot \cos \left(\frac{angle\_m \cdot \pi}{-180}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle 180) < 9.99999999999999999e-15Initial program 60.2%
Simplified61.6%
unpow261.6%
unpow261.6%
difference-of-squares65.5%
Applied egg-rr65.5%
add-log-exp38.7%
associate-*l*38.7%
exp-prod36.4%
*-commutative36.4%
Applied egg-rr35.9%
log-pow36.0%
+-commutative36.0%
rem-log-exp78.4%
*-commutative78.4%
associate-*r*77.6%
*-commutative77.6%
associate-*r*78.0%
associate-*r*78.7%
*-commutative78.7%
associate-*r*78.5%
Simplified78.5%
associate-*r*78.7%
metadata-eval78.7%
div-inv78.6%
Applied egg-rr78.6%
Taylor expanded in angle around 0 69.1%
associate-*r*69.1%
Simplified69.1%
if 9.99999999999999999e-15 < (/.f64 angle 180) < 5.00000000000000025e95Initial program 46.2%
Simplified43.0%
unpow243.0%
unpow243.0%
difference-of-squares43.0%
Applied egg-rr43.0%
Taylor expanded in angle around inf 45.9%
*-commutative45.9%
associate-*l*46.9%
Simplified46.9%
associate-*r*46.1%
metadata-eval46.1%
div-inv50.9%
Applied egg-rr51.0%
if 5.00000000000000025e95 < (/.f64 angle 180) Initial program 23.3%
Simplified24.3%
unpow224.3%
unpow224.3%
difference-of-squares24.3%
Applied egg-rr24.3%
Taylor expanded in angle around 0 32.2%
Final simplification60.4%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* PI 0.005555555555555556))))
(*
angle_s
(if (<= a 3.2e-57)
(* 2.0 (* (+ a b) (* b (* (cos t_0) (sin t_0)))))
(* 2.0 (* (+ a b) (* (- b a) (sin (/ (* angle_m PI) 180.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 * (((double) M_PI) * 0.005555555555555556);
double tmp;
if (a <= 3.2e-57) {
tmp = 2.0 * ((a + b) * (b * (cos(t_0) * sin(t_0))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * sin(((angle_m * ((double) M_PI)) / 180.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 * (Math.PI * 0.005555555555555556);
double tmp;
if (a <= 3.2e-57) {
tmp = 2.0 * ((a + b) * (b * (Math.cos(t_0) * Math.sin(t_0))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * Math.sin(((angle_m * Math.PI) / 180.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 * (math.pi * 0.005555555555555556) tmp = 0 if a <= 3.2e-57: tmp = 2.0 * ((a + b) * (b * (math.cos(t_0) * math.sin(t_0)))) else: tmp = 2.0 * ((a + b) * ((b - a) * math.sin(((angle_m * math.pi) / 180.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(angle_m * Float64(pi * 0.005555555555555556)) tmp = 0.0 if (a <= 3.2e-57) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(b * Float64(cos(t_0) * sin(t_0))))); else tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * pi) / 180.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 * (pi * 0.005555555555555556); tmp = 0.0; if (a <= 3.2e-57) tmp = 2.0 * ((a + b) * (b * (cos(t_0) * sin(t_0)))); else tmp = 2.0 * ((a + b) * ((b - a) * sin(((angle_m * pi) / 180.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[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[a, 3.2e-57], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b * N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.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 := angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 3.2 \cdot 10^{-57}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(b \cdot \left(\cos t\_0 \cdot \sin t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if a < 3.2000000000000001e-57Initial program 50.4%
Simplified50.4%
unpow250.4%
unpow250.4%
difference-of-squares52.1%
Applied egg-rr52.1%
add-log-exp30.6%
associate-*l*30.6%
exp-prod30.0%
*-commutative30.0%
Applied egg-rr29.9%
log-pow30.1%
+-commutative30.1%
rem-log-exp60.3%
*-commutative60.3%
associate-*r*58.7%
*-commutative58.7%
associate-*r*60.6%
associate-*r*59.5%
*-commutative59.5%
associate-*r*59.9%
Simplified59.9%
Taylor expanded in b around inf 46.7%
*-commutative46.7%
associate-*r*47.2%
*-commutative47.2%
associate-*r*47.9%
Simplified47.9%
if 3.2000000000000001e-57 < a Initial program 55.6%
Simplified58.2%
unpow258.2%
unpow258.2%
difference-of-squares63.8%
Applied egg-rr63.8%
add-log-exp40.4%
associate-*l*40.4%
exp-prod36.2%
*-commutative36.2%
Applied egg-rr34.8%
log-pow34.8%
+-commutative34.8%
rem-log-exp73.8%
*-commutative73.8%
associate-*r*74.2%
*-commutative74.2%
associate-*r*74.3%
associate-*r*77.1%
*-commutative77.1%
associate-*r*75.9%
Simplified75.9%
associate-*r*77.1%
metadata-eval77.1%
div-inv75.7%
Applied egg-rr75.7%
Taylor expanded in angle around 0 73.3%
Final simplification55.3%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556))))
(*
angle_s
(if (<= a 2.4e-57)
(* 2.0 (* (+ a b) (* b (* (sin t_0) (cos t_0)))))
(* 2.0 (* (+ a b) (* (- b a) (sin (/ (* angle_m PI) 180.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 tmp;
if (a <= 2.4e-57) {
tmp = 2.0 * ((a + b) * (b * (sin(t_0) * cos(t_0))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * sin(((angle_m * ((double) M_PI)) / 180.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 tmp;
if (a <= 2.4e-57) {
tmp = 2.0 * ((a + b) * (b * (Math.sin(t_0) * Math.cos(t_0))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * Math.sin(((angle_m * Math.PI) / 180.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) tmp = 0 if a <= 2.4e-57: tmp = 2.0 * ((a + b) * (b * (math.sin(t_0) * math.cos(t_0)))) else: tmp = 2.0 * ((a + b) * ((b - a) * math.sin(((angle_m * math.pi) / 180.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)) tmp = 0.0 if (a <= 2.4e-57) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(b * Float64(sin(t_0) * cos(t_0))))); else tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * pi) / 180.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); tmp = 0.0; if (a <= 2.4e-57) tmp = 2.0 * ((a + b) * (b * (sin(t_0) * cos(t_0)))); else tmp = 2.0 * ((a + b) * ((b - a) * sin(((angle_m * pi) / 180.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]}, N[(angle$95$s * If[LessEqual[a, 2.4e-57], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(b * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.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)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 2.4 \cdot 10^{-57}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(b \cdot \left(\sin t\_0 \cdot \cos t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if a < 2.40000000000000006e-57Initial program 50.4%
Simplified50.4%
unpow250.4%
unpow250.4%
difference-of-squares52.1%
Applied egg-rr52.1%
add-log-exp30.6%
associate-*l*30.6%
exp-prod30.0%
*-commutative30.0%
Applied egg-rr29.9%
log-pow30.1%
+-commutative30.1%
rem-log-exp60.3%
*-commutative60.3%
associate-*r*58.7%
*-commutative58.7%
associate-*r*60.6%
associate-*r*59.5%
*-commutative59.5%
associate-*r*59.9%
Simplified59.9%
associate-*r*59.5%
metadata-eval59.5%
div-inv61.9%
Applied egg-rr61.9%
Taylor expanded in b around inf 46.7%
*-commutative46.7%
associate-*r*46.9%
*-commutative46.9%
associate-*r*48.6%
*-commutative48.6%
Simplified48.6%
if 2.40000000000000006e-57 < a Initial program 55.6%
Simplified58.2%
unpow258.2%
unpow258.2%
difference-of-squares63.8%
Applied egg-rr63.8%
add-log-exp40.4%
associate-*l*40.4%
exp-prod36.2%
*-commutative36.2%
Applied egg-rr34.8%
log-pow34.8%
+-commutative34.8%
rem-log-exp73.8%
*-commutative73.8%
associate-*r*74.2%
*-commutative74.2%
associate-*r*74.3%
associate-*r*77.1%
*-commutative77.1%
associate-*r*75.9%
Simplified75.9%
associate-*r*77.1%
metadata-eval77.1%
div-inv75.7%
Applied egg-rr75.7%
Taylor expanded in angle around 0 73.3%
Final simplification55.8%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(*
2.0
(*
(+ a b)
(*
(- b a)
(*
(cos (* angle_m (* PI 0.005555555555555556)))
(sin (/ (* angle_m PI) 180.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 * (2.0 * ((a + b) * ((b - a) * (cos((angle_m * (((double) M_PI) * 0.005555555555555556))) * sin(((angle_m * ((double) M_PI)) / 180.0))))));
}
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 * ((a + b) * ((b - a) * (Math.cos((angle_m * (Math.PI * 0.005555555555555556))) * Math.sin(((angle_m * Math.PI) / 180.0))))));
}
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 * ((a + b) * ((b - a) * (math.cos((angle_m * (math.pi * 0.005555555555555556))) * math.sin(((angle_m * math.pi) / 180.0))))))
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(a + b) * Float64(Float64(b - a) * Float64(cos(Float64(angle_m * Float64(pi * 0.005555555555555556))) * sin(Float64(Float64(angle_m * pi) / 180.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 * (2.0 * ((a + b) * ((b - a) * (cos((angle_m * (pi * 0.005555555555555556))) * sin(((angle_m * pi) / 180.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 * N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $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(2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)\right)\right)\right)
\end{array}
Initial program 51.9%
Simplified52.7%
unpow252.7%
unpow252.7%
difference-of-squares55.5%
Applied egg-rr55.5%
add-log-exp33.4%
associate-*l*33.4%
exp-prod31.8%
*-commutative31.8%
Applied egg-rr31.3%
log-pow31.4%
+-commutative31.4%
rem-log-exp64.2%
*-commutative64.2%
associate-*r*63.2%
*-commutative63.2%
associate-*r*64.5%
associate-*r*64.6%
*-commutative64.6%
associate-*r*64.5%
Simplified64.5%
associate-*r*64.6%
metadata-eval64.6%
div-inv65.9%
Applied egg-rr65.9%
Final simplification65.9%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 500.0)
(* 2.0 (* (+ a b) (* (* angle_m 0.005555555555555556) (* (- b a) PI))))
(* 2.0 (* (* (+ a b) (- b a)) (sin (* PI (/ angle_m 180.0))))))))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) <= 500.0) {
tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * ((double) M_PI))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * sin((((double) M_PI) * (angle_m / 180.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 tmp;
if ((angle_m / 180.0) <= 500.0) {
tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * Math.PI)));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * Math.sin((Math.PI * (angle_m / 180.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): tmp = 0 if (angle_m / 180.0) <= 500.0: tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * math.pi))) else: tmp = 2.0 * (((a + b) * (b - a)) * math.sin((math.pi * (angle_m / 180.0)))) 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) <= 500.0) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(angle_m * 0.005555555555555556) * Float64(Float64(b - a) * pi)))); else tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * sin(Float64(pi * Float64(angle_m / 180.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) tmp = 0.0; if ((angle_m / 180.0) <= 500.0) tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * pi))); else tmp = 2.0 * (((a + b) * (b - a)) * sin((pi * (angle_m / 180.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_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 500.0], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $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}\;\frac{angle\_m}{180} \leq 500:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 500Initial program 61.1%
Simplified62.4%
unpow262.4%
unpow262.4%
difference-of-squares66.2%
Applied egg-rr66.2%
add-log-exp39.0%
associate-*l*39.0%
exp-prod36.8%
*-commutative36.8%
Applied egg-rr36.3%
log-pow36.4%
+-commutative36.4%
rem-log-exp78.9%
*-commutative78.9%
associate-*r*78.1%
*-commutative78.1%
associate-*r*78.4%
associate-*r*79.1%
*-commutative79.1%
associate-*r*78.9%
Simplified78.9%
associate-*r*79.1%
metadata-eval79.1%
div-inv79.0%
Applied egg-rr79.0%
Taylor expanded in angle around 0 69.2%
associate-*r*69.3%
Simplified69.3%
if 500 < (/.f64 angle 180) Initial program 27.5%
Simplified26.9%
unpow226.9%
unpow226.9%
difference-of-squares26.9%
Applied egg-rr26.9%
Taylor expanded in angle around 0 28.6%
Final simplification58.1%
angle_m = (fabs.f64 angle)
angle_s = (copysign.f64 1 angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 205000.0)
(* 2.0 (* (+ a b) (* (* angle_m 0.005555555555555556) (* (- b a) PI))))
(*
2.0
(* (sin (* angle_m (* PI 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 <= 205000.0) {
tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * ((double) M_PI))));
} else {
tmp = 2.0 * (sin((angle_m * (((double) M_PI) * 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 <= 205000.0) {
tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * Math.PI)));
} else {
tmp = 2.0 * (Math.sin((angle_m * (Math.PI * 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 <= 205000.0: tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * math.pi))) else: tmp = 2.0 * (math.sin((angle_m * (math.pi * 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 (angle_m <= 205000.0) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(angle_m * 0.005555555555555556) * Float64(Float64(b - a) * pi)))); else tmp = Float64(2.0 * Float64(sin(Float64(angle_m * Float64(pi * 0.005555555555555556))) * Float64(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 <= 205000.0) tmp = 2.0 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * pi))); else tmp = 2.0 * (sin((angle_m * (pi * 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[angle$95$m, 205000.0], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * 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}\;angle\_m \leq 205000:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if angle < 205000Initial program 61.1%
Simplified62.4%
unpow262.4%
unpow262.4%
difference-of-squares66.2%
Applied egg-rr66.2%
add-log-exp39.0%
associate-*l*39.0%
exp-prod36.8%
*-commutative36.8%
Applied egg-rr36.3%
log-pow36.4%
+-commutative36.4%
rem-log-exp78.9%
*-commutative78.9%
associate-*r*78.1%
*-commutative78.1%
associate-*r*78.4%
associate-*r*79.1%
*-commutative79.1%
associate-*r*78.9%
Simplified78.9%
associate-*r*79.1%
metadata-eval79.1%
div-inv79.0%
Applied egg-rr79.0%
Taylor expanded in angle around 0 69.2%
associate-*r*69.3%
Simplified69.3%
if 205000 < angle Initial program 27.5%
Simplified26.9%
unpow226.9%
unpow226.9%
difference-of-squares26.9%
Applied egg-rr26.9%
Taylor expanded in angle around inf 23.6%
*-commutative23.6%
associate-*l*23.6%
Simplified23.6%
Taylor expanded in angle around 0 25.3%
Final simplification57.2%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 2.0 (* (+ a b) (* (- b a) (sin (/ (* angle_m PI) 180.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 * (2.0 * ((a + b) * ((b - a) * sin(((angle_m * ((double) M_PI)) / 180.0)))));
}
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 * ((a + b) * ((b - a) * Math.sin(((angle_m * Math.PI) / 180.0)))));
}
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 * ((a + b) * ((b - a) * math.sin(((angle_m * math.pi) / 180.0)))))
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(a + b) * Float64(Float64(b - a) * sin(Float64(Float64(angle_m * pi) / 180.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 * (2.0 * ((a + b) * ((b - a) * sin(((angle_m * pi) / 180.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 * N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $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(2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)\right)\right)
\end{array}
Initial program 51.9%
Simplified52.7%
unpow252.7%
unpow252.7%
difference-of-squares55.5%
Applied egg-rr55.5%
add-log-exp33.4%
associate-*l*33.4%
exp-prod31.8%
*-commutative31.8%
Applied egg-rr31.3%
log-pow31.4%
+-commutative31.4%
rem-log-exp64.2%
*-commutative64.2%
associate-*r*63.2%
*-commutative63.2%
associate-*r*64.5%
associate-*r*64.6%
*-commutative64.6%
associate-*r*64.5%
Simplified64.5%
associate-*r*64.6%
metadata-eval64.6%
div-inv65.9%
Applied egg-rr65.9%
Taylor expanded in angle around 0 61.2%
Final simplification61.2%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 2.0 (* 0.005555555555555556 (* angle_m (* PI (* (+ 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 * (0.005555555555555556 * (angle_m * (((double) M_PI) * ((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 * (0.005555555555555556 * (angle_m * (Math.PI * ((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 * (0.005555555555555556 * (angle_m * (math.pi * ((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(0.005555555555555556 * Float64(angle_m * Float64(pi * Float64(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 * (0.005555555555555556 * (angle_m * (pi * ((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[(0.005555555555555556 * N[(angle$95$m * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $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(2 \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)\right)
\end{array}
Initial program 51.9%
Simplified52.7%
Taylor expanded in angle around 0 44.4%
unpow252.7%
unpow252.7%
difference-of-squares55.5%
Applied egg-rr47.6%
Final simplification47.6%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 2.0 (* 0.005555555555555556 (* (* angle_m PI) (* (+ 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 * (0.005555555555555556 * ((angle_m * ((double) M_PI)) * ((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 * (0.005555555555555556 * ((angle_m * Math.PI) * ((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 * (0.005555555555555556 * ((angle_m * math.pi) * ((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(0.005555555555555556 * Float64(Float64(angle_m * pi) * Float64(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 * (0.005555555555555556 * ((angle_m * pi) * ((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[(0.005555555555555556 * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * 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(2 \cdot \left(0.005555555555555556 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)\right)\right)
\end{array}
Initial program 51.9%
Simplified52.7%
unpow252.7%
unpow252.7%
difference-of-squares55.5%
Applied egg-rr55.5%
Taylor expanded in angle around 0 47.6%
associate-*r*47.7%
Simplified47.7%
Final simplification47.7%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 2.0 (* (+ a b) (* 0.005555555555555556 (* angle_m (* (- b a) PI)))))))
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 * ((a + b) * (0.005555555555555556 * (angle_m * ((b - a) * ((double) M_PI))))));
}
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 * ((a + b) * (0.005555555555555556 * (angle_m * ((b - a) * Math.PI)))));
}
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 * ((a + b) * (0.005555555555555556 * (angle_m * ((b - a) * math.pi)))))
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(a + b) * Float64(0.005555555555555556 * Float64(angle_m * Float64(Float64(b - a) * pi)))))) 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 * ((a + b) * (0.005555555555555556 * (angle_m * ((b - a) * pi))))); 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[(a + b), $MachinePrecision] * N[(0.005555555555555556 * N[(angle$95$m * N[(N[(b - a), $MachinePrecision] * 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 \left(2 \cdot \left(\left(a + b\right) \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\right)\right)
\end{array}
Initial program 51.9%
Simplified52.7%
unpow252.7%
unpow252.7%
difference-of-squares55.5%
Applied egg-rr55.5%
add-log-exp33.4%
associate-*l*33.4%
exp-prod31.8%
*-commutative31.8%
Applied egg-rr31.3%
log-pow31.4%
+-commutative31.4%
rem-log-exp64.2%
*-commutative64.2%
associate-*r*63.2%
*-commutative63.2%
associate-*r*64.5%
associate-*r*64.6%
*-commutative64.6%
associate-*r*64.5%
Simplified64.5%
Taylor expanded in angle around 0 56.7%
Final simplification56.7%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 2.0 (* (+ a b) (* (* angle_m 0.005555555555555556) (* (- b a) PI))))))
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 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * ((double) M_PI)))));
}
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 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * Math.PI))));
}
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 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * math.pi))))
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(a + b) * Float64(Float64(angle_m * 0.005555555555555556) * Float64(Float64(b - a) * pi))))) 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 * ((a + b) * ((angle_m * 0.005555555555555556) * ((b - a) * pi)))); 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[(a + b), $MachinePrecision] * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[(N[(b - a), $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 \left(2 \cdot \left(\left(a + b\right) \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 51.9%
Simplified52.7%
unpow252.7%
unpow252.7%
difference-of-squares55.5%
Applied egg-rr55.5%
add-log-exp33.4%
associate-*l*33.4%
exp-prod31.8%
*-commutative31.8%
Applied egg-rr31.3%
log-pow31.4%
+-commutative31.4%
rem-log-exp64.2%
*-commutative64.2%
associate-*r*63.2%
*-commutative63.2%
associate-*r*64.5%
associate-*r*64.6%
*-commutative64.6%
associate-*r*64.5%
Simplified64.5%
associate-*r*64.6%
metadata-eval64.6%
div-inv65.9%
Applied egg-rr65.9%
Taylor expanded in angle around 0 56.7%
associate-*r*56.8%
Simplified56.8%
Final simplification56.8%
angle_m = (fabs.f64 angle) angle_s = (copysign.f64 1 angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 2.0 (* (+ a b) 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 * (2.0 * ((a + b) * 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 * (2.0d0 * ((a + b) * 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 * (2.0 * ((a + b) * 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 * (2.0 * ((a + b) * 0.0))
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(a + b) * 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 * (2.0 * ((a + b) * 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 * N[(2.0 * N[(N[(a + b), $MachinePrecision] * 0.0), $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(a + b\right) \cdot 0\right)\right)
\end{array}
Initial program 51.9%
Simplified52.7%
unpow252.7%
unpow252.7%
difference-of-squares55.5%
Applied egg-rr55.5%
add-log-exp33.4%
associate-*l*33.4%
exp-prod31.8%
*-commutative31.8%
Applied egg-rr31.3%
log-pow31.4%
+-commutative31.4%
rem-log-exp64.2%
*-commutative64.2%
associate-*r*63.2%
*-commutative63.2%
associate-*r*64.5%
associate-*r*64.6%
*-commutative64.6%
associate-*r*64.5%
Simplified64.5%
associate-*r*64.6%
metadata-eval64.6%
div-inv65.9%
Applied egg-rr65.9%
Applied egg-rr5.5%
*-commutative5.5%
associate-/l*5.5%
count-25.5%
*-commutative5.5%
mul0-rgt5.5%
sin-05.5%
metadata-eval5.5%
mul0-lft10.8%
Simplified10.8%
Final simplification10.8%
herbie shell --seed 2024044
(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)))))