
(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 27 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}
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0
(*
(+ b a_m)
(*
(- b a_m)
(*
2.0
(sin (* (/ (sqrt PI) 180.0) (/ (sqrt PI) (/ 1.0 angle_m)))))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+87)
(*
(*
(+ b a_m)
(* (- b a_m) (* (sin (* PI (* angle_m 0.005555555555555556))) 2.0)))
(cos (* angle_m (* PI 0.005555555555555556))))
(if (<= (/ angle_m 180.0) 5e+144)
(*
t_0
(cos
(/
1.0
(/
180.0
(*
angle_m
(*
(cbrt (sqrt PI))
(pow (* (sqrt PI) (* PI PI)) 0.3333333333333333)))))))
(* t_0 (cos (/ 1.0 (/ 180.0 (* angle_m PI))))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (b + a_m) * ((b - a_m) * (2.0 * sin(((sqrt(((double) M_PI)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle_m))))));
double tmp;
if ((angle_m / 180.0) <= 4e+87) {
tmp = ((b + a_m) * ((b - a_m) * (sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * 2.0))) * cos((angle_m * (((double) M_PI) * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 5e+144) {
tmp = t_0 * cos((1.0 / (180.0 / (angle_m * (cbrt(sqrt(((double) M_PI))) * pow((sqrt(((double) M_PI)) * (((double) M_PI) * ((double) M_PI))), 0.3333333333333333))))));
} else {
tmp = t_0 * cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (b + a_m) * ((b - a_m) * (2.0 * Math.sin(((Math.sqrt(Math.PI) / 180.0) * (Math.sqrt(Math.PI) / (1.0 / angle_m))))));
double tmp;
if ((angle_m / 180.0) <= 4e+87) {
tmp = ((b + a_m) * ((b - a_m) * (Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * 2.0))) * Math.cos((angle_m * (Math.PI * 0.005555555555555556)));
} else if ((angle_m / 180.0) <= 5e+144) {
tmp = t_0 * Math.cos((1.0 / (180.0 / (angle_m * (Math.cbrt(Math.sqrt(Math.PI)) * Math.pow((Math.sqrt(Math.PI) * (Math.PI * Math.PI)), 0.3333333333333333))))));
} else {
tmp = t_0 * Math.cos((1.0 / (180.0 / (angle_m * Math.PI))));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(Float64(sqrt(pi) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle_m))))))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+87) tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * 2.0))) * cos(Float64(angle_m * Float64(pi * 0.005555555555555556)))); elseif (Float64(angle_m / 180.0) <= 5e+144) tmp = Float64(t_0 * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * Float64(cbrt(sqrt(pi)) * (Float64(sqrt(pi) * Float64(pi * pi)) ^ 0.3333333333333333))))))); else tmp = Float64(t_0 * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+87], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+144], N[(t$95$0 * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[Sqrt[Pi], $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle\_m}}\right)\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+87}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+144}:\\
\;\;\;\;t\_0 \cdot \cos \left(\frac{1}{\frac{180}{angle\_m \cdot \left(\sqrt[3]{\sqrt{\pi}} \cdot {\left(\sqrt{\pi} \cdot \left(\pi \cdot \pi\right)\right)}^{0.3333333333333333}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.9999999999999998e87Initial program 62.1%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr80.1%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.6
Applied egg-rr79.6%
if 3.9999999999999998e87 < (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999999e144Initial program 22.8%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr23.8%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6440.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.5
Applied egg-rr40.5%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6436.2
Applied egg-rr36.2%
add-cbrt-cubeN/A
pow1/3N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lower-cbrt.f6450.7
Applied egg-rr50.7%
if 4.9999999999999999e144 < (/.f64 angle #s(literal 180 binary64)) Initial program 29.6%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr29.1%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6431.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6431.8
Applied egg-rr31.8%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6442.3
Applied egg-rr42.3%
Final simplification71.9%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0
(* (* (+ b a_m) 0.011111111111111112) (* (- b a_m) (* angle_m PI))))
(t_1 (* (/ angle_m 180.0) PI))
(t_2
(* (cos t_1) (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_1)))))
(*
angle_s
(if (<= t_2 -1e-304)
t_0
(if (<= t_2 5e+109)
(* (* angle_m PI) (* 0.011111111111111112 (* b b)))
t_0)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * ((double) M_PI)));
double t_1 = (angle_m / 180.0) * ((double) M_PI);
double t_2 = cos(t_1) * ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_1));
double tmp;
if (t_2 <= -1e-304) {
tmp = t_0;
} else if (t_2 <= 5e+109) {
tmp = (angle_m * ((double) M_PI)) * (0.011111111111111112 * (b * b));
} else {
tmp = t_0;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * Math.PI));
double t_1 = (angle_m / 180.0) * Math.PI;
double t_2 = Math.cos(t_1) * ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) * Math.sin(t_1));
double tmp;
if (t_2 <= -1e-304) {
tmp = t_0;
} else if (t_2 <= 5e+109) {
tmp = (angle_m * Math.PI) * (0.011111111111111112 * (b * b));
} else {
tmp = t_0;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * math.pi)) t_1 = (angle_m / 180.0) * math.pi t_2 = math.cos(t_1) * ((2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) * math.sin(t_1)) tmp = 0 if t_2 <= -1e-304: tmp = t_0 elif t_2 <= 5e+109: tmp = (angle_m * math.pi) * (0.011111111111111112 * (b * b)) else: tmp = t_0 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(Float64(b + a_m) * 0.011111111111111112) * Float64(Float64(b - a_m) * Float64(angle_m * pi))) t_1 = Float64(Float64(angle_m / 180.0) * pi) t_2 = Float64(cos(t_1) * Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_1))) tmp = 0.0 if (t_2 <= -1e-304) tmp = t_0; elseif (t_2 <= 5e+109) tmp = Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(b * b))); else tmp = t_0; end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * pi)); t_1 = (angle_m / 180.0) * pi; t_2 = cos(t_1) * ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_1)); tmp = 0.0; if (t_2 <= -1e-304) tmp = t_0; elseif (t_2 <= 5e+109) tmp = (angle_m * pi) * (0.011111111111111112 * (b * b)); else tmp = t_0; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(N[(b + a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, -1e-304], t$95$0, If[LessEqual[t$95$2, 5e+109], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(\left(b + a\_m\right) \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle\_m \cdot \pi\right)\right)\\
t_1 := \frac{angle\_m}{180} \cdot \pi\\
t_2 := \cos t\_1 \cdot \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_1\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-304}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+109}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -9.99999999999999971e-305 or 5.0000000000000001e109 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 46.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6446.4
Simplified46.4%
Taylor expanded in angle around 0
Simplified41.4%
lift-PI.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
remove-double-divN/A
lift-/.f64N/A
div-invN/A
lift-*.f64N/A
lift-/.f64N/A
associate-/r/N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied egg-rr57.9%
if -9.99999999999999971e-305 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 5.0000000000000001e109Initial program 78.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6474.7
Simplified74.7%
Taylor expanded in angle around 0
Simplified74.6%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6449.2
Simplified49.2%
Final simplification55.8%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI)))
(*
angle_s
(if (<=
(* (cos t_0) (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)))
-1e+284)
(*
(+ b a_m)
(* (- b a_m) (* 2.0 (sin (* 0.005555555555555556 (* angle_m PI))))))
(*
(*
(+ b a_m)
(* (- b a_m) (* (sin (* PI (* angle_m 0.005555555555555556))) 2.0)))
(cos (/ (* angle_m PI) 180.0)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double tmp;
if ((cos(t_0) * ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0))) <= -1e+284) {
tmp = (b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = ((b + a_m) * ((b - a_m) * (sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * 2.0))) * cos(((angle_m * ((double) M_PI)) / 180.0));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
double tmp;
if ((Math.cos(t_0) * ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) * Math.sin(t_0))) <= -1e+284) {
tmp = (b + a_m) * ((b - a_m) * (2.0 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = ((b + a_m) * ((b - a_m) * (Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * 2.0))) * Math.cos(((angle_m * Math.PI) / 180.0));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = (angle_m / 180.0) * math.pi tmp = 0 if (math.cos(t_0) * ((2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) * math.sin(t_0))) <= -1e+284: tmp = (b + a_m) * ((b - a_m) * (2.0 * math.sin((0.005555555555555556 * (angle_m * math.pi))))) else: tmp = ((b + a_m) * ((b - a_m) * (math.sin((math.pi * (angle_m * 0.005555555555555556))) * 2.0))) * math.cos(((angle_m * math.pi) / 180.0)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) tmp = 0.0 if (Float64(cos(t_0) * Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0))) <= -1e+284) tmp = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * 2.0))) * cos(Float64(Float64(angle_m * pi) / 180.0))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = (angle_m / 180.0) * pi; tmp = 0.0; if ((cos(t_0) * ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0))) <= -1e+284) tmp = (b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (angle_m * pi))))); else tmp = ((b + a_m) * ((b - a_m) * (sin((pi * (angle_m * 0.005555555555555556))) * 2.0))) * cos(((angle_m * pi) / 180.0)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+284], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\cos t\_0 \cdot \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \leq -1 \cdot 10^{+284}:\\
\;\;\;\;\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\frac{angle\_m \cdot \pi}{180}\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -1.00000000000000008e284Initial program 61.7%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr82.7%
lift-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6482.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6482.8
Applied egg-rr82.8%
Taylor expanded in angle around 0
Simplified78.6%
if -1.00000000000000008e284 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 52.8%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr65.2%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
lower-/.f6466.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.1
Applied egg-rr66.1%
Final simplification68.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (pow (cbrt (sqrt PI)) 3.0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 6e+149)
(*
(*
(+ b a_m)
(* (- b a_m) (* (sin (* PI (* angle_m 0.005555555555555556))) 2.0)))
(cos (/ 1.0 (/ 180.0 (* angle_m (* t_0 t_0))))))
(*
(*
(+ b a_m)
(*
(- b a_m)
(* 2.0 (sin (* (/ (sqrt PI) 180.0) (/ (sqrt PI) (/ 1.0 angle_m)))))))
(cos (/ 1.0 (/ 180.0 (* angle_m PI)))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = pow(cbrt(sqrt(((double) M_PI))), 3.0);
double tmp;
if ((angle_m / 180.0) <= 6e+149) {
tmp = ((b + a_m) * ((b - a_m) * (sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * 2.0))) * cos((1.0 / (180.0 / (angle_m * (t_0 * t_0)))));
} else {
tmp = ((b + a_m) * ((b - a_m) * (2.0 * sin(((sqrt(((double) M_PI)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle_m))))))) * cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = Math.pow(Math.cbrt(Math.sqrt(Math.PI)), 3.0);
double tmp;
if ((angle_m / 180.0) <= 6e+149) {
tmp = ((b + a_m) * ((b - a_m) * (Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * 2.0))) * Math.cos((1.0 / (180.0 / (angle_m * (t_0 * t_0)))));
} else {
tmp = ((b + a_m) * ((b - a_m) * (2.0 * Math.sin(((Math.sqrt(Math.PI) / 180.0) * (Math.sqrt(Math.PI) / (1.0 / angle_m))))))) * Math.cos((1.0 / (180.0 / (angle_m * Math.PI))));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = cbrt(sqrt(pi)) ^ 3.0 tmp = 0.0 if (Float64(angle_m / 180.0) <= 6e+149) tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * 2.0))) * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * Float64(t_0 * t_0)))))); else tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(Float64(sqrt(pi) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle_m))))))) * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+149], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+149}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{angle\_m \cdot \left(t\_0 \cdot t\_0\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle\_m}}\right)\right)\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 6.00000000000000007e149Initial program 58.7%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr75.2%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6475.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6475.7
Applied egg-rr75.7%
add-cube-cbrtN/A
pow3N/A
add-sqr-sqrtN/A
cbrt-prodN/A
unpow-prod-downN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-pow.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6474.4
Applied egg-rr74.4%
if 6.00000000000000007e149 < (/.f64 angle #s(literal 180 binary64)) Initial program 29.9%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr29.4%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6432.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6432.7
Applied egg-rr32.7%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6443.4
Applied egg-rr43.4%
Final simplification69.8%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI))
(t_1 (* 0.005555555555555556 (* angle_m PI))))
(*
angle_s
(if (<=
(* (cos t_0) (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)))
-1e+284)
(* (+ b a_m) (* (- b a_m) (* 2.0 (sin t_1))))
(*
(*
(+ b a_m)
(* (- b a_m) (* (sin (* PI (* angle_m 0.005555555555555556))) 2.0)))
(cos t_1))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double t_1 = 0.005555555555555556 * (angle_m * ((double) M_PI));
double tmp;
if ((cos(t_0) * ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0))) <= -1e+284) {
tmp = (b + a_m) * ((b - a_m) * (2.0 * sin(t_1)));
} else {
tmp = ((b + a_m) * ((b - a_m) * (sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * 2.0))) * cos(t_1);
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
double t_1 = 0.005555555555555556 * (angle_m * Math.PI);
double tmp;
if ((Math.cos(t_0) * ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) * Math.sin(t_0))) <= -1e+284) {
tmp = (b + a_m) * ((b - a_m) * (2.0 * Math.sin(t_1)));
} else {
tmp = ((b + a_m) * ((b - a_m) * (Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * 2.0))) * Math.cos(t_1);
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = (angle_m / 180.0) * math.pi t_1 = 0.005555555555555556 * (angle_m * math.pi) tmp = 0 if (math.cos(t_0) * ((2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) * math.sin(t_0))) <= -1e+284: tmp = (b + a_m) * ((b - a_m) * (2.0 * math.sin(t_1))) else: tmp = ((b + a_m) * ((b - a_m) * (math.sin((math.pi * (angle_m * 0.005555555555555556))) * 2.0))) * math.cos(t_1) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) t_1 = Float64(0.005555555555555556 * Float64(angle_m * pi)) tmp = 0.0 if (Float64(cos(t_0) * Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0))) <= -1e+284) tmp = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(t_1)))); else tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * 2.0))) * cos(t_1)); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = (angle_m / 180.0) * pi; t_1 = 0.005555555555555556 * (angle_m * pi); tmp = 0.0; if ((cos(t_0) * ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0))) <= -1e+284) tmp = (b + a_m) * ((b - a_m) * (2.0 * sin(t_1))); else tmp = ((b + a_m) * ((b - a_m) * (sin((pi * (angle_m * 0.005555555555555556))) * 2.0))) * cos(t_1); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+284], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
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 := 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\cos t\_0 \cdot \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \leq -1 \cdot 10^{+284}:\\
\;\;\;\;\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right) \cdot \cos t\_1\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -1.00000000000000008e284Initial program 61.7%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr82.7%
lift-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6482.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6482.8
Applied egg-rr82.8%
Taylor expanded in angle around 0
Simplified78.6%
if -1.00000000000000008e284 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 52.8%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr65.2%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6465.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.6
Applied egg-rr65.6%
Final simplification68.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (cos (/ 1.0 (/ 180.0 (* angle_m PI)))))
(t_1 (pow (pow (* PI (* angle_m 0.005555555555555556)) -0.5) -1.0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+222)
(* t_0 (* (+ b a_m) (* (- b a_m) (* 2.0 (sin (* t_1 t_1))))))
(*
(*
(+ b a_m)
(*
(- b a_m)
(* 2.0 (sin (* (/ (sqrt PI) 180.0) (/ (sqrt PI) (/ 1.0 angle_m)))))))
t_0)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))));
double t_1 = pow(pow((((double) M_PI) * (angle_m * 0.005555555555555556)), -0.5), -1.0);
double tmp;
if ((angle_m / 180.0) <= 1e+222) {
tmp = t_0 * ((b + a_m) * ((b - a_m) * (2.0 * sin((t_1 * t_1)))));
} else {
tmp = ((b + a_m) * ((b - a_m) * (2.0 * sin(((sqrt(((double) M_PI)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle_m))))))) * t_0;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = Math.cos((1.0 / (180.0 / (angle_m * Math.PI))));
double t_1 = Math.pow(Math.pow((Math.PI * (angle_m * 0.005555555555555556)), -0.5), -1.0);
double tmp;
if ((angle_m / 180.0) <= 1e+222) {
tmp = t_0 * ((b + a_m) * ((b - a_m) * (2.0 * Math.sin((t_1 * t_1)))));
} else {
tmp = ((b + a_m) * ((b - a_m) * (2.0 * Math.sin(((Math.sqrt(Math.PI) / 180.0) * (Math.sqrt(Math.PI) / (1.0 / angle_m))))))) * t_0;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = math.cos((1.0 / (180.0 / (angle_m * math.pi)))) t_1 = math.pow(math.pow((math.pi * (angle_m * 0.005555555555555556)), -0.5), -1.0) tmp = 0 if (angle_m / 180.0) <= 1e+222: tmp = t_0 * ((b + a_m) * ((b - a_m) * (2.0 * math.sin((t_1 * t_1))))) else: tmp = ((b + a_m) * ((b - a_m) * (2.0 * math.sin(((math.sqrt(math.pi) / 180.0) * (math.sqrt(math.pi) / (1.0 / angle_m))))))) * t_0 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi)))) t_1 = (Float64(pi * Float64(angle_m * 0.005555555555555556)) ^ -0.5) ^ -1.0 tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+222) tmp = Float64(t_0 * Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(t_1 * t_1)))))); else tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(Float64(sqrt(pi) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle_m))))))) * t_0); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = cos((1.0 / (180.0 / (angle_m * pi)))); t_1 = ((pi * (angle_m * 0.005555555555555556)) ^ -0.5) ^ -1.0; tmp = 0.0; if ((angle_m / 180.0) <= 1e+222) tmp = t_0 * ((b + a_m) * ((b - a_m) * (2.0 * sin((t_1 * t_1))))); else tmp = ((b + a_m) * ((b - a_m) * (2.0 * sin(((sqrt(pi) / 180.0) * (sqrt(pi) / (1.0 / angle_m))))))) * t_0; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Power[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision], -1.0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+222], N[(t$95$0 * N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \cos \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\right)\\
t_1 := {\left({\left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)}^{-0.5}\right)}^{-1}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+222}:\\
\;\;\;\;t\_0 \cdot \left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(t\_1 \cdot t\_1\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle\_m}}\right)\right)\right)\right) \cdot t\_0\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1e222Initial program 55.8%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr71.5%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6472.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6472.0
Applied egg-rr72.0%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6472.8
Applied egg-rr72.8%
lift-PI.f64N/A
lift-sqrt.f64N/A
frac-2negN/A
lift-PI.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
frac-2negN/A
frac-2negN/A
frac-timesN/A
lift-/.f64N/A
div-invN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
div-invN/A
clear-numN/A
div-invN/A
metadata-evalN/A
Applied egg-rr42.0%
if 1e222 < (/.f64 angle #s(literal 180 binary64)) Initial program 39.3%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr33.6%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6439.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied egg-rr39.0%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6451.1
Applied egg-rr51.1%
Final simplification42.7%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0
(*
(+ b a_m)
(* (- b a_m) (* 2.0 (sin (* 0.005555555555555556 (* angle_m PI)))))))
(t_1 (* (/ angle_m 180.0) PI)))
(*
angle_s
(if (<=
(* (cos t_1) (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_1)))
2e+250)
t_0
(*
(fma (* angle_m angle_m) (* (* PI PI) -1.54320987654321e-5) 1.0)
t_0)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
double t_1 = (angle_m / 180.0) * ((double) M_PI);
double tmp;
if ((cos(t_1) * ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_1))) <= 2e+250) {
tmp = t_0;
} else {
tmp = fma((angle_m * angle_m), ((((double) M_PI) * ((double) M_PI)) * -1.54320987654321e-5), 1.0) * t_0;
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))) t_1 = Float64(Float64(angle_m / 180.0) * pi) tmp = 0.0 if (Float64(cos(t_1) * Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_1))) <= 2e+250) tmp = t_0; else tmp = Float64(fma(Float64(angle_m * angle_m), Float64(Float64(pi * pi) * -1.54320987654321e-5), 1.0) * t_0); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+250], t$95$0, N[(N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * -1.54320987654321e-5), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
t_1 := \frac{angle\_m}{180} \cdot \pi\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\cos t\_1 \cdot \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_1\right) \leq 2 \cdot 10^{+250}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot angle\_m, \left(\pi \cdot \pi\right) \cdot -1.54320987654321 \cdot 10^{-5}, 1\right) \cdot t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 1.9999999999999998e250Initial program 60.0%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr65.4%
lift-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6465.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.9
Applied egg-rr65.9%
Taylor expanded in angle around 0
Simplified63.4%
if 1.9999999999999998e250 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 42.8%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr74.6%
lift-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6475.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6475.8
Applied egg-rr75.8%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6473.3
Simplified73.3%
Final simplification66.6%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow a_m 2.0) 5e-318)
(*
(*
(+ b a_m)
(* (- b a_m) (* (sin (* PI (* angle_m 0.005555555555555556))) 2.0)))
(cos (* (/ angle_m 180.0) PI)))
(*
(*
(+ b a_m)
(*
(- b a_m)
(* 2.0 (sin (* (/ (sqrt PI) 180.0) (/ (sqrt PI) (/ 1.0 angle_m)))))))
(cos (/ 1.0 (/ 180.0 (* angle_m PI))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (pow(a_m, 2.0) <= 5e-318) {
tmp = ((b + a_m) * ((b - a_m) * (sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * 2.0))) * cos(((angle_m / 180.0) * ((double) M_PI)));
} else {
tmp = ((b + a_m) * ((b - a_m) * (2.0 * sin(((sqrt(((double) M_PI)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle_m))))))) * cos((1.0 / (180.0 / (angle_m * ((double) M_PI)))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (Math.pow(a_m, 2.0) <= 5e-318) {
tmp = ((b + a_m) * ((b - a_m) * (Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * 2.0))) * Math.cos(((angle_m / 180.0) * Math.PI));
} else {
tmp = ((b + a_m) * ((b - a_m) * (2.0 * Math.sin(((Math.sqrt(Math.PI) / 180.0) * (Math.sqrt(Math.PI) / (1.0 / angle_m))))))) * Math.cos((1.0 / (180.0 / (angle_m * Math.PI))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if math.pow(a_m, 2.0) <= 5e-318: tmp = ((b + a_m) * ((b - a_m) * (math.sin((math.pi * (angle_m * 0.005555555555555556))) * 2.0))) * math.cos(((angle_m / 180.0) * math.pi)) else: tmp = ((b + a_m) * ((b - a_m) * (2.0 * math.sin(((math.sqrt(math.pi) / 180.0) * (math.sqrt(math.pi) / (1.0 / angle_m))))))) * math.cos((1.0 / (180.0 / (angle_m * math.pi)))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if ((a_m ^ 2.0) <= 5e-318) tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * 2.0))) * cos(Float64(Float64(angle_m / 180.0) * pi))); else tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(Float64(sqrt(pi) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle_m))))))) * cos(Float64(1.0 / Float64(180.0 / Float64(angle_m * pi))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((a_m ^ 2.0) <= 5e-318) tmp = ((b + a_m) * ((b - a_m) * (sin((pi * (angle_m * 0.005555555555555556))) * 2.0))) * cos(((angle_m / 180.0) * pi)); else tmp = ((b + a_m) * ((b - a_m) * (2.0 * sin(((sqrt(pi) / 180.0) * (sqrt(pi) / (1.0 / angle_m))))))) * cos((1.0 / (180.0 / (angle_m * pi)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[a$95$m, 2.0], $MachinePrecision], 5e-318], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(180.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a\_m}^{2} \leq 5 \cdot 10^{-318}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle\_m}}\right)\right)\right)\right) \cdot \cos \left(\frac{1}{\frac{180}{angle\_m \cdot \pi}}\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 4.9999987e-318Initial program 62.7%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr75.8%
if 4.9999987e-318 < (pow.f64 a #s(literal 2 binary64)) Initial program 51.6%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr65.9%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6467.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
Applied egg-rr67.5%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6472.1
Applied egg-rr72.1%
Final simplification73.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (cos (* (/ angle_m 180.0) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1.2e+122)
(*
(*
(+ b a_m)
(* (- b a_m) (* (sin (* PI (* angle_m 0.005555555555555556))) 2.0)))
t_0)
(if (<= (/ angle_m 180.0) 6e+149)
(*
(* (* angle_m PI) (* 0.011111111111111112 (* (+ b a_m) (- b a_m))))
(fma (* angle_m angle_m) (* (* PI PI) -1.54320987654321e-5) 1.0))
(*
t_0
(*
(+ b a_m)
(*
(- b a_m)
(*
2.0
(sin (* 0.005555555555555556 (/ PI (/ 1.0 angle_m)))))))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = cos(((angle_m / 180.0) * ((double) M_PI)));
double tmp;
if ((angle_m / 180.0) <= 1.2e+122) {
tmp = ((b + a_m) * ((b - a_m) * (sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * 2.0))) * t_0;
} else if ((angle_m / 180.0) <= 6e+149) {
tmp = ((angle_m * ((double) M_PI)) * (0.011111111111111112 * ((b + a_m) * (b - a_m)))) * fma((angle_m * angle_m), ((((double) M_PI) * ((double) M_PI)) * -1.54320987654321e-5), 1.0);
} else {
tmp = t_0 * ((b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (((double) M_PI) / (1.0 / angle_m)))))));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = cos(Float64(Float64(angle_m / 180.0) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1.2e+122) tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * 2.0))) * t_0); elseif (Float64(angle_m / 180.0) <= 6e+149) tmp = Float64(Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(Float64(b + a_m) * Float64(b - a_m)))) * fma(Float64(angle_m * angle_m), Float64(Float64(pi * pi) * -1.54320987654321e-5), 1.0)); else tmp = Float64(t_0 * Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(0.005555555555555556 * Float64(pi / Float64(1.0 / angle_m)))))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = 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], 1.2e+122], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+149], N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * -1.54320987654321e-5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(0.005555555555555556 * N[(Pi / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 1.2 \cdot 10^{+122}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right) \cdot t\_0\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+149}:\\
\;\;\;\;\left(\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\right) \cdot \mathsf{fma}\left(angle\_m \cdot angle\_m, \left(\pi \cdot \pi\right) \cdot -1.54320987654321 \cdot 10^{-5}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(0.005555555555555556 \cdot \frac{\pi}{\frac{1}{angle\_m}}\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.2000000000000001e122Initial program 61.2%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr78.7%
if 1.2000000000000001e122 < (/.f64 angle #s(literal 180 binary64)) < 6.00000000000000007e149Initial program 15.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6434.0
Simplified34.0%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6459.1
Simplified59.1%
if 6.00000000000000007e149 < (/.f64 angle #s(literal 180 binary64)) Initial program 29.9%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr29.4%
lift-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6434.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied egg-rr34.6%
lift-PI.f64N/A
associate-*r*N/A
metadata-evalN/A
div-invN/A
clear-numN/A
associate-*r/N/A
*-commutativeN/A
div-invN/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6440.3
Applied egg-rr40.3%
Final simplification72.1%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556))))
(*
angle_s
(if (<= b 3.1e+182)
(*
(* (+ b a_m) (* (- b a_m) (* (sin t_0) 2.0)))
(cos (/ 1.0 (/ 1.0 t_0))))
(*
(*
(+ b a_m)
(*
(- b a_m)
(* 2.0 (sin (* (/ (sqrt PI) 180.0) (/ (sqrt PI) (/ 1.0 angle_m)))))))
(cos t_0))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double tmp;
if (b <= 3.1e+182) {
tmp = ((b + a_m) * ((b - a_m) * (sin(t_0) * 2.0))) * cos((1.0 / (1.0 / t_0)));
} else {
tmp = ((b + a_m) * ((b - a_m) * (2.0 * sin(((sqrt(((double) M_PI)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle_m))))))) * cos(t_0);
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double tmp;
if (b <= 3.1e+182) {
tmp = ((b + a_m) * ((b - a_m) * (Math.sin(t_0) * 2.0))) * Math.cos((1.0 / (1.0 / t_0)));
} else {
tmp = ((b + a_m) * ((b - a_m) * (2.0 * Math.sin(((Math.sqrt(Math.PI) / 180.0) * (Math.sqrt(Math.PI) / (1.0 / angle_m))))))) * Math.cos(t_0);
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = math.pi * (angle_m * 0.005555555555555556) tmp = 0 if b <= 3.1e+182: tmp = ((b + a_m) * ((b - a_m) * (math.sin(t_0) * 2.0))) * math.cos((1.0 / (1.0 / t_0))) else: tmp = ((b + a_m) * ((b - a_m) * (2.0 * math.sin(((math.sqrt(math.pi) / 180.0) * (math.sqrt(math.pi) / (1.0 / angle_m))))))) * math.cos(t_0) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) tmp = 0.0 if (b <= 3.1e+182) tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(sin(t_0) * 2.0))) * cos(Float64(1.0 / Float64(1.0 / t_0)))); else tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(Float64(sqrt(pi) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle_m))))))) * cos(t_0)); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = pi * (angle_m * 0.005555555555555556); tmp = 0.0; if (b <= 3.1e+182) tmp = ((b + a_m) * ((b - a_m) * (sin(t_0) * 2.0))) * cos((1.0 / (1.0 / t_0))); else tmp = ((b + a_m) * ((b - a_m) * (2.0 * sin(((sqrt(pi) / 180.0) * (sqrt(pi) / (1.0 / angle_m))))))) * cos(t_0); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 3.1e+182], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(1.0 / N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
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}\;b \leq 3.1 \cdot 10^{+182}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin t\_0 \cdot 2\right)\right)\right) \cdot \cos \left(\frac{1}{\frac{1}{t\_0}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle\_m}}\right)\right)\right)\right) \cdot \cos t\_0\\
\end{array}
\end{array}
\end{array}
if b < 3.09999999999999996e182Initial program 58.6%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr68.2%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6467.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.5
Applied egg-rr67.5%
lift-PI.f64N/A
lift-*.f64N/A
clear-numN/A
lift-*.f64N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lower-/.f6467.2
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lift-*.f6467.8
Applied egg-rr67.8%
if 3.09999999999999996e182 < b Initial program 26.2%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr69.5%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6481.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6481.6
Applied egg-rr81.6%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6484.4
Applied egg-rr84.4%
lift-PI.f64N/A
lift-*.f64N/A
frac-2negN/A
*-lft-identityN/A
associate-/l/N/A
frac-2negN/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
clear-numN/A
div-invN/A
metadata-evalN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lower-cos.f6484.4
Applied egg-rr84.4%
Final simplification69.9%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (cos (* (/ angle_m 180.0) PI))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1.2e+122)
(*
(*
(+ b a_m)
(* (- b a_m) (* (sin (* PI (* angle_m 0.005555555555555556))) 2.0)))
t_0)
(if (<= (/ angle_m 180.0) 6e+149)
(*
(* (* angle_m PI) (* 0.011111111111111112 (* (+ b a_m) (- b a_m))))
(fma (* angle_m angle_m) (* (* PI PI) -1.54320987654321e-5) 1.0))
(*
t_0
(*
(+ b a_m)
(*
(- b a_m)
(* 2.0 (sin (* 0.005555555555555556 (* angle_m PI))))))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = cos(((angle_m / 180.0) * ((double) M_PI)));
double tmp;
if ((angle_m / 180.0) <= 1.2e+122) {
tmp = ((b + a_m) * ((b - a_m) * (sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * 2.0))) * t_0;
} else if ((angle_m / 180.0) <= 6e+149) {
tmp = ((angle_m * ((double) M_PI)) * (0.011111111111111112 * ((b + a_m) * (b - a_m)))) * fma((angle_m * angle_m), ((((double) M_PI) * ((double) M_PI)) * -1.54320987654321e-5), 1.0);
} else {
tmp = t_0 * ((b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI)))))));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = cos(Float64(Float64(angle_m / 180.0) * pi)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1.2e+122) tmp = Float64(Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * 2.0))) * t_0); elseif (Float64(angle_m / 180.0) <= 6e+149) tmp = Float64(Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(Float64(b + a_m) * Float64(b - a_m)))) * fma(Float64(angle_m * angle_m), Float64(Float64(pi * pi) * -1.54320987654321e-5), 1.0)); else tmp = Float64(t_0 * Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = 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], 1.2e+122], N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 6e+149], N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * -1.54320987654321e-5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 1.2 \cdot 10^{+122}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right) \cdot t\_0\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 6 \cdot 10^{+149}:\\
\;\;\;\;\left(\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\right) \cdot \mathsf{fma}\left(angle\_m \cdot angle\_m, \left(\pi \cdot \pi\right) \cdot -1.54320987654321 \cdot 10^{-5}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.2000000000000001e122Initial program 61.2%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr78.7%
if 1.2000000000000001e122 < (/.f64 angle #s(literal 180 binary64)) < 6.00000000000000007e149Initial program 15.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6434.0
Simplified34.0%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6459.1
Simplified59.1%
if 6.00000000000000007e149 < (/.f64 angle #s(literal 180 binary64)) Initial program 29.9%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr29.4%
lift-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6434.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied egg-rr34.6%
Final simplification71.2%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) -1e-264)
(* a_m (* (* angle_m -0.011111111111111112) (* a_m PI)))
(* (* angle_m PI) (* 0.011111111111111112 (* b b))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -1e-264) {
tmp = a_m * ((angle_m * -0.011111111111111112) * (a_m * ((double) M_PI)));
} else {
tmp = (angle_m * ((double) M_PI)) * (0.011111111111111112 * (b * b));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -1e-264) {
tmp = a_m * ((angle_m * -0.011111111111111112) * (a_m * Math.PI));
} else {
tmp = (angle_m * Math.PI) * (0.011111111111111112 * (b * b));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -1e-264: tmp = a_m * ((angle_m * -0.011111111111111112) * (a_m * math.pi)) else: tmp = (angle_m * math.pi) * (0.011111111111111112 * (b * b)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = Float64(a_m * Float64(Float64(angle_m * -0.011111111111111112) * Float64(a_m * pi))); else tmp = Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(b * b))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = a_m * ((angle_m * -0.011111111111111112) * (a_m * pi)); else tmp = (angle_m * pi) * (0.011111111111111112 * (b * b)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -1e-264], N[(a$95$m * N[(N[(angle$95$m * -0.011111111111111112), $MachinePrecision] * N[(a$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -1 \cdot 10^{-264}:\\
\;\;\;\;a\_m \cdot \left(\left(angle\_m \cdot -0.011111111111111112\right) \cdot \left(a\_m \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6458.3
Simplified58.3%
Taylor expanded in angle around 0
Simplified52.6%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6452.2
Simplified52.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6458.4
Applied egg-rr58.4%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6448.6
Simplified48.6%
Taylor expanded in angle around 0
Simplified46.4%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6445.0
Simplified45.0%
Final simplification51.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) -1e-264)
(* (* PI (* angle_m -0.011111111111111112)) (* a_m a_m))
(* (* angle_m PI) (* 0.011111111111111112 (* b b))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -1e-264) {
tmp = (((double) M_PI) * (angle_m * -0.011111111111111112)) * (a_m * a_m);
} else {
tmp = (angle_m * ((double) M_PI)) * (0.011111111111111112 * (b * b));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -1e-264) {
tmp = (Math.PI * (angle_m * -0.011111111111111112)) * (a_m * a_m);
} else {
tmp = (angle_m * Math.PI) * (0.011111111111111112 * (b * b));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -1e-264: tmp = (math.pi * (angle_m * -0.011111111111111112)) * (a_m * a_m) else: tmp = (angle_m * math.pi) * (0.011111111111111112 * (b * b)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = Float64(Float64(pi * Float64(angle_m * -0.011111111111111112)) * Float64(a_m * a_m)); else tmp = Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(b * b))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = (pi * (angle_m * -0.011111111111111112)) * (a_m * a_m); else tmp = (angle_m * pi) * (0.011111111111111112 * (b * b)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -1e-264], N[(N[(Pi * N[(angle$95$m * -0.011111111111111112), $MachinePrecision]), $MachinePrecision] * N[(a$95$m * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -1 \cdot 10^{-264}:\\
\;\;\;\;\left(\pi \cdot \left(angle\_m \cdot -0.011111111111111112\right)\right) \cdot \left(a\_m \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6458.3
Simplified58.3%
Taylor expanded in angle around 0
Simplified52.6%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6452.2
Simplified52.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6452.3
Applied egg-rr52.3%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6448.6
Simplified48.6%
Taylor expanded in angle around 0
Simplified46.4%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6445.0
Simplified45.0%
Final simplification48.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) -1e-264)
(* (* angle_m PI) (* -0.011111111111111112 (* a_m a_m)))
(* (* angle_m PI) (* 0.011111111111111112 (* b b))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -1e-264) {
tmp = (angle_m * ((double) M_PI)) * (-0.011111111111111112 * (a_m * a_m));
} else {
tmp = (angle_m * ((double) M_PI)) * (0.011111111111111112 * (b * b));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -1e-264) {
tmp = (angle_m * Math.PI) * (-0.011111111111111112 * (a_m * a_m));
} else {
tmp = (angle_m * Math.PI) * (0.011111111111111112 * (b * b));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -1e-264: tmp = (angle_m * math.pi) * (-0.011111111111111112 * (a_m * a_m)) else: tmp = (angle_m * math.pi) * (0.011111111111111112 * (b * b)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = Float64(Float64(angle_m * pi) * Float64(-0.011111111111111112 * Float64(a_m * a_m))); else tmp = Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(b * b))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = (angle_m * pi) * (-0.011111111111111112 * (a_m * a_m)); else tmp = (angle_m * pi) * (0.011111111111111112 * (b * b)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -1e-264], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(-0.011111111111111112 * N[(a$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -1 \cdot 10^{-264}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(-0.011111111111111112 \cdot \left(a\_m \cdot a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6458.3
Simplified58.3%
Taylor expanded in angle around 0
Simplified52.6%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6452.2
Simplified52.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6452.3
Applied egg-rr52.3%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6448.6
Simplified48.6%
Taylor expanded in angle around 0
Simplified46.4%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6445.0
Simplified45.0%
Final simplification48.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) -1e-264)
(* (* angle_m PI) (* a_m (* a_m -0.011111111111111112)))
(* (* angle_m PI) (* 0.011111111111111112 (* b b))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -1e-264) {
tmp = (angle_m * ((double) M_PI)) * (a_m * (a_m * -0.011111111111111112));
} else {
tmp = (angle_m * ((double) M_PI)) * (0.011111111111111112 * (b * b));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -1e-264) {
tmp = (angle_m * Math.PI) * (a_m * (a_m * -0.011111111111111112));
} else {
tmp = (angle_m * Math.PI) * (0.011111111111111112 * (b * b));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -1e-264: tmp = (angle_m * math.pi) * (a_m * (a_m * -0.011111111111111112)) else: tmp = (angle_m * math.pi) * (0.011111111111111112 * (b * b)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = Float64(Float64(angle_m * pi) * Float64(a_m * Float64(a_m * -0.011111111111111112))); else tmp = Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(b * b))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = (angle_m * pi) * (a_m * (a_m * -0.011111111111111112)); else tmp = (angle_m * pi) * (0.011111111111111112 * (b * b)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -1e-264], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a$95$m * N[(a$95$m * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -1 \cdot 10^{-264}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(a\_m \cdot \left(a\_m \cdot -0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6458.3
Simplified58.3%
Taylor expanded in angle around 0
Simplified52.6%
Taylor expanded in a around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6452.3
Simplified52.3%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6448.6
Simplified48.6%
Taylor expanded in angle around 0
Simplified46.4%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6445.0
Simplified45.0%
Final simplification48.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) -1e-264)
(* -0.011111111111111112 (* angle_m (* PI (* a_m a_m))))
(* (* angle_m PI) (* 0.011111111111111112 (* b b))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -1e-264) {
tmp = -0.011111111111111112 * (angle_m * (((double) M_PI) * (a_m * a_m)));
} else {
tmp = (angle_m * ((double) M_PI)) * (0.011111111111111112 * (b * b));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -1e-264) {
tmp = -0.011111111111111112 * (angle_m * (Math.PI * (a_m * a_m)));
} else {
tmp = (angle_m * Math.PI) * (0.011111111111111112 * (b * b));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -1e-264: tmp = -0.011111111111111112 * (angle_m * (math.pi * (a_m * a_m))) else: tmp = (angle_m * math.pi) * (0.011111111111111112 * (b * b)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = Float64(-0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a_m * a_m)))); else tmp = Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(b * b))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = -0.011111111111111112 * (angle_m * (pi * (a_m * a_m))); else tmp = (angle_m * pi) * (0.011111111111111112 * (b * b)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -1e-264], N[(-0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -1 \cdot 10^{-264}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a\_m \cdot a\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6458.3
Simplified58.3%
Taylor expanded in angle around 0
Simplified52.6%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6452.2
Simplified52.2%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6448.6
Simplified48.6%
Taylor expanded in angle around 0
Simplified46.4%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f6445.0
Simplified45.0%
Final simplification48.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a_m 2.0)) -1e-264)
(* -0.011111111111111112 (* angle_m (* PI (* a_m a_m))))
(* 0.011111111111111112 (* angle_m (* PI (* b b)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -1e-264) {
tmp = -0.011111111111111112 * (angle_m * (((double) M_PI) * (a_m * a_m)));
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b * b)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -1e-264) {
tmp = -0.011111111111111112 * (angle_m * (Math.PI * (a_m * a_m)));
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b * b)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -1e-264: tmp = -0.011111111111111112 * (angle_m * (math.pi * (a_m * a_m))) else: tmp = 0.011111111111111112 * (angle_m * (math.pi * (b * b))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = Float64(-0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a_m * a_m)))); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b * b)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = -0.011111111111111112 * (angle_m * (pi * (a_m * a_m))); else tmp = 0.011111111111111112 * (angle_m * (pi * (b * b))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -1e-264], N[(-0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -1 \cdot 10^{-264}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a\_m \cdot a\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6458.3
Simplified58.3%
Taylor expanded in angle around 0
Simplified52.6%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6452.2
Simplified52.2%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6448.6
Simplified48.6%
Taylor expanded in angle around 0
Simplified46.4%
Taylor expanded in a around 0
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6445.0
Simplified45.0%
Final simplification48.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+121)
(*
(+ b a_m)
(* (- b a_m) (* 2.0 (sin (* 0.005555555555555556 (* angle_m PI))))))
(*
(cos (* angle_m (* PI 0.005555555555555556)))
(* 0.011111111111111112 (* (* angle_m PI) (* (+ b a_m) (- b a_m))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 4e+121) {
tmp = (b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = cos((angle_m * (((double) M_PI) * 0.005555555555555556))) * (0.011111111111111112 * ((angle_m * ((double) M_PI)) * ((b + a_m) * (b - a_m))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 4e+121) {
tmp = (b + a_m) * ((b - a_m) * (2.0 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = Math.cos((angle_m * (Math.PI * 0.005555555555555556))) * (0.011111111111111112 * ((angle_m * Math.PI) * ((b + a_m) * (b - a_m))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 4e+121: tmp = (b + a_m) * ((b - a_m) * (2.0 * math.sin((0.005555555555555556 * (angle_m * math.pi))))) else: tmp = math.cos((angle_m * (math.pi * 0.005555555555555556))) * (0.011111111111111112 * ((angle_m * math.pi) * ((b + a_m) * (b - a_m)))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+121) tmp = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = Float64(cos(Float64(angle_m * Float64(pi * 0.005555555555555556))) * Float64(0.011111111111111112 * Float64(Float64(angle_m * pi) * Float64(Float64(b + a_m) * Float64(b - a_m))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 4e+121) tmp = (b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (angle_m * pi))))); else tmp = cos((angle_m * (pi * 0.005555555555555556))) * (0.011111111111111112 * ((angle_m * pi) * ((b + a_m) * (b - a_m)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+121], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.011111111111111112 * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
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^{+121}:\\
\;\;\;\;\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \left(0.011111111111111112 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000015e121Initial program 61.0%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr78.6%
lift-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6478.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6478.5
Applied egg-rr78.5%
Taylor expanded in angle around 0
Simplified77.6%
if 4.00000000000000015e121 < (/.f64 angle #s(literal 180 binary64)) Initial program 27.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6432.5
Simplified32.5%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6438.5
Applied egg-rr38.5%
lift-PI.f64N/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
difference-of-squaresN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
difference-of-squaresN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f6438.5
Applied egg-rr38.5%
Final simplification69.8%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 4e+121)
(*
(+ b a_m)
(* (- b a_m) (* 2.0 (sin (* 0.005555555555555556 (* angle_m PI))))))
(*
(cos (* angle_m (* PI 0.005555555555555556)))
(* (* angle_m PI) (* 0.011111111111111112 (* (+ b a_m) (- b a_m))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 4e+121) {
tmp = (b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))));
} else {
tmp = cos((angle_m * (((double) M_PI) * 0.005555555555555556))) * ((angle_m * ((double) M_PI)) * (0.011111111111111112 * ((b + a_m) * (b - a_m))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 4e+121) {
tmp = (b + a_m) * ((b - a_m) * (2.0 * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))));
} else {
tmp = Math.cos((angle_m * (Math.PI * 0.005555555555555556))) * ((angle_m * Math.PI) * (0.011111111111111112 * ((b + a_m) * (b - a_m))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 4e+121: tmp = (b + a_m) * ((b - a_m) * (2.0 * math.sin((0.005555555555555556 * (angle_m * math.pi))))) else: tmp = math.cos((angle_m * (math.pi * 0.005555555555555556))) * ((angle_m * math.pi) * (0.011111111111111112 * ((b + a_m) * (b - a_m)))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 4e+121) tmp = Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))))); else tmp = Float64(cos(Float64(angle_m * Float64(pi * 0.005555555555555556))) * Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(Float64(b + a_m) * Float64(b - a_m))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 4e+121) tmp = (b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (angle_m * pi))))); else tmp = cos((angle_m * (pi * 0.005555555555555556))) * ((angle_m * pi) * (0.011111111111111112 * ((b + a_m) * (b - a_m)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+121], N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
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^{+121}:\\
\;\;\;\;\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.00000000000000015e121Initial program 61.0%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr78.6%
lift-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6478.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6478.5
Applied egg-rr78.5%
Taylor expanded in angle around 0
Simplified77.6%
if 4.00000000000000015e121 < (/.f64 angle #s(literal 180 binary64)) Initial program 27.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6432.5
Simplified32.5%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6438.5
Applied egg-rr38.5%
Final simplification69.8%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (+ b a_m) (* (- b a_m) (* 2.0 (sin (* 0.005555555555555556 (* angle_m PI))))))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (angle_m * ((double) M_PI)))))));
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((b + a_m) * ((b - a_m) * (2.0 * Math.sin((0.005555555555555556 * (angle_m * Math.PI))))));
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * ((b + a_m) * ((b - a_m) * (2.0 * math.sin((0.005555555555555556 * (angle_m * math.pi))))))
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(2.0 * sin(Float64(0.005555555555555556 * Float64(angle_m * pi))))))) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * ((b + a_m) * ((b - a_m) * (2.0 * sin((0.005555555555555556 * (angle_m * pi)))))); end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(2.0 * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(2 \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\right)
\end{array}
Initial program 54.4%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr68.4%
lift-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6469.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied egg-rr69.1%
Taylor expanded in angle around 0
Simplified66.7%
Final simplification66.7%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (+ b a_m) (* (- b a_m) (* (sin (* PI (* angle_m 0.005555555555555556))) 2.0)))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((b + a_m) * ((b - a_m) * (sin((((double) M_PI) * (angle_m * 0.005555555555555556))) * 2.0)));
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((b + a_m) * ((b - a_m) * (Math.sin((Math.PI * (angle_m * 0.005555555555555556))) * 2.0)));
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * ((b + a_m) * ((b - a_m) * (math.sin((math.pi * (angle_m * 0.005555555555555556))) * 2.0)))
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(Float64(b + a_m) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi * Float64(angle_m * 0.005555555555555556))) * 2.0)))) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * ((b + a_m) * ((b - a_m) * (sin((pi * (angle_m * 0.005555555555555556))) * 2.0))); end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(b + a$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(b + a\_m\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right) \cdot 2\right)\right)\right)
\end{array}
Initial program 54.4%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr68.4%
Taylor expanded in angle around 0
Simplified66.7%
Final simplification66.7%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 100000.0)
(* (- b a_m) (* (+ b a_m) (* PI (* angle_m 0.011111111111111112))))
(*
(* (* angle_m PI) (* 0.011111111111111112 (* (+ b a_m) (- b a_m))))
(fma (* angle_m angle_m) (* (* PI PI) -1.54320987654321e-5) 1.0)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 100000.0) {
tmp = (b - a_m) * ((b + a_m) * (((double) M_PI) * (angle_m * 0.011111111111111112)));
} else {
tmp = ((angle_m * ((double) M_PI)) * (0.011111111111111112 * ((b + a_m) * (b - a_m)))) * fma((angle_m * angle_m), ((((double) M_PI) * ((double) M_PI)) * -1.54320987654321e-5), 1.0);
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 100000.0) tmp = Float64(Float64(b - a_m) * Float64(Float64(b + a_m) * Float64(pi * Float64(angle_m * 0.011111111111111112)))); else tmp = Float64(Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(Float64(b + a_m) * Float64(b - a_m)))) * fma(Float64(angle_m * angle_m), Float64(Float64(pi * pi) * -1.54320987654321e-5), 1.0)); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 100000.0], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * -1.54320987654321e-5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
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 100000:\\
\;\;\;\;\left(b - a\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\right) \cdot \mathsf{fma}\left(angle\_m \cdot angle\_m, \left(\pi \cdot \pi\right) \cdot -1.54320987654321 \cdot 10^{-5}, 1\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1e5Initial program 62.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6463.0
Simplified63.0%
Taylor expanded in angle around 0
Simplified60.3%
lift-PI.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
remove-double-divN/A
lift-/.f64N/A
div-invN/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
/-rgt-identityN/A
times-fracN/A
*-rgt-identityN/A
Applied egg-rr75.0%
if 1e5 < (/.f64 angle #s(literal 180 binary64)) Initial program 32.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6427.1
Simplified27.1%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6435.3
Simplified35.3%
Final simplification64.2%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (+ b a_m) 0.011111111111111112)))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-5)
(* (- b a_m) (* (+ b a_m) (* PI (* angle_m 0.011111111111111112))))
(* (* angle_m PI) (fma t_0 (- a_m) (* b t_0)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (b + a_m) * 0.011111111111111112;
double tmp;
if ((angle_m / 180.0) <= 2e-5) {
tmp = (b - a_m) * ((b + a_m) * (((double) M_PI) * (angle_m * 0.011111111111111112)));
} else {
tmp = (angle_m * ((double) M_PI)) * fma(t_0, -a_m, (b * t_0));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(b + a_m) * 0.011111111111111112) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-5) tmp = Float64(Float64(b - a_m) * Float64(Float64(b + a_m) * Float64(pi * Float64(angle_m * 0.011111111111111112)))); else tmp = Float64(Float64(angle_m * pi) * fma(t_0, Float64(-a_m), Float64(b * t_0))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-5], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(t$95$0 * (-a$95$m) + N[(b * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\_m\right) \cdot 0.011111111111111112\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\left(b - a\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \mathsf{fma}\left(t\_0, -a\_m, b \cdot t\_0\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000016e-5Initial program 62.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6462.9
Simplified62.9%
Taylor expanded in angle around 0
Simplified60.1%
lift-PI.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
remove-double-divN/A
lift-/.f64N/A
div-invN/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
/-rgt-identityN/A
times-fracN/A
*-rgt-identityN/A
Applied egg-rr75.1%
if 2.00000000000000016e-5 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6428.4
Simplified28.4%
Taylor expanded in angle around 0
Simplified21.6%
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lift--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lower-*.f6421.6
Applied egg-rr21.6%
Final simplification60.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-5)
(* (- b a_m) (* (+ b a_m) (* PI (* angle_m 0.011111111111111112))))
(* angle_m (* PI (* 0.011111111111111112 (* (+ b a_m) (- b a_m))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 2e-5) {
tmp = (b - a_m) * ((b + a_m) * (((double) M_PI) * (angle_m * 0.011111111111111112)));
} else {
tmp = angle_m * (((double) M_PI) * (0.011111111111111112 * ((b + a_m) * (b - a_m))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 2e-5) {
tmp = (b - a_m) * ((b + a_m) * (Math.PI * (angle_m * 0.011111111111111112)));
} else {
tmp = angle_m * (Math.PI * (0.011111111111111112 * ((b + a_m) * (b - a_m))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 2e-5: tmp = (b - a_m) * ((b + a_m) * (math.pi * (angle_m * 0.011111111111111112))) else: tmp = angle_m * (math.pi * (0.011111111111111112 * ((b + a_m) * (b - a_m)))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-5) tmp = Float64(Float64(b - a_m) * Float64(Float64(b + a_m) * Float64(pi * Float64(angle_m * 0.011111111111111112)))); else tmp = Float64(angle_m * Float64(pi * Float64(0.011111111111111112 * Float64(Float64(b + a_m) * Float64(b - a_m))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 2e-5) tmp = (b - a_m) * ((b + a_m) * (pi * (angle_m * 0.011111111111111112))); else tmp = angle_m * (pi * (0.011111111111111112 * ((b + a_m) * (b - a_m)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-5], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(angle$95$m * N[(Pi * N[(0.011111111111111112 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
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 2 \cdot 10^{-5}:\\
\;\;\;\;\left(b - a\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;angle\_m \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000016e-5Initial program 62.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6462.9
Simplified62.9%
Taylor expanded in angle around 0
Simplified60.1%
lift-PI.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
remove-double-divN/A
lift-/.f64N/A
div-invN/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
/-rgt-identityN/A
times-fracN/A
*-rgt-identityN/A
Applied egg-rr75.1%
if 2.00000000000000016e-5 < (/.f64 angle #s(literal 180 binary64)) Initial program 34.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6428.4
Simplified28.4%
Taylor expanded in angle around 0
Simplified21.6%
lift-PI.f64N/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
remove-double-divN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lift-/.f64N/A
associate-/r/N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied egg-rr21.6%
Final simplification60.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-23)
(* (* (+ b a_m) 0.011111111111111112) (* (- b a_m) (* angle_m PI)))
(* angle_m (* PI (* 0.011111111111111112 (* (+ b a_m) (- b a_m))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 5e-23) {
tmp = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * ((double) M_PI)));
} else {
tmp = angle_m * (((double) M_PI) * (0.011111111111111112 * ((b + a_m) * (b - a_m))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 5e-23) {
tmp = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * Math.PI));
} else {
tmp = angle_m * (Math.PI * (0.011111111111111112 * ((b + a_m) * (b - a_m))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 5e-23: tmp = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * math.pi)) else: tmp = angle_m * (math.pi * (0.011111111111111112 * ((b + a_m) * (b - a_m)))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-23) tmp = Float64(Float64(Float64(b + a_m) * 0.011111111111111112) * Float64(Float64(b - a_m) * Float64(angle_m * pi))); else tmp = Float64(angle_m * Float64(pi * Float64(0.011111111111111112 * Float64(Float64(b + a_m) * Float64(b - a_m))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 5e-23) tmp = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * pi)); else tmp = angle_m * (pi * (0.011111111111111112 * ((b + a_m) * (b - a_m)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-23], N[(N[(N[(b + a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(angle$95$m * N[(Pi * N[(0.011111111111111112 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
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 5 \cdot 10^{-23}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;angle\_m \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.0000000000000002e-23Initial program 62.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6462.5
Simplified62.5%
Taylor expanded in angle around 0
Simplified59.7%
lift-PI.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
remove-double-divN/A
lift-/.f64N/A
div-invN/A
lift-*.f64N/A
lift-/.f64N/A
associate-/r/N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied egg-rr74.8%
if 5.0000000000000002e-23 < (/.f64 angle #s(literal 180 binary64)) Initial program 35.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6430.3
Simplified30.3%
Taylor expanded in angle around 0
Simplified23.7%
lift-PI.f64N/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
remove-double-divN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lift-/.f64N/A
associate-/r/N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied egg-rr23.7%
Final simplification60.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 2e-24)
(* (* (+ b a_m) 0.011111111111111112) (* (- b a_m) (* angle_m PI)))
(* (* angle_m PI) (* 0.011111111111111112 (* (+ b a_m) (- b a_m)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 2e-24) {
tmp = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * ((double) M_PI)));
} else {
tmp = (angle_m * ((double) M_PI)) * (0.011111111111111112 * ((b + a_m) * (b - a_m)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 2e-24) {
tmp = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * Math.PI));
} else {
tmp = (angle_m * Math.PI) * (0.011111111111111112 * ((b + a_m) * (b - a_m)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 2e-24: tmp = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * math.pi)) else: tmp = (angle_m * math.pi) * (0.011111111111111112 * ((b + a_m) * (b - a_m))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e-24) tmp = Float64(Float64(Float64(b + a_m) * 0.011111111111111112) * Float64(Float64(b - a_m) * Float64(angle_m * pi))); else tmp = Float64(Float64(angle_m * pi) * Float64(0.011111111111111112 * Float64(Float64(b + a_m) * Float64(b - a_m)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 2e-24) tmp = ((b + a_m) * 0.011111111111111112) * ((b - a_m) * (angle_m * pi)); else tmp = (angle_m * pi) * (0.011111111111111112 * ((b + a_m) * (b - a_m))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e-24], N[(N[(N[(b + a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(0.011111111111111112 * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
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 2 \cdot 10^{-24}:\\
\;\;\;\;\left(\left(b + a\_m\right) \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999985e-24Initial program 62.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6462.5
Simplified62.5%
Taylor expanded in angle around 0
Simplified59.7%
lift-PI.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
remove-double-divN/A
lift-/.f64N/A
div-invN/A
lift-*.f64N/A
lift-/.f64N/A
associate-/r/N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied egg-rr74.8%
if 1.99999999999999985e-24 < (/.f64 angle #s(literal 180 binary64)) Initial program 35.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6430.3
Simplified30.3%
Taylor expanded in angle around 0
Simplified23.7%
Final simplification60.0%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* -0.011111111111111112 (* angle_m (* PI (* a_m a_m))))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (-0.011111111111111112 * (angle_m * (((double) M_PI) * (a_m * a_m))));
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (-0.011111111111111112 * (angle_m * (Math.PI * (a_m * a_m))));
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * (-0.011111111111111112 * (angle_m * (math.pi * (a_m * a_m))))
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(-0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a_m * a_m))))) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * (-0.011111111111111112 * (angle_m * (pi * (a_m * a_m)))); end
a_m = N[Abs[a], $MachinePrecision]
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$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(-0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
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(\pi \cdot \left(a\_m \cdot a\_m\right)\right)\right)\right)
\end{array}
Initial program 54.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6453.2
Simplified53.2%
Taylor expanded in angle around 0
Simplified49.3%
Taylor expanded in a around inf
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6435.3
Simplified35.3%
Final simplification35.3%
herbie shell --seed 2024219
(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)))))