
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m 0.005555555555555556)))
(t_1 (* (+ b a) (* (- b a) (* 2.0 (sin t_0))))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+156)
(* t_1 (cos (pow (exp (- (log t_0))) -1.0)))
(* t_1 (cos (/ (* angle_m 0.005555555555555556) (/ 1.0 PI))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = (b + a) * ((b - a) * (2.0 * sin(t_0)));
double tmp;
if ((angle_m / 180.0) <= 5e+156) {
tmp = t_1 * cos(pow(exp(-log(t_0)), -1.0));
} else {
tmp = t_1 * cos(((angle_m * 0.005555555555555556) / (1.0 / ((double) M_PI))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * 0.005555555555555556);
double t_1 = (b + a) * ((b - a) * (2.0 * Math.sin(t_0)));
double tmp;
if ((angle_m / 180.0) <= 5e+156) {
tmp = t_1 * Math.cos(Math.pow(Math.exp(-Math.log(t_0)), -1.0));
} else {
tmp = t_1 * Math.cos(((angle_m * 0.005555555555555556) / (1.0 / Math.PI)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.pi * (angle_m * 0.005555555555555556) t_1 = (b + a) * ((b - a) * (2.0 * math.sin(t_0))) tmp = 0 if (angle_m / 180.0) <= 5e+156: tmp = t_1 * math.cos(math.pow(math.exp(-math.log(t_0)), -1.0)) else: tmp = t_1 * math.cos(((angle_m * 0.005555555555555556) / (1.0 / math.pi))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(t_0)))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e+156) tmp = Float64(t_1 * cos((exp(Float64(-log(t_0))) ^ -1.0))); else tmp = Float64(t_1 * cos(Float64(Float64(angle_m * 0.005555555555555556) / Float64(1.0 / pi)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = pi * (angle_m * 0.005555555555555556); t_1 = (b + a) * ((b - a) * (2.0 * sin(t_0))); tmp = 0.0; if ((angle_m / 180.0) <= 5e+156) tmp = t_1 * cos((exp(-log(t_0)) ^ -1.0)); else tmp = t_1 * cos(((angle_m * 0.005555555555555556) / (1.0 / pi))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+156], N[(t$95$1 * N[Cos[N[Power[N[Exp[(-N[Log[t$95$0], $MachinePrecision])], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] / N[(1.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin t\_0\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+156}:\\
\;\;\;\;t\_1 \cdot \cos \left({\left(e^{-\log t\_0}\right)}^{-1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \cos \left(\frac{angle\_m \cdot 0.005555555555555556}{\frac{1}{\pi}}\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999992e156Initial program 58.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6472.3
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval73.2
Applied rewrites73.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6474.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
lift-/.f64N/A
inv-powN/A
pow-to-expN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lift-/.f64N/A
clear-numN/A
lift-*.f64N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f6438.5
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lift-*.f6438.5
Applied rewrites38.5%
if 4.99999999999999992e156 < (/.f64 angle #s(literal 180 binary64)) Initial program 37.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6442.6
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval43.1
Applied rewrites43.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6437.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6437.6
Applied rewrites37.6%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
clear-numN/A
div-invN/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f64N/A
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lift-*.f64N/A
lower-/.f6442.7
Applied rewrites42.7%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0
(*
(+ b a)
(* (- b a) (* 2.0 (sin (* PI (* angle_m 0.005555555555555556))))))))
(*
angle_s
(if (<= (pow a 2.0) 4e-290)
(* t_0 1.0)
(* t_0 (cos (* 0.005555555555555556 (/ PI (/ 1.0 angle_m)))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * ((b - a) * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))));
double tmp;
if (pow(a, 2.0) <= 4e-290) {
tmp = t_0 * 1.0;
} else {
tmp = t_0 * cos((0.005555555555555556 * (((double) M_PI) / (1.0 / angle_m))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b + a) * ((b - a) * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))));
double tmp;
if (Math.pow(a, 2.0) <= 4e-290) {
tmp = t_0 * 1.0;
} else {
tmp = t_0 * Math.cos((0.005555555555555556 * (Math.PI / (1.0 / angle_m))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (b + a) * ((b - a) * (2.0 * math.sin((math.pi * (angle_m * 0.005555555555555556))))) tmp = 0 if math.pow(a, 2.0) <= 4e-290: tmp = t_0 * 1.0 else: tmp = t_0 * math.cos((0.005555555555555556 * (math.pi / (1.0 / angle_m)))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))))) tmp = 0.0 if ((a ^ 2.0) <= 4e-290) tmp = Float64(t_0 * 1.0); else tmp = Float64(t_0 * cos(Float64(0.005555555555555556 * Float64(pi / Float64(1.0 / angle_m))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (b + a) * ((b - a) * (2.0 * sin((pi * (angle_m * 0.005555555555555556))))); tmp = 0.0; if ((a ^ 2.0) <= 4e-290) tmp = t_0 * 1.0; else tmp = t_0 * cos((0.005555555555555556 * (pi / (1.0 / angle_m)))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 4e-290], N[(t$95$0 * 1.0), $MachinePrecision], N[(t$95$0 * N[Cos[N[(0.005555555555555556 * N[(Pi / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 4 \cdot 10^{-290}:\\
\;\;\;\;t\_0 \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(0.005555555555555556 \cdot \frac{\pi}{\frac{1}{angle\_m}}\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 4.0000000000000003e-290Initial program 62.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6466.8
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval66.8
Applied rewrites66.8%
Taylor expanded in angle around 0
Applied rewrites71.9%
if 4.0000000000000003e-290 < (pow.f64 a #s(literal 2 binary64)) Initial program 51.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6467.5
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval68.8
Applied rewrites68.8%
lift-*.f64N/A
lift-/.f64N/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-/.f6469.3
Applied rewrites69.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (sin (* PI (* angle_m 0.005555555555555556))))))
(*
angle_s
(if (<= (pow a 2.0) 5e-270)
(* (* (+ b a) (* (- b a) t_0)) 1.0)
(*
(* (- b a) (* (+ b a) t_0))
(cos (* 0.005555555555555556 (* angle_m PI))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
double tmp;
if (pow(a, 2.0) <= 5e-270) {
tmp = ((b + a) * ((b - a) * t_0)) * 1.0;
} else {
tmp = ((b - a) * ((b + a) * t_0)) * cos((0.005555555555555556 * (angle_m * ((double) M_PI))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556)));
double tmp;
if (Math.pow(a, 2.0) <= 5e-270) {
tmp = ((b + a) * ((b - a) * t_0)) * 1.0;
} else {
tmp = ((b - a) * ((b + a) * t_0)) * Math.cos((0.005555555555555556 * (angle_m * Math.PI)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = 2.0 * math.sin((math.pi * (angle_m * 0.005555555555555556))) tmp = 0 if math.pow(a, 2.0) <= 5e-270: tmp = ((b + a) * ((b - a) * t_0)) * 1.0 else: tmp = ((b - a) * ((b + a) * t_0)) * math.cos((0.005555555555555556 * (angle_m * math.pi))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))) tmp = 0.0 if ((a ^ 2.0) <= 5e-270) tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * t_0)) * 1.0); else tmp = Float64(Float64(Float64(b - a) * Float64(Float64(b + a) * t_0)) * cos(Float64(0.005555555555555556 * Float64(angle_m * pi)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = 2.0 * sin((pi * (angle_m * 0.005555555555555556))); tmp = 0.0; if ((a ^ 2.0) <= 5e-270) tmp = ((b + a) * ((b - a) * t_0)) * 1.0; else tmp = ((b - a) * ((b + a) * t_0)) * cos((0.005555555555555556 * (angle_m * pi))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e-270], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{-270}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot t\_0\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot t\_0\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 4.9999999999999998e-270Initial program 62.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6467.0
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval67.0
Applied rewrites67.0%
Taylor expanded in angle around 0
Applied rewrites71.7%
if 4.9999999999999998e-270 < (pow.f64 a #s(literal 2 binary64)) Initial program 51.4%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-cos.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6450.0
Applied rewrites50.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
Applied rewrites69.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= b 2.9e+165)
(*
(*
(+ b a)
(* (- b a) (* 2.0 (sin (* PI (* angle_m 0.005555555555555556))))))
(cos (* (/ angle_m 180.0) (* (sqrt (* PI (sqrt PI))) (sqrt (sqrt PI))))))
(*
(*
(+ b a)
(*
(- b a)
(*
2.0
(sin (* (sqrt PI) (* (* angle_m 0.005555555555555556) (sqrt PI)))))))
(cos (/ (* PI 0.005555555555555556) (/ 1.0 angle_m)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 2.9e+165) {
tmp = ((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))))) * cos(((angle_m / 180.0) * (sqrt((((double) M_PI) * sqrt(((double) M_PI)))) * sqrt(sqrt(((double) M_PI))))));
} else {
tmp = ((b + a) * ((b - a) * (2.0 * sin((sqrt(((double) M_PI)) * ((angle_m * 0.005555555555555556) * sqrt(((double) M_PI)))))))) * cos(((((double) M_PI) * 0.005555555555555556) / (1.0 / angle_m)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 2.9e+165) {
tmp = ((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))))) * Math.cos(((angle_m / 180.0) * (Math.sqrt((Math.PI * Math.sqrt(Math.PI))) * Math.sqrt(Math.sqrt(Math.PI)))));
} else {
tmp = ((b + a) * ((b - a) * (2.0 * Math.sin((Math.sqrt(Math.PI) * ((angle_m * 0.005555555555555556) * Math.sqrt(Math.PI))))))) * Math.cos(((Math.PI * 0.005555555555555556) / (1.0 / angle_m)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if b <= 2.9e+165: tmp = ((b + a) * ((b - a) * (2.0 * math.sin((math.pi * (angle_m * 0.005555555555555556)))))) * math.cos(((angle_m / 180.0) * (math.sqrt((math.pi * math.sqrt(math.pi))) * math.sqrt(math.sqrt(math.pi))))) else: tmp = ((b + a) * ((b - a) * (2.0 * math.sin((math.sqrt(math.pi) * ((angle_m * 0.005555555555555556) * math.sqrt(math.pi))))))) * math.cos(((math.pi * 0.005555555555555556) / (1.0 / angle_m))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (b <= 2.9e+165) tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))))) * cos(Float64(Float64(angle_m / 180.0) * Float64(sqrt(Float64(pi * sqrt(pi))) * sqrt(sqrt(pi)))))); else tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(sqrt(pi) * Float64(Float64(angle_m * 0.005555555555555556) * sqrt(pi))))))) * cos(Float64(Float64(pi * 0.005555555555555556) / Float64(1.0 / angle_m)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (b <= 2.9e+165) tmp = ((b + a) * ((b - a) * (2.0 * sin((pi * (angle_m * 0.005555555555555556)))))) * cos(((angle_m / 180.0) * (sqrt((pi * sqrt(pi))) * sqrt(sqrt(pi))))); else tmp = ((b + a) * ((b - a) * (2.0 * sin((sqrt(pi) * ((angle_m * 0.005555555555555556) * sqrt(pi))))))) * cos(((pi * 0.005555555555555556) / (1.0 / angle_m))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 2.9e+165], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * N[(N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.9 \cdot 10^{+165}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \cos \left(\frac{angle\_m}{180} \cdot \left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\sqrt{\pi} \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \sqrt{\pi}\right)\right)\right)\right)\right) \cdot \cos \left(\frac{\pi \cdot 0.005555555555555556}{\frac{1}{angle\_m}}\right)\\
\end{array}
\end{array}
if b < 2.90000000000000006e165Initial program 55.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6465.4
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval66.3
Applied rewrites66.3%
rem-square-sqrtN/A
sqrt-unprodN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6468.7
Applied rewrites68.7%
if 2.90000000000000006e165 < b Initial program 54.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6484.5
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval84.4
Applied rewrites84.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6484.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6484.4
Applied rewrites84.4%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
associate-/r*N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f6488.2
Applied rewrites88.2%
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6473.0
Applied rewrites73.0%
Final simplification69.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(*
(*
(+ b a)
(* (- b a) (* 2.0 (sin (* PI (* angle_m 0.005555555555555556))))))
(cos (/ (* PI 0.005555555555555556) (/ 1.0 angle_m))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))))) * cos(((((double) M_PI) * 0.005555555555555556) / (1.0 / angle_m))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))))) * Math.cos(((Math.PI * 0.005555555555555556) / (1.0 / angle_m))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (((b + a) * ((b - a) * (2.0 * math.sin((math.pi * (angle_m * 0.005555555555555556)))))) * math.cos(((math.pi * 0.005555555555555556) / (1.0 / angle_m))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))))) * cos(Float64(Float64(pi * 0.005555555555555556) / Float64(1.0 / angle_m))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (((b + a) * ((b - a) * (2.0 * sin((pi * (angle_m * 0.005555555555555556)))))) * cos(((pi * 0.005555555555555556) / (1.0 / angle_m)))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \cos \left(\frac{\pi \cdot 0.005555555555555556}{\frac{1}{angle\_m}}\right)\right)
\end{array}
Initial program 55.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6467.3
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval68.2
Applied rewrites68.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6468.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.3
Applied rewrites68.3%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
associate-/r*N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f6470.0
Applied rewrites70.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow a 2.0) 4e-290)
(*
(*
(+ b a)
(* (- b a) (* 2.0 (sin (* PI (* angle_m 0.005555555555555556))))))
1.0)
(* (- b a) (* (+ b a) (sin (* PI (* angle_m 0.011111111111111112))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (pow(a, 2.0) <= 4e-290) {
tmp = ((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))))) * 1.0;
} else {
tmp = (b - a) * ((b + a) * sin((((double) M_PI) * (angle_m * 0.011111111111111112))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (Math.pow(a, 2.0) <= 4e-290) {
tmp = ((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI * (angle_m * 0.005555555555555556)))))) * 1.0;
} else {
tmp = (b - a) * ((b + a) * Math.sin((Math.PI * (angle_m * 0.011111111111111112))));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if math.pow(a, 2.0) <= 4e-290: tmp = ((b + a) * ((b - a) * (2.0 * math.sin((math.pi * (angle_m * 0.005555555555555556)))))) * 1.0 else: tmp = (b - a) * ((b + a) * math.sin((math.pi * (angle_m * 0.011111111111111112)))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if ((a ^ 2.0) <= 4e-290) tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))))) * 1.0); else tmp = Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112))))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((a ^ 2.0) <= 4e-290) tmp = ((b + a) * ((b - a) * (2.0 * sin((pi * (angle_m * 0.005555555555555556)))))) * 1.0; else tmp = (b - a) * ((b + a) * sin((pi * (angle_m * 0.011111111111111112)))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 4e-290], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 4 \cdot 10^{-290}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 4.0000000000000003e-290Initial program 62.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6466.8
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval66.8
Applied rewrites66.8%
Taylor expanded in angle around 0
Applied rewrites71.9%
if 4.0000000000000003e-290 < (pow.f64 a #s(literal 2 binary64)) Initial program 51.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6467.5
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval68.8
Applied rewrites68.8%
rem-square-sqrtN/A
sqrt-unprodN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6470.1
Applied rewrites70.1%
Applied rewrites68.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) -2e-232)
(* -0.011111111111111112 (* a (* a (* angle_m PI))))
(* (* angle_m 0.011111111111111112) (* PI (* b b))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -2e-232) {
tmp = -0.011111111111111112 * (a * (a * (angle_m * ((double) M_PI))));
} else {
tmp = (angle_m * 0.011111111111111112) * (((double) M_PI) * (b * b));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -2e-232) {
tmp = -0.011111111111111112 * (a * (a * (angle_m * Math.PI)));
} else {
tmp = (angle_m * 0.011111111111111112) * (Math.PI * (b * b));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -2e-232: tmp = -0.011111111111111112 * (a * (a * (angle_m * math.pi))) else: tmp = (angle_m * 0.011111111111111112) * (math.pi * (b * b)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -2e-232) tmp = Float64(-0.011111111111111112 * Float64(a * Float64(a * Float64(angle_m * pi)))); else tmp = Float64(Float64(angle_m * 0.011111111111111112) * Float64(pi * Float64(b * b))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= -2e-232) tmp = -0.011111111111111112 * (a * (a * (angle_m * pi))); else tmp = (angle_m * 0.011111111111111112) * (pi * (b * b)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -2e-232], N[(-0.011111111111111112 * N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-232}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot 0.011111111111111112\right) \cdot \left(\pi \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))) < -2.00000000000000005e-232Initial program 55.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6453.4
Applied rewrites53.4%
Taylor expanded in b around 0
Applied rewrites51.9%
Applied rewrites58.6%
if -2.00000000000000005e-232 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6455.9
Applied rewrites55.9%
Taylor expanded in b around 0
Applied rewrites25.5%
Taylor expanded in b around inf
Applied rewrites55.9%
Final simplification56.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (- (pow b 2.0) (pow a 2.0)) -2e-232)
(* -0.011111111111111112 (* a (* a (* angle_m PI))))
(* 0.011111111111111112 (* PI (* angle_m (* b b)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -2e-232) {
tmp = -0.011111111111111112 * (a * (a * (angle_m * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle_m * (b * b)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -2e-232) {
tmp = -0.011111111111111112 * (a * (a * (angle_m * Math.PI)));
} else {
tmp = 0.011111111111111112 * (Math.PI * (angle_m * (b * b)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -2e-232: tmp = -0.011111111111111112 * (a * (a * (angle_m * math.pi))) else: tmp = 0.011111111111111112 * (math.pi * (angle_m * (b * b))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -2e-232) tmp = Float64(-0.011111111111111112 * Float64(a * Float64(a * Float64(angle_m * pi)))); else tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle_m * Float64(b * b)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= -2e-232) tmp = -0.011111111111111112 * (a * (a * (angle_m * pi))); else tmp = 0.011111111111111112 * (pi * (angle_m * (b * b))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -2e-232], N[(-0.011111111111111112 * N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(Pi * N[(angle$95$m * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-232}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle\_m \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))) < -2.00000000000000005e-232Initial program 55.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6453.4
Applied rewrites53.4%
Taylor expanded in b around 0
Applied rewrites51.9%
Applied rewrites58.6%
if -2.00000000000000005e-232 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6455.9
Applied rewrites55.9%
Taylor expanded in b around inf
Applied rewrites55.9%
Final simplification56.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+64)
(*
(+ b a)
(*
(- b a)
(*
angle_m
(fma
-2.2862368541380886e-7
(* (* angle_m angle_m) (* PI (* PI PI)))
(* PI 0.011111111111111112)))))
(* (* (+ b a) (- b a)) (sin (* PI (* angle_m 0.011111111111111112)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 1e+64) {
tmp = (b + a) * ((b - a) * (angle_m * fma(-2.2862368541380886e-7, ((angle_m * angle_m) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.011111111111111112))));
} else {
tmp = ((b + a) * (b - a)) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+64) tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(angle_m * fma(-2.2862368541380886e-7, Float64(Float64(angle_m * angle_m) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.011111111111111112))))); else tmp = Float64(Float64(Float64(b + a) * Float64(b - a)) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112)))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+64], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(angle$95$m * N[(-2.2862368541380886e-7 * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+64}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle\_m \cdot angle\_m\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000002e64Initial program 61.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/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
Applied rewrites76.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6471.7
Applied rewrites71.7%
if 1.00000000000000002e64 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6440.9
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval39.9
Applied rewrites39.9%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites37.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6437.7
Applied rewrites37.7%
Final simplification63.4%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (+ b a) (* (- b a) (sin (/ (* PI 0.011111111111111112) (/ 1.0 angle_m)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((b + a) * ((b - a) * sin(((((double) M_PI) * 0.011111111111111112) / (1.0 / angle_m)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((b + a) * ((b - a) * Math.sin(((Math.PI * 0.011111111111111112) / (1.0 / angle_m)))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * ((b + a) * ((b - a) * math.sin(((math.pi * 0.011111111111111112) / (1.0 / angle_m)))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(Float64(pi * 0.011111111111111112) / Float64(1.0 / angle_m)))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * ((b + a) * ((b - a) * sin(((pi * 0.011111111111111112) / (1.0 / angle_m))))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(Pi * 0.011111111111111112), $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{\pi \cdot 0.011111111111111112}{\frac{1}{angle\_m}}\right)\right)\right)
\end{array}
Initial program 55.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/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
Applied rewrites64.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-PI.f64N/A
*-commutativeN/A
remove-double-divN/A
lift-/.f64N/A
un-div-invN/A
lower-/.f64N/A
lift-PI.f64N/A
lower-*.f6468.2
Applied rewrites68.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sin (* 0.011111111111111112 (* angle_m PI)))))
(*
angle_s
(if (<= b 1.6e-119)
(* (+ b a) (* (- a) t_0))
(if (<= b 2.9e+149)
(* (- b a) (* (+ b a) (* angle_m (* PI 0.011111111111111112))))
(if (<= b 1.65e+258)
(*
(+ b a)
(*
angle_m
(fma
0.011111111111111112
(* (- b a) PI)
(*
(* -2.2862368541380886e-7 (* angle_m angle_m))
(* (- b a) (* PI (* PI PI)))))))
(* (+ b a) (* b t_0))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sin((0.011111111111111112 * (angle_m * ((double) M_PI))));
double tmp;
if (b <= 1.6e-119) {
tmp = (b + a) * (-a * t_0);
} else if (b <= 2.9e+149) {
tmp = (b - a) * ((b + a) * (angle_m * (((double) M_PI) * 0.011111111111111112)));
} else if (b <= 1.65e+258) {
tmp = (b + a) * (angle_m * fma(0.011111111111111112, ((b - a) * ((double) M_PI)), ((-2.2862368541380886e-7 * (angle_m * angle_m)) * ((b - a) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))))));
} else {
tmp = (b + a) * (b * t_0);
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sin(Float64(0.011111111111111112 * Float64(angle_m * pi))) tmp = 0.0 if (b <= 1.6e-119) tmp = Float64(Float64(b + a) * Float64(Float64(-a) * t_0)); elseif (b <= 2.9e+149) tmp = Float64(Float64(b - a) * Float64(Float64(b + a) * Float64(angle_m * Float64(pi * 0.011111111111111112)))); elseif (b <= 1.65e+258) tmp = Float64(Float64(b + a) * Float64(angle_m * fma(0.011111111111111112, Float64(Float64(b - a) * pi), Float64(Float64(-2.2862368541380886e-7 * Float64(angle_m * angle_m)) * Float64(Float64(b - a) * Float64(pi * Float64(pi * pi))))))); else tmp = Float64(Float64(b + a) * Float64(b * t_0)); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 1.6e-119], N[(N[(b + a), $MachinePrecision] * N[((-a) * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.9e+149], N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.65e+258], N[(N[(b + a), $MachinePrecision] * N[(angle$95$m * N[(0.011111111111111112 * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision] + N[(N[(-2.2862368541380886e-7 * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(b * t$95$0), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 1.6 \cdot 10^{-119}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(-a\right) \cdot t\_0\right)\\
\mathbf{elif}\;b \leq 2.9 \cdot 10^{+149}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{elif}\;b \leq 1.65 \cdot 10^{+258}:\\
\;\;\;\;\left(b + a\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(0.011111111111111112, \left(b - a\right) \cdot \pi, \left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle\_m \cdot angle\_m\right)\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(b \cdot t\_0\right)\\
\end{array}
\end{array}
\end{array}
if b < 1.59999999999999997e-119Initial program 55.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/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
Applied rewrites62.8%
Taylor expanded in b around 0
mul-1-negN/A
lower-neg.f6441.2
Applied rewrites41.2%
if 1.59999999999999997e-119 < b < 2.9000000000000002e149Initial program 57.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6461.7
Applied rewrites61.7%
Applied rewrites69.6%
if 2.9000000000000002e149 < b < 1.64999999999999998e258Initial program 38.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/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
Applied rewrites70.7%
Taylor expanded in angle around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6479.5
Applied rewrites79.5%
if 1.64999999999999998e258 < b Initial program 85.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/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
Applied rewrites85.7%
Taylor expanded in b around inf
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6485.7
Applied rewrites85.7%
Final simplification51.4%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (sin (* 0.011111111111111112 (* angle_m PI)))))
(*
angle_s
(if (<= b 2.8e-151)
(* t_0 (- (* a a)))
(if (<= b 2.9e+149)
(* (- b a) (* (+ b a) (* angle_m (* PI 0.011111111111111112))))
(if (<= b 1.65e+258)
(*
(+ b a)
(*
angle_m
(fma
0.011111111111111112
(* (- b a) PI)
(*
(* -2.2862368541380886e-7 (* angle_m angle_m))
(* (- b a) (* PI (* PI PI)))))))
(* (+ b a) (* b t_0))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sin((0.011111111111111112 * (angle_m * ((double) M_PI))));
double tmp;
if (b <= 2.8e-151) {
tmp = t_0 * -(a * a);
} else if (b <= 2.9e+149) {
tmp = (b - a) * ((b + a) * (angle_m * (((double) M_PI) * 0.011111111111111112)));
} else if (b <= 1.65e+258) {
tmp = (b + a) * (angle_m * fma(0.011111111111111112, ((b - a) * ((double) M_PI)), ((-2.2862368541380886e-7 * (angle_m * angle_m)) * ((b - a) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))))));
} else {
tmp = (b + a) * (b * t_0);
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sin(Float64(0.011111111111111112 * Float64(angle_m * pi))) tmp = 0.0 if (b <= 2.8e-151) tmp = Float64(t_0 * Float64(-Float64(a * a))); elseif (b <= 2.9e+149) tmp = Float64(Float64(b - a) * Float64(Float64(b + a) * Float64(angle_m * Float64(pi * 0.011111111111111112)))); elseif (b <= 1.65e+258) tmp = Float64(Float64(b + a) * Float64(angle_m * fma(0.011111111111111112, Float64(Float64(b - a) * pi), Float64(Float64(-2.2862368541380886e-7 * Float64(angle_m * angle_m)) * Float64(Float64(b - a) * Float64(pi * Float64(pi * pi))))))); else tmp = Float64(Float64(b + a) * Float64(b * t_0)); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 2.8e-151], N[(t$95$0 * (-N[(a * a), $MachinePrecision])), $MachinePrecision], If[LessEqual[b, 2.9e+149], N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.65e+258], N[(N[(b + a), $MachinePrecision] * N[(angle$95$m * N[(0.011111111111111112 * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision] + N[(N[(-2.2862368541380886e-7 * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(b * t$95$0), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.8 \cdot 10^{-151}:\\
\;\;\;\;t\_0 \cdot \left(-a \cdot a\right)\\
\mathbf{elif}\;b \leq 2.9 \cdot 10^{+149}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{elif}\;b \leq 1.65 \cdot 10^{+258}:\\
\;\;\;\;\left(b + a\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(0.011111111111111112, \left(b - a\right) \cdot \pi, \left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle\_m \cdot angle\_m\right)\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(b \cdot t\_0\right)\\
\end{array}
\end{array}
\end{array}
if b < 2.8000000000000001e-151Initial program 54.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6464.4
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval65.8
Applied rewrites65.8%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites58.7%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6438.3
Applied rewrites38.3%
if 2.8000000000000001e-151 < b < 2.9000000000000002e149Initial program 60.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6463.8
Applied rewrites63.8%
Applied rewrites72.3%
if 2.9000000000000002e149 < b < 1.64999999999999998e258Initial program 38.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/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
Applied rewrites70.7%
Taylor expanded in angle around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6479.5
Applied rewrites79.5%
if 1.64999999999999998e258 < b Initial program 85.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/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
Applied rewrites85.7%
Taylor expanded in b around inf
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6485.7
Applied rewrites85.7%
Final simplification50.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow a 2.0) 5e+302)
(* angle_m (* (* PI 0.011111111111111112) (* (+ b a) (- b a))))
(* -0.011111111111111112 (* a (* a (* angle_m PI)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (pow(a, 2.0) <= 5e+302) {
tmp = angle_m * ((((double) M_PI) * 0.011111111111111112) * ((b + a) * (b - a)));
} else {
tmp = -0.011111111111111112 * (a * (a * (angle_m * ((double) M_PI))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (Math.pow(a, 2.0) <= 5e+302) {
tmp = angle_m * ((Math.PI * 0.011111111111111112) * ((b + a) * (b - a)));
} else {
tmp = -0.011111111111111112 * (a * (a * (angle_m * Math.PI)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if math.pow(a, 2.0) <= 5e+302: tmp = angle_m * ((math.pi * 0.011111111111111112) * ((b + a) * (b - a))) else: tmp = -0.011111111111111112 * (a * (a * (angle_m * math.pi))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if ((a ^ 2.0) <= 5e+302) tmp = Float64(angle_m * Float64(Float64(pi * 0.011111111111111112) * Float64(Float64(b + a) * Float64(b - a)))); else tmp = Float64(-0.011111111111111112 * Float64(a * Float64(a * Float64(angle_m * pi)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((a ^ 2.0) <= 5e+302) tmp = angle_m * ((pi * 0.011111111111111112) * ((b + a) * (b - a))); else tmp = -0.011111111111111112 * (a * (a * (angle_m * pi))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+302], N[(angle$95$m * N[(N[(Pi * 0.011111111111111112), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+302}:\\
\;\;\;\;angle\_m \cdot \left(\left(\pi \cdot 0.011111111111111112\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 5e302Initial program 58.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.7
Applied rewrites54.7%
Applied rewrites54.8%
if 5e302 < (pow.f64 a #s(literal 2 binary64)) Initial program 40.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6456.0
Applied rewrites56.0%
Taylor expanded in b around 0
Applied rewrites54.1%
Applied rewrites69.1%
Final simplification57.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (pow a 2.0) 5e+302)
(* (* (+ b a) (- b a)) (* angle_m (* PI 0.011111111111111112)))
(* -0.011111111111111112 (* a (* a (* angle_m PI)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (pow(a, 2.0) <= 5e+302) {
tmp = ((b + a) * (b - a)) * (angle_m * (((double) M_PI) * 0.011111111111111112));
} else {
tmp = -0.011111111111111112 * (a * (a * (angle_m * ((double) M_PI))));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (Math.pow(a, 2.0) <= 5e+302) {
tmp = ((b + a) * (b - a)) * (angle_m * (Math.PI * 0.011111111111111112));
} else {
tmp = -0.011111111111111112 * (a * (a * (angle_m * Math.PI)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if math.pow(a, 2.0) <= 5e+302: tmp = ((b + a) * (b - a)) * (angle_m * (math.pi * 0.011111111111111112)) else: tmp = -0.011111111111111112 * (a * (a * (angle_m * math.pi))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if ((a ^ 2.0) <= 5e+302) tmp = Float64(Float64(Float64(b + a) * Float64(b - a)) * Float64(angle_m * Float64(pi * 0.011111111111111112))); else tmp = Float64(-0.011111111111111112 * Float64(a * Float64(a * Float64(angle_m * pi)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((a ^ 2.0) <= 5e+302) tmp = ((b + a) * (b - a)) * (angle_m * (pi * 0.011111111111111112)); else tmp = -0.011111111111111112 * (a * (a * (angle_m * pi))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+302], N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+302}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 5e302Initial program 58.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.7
Applied rewrites54.7%
if 5e302 < (pow.f64 a #s(literal 2 binary64)) Initial program 40.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6456.0
Applied rewrites56.0%
Taylor expanded in b around 0
Applied rewrites54.1%
Applied rewrites69.1%
Final simplification57.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (- b a) (* (+ b a) (* angle_m (* PI 0.011111111111111112))))))
(*
angle_s
(if (<= b 2.8e-151)
(* (sin (* 0.011111111111111112 (* angle_m PI))) (- (* a a)))
(if (<= b 2.9e+149)
t_0
(if (<= b 6.3e+257)
(*
(+ b a)
(*
angle_m
(fma
0.011111111111111112
(* (- b a) PI)
(*
(* -2.2862368541380886e-7 (* angle_m angle_m))
(* (- b a) (* PI (* PI PI)))))))
t_0))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (b - a) * ((b + a) * (angle_m * (((double) M_PI) * 0.011111111111111112)));
double tmp;
if (b <= 2.8e-151) {
tmp = sin((0.011111111111111112 * (angle_m * ((double) M_PI)))) * -(a * a);
} else if (b <= 2.9e+149) {
tmp = t_0;
} else if (b <= 6.3e+257) {
tmp = (b + a) * (angle_m * fma(0.011111111111111112, ((b - a) * ((double) M_PI)), ((-2.2862368541380886e-7 * (angle_m * angle_m)) * ((b - a) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))))));
} else {
tmp = t_0;
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(b - a) * Float64(Float64(b + a) * Float64(angle_m * Float64(pi * 0.011111111111111112)))) tmp = 0.0 if (b <= 2.8e-151) tmp = Float64(sin(Float64(0.011111111111111112 * Float64(angle_m * pi))) * Float64(-Float64(a * a))); elseif (b <= 2.9e+149) tmp = t_0; elseif (b <= 6.3e+257) tmp = Float64(Float64(b + a) * Float64(angle_m * fma(0.011111111111111112, Float64(Float64(b - a) * pi), Float64(Float64(-2.2862368541380886e-7 * Float64(angle_m * angle_m)) * Float64(Float64(b - a) * Float64(pi * Float64(pi * pi))))))); else tmp = t_0; end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 2.8e-151], N[(N[Sin[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[(a * a), $MachinePrecision])), $MachinePrecision], If[LessEqual[b, 2.9e+149], t$95$0, If[LessEqual[b, 6.3e+257], N[(N[(b + a), $MachinePrecision] * N[(angle$95$m * N[(0.011111111111111112 * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision] + N[(N[(-2.2862368541380886e-7 * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.8 \cdot 10^{-151}:\\
\;\;\;\;\sin \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(-a \cdot a\right)\\
\mathbf{elif}\;b \leq 2.9 \cdot 10^{+149}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 6.3 \cdot 10^{+257}:\\
\;\;\;\;\left(b + a\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(0.011111111111111112, \left(b - a\right) \cdot \pi, \left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle\_m \cdot angle\_m\right)\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if b < 2.8000000000000001e-151Initial program 54.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6464.4
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval65.8
Applied rewrites65.8%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites58.7%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6438.3
Applied rewrites38.3%
if 2.8000000000000001e-151 < b < 2.9000000000000002e149 or 6.30000000000000012e257 < b Initial program 63.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6464.6
Applied rewrites64.6%
Applied rewrites72.2%
if 2.9000000000000002e149 < b < 6.30000000000000012e257Initial program 38.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/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
Applied rewrites70.7%
Taylor expanded in angle around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6479.5
Applied rewrites79.5%
Final simplification50.5%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (- b a) (* (+ b a) (sin (* PI (* angle_m 0.011111111111111112)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((b - a) * ((b + a) * sin((((double) M_PI) * (angle_m * 0.011111111111111112)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((b - a) * ((b + a) * Math.sin((Math.PI * (angle_m * 0.011111111111111112)))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * ((b - a) * ((b + a) * math.sin((math.pi * (angle_m * 0.011111111111111112)))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(pi * Float64(angle_m * 0.011111111111111112)))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * ((b - a) * ((b + a) * sin((pi * (angle_m * 0.011111111111111112))))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\right)\right)
\end{array}
Initial program 55.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/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
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6467.3
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval68.2
Applied rewrites68.2%
rem-square-sqrtN/A
sqrt-unprodN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6468.4
Applied rewrites68.4%
Applied rewrites67.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+64)
(*
(+ b a)
(*
(- b a)
(*
angle_m
(fma
-2.2862368541380886e-7
(* (* angle_m angle_m) (* PI (* PI PI)))
(* PI 0.011111111111111112)))))
(* (* (+ b a) (- b a)) (* PI (* angle_m 0.011111111111111112))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 1e+64) {
tmp = (b + a) * ((b - a) * (angle_m * fma(-2.2862368541380886e-7, ((angle_m * angle_m) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.011111111111111112))));
} else {
tmp = ((b + a) * (b - a)) * (((double) M_PI) * (angle_m * 0.011111111111111112));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+64) tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(angle_m * fma(-2.2862368541380886e-7, Float64(Float64(angle_m * angle_m) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.011111111111111112))))); else tmp = Float64(Float64(Float64(b + a) * Float64(b - a)) * Float64(pi * Float64(angle_m * 0.011111111111111112))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+64], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(angle$95$m * N[(-2.2862368541380886e-7 * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+64}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle\_m \cdot angle\_m\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000002e64Initial program 61.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/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
Applied rewrites76.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6471.7
Applied rewrites71.7%
if 1.00000000000000002e64 < (/.f64 angle #s(literal 180 binary64)) Initial program 36.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6428.8
Applied rewrites28.8%
Applied rewrites28.8%
Final simplification61.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 5e-76)
(* -0.011111111111111112 (* a (* a (* angle_m PI))))
(* -0.011111111111111112 (* angle_m (* PI (* a a)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 5e-76) {
tmp = -0.011111111111111112 * (a * (a * (angle_m * ((double) M_PI))));
} else {
tmp = -0.011111111111111112 * (angle_m * (((double) M_PI) * (a * a)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 5e-76) {
tmp = -0.011111111111111112 * (a * (a * (angle_m * Math.PI)));
} else {
tmp = -0.011111111111111112 * (angle_m * (Math.PI * (a * a)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 5e-76: tmp = -0.011111111111111112 * (a * (a * (angle_m * math.pi))) else: tmp = -0.011111111111111112 * (angle_m * (math.pi * (a * a))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-76) tmp = Float64(-0.011111111111111112 * Float64(a * Float64(a * Float64(angle_m * pi)))); else tmp = Float64(-0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(a * a)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 5e-76) tmp = -0.011111111111111112 * (a * (a * (angle_m * pi))); else tmp = -0.011111111111111112 * (angle_m * (pi * (a * a))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-76], N[(-0.011111111111111112 * N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-76}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.9999999999999998e-76Initial program 60.7%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6464.9
Applied rewrites64.9%
Taylor expanded in b around 0
Applied rewrites42.5%
Applied rewrites44.9%
if 4.9999999999999998e-76 < (/.f64 angle #s(literal 180 binary64)) Initial program 44.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6437.3
Applied rewrites37.3%
Taylor expanded in b around 0
Applied rewrites23.0%
Applied rewrites23.1%
Final simplification37.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (/ angle_m 180.0) 3e-25)
(* -0.011111111111111112 (* a (* a (* angle_m PI))))
(* -0.011111111111111112 (* PI (* angle_m (* a a)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 3e-25) {
tmp = -0.011111111111111112 * (a * (a * (angle_m * ((double) M_PI))));
} else {
tmp = -0.011111111111111112 * (((double) M_PI) * (angle_m * (a * a)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 3e-25) {
tmp = -0.011111111111111112 * (a * (a * (angle_m * Math.PI)));
} else {
tmp = -0.011111111111111112 * (Math.PI * (angle_m * (a * a)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 3e-25: tmp = -0.011111111111111112 * (a * (a * (angle_m * math.pi))) else: tmp = -0.011111111111111112 * (math.pi * (angle_m * (a * a))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 3e-25) tmp = Float64(-0.011111111111111112 * Float64(a * Float64(a * Float64(angle_m * pi)))); else tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(angle_m * Float64(a * a)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 3e-25) tmp = -0.011111111111111112 * (a * (a * (angle_m * pi))); else tmp = -0.011111111111111112 * (pi * (angle_m * (a * a))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 3e-25], N[(-0.011111111111111112 * N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(Pi * N[(angle$95$m * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 3 \cdot 10^{-25}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(angle\_m \cdot \left(a \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.9999999999999998e-25Initial program 62.5%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6466.4
Applied rewrites66.4%
Taylor expanded in b around 0
Applied rewrites42.9%
Applied rewrites45.2%
if 2.9999999999999998e-25 < (/.f64 angle #s(literal 180 binary64)) Initial program 39.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6430.7
Applied rewrites30.7%
Taylor expanded in b around 0
Applied rewrites19.7%
Final simplification37.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= b 2.8e-151)
(* (* a a) (* (* angle_m PI) -0.011111111111111112))
(* (- b a) (* (+ b a) (* angle_m (* PI 0.011111111111111112)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 2.8e-151) {
tmp = (a * a) * ((angle_m * ((double) M_PI)) * -0.011111111111111112);
} else {
tmp = (b - a) * ((b + a) * (angle_m * (((double) M_PI) * 0.011111111111111112)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 2.8e-151) {
tmp = (a * a) * ((angle_m * Math.PI) * -0.011111111111111112);
} else {
tmp = (b - a) * ((b + a) * (angle_m * (Math.PI * 0.011111111111111112)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if b <= 2.8e-151: tmp = (a * a) * ((angle_m * math.pi) * -0.011111111111111112) else: tmp = (b - a) * ((b + a) * (angle_m * (math.pi * 0.011111111111111112))) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (b <= 2.8e-151) tmp = Float64(Float64(a * a) * Float64(Float64(angle_m * pi) * -0.011111111111111112)); else tmp = Float64(Float64(b - a) * Float64(Float64(b + a) * Float64(angle_m * Float64(pi * 0.011111111111111112)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (b <= 2.8e-151) tmp = (a * a) * ((angle_m * pi) * -0.011111111111111112); else tmp = (b - a) * ((b + a) * (angle_m * (pi * 0.011111111111111112))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 2.8e-151], N[(N[(a * a), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 2.8 \cdot 10^{-151}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.8000000000000001e-151Initial program 54.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6453.6
Applied rewrites53.6%
Taylor expanded in b around 0
Applied rewrites35.3%
Applied rewrites35.3%
if 2.8000000000000001e-151 < b Initial program 56.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.8
Applied rewrites57.8%
Applied rewrites70.6%
Final simplification47.3%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* -0.011111111111111112 (* a (* a (* angle_m PI))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (-0.011111111111111112 * (a * (a * (angle_m * ((double) M_PI)))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (-0.011111111111111112 * (a * (a * (angle_m * Math.PI))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (-0.011111111111111112 * (a * (a * (angle_m * math.pi))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(-0.011111111111111112 * Float64(a * Float64(a * Float64(angle_m * pi))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (-0.011111111111111112 * (a * (a * (angle_m * pi)))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(-0.011111111111111112 * N[(a * N[(a * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 55.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6455.0
Applied rewrites55.0%
Taylor expanded in b around 0
Applied rewrites35.5%
Applied rewrites36.3%
Final simplification36.3%
herbie shell --seed 2024221
(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)))))