
(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}
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0
(*
(* (sin (* (* 0.005555555555555556 angle_m) PI)) (+ a_m b))
(- b a_m))))
(*
angle_s
(if (<= a_m 2e+203)
(*
(* 2.0 (sin (fma (* 0.005555555555555556 angle_m) PI (/ PI 2.0))))
t_0)
(*
(* 2.0 (sin (fma (- (* 0.005555555555555556 angle_m)) PI (/ PI 2.0))))
t_0)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * (a_m + b)) * (b - a_m);
double tmp;
if (a_m <= 2e+203) {
tmp = (2.0 * sin(fma((0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)))) * t_0;
} else {
tmp = (2.0 * sin(fma(-(0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)))) * t_0;
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * Float64(a_m + b)) * Float64(b - a_m)) tmp = 0.0 if (a_m <= 2e+203) tmp = Float64(Float64(2.0 * sin(fma(Float64(0.005555555555555556 * angle_m), pi, Float64(pi / 2.0)))) * t_0); else tmp = Float64(Float64(2.0 * sin(fma(Float64(-Float64(0.005555555555555556 * angle_m)), pi, Float64(pi / 2.0)))) * t_0); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[a$95$m, 2e+203], N[(N[(2.0 * N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(2.0 * N[Sin[N[((-N[(0.005555555555555556 * angle$95$m), $MachinePrecision]) * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 2 \cdot 10^{+203}:\\
\;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \pi, \frac{\pi}{2}\right)\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556 \cdot angle\_m, \pi, \frac{\pi}{2}\right)\right)\right) \cdot t\_0\\
\end{array}
\end{array}
\end{array}
if a < 2e203Initial program 55.4%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites56.6%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites65.3%
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6465.6
Applied rewrites65.6%
if 2e203 < a Initial program 46.0%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites60.8%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites74.4%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-neg.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites75.1%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (sin (* (* 0.005555555555555556 angle_m) PI))))
(*
angle_s
(if (<= a_m 4e+203)
(*
(* 2.0 (sin (fma (* 0.005555555555555556 angle_m) PI (/ PI 2.0))))
(* (* t_0 (+ a_m b)) (- b a_m)))
(*
(* 2.0 (sin (fma (- (* 0.005555555555555556 angle_m)) PI (/ PI 2.0))))
(* (* t_0 a_m) (- b a_m)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = sin(((0.005555555555555556 * angle_m) * ((double) M_PI)));
double tmp;
if (a_m <= 4e+203) {
tmp = (2.0 * sin(fma((0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)))) * ((t_0 * (a_m + b)) * (b - a_m));
} else {
tmp = (2.0 * sin(fma(-(0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)))) * ((t_0 * a_m) * (b - a_m));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) tmp = 0.0 if (a_m <= 4e+203) tmp = Float64(Float64(2.0 * sin(fma(Float64(0.005555555555555556 * angle_m), pi, Float64(pi / 2.0)))) * Float64(Float64(t_0 * Float64(a_m + b)) * Float64(b - a_m))); else tmp = Float64(Float64(2.0 * sin(fma(Float64(-Float64(0.005555555555555556 * angle_m)), pi, Float64(pi / 2.0)))) * Float64(Float64(t_0 * a_m) * Float64(b - a_m))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[a$95$m, 4e+203], N[(N[(2.0 * N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[((-N[(0.005555555555555556 * angle$95$m), $MachinePrecision]) * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 4 \cdot 10^{+203}:\\
\;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \pi, \frac{\pi}{2}\right)\right)\right) \cdot \left(\left(t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556 \cdot angle\_m, \pi, \frac{\pi}{2}\right)\right)\right) \cdot \left(\left(t\_0 \cdot a\_m\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if a < 4e203Initial program 55.3%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites56.5%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites65.3%
lift-cos.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6465.6
Applied rewrites65.6%
if 4e203 < a Initial program 46.1%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites60.9%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites74.4%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-neg.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites75.1%
Taylor expanded in a around inf
Applied rewrites71.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (* PI angle_m) 0.005555555555555556)) (t_1 (* 2.0 (cos t_0))))
(*
angle_s
(if (<= angle_m 0.01)
(*
t_1
(*
(*
(*
(fma
0.005555555555555556
PI
(* (* -2.8577960676726107e-8 (* angle_m angle_m)) (* (* PI PI) PI)))
angle_m)
(+ a_m b))
(- b a_m)))
(if (<= angle_m 3.15e+150)
(* t_1 (* (sin t_0) (* (+ b a_m) (- b a_m))))
(*
(* 2.0 (sin (* -0.005555555555555556 (* angle_m PI))))
(*
(* (sin (* (* 0.005555555555555556 angle_m) PI)) (+ a_m b))
(- b a_m))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (((double) M_PI) * angle_m) * 0.005555555555555556;
double t_1 = 2.0 * cos(t_0);
double tmp;
if (angle_m <= 0.01) {
tmp = t_1 * (((fma(0.005555555555555556, ((double) M_PI), ((-2.8577960676726107e-8 * (angle_m * angle_m)) * ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)))) * angle_m) * (a_m + b)) * (b - a_m));
} else if (angle_m <= 3.15e+150) {
tmp = t_1 * (sin(t_0) * ((b + a_m) * (b - a_m)));
} else {
tmp = (2.0 * sin((-0.005555555555555556 * (angle_m * ((double) M_PI))))) * ((sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * (a_m + b)) * (b - a_m));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(pi * angle_m) * 0.005555555555555556) t_1 = Float64(2.0 * cos(t_0)) tmp = 0.0 if (angle_m <= 0.01) tmp = Float64(t_1 * Float64(Float64(Float64(fma(0.005555555555555556, pi, Float64(Float64(-2.8577960676726107e-8 * Float64(angle_m * angle_m)) * Float64(Float64(pi * pi) * pi))) * angle_m) * Float64(a_m + b)) * Float64(b - a_m))); elseif (angle_m <= 3.15e+150) tmp = Float64(t_1 * Float64(sin(t_0) * Float64(Float64(b + a_m) * Float64(b - a_m)))); else tmp = Float64(Float64(2.0 * sin(Float64(-0.005555555555555556 * Float64(angle_m * pi)))) * Float64(Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * Float64(a_m + b)) * Float64(b - a_m))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 0.01], N[(t$95$1 * N[(N[(N[(N[(0.005555555555555556 * Pi + N[(N[(-2.8577960676726107e-8 * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 3.15e+150], N[(t$95$1 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
t_1 := 2 \cdot \cos t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 0.01:\\
\;\;\;\;t\_1 \cdot \left(\left(\left(\mathsf{fma}\left(0.005555555555555556, \pi, \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle\_m \cdot angle\_m\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\right) \cdot angle\_m\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{elif}\;angle\_m \leq 3.15 \cdot 10^{+150}:\\
\;\;\;\;t\_1 \cdot \left(\sin t\_0 \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 0.0100000000000000002Initial program 75.3%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites79.5%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.6%
if 0.0100000000000000002 < angle < 3.15000000000000015e150Initial program 36.1%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites40.0%
if 3.15000000000000015e150 < angle Initial program 29.9%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites31.9%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites30.9%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-neg.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites32.1%
Taylor expanded in angle around inf
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6432.1
Applied rewrites32.1%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* -0.005555555555555556 (* angle_m PI))))
(*
angle_s
(if (<= angle_m 3.15e+150)
(*
(*
(*
(* (+ a_m b) (sin (* (* angle_m PI) 0.005555555555555556)))
(- b a_m))
(cos t_0))
2.0)
(*
(* 2.0 (sin t_0))
(*
(* (sin (* (* 0.005555555555555556 angle_m) PI)) (+ a_m b))
(- b a_m)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = -0.005555555555555556 * (angle_m * ((double) M_PI));
double tmp;
if (angle_m <= 3.15e+150) {
tmp = ((((a_m + b) * sin(((angle_m * ((double) M_PI)) * 0.005555555555555556))) * (b - a_m)) * cos(t_0)) * 2.0;
} else {
tmp = (2.0 * sin(t_0)) * ((sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * (a_m + b)) * (b - a_m));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = -0.005555555555555556 * (angle_m * Math.PI);
double tmp;
if (angle_m <= 3.15e+150) {
tmp = ((((a_m + b) * Math.sin(((angle_m * Math.PI) * 0.005555555555555556))) * (b - a_m)) * Math.cos(t_0)) * 2.0;
} else {
tmp = (2.0 * Math.sin(t_0)) * ((Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * (a_m + b)) * (b - a_m));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = -0.005555555555555556 * (angle_m * math.pi) tmp = 0 if angle_m <= 3.15e+150: tmp = ((((a_m + b) * math.sin(((angle_m * math.pi) * 0.005555555555555556))) * (b - a_m)) * math.cos(t_0)) * 2.0 else: tmp = (2.0 * math.sin(t_0)) * ((math.sin(((0.005555555555555556 * angle_m) * math.pi)) * (a_m + b)) * (b - a_m)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(-0.005555555555555556 * Float64(angle_m * pi)) tmp = 0.0 if (angle_m <= 3.15e+150) tmp = Float64(Float64(Float64(Float64(Float64(a_m + b) * sin(Float64(Float64(angle_m * pi) * 0.005555555555555556))) * Float64(b - a_m)) * cos(t_0)) * 2.0); else tmp = Float64(Float64(2.0 * sin(t_0)) * Float64(Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * Float64(a_m + b)) * Float64(b - a_m))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = -0.005555555555555556 * (angle_m * pi); tmp = 0.0; if (angle_m <= 3.15e+150) tmp = ((((a_m + b) * sin(((angle_m * pi) * 0.005555555555555556))) * (b - a_m)) * cos(t_0)) * 2.0; else tmp = (2.0 * sin(t_0)) * ((sin(((0.005555555555555556 * angle_m) * pi)) * (a_m + b)) * (b - a_m)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 3.15e+150], N[(N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := -0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 3.15 \cdot 10^{+150}:\\
\;\;\;\;\left(\left(\left(\left(a\_m + b\right) \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \cos t\_0\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin t\_0\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 3.15000000000000015e150Initial program 62.2%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites66.3%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites79.6%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-neg.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites79.3%
Applied rewrites79.6%
if 3.15000000000000015e150 < angle Initial program 29.9%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites31.9%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites30.9%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-neg.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites32.1%
Taylor expanded in angle around inf
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6432.1
Applied rewrites32.1%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle_m) PI)))
(*
angle_s
(if (<= angle_m 1e-5)
(*
(* 2.0 (cos (* (* PI angle_m) 0.005555555555555556)))
(*
(*
(*
(fma
0.005555555555555556
PI
(* (* -2.8577960676726107e-8 (* angle_m angle_m)) (* (* PI PI) PI)))
angle_m)
(+ a_m b))
(- b a_m)))
(if (<= angle_m 1.6e+146)
(* (sin (* 2.0 t_0)) (* (- b a_m) (+ a_m b)))
(*
(* 2.0 (sin (* -0.005555555555555556 (* angle_m PI))))
(* (* (sin t_0) (+ a_m b)) (- b a_m))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (0.005555555555555556 * angle_m) * ((double) M_PI);
double tmp;
if (angle_m <= 1e-5) {
tmp = (2.0 * cos(((((double) M_PI) * angle_m) * 0.005555555555555556))) * (((fma(0.005555555555555556, ((double) M_PI), ((-2.8577960676726107e-8 * (angle_m * angle_m)) * ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)))) * angle_m) * (a_m + b)) * (b - a_m));
} else if (angle_m <= 1.6e+146) {
tmp = sin((2.0 * t_0)) * ((b - a_m) * (a_m + b));
} else {
tmp = (2.0 * sin((-0.005555555555555556 * (angle_m * ((double) M_PI))))) * ((sin(t_0) * (a_m + b)) * (b - a_m));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(0.005555555555555556 * angle_m) * pi) tmp = 0.0 if (angle_m <= 1e-5) tmp = Float64(Float64(2.0 * cos(Float64(Float64(pi * angle_m) * 0.005555555555555556))) * Float64(Float64(Float64(fma(0.005555555555555556, pi, Float64(Float64(-2.8577960676726107e-8 * Float64(angle_m * angle_m)) * Float64(Float64(pi * pi) * pi))) * angle_m) * Float64(a_m + b)) * Float64(b - a_m))); elseif (angle_m <= 1.6e+146) tmp = Float64(sin(Float64(2.0 * t_0)) * Float64(Float64(b - a_m) * Float64(a_m + b))); else tmp = Float64(Float64(2.0 * sin(Float64(-0.005555555555555556 * Float64(angle_m * pi)))) * Float64(Float64(sin(t_0) * Float64(a_m + b)) * Float64(b - a_m))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 1e-5], N[(N[(2.0 * N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(0.005555555555555556 * Pi + N[(N[(-2.8577960676726107e-8 * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 1.6e+146], N[(N[Sin[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 10^{-5}:\\
\;\;\;\;\left(2 \cdot \cos \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right) \cdot \left(\left(\left(\mathsf{fma}\left(0.005555555555555556, \pi, \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle\_m \cdot angle\_m\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\right) \cdot angle\_m\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{elif}\;angle\_m \leq 1.6 \cdot 10^{+146}:\\
\;\;\;\;\sin \left(2 \cdot t\_0\right) \cdot \left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right) \cdot \left(\left(\sin t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 1.00000000000000008e-5Initial program 75.1%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites79.3%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.6%
if 1.00000000000000008e-5 < angle < 1.6e146Initial program 37.4%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites41.1%
Applied rewrites41.0%
if 1.6e146 < angle Initial program 30.0%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites32.1%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites30.9%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-neg.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites32.2%
Taylor expanded in angle around inf
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6432.3
Applied rewrites32.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle_m) PI)) (t_1 (sin t_0)))
(*
angle_s
(if (<= angle_m 1.6e+146)
(* (* (* (cos t_0) 2.0) (* (+ a_m b) t_1)) (- b a_m))
(*
(* 2.0 (sin (* -0.005555555555555556 (* angle_m PI))))
(* (* t_1 (+ a_m b)) (- b a_m)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (0.005555555555555556 * angle_m) * ((double) M_PI);
double t_1 = sin(t_0);
double tmp;
if (angle_m <= 1.6e+146) {
tmp = ((cos(t_0) * 2.0) * ((a_m + b) * t_1)) * (b - a_m);
} else {
tmp = (2.0 * sin((-0.005555555555555556 * (angle_m * ((double) M_PI))))) * ((t_1 * (a_m + b)) * (b - a_m));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (0.005555555555555556 * angle_m) * Math.PI;
double t_1 = Math.sin(t_0);
double tmp;
if (angle_m <= 1.6e+146) {
tmp = ((Math.cos(t_0) * 2.0) * ((a_m + b) * t_1)) * (b - a_m);
} else {
tmp = (2.0 * Math.sin((-0.005555555555555556 * (angle_m * Math.PI)))) * ((t_1 * (a_m + b)) * (b - a_m));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = (0.005555555555555556 * angle_m) * math.pi t_1 = math.sin(t_0) tmp = 0 if angle_m <= 1.6e+146: tmp = ((math.cos(t_0) * 2.0) * ((a_m + b) * t_1)) * (b - a_m) else: tmp = (2.0 * math.sin((-0.005555555555555556 * (angle_m * math.pi)))) * ((t_1 * (a_m + b)) * (b - a_m)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(0.005555555555555556 * angle_m) * pi) t_1 = sin(t_0) tmp = 0.0 if (angle_m <= 1.6e+146) tmp = Float64(Float64(Float64(cos(t_0) * 2.0) * Float64(Float64(a_m + b) * t_1)) * Float64(b - a_m)); else tmp = Float64(Float64(2.0 * sin(Float64(-0.005555555555555556 * Float64(angle_m * pi)))) * Float64(Float64(t_1 * Float64(a_m + b)) * Float64(b - a_m))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = (0.005555555555555556 * angle_m) * pi; t_1 = sin(t_0); tmp = 0.0; if (angle_m <= 1.6e+146) tmp = ((cos(t_0) * 2.0) * ((a_m + b) * t_1)) * (b - a_m); else tmp = (2.0 * sin((-0.005555555555555556 * (angle_m * pi)))) * ((t_1 * (a_m + b)) * (b - a_m)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 1.6e+146], N[(N[(N[(N[Cos[t$95$0], $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\\
t_1 := \sin t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 1.6 \cdot 10^{+146}:\\
\;\;\;\;\left(\left(\cos t\_0 \cdot 2\right) \cdot \left(\left(a\_m + b\right) \cdot t\_1\right)\right) \cdot \left(b - a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right) \cdot \left(\left(t\_1 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 1.6e146Initial program 62.4%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites66.5%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites80.1%
Applied rewrites79.9%
if 1.6e146 < angle Initial program 30.0%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites32.1%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites30.9%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-neg.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites32.2%
Taylor expanded in angle around inf
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6432.3
Applied rewrites32.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle_m) PI))
(t_1 (sin t_0))
(t_2 (* (* t_1 (+ a_m b)) (- b a_m))))
(*
angle_s
(if (<= a_m 2.65e-198)
(* (* (* (* b (cos t_0)) t_1) b) 2.0)
(if (<= a_m 6e+149)
(* 2.0 t_2)
(*
(fma (* -3.08641975308642e-5 (* angle_m angle_m)) (* PI PI) 2.0)
t_2))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (0.005555555555555556 * angle_m) * ((double) M_PI);
double t_1 = sin(t_0);
double t_2 = (t_1 * (a_m + b)) * (b - a_m);
double tmp;
if (a_m <= 2.65e-198) {
tmp = (((b * cos(t_0)) * t_1) * b) * 2.0;
} else if (a_m <= 6e+149) {
tmp = 2.0 * t_2;
} else {
tmp = fma((-3.08641975308642e-5 * (angle_m * angle_m)), (((double) M_PI) * ((double) M_PI)), 2.0) * t_2;
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(0.005555555555555556 * angle_m) * pi) t_1 = sin(t_0) t_2 = Float64(Float64(t_1 * Float64(a_m + b)) * Float64(b - a_m)) tmp = 0.0 if (a_m <= 2.65e-198) tmp = Float64(Float64(Float64(Float64(b * cos(t_0)) * t_1) * b) * 2.0); elseif (a_m <= 6e+149) tmp = Float64(2.0 * t_2); else tmp = Float64(fma(Float64(-3.08641975308642e-5 * Float64(angle_m * angle_m)), Float64(pi * pi), 2.0) * t_2); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[a$95$m, 2.65e-198], N[(N[(N[(N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * b), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[a$95$m, 6e+149], N[(2.0 * t$95$2), $MachinePrecision], N[(N[(N[(-3.08641975308642e-5 * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 2.0), $MachinePrecision] * t$95$2), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\\
t_1 := \sin t\_0\\
t_2 := \left(t\_1 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 2.65 \cdot 10^{-198}:\\
\;\;\;\;\left(\left(\left(b \cdot \cos t\_0\right) \cdot t\_1\right) \cdot b\right) \cdot 2\\
\mathbf{elif}\;a\_m \leq 6 \cdot 10^{+149}:\\
\;\;\;\;2 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(angle\_m \cdot angle\_m\right), \pi \cdot \pi, 2\right) \cdot t\_2\\
\end{array}
\end{array}
\end{array}
if a < 2.64999999999999994e-198Initial program 66.9%
Taylor expanded in a around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cos.f64N/A
Applied rewrites66.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites66.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
Applied rewrites71.6%
if 2.64999999999999994e-198 < a < 6.00000000000000007e149Initial program 55.9%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites55.8%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites61.8%
Taylor expanded in angle around 0
Applied rewrites61.2%
if 6.00000000000000007e149 < a Initial program 40.3%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites54.1%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites74.6%
Taylor expanded in angle around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f6473.4
Applied rewrites73.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1 (* (* 0.005555555555555556 angle_m) PI))
(t_2
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))))
(*
angle_s
(if (<= t_2 (- INFINITY))
(*
(fma (* -3.08641975308642e-5 (* angle_m angle_m)) (* PI PI) 2.0)
(* (* (sin t_1) (+ a_m b)) (- b a_m)))
(if (<= t_2 5e+212)
(* (sin (* 2.0 t_1)) (* (- b a_m) (+ a_m b)))
(*
(* 2.0 (sin (fma (- (* 0.005555555555555556 angle_m)) PI (/ PI 2.0))))
(*
(* (* (* angle_m PI) 0.005555555555555556) (+ a_m b))
(- b a_m))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = (0.005555555555555556 * angle_m) * ((double) M_PI);
double t_2 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma((-3.08641975308642e-5 * (angle_m * angle_m)), (((double) M_PI) * ((double) M_PI)), 2.0) * ((sin(t_1) * (a_m + b)) * (b - a_m));
} else if (t_2 <= 5e+212) {
tmp = sin((2.0 * t_1)) * ((b - a_m) * (a_m + b));
} else {
tmp = (2.0 * sin(fma(-(0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)))) * ((((angle_m * ((double) M_PI)) * 0.005555555555555556) * (a_m + b)) * (b - a_m));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = Float64(Float64(0.005555555555555556 * angle_m) * pi) t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(fma(Float64(-3.08641975308642e-5 * Float64(angle_m * angle_m)), Float64(pi * pi), 2.0) * Float64(Float64(sin(t_1) * Float64(a_m + b)) * Float64(b - a_m))); elseif (t_2 <= 5e+212) tmp = Float64(sin(Float64(2.0 * t_1)) * Float64(Float64(b - a_m) * Float64(a_m + b))); else tmp = Float64(Float64(2.0 * sin(fma(Float64(-Float64(0.005555555555555556 * angle_m)), pi, Float64(pi / 2.0)))) * Float64(Float64(Float64(Float64(angle_m * pi) * 0.005555555555555556) * Float64(a_m + b)) * Float64(b - a_m))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(-3.08641975308642e-5 * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 2.0), $MachinePrecision] * N[(N[(N[Sin[t$95$1], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+212], N[(N[Sin[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[((-N[(0.005555555555555556 * angle$95$m), $MachinePrecision]) * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\\
t_2 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(angle\_m \cdot angle\_m\right), \pi \cdot \pi, 2\right) \cdot \left(\left(\sin t\_1 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+212}:\\
\;\;\;\;\sin \left(2 \cdot t\_1\right) \cdot \left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556 \cdot angle\_m, \pi, \frac{\pi}{2}\right)\right)\right) \cdot \left(\left(\left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -inf.0Initial program 53.1%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites51.6%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites74.8%
Taylor expanded in angle around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f6473.0
Applied rewrites73.0%
if -inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 4.99999999999999992e212Initial program 62.9%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites62.9%
Applied rewrites62.9%
if 4.99999999999999992e212 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 37.0%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites50.7%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites69.1%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-neg.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
Applied rewrites71.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6468.2
Applied rewrites68.2%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1 (* (* 0.005555555555555556 angle_m) PI))
(t_2 (* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0)))
(t_3
(*
(fma (* -3.08641975308642e-5 (* angle_m angle_m)) (* PI PI) 2.0)
(* (* (sin t_1) (+ a_m b)) (- b a_m)))))
(*
angle_s
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 5e+212)
(* (sin (* 2.0 t_1)) (* (- b a_m) (+ a_m b)))
t_3)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = (0.005555555555555556 * angle_m) * ((double) M_PI);
double t_2 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0);
double t_3 = fma((-3.08641975308642e-5 * (angle_m * angle_m)), (((double) M_PI) * ((double) M_PI)), 2.0) * ((sin(t_1) * (a_m + b)) * (b - a_m));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 5e+212) {
tmp = sin((2.0 * t_1)) * ((b - a_m) * (a_m + b));
} else {
tmp = t_3;
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = Float64(Float64(0.005555555555555556 * angle_m) * pi) t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) t_3 = Float64(fma(Float64(-3.08641975308642e-5 * Float64(angle_m * angle_m)), Float64(pi * pi), 2.0) * Float64(Float64(sin(t_1) * Float64(a_m + b)) * Float64(b - a_m))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 5e+212) tmp = Float64(sin(Float64(2.0 * t_1)) * Float64(Float64(b - a_m) * Float64(a_m + b))); else tmp = t_3; end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(-3.08641975308642e-5 * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 2.0), $MachinePrecision] * N[(N[(N[Sin[t$95$1], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 5e+212], N[(N[Sin[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\\
t_2 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
t_3 := \mathsf{fma}\left(-3.08641975308642 \cdot 10^{-5} \cdot \left(angle\_m \cdot angle\_m\right), \pi \cdot \pi, 2\right) \cdot \left(\left(\sin t\_1 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+212}:\\
\;\;\;\;\sin \left(2 \cdot t\_1\right) \cdot \left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -inf.0 or 4.99999999999999992e212 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 43.7%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites51.1%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites71.4%
Taylor expanded in angle around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f6470.0
Applied rewrites70.0%
if -inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 4.99999999999999992e212Initial program 62.9%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites62.9%
Applied rewrites62.9%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle_m) PI)))
(*
angle_s
(if (<= angle_m 6e-9)
(* 2.0 (* (* (sin t_0) (+ a_m b)) (- b a_m)))
(if (<= angle_m 1.3e+149)
(* (sin (* 2.0 t_0)) (* (- b a_m) (+ a_m b)))
(*
2.0
(*
(sin (* (* PI angle_m) 0.005555555555555556))
(* (+ b a_m) (- b a_m)))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (0.005555555555555556 * angle_m) * ((double) M_PI);
double tmp;
if (angle_m <= 6e-9) {
tmp = 2.0 * ((sin(t_0) * (a_m + b)) * (b - a_m));
} else if (angle_m <= 1.3e+149) {
tmp = sin((2.0 * t_0)) * ((b - a_m) * (a_m + b));
} else {
tmp = 2.0 * (sin(((((double) M_PI) * angle_m) * 0.005555555555555556)) * ((b + a_m) * (b - a_m)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (0.005555555555555556 * angle_m) * Math.PI;
double tmp;
if (angle_m <= 6e-9) {
tmp = 2.0 * ((Math.sin(t_0) * (a_m + b)) * (b - a_m));
} else if (angle_m <= 1.3e+149) {
tmp = Math.sin((2.0 * t_0)) * ((b - a_m) * (a_m + b));
} else {
tmp = 2.0 * (Math.sin(((Math.PI * angle_m) * 0.005555555555555556)) * ((b + a_m) * (b - a_m)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = (0.005555555555555556 * angle_m) * math.pi tmp = 0 if angle_m <= 6e-9: tmp = 2.0 * ((math.sin(t_0) * (a_m + b)) * (b - a_m)) elif angle_m <= 1.3e+149: tmp = math.sin((2.0 * t_0)) * ((b - a_m) * (a_m + b)) else: tmp = 2.0 * (math.sin(((math.pi * angle_m) * 0.005555555555555556)) * ((b + a_m) * (b - a_m))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(0.005555555555555556 * angle_m) * pi) tmp = 0.0 if (angle_m <= 6e-9) tmp = Float64(2.0 * Float64(Float64(sin(t_0) * Float64(a_m + b)) * Float64(b - a_m))); elseif (angle_m <= 1.3e+149) tmp = Float64(sin(Float64(2.0 * t_0)) * Float64(Float64(b - a_m) * Float64(a_m + b))); else tmp = Float64(2.0 * Float64(sin(Float64(Float64(pi * angle_m) * 0.005555555555555556)) * Float64(Float64(b + a_m) * Float64(b - a_m)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = (0.005555555555555556 * angle_m) * pi; tmp = 0.0; if (angle_m <= 6e-9) tmp = 2.0 * ((sin(t_0) * (a_m + b)) * (b - a_m)); elseif (angle_m <= 1.3e+149) tmp = sin((2.0 * t_0)) * ((b - a_m) * (a_m + b)); else tmp = 2.0 * (sin(((pi * angle_m) * 0.005555555555555556)) * ((b + a_m) * (b - a_m))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 6e-9], N[(2.0 * N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 1.3e+149], N[(N[Sin[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 6 \cdot 10^{-9}:\\
\;\;\;\;2 \cdot \left(\left(\sin t\_0 \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{elif}\;angle\_m \leq 1.3 \cdot 10^{+149}:\\
\;\;\;\;\sin \left(2 \cdot t\_0\right) \cdot \left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 5.99999999999999996e-9Initial program 74.9%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites79.1%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.5%
Taylor expanded in angle around 0
Applied rewrites99.5%
if 5.99999999999999996e-9 < angle < 1.29999999999999989e149Initial program 38.3%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites42.1%
Applied rewrites41.9%
if 1.29999999999999989e149 < angle Initial program 30.0%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites32.0%
Taylor expanded in angle around 0
Applied rewrites32.3%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (* 2.0 (cos (* (* PI angle_m) 0.005555555555555556))) (* (* (sin (* (* 0.005555555555555556 angle_m) PI)) (+ a_m b)) (- b a_m)))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((2.0 * cos(((((double) M_PI) * angle_m) * 0.005555555555555556))) * ((sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * (a_m + b)) * (b - a_m)));
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((2.0 * Math.cos(((Math.PI * angle_m) * 0.005555555555555556))) * ((Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * (a_m + b)) * (b - a_m)));
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * ((2.0 * math.cos(((math.pi * angle_m) * 0.005555555555555556))) * ((math.sin(((0.005555555555555556 * angle_m) * math.pi)) * (a_m + b)) * (b - a_m)))
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(Float64(2.0 * cos(Float64(Float64(pi * angle_m) * 0.005555555555555556))) * Float64(Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * Float64(a_m + b)) * Float64(b - a_m)))) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * ((2.0 * cos(((pi * angle_m) * 0.005555555555555556))) * ((sin(((0.005555555555555556 * angle_m) * pi)) * (a_m + b)) * (b - a_m))); end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(2.0 * N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(2 \cdot \cos \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right) \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\right)
\end{array}
Initial program 53.8%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites57.3%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites66.9%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= a_m 2.6e-198)
(* (sin (* (* angle_m PI) 0.011111111111111112)) (* b b))
(*
2.0
(*
(* (sin (* (* 0.005555555555555556 angle_m) PI)) (+ a_m b))
(- b a_m))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (a_m <= 2.6e-198) {
tmp = sin(((angle_m * ((double) M_PI)) * 0.011111111111111112)) * (b * b);
} else {
tmp = 2.0 * ((sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * (a_m + b)) * (b - a_m));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (a_m <= 2.6e-198) {
tmp = Math.sin(((angle_m * Math.PI) * 0.011111111111111112)) * (b * b);
} else {
tmp = 2.0 * ((Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * (a_m + b)) * (b - a_m));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if a_m <= 2.6e-198: tmp = math.sin(((angle_m * math.pi) * 0.011111111111111112)) * (b * b) else: tmp = 2.0 * ((math.sin(((0.005555555555555556 * angle_m) * math.pi)) * (a_m + b)) * (b - a_m)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (a_m <= 2.6e-198) tmp = Float64(sin(Float64(Float64(angle_m * pi) * 0.011111111111111112)) * Float64(b * b)); else tmp = Float64(2.0 * Float64(Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * Float64(a_m + b)) * Float64(b - a_m))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (a_m <= 2.6e-198) tmp = sin(((angle_m * pi) * 0.011111111111111112)) * (b * b); else tmp = 2.0 * ((sin(((0.005555555555555556 * angle_m) * pi)) * (a_m + b)) * (b - a_m)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a$95$m, 2.6e-198], N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 2.6 \cdot 10^{-198}:\\
\;\;\;\;\sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
if a < 2.60000000000000007e-198Initial program 66.9%
Taylor expanded in a around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cos.f64N/A
Applied rewrites66.6%
lift-*.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
cos-neg-revN/A
sin-cos-multN/A
lower-/.f64N/A
Applied rewrites66.5%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.6%
if 2.60000000000000007e-198 < a Initial program 50.9%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites55.3%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites65.9%
Taylor expanded in angle around 0
Applied rewrites65.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 9600000.0)
(* (* (* (* angle_m PI) (+ a_m b)) (- b a_m)) 0.011111111111111112)
(*
2.0
(*
(sin (* (* PI angle_m) 0.005555555555555556))
(* (+ b a_m) (- b a_m)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 9600000.0) {
tmp = (((angle_m * ((double) M_PI)) * (a_m + b)) * (b - a_m)) * 0.011111111111111112;
} else {
tmp = 2.0 * (sin(((((double) M_PI) * angle_m) * 0.005555555555555556)) * ((b + a_m) * (b - a_m)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 9600000.0) {
tmp = (((angle_m * Math.PI) * (a_m + b)) * (b - a_m)) * 0.011111111111111112;
} else {
tmp = 2.0 * (Math.sin(((Math.PI * angle_m) * 0.005555555555555556)) * ((b + a_m) * (b - a_m)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 9600000.0: tmp = (((angle_m * math.pi) * (a_m + b)) * (b - a_m)) * 0.011111111111111112 else: tmp = 2.0 * (math.sin(((math.pi * angle_m) * 0.005555555555555556)) * ((b + a_m) * (b - a_m))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 9600000.0) tmp = Float64(Float64(Float64(Float64(angle_m * pi) * Float64(a_m + b)) * Float64(b - a_m)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(sin(Float64(Float64(pi * angle_m) * 0.005555555555555556)) * Float64(Float64(b + a_m) * Float64(b - a_m)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 9600000.0) tmp = (((angle_m * pi) * (a_m + b)) * (b - a_m)) * 0.011111111111111112; else tmp = 2.0 * (sin(((pi * angle_m) * 0.005555555555555556)) * ((b + a_m) * (b - a_m))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 9600000.0], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 9600000:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right)\\
\end{array}
\end{array}
if angle < 9.6e6Initial program 75.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6478.5
Applied rewrites78.5%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6497.8
Applied rewrites97.8%
if 9.6e6 < angle Initial program 31.3%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites34.1%
Taylor expanded in angle around 0
Applied rewrites33.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (- (pow b 2.0) (pow a_m 2.0)))))
(*
angle_s
(if (<= t_0 -1e-127)
(* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
(if (<= t_0 1e+302)
(* (* b b) (sin (* 2.0 (* (* 0.005555555555555556 angle_m) PI))))
(*
(* (* (* angle_m PI) (+ a_m b)) (- b a_m))
0.011111111111111112))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (pow(b, 2.0) - pow(a_m, 2.0));
double tmp;
if (t_0 <= -1e-127) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
} else if (t_0 <= 1e+302) {
tmp = (b * b) * sin((2.0 * ((0.005555555555555556 * angle_m) * ((double) M_PI))));
} else {
tmp = (((angle_m * ((double) M_PI)) * (a_m + b)) * (b - a_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0));
double tmp;
if (t_0 <= -1e-127) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
} else if (t_0 <= 1e+302) {
tmp = (b * b) * Math.sin((2.0 * ((0.005555555555555556 * angle_m) * Math.PI)));
} else {
tmp = (((angle_m * Math.PI) * (a_m + b)) * (b - a_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = 2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0)) tmp = 0 if t_0 <= -1e-127: tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) elif t_0 <= 1e+302: tmp = (b * b) * math.sin((2.0 * ((0.005555555555555556 * angle_m) * math.pi))) else: tmp = (((angle_m * math.pi) * (a_m + b)) * (b - a_m)) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) tmp = 0.0 if (t_0 <= -1e-127) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)); elseif (t_0 <= 1e+302) tmp = Float64(Float64(b * b) * sin(Float64(2.0 * Float64(Float64(0.005555555555555556 * angle_m) * pi)))); else tmp = Float64(Float64(Float64(Float64(angle_m * pi) * Float64(a_m + b)) * Float64(b - a_m)) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = 2.0 * ((b ^ 2.0) - (a_m ^ 2.0)); tmp = 0.0; if (t_0 <= -1e-127) tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); elseif (t_0 <= 1e+302) tmp = (b * b) * sin((2.0 * ((0.005555555555555556 * angle_m) * pi))); else tmp = (((angle_m * pi) * (a_m + b)) * (b - a_m)) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -1e-127], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+302], N[(N[(b * b), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-127}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
\mathbf{elif}\;t\_0 \leq 10^{+302}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \sin \left(2 \cdot \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -1e-127Initial program 54.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6450.9
Applied rewrites50.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6450.7
Applied rewrites50.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.8
Applied rewrites50.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6462.4
Applied rewrites62.4%
if -1e-127 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 1.0000000000000001e302Initial program 64.2%
Taylor expanded in a around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cos.f64N/A
Applied rewrites61.5%
Applied rewrites61.5%
if 1.0000000000000001e302 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 38.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.4
Applied rewrites52.4%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6472.6
Applied rewrites72.6%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (- (pow b 2.0) (pow a_m 2.0)))))
(*
angle_s
(if (<= t_0 -1.9e-153)
(* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
(if (<= t_0 1e+302)
(* (sin (* (* angle_m PI) 0.011111111111111112)) (* b b))
(*
(* (* (* angle_m PI) (+ a_m b)) (- b a_m))
0.011111111111111112))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (pow(b, 2.0) - pow(a_m, 2.0));
double tmp;
if (t_0 <= -1.9e-153) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
} else if (t_0 <= 1e+302) {
tmp = sin(((angle_m * ((double) M_PI)) * 0.011111111111111112)) * (b * b);
} else {
tmp = (((angle_m * ((double) M_PI)) * (a_m + b)) * (b - a_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0));
double tmp;
if (t_0 <= -1.9e-153) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
} else if (t_0 <= 1e+302) {
tmp = Math.sin(((angle_m * Math.PI) * 0.011111111111111112)) * (b * b);
} else {
tmp = (((angle_m * Math.PI) * (a_m + b)) * (b - a_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = 2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0)) tmp = 0 if t_0 <= -1.9e-153: tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) elif t_0 <= 1e+302: tmp = math.sin(((angle_m * math.pi) * 0.011111111111111112)) * (b * b) else: tmp = (((angle_m * math.pi) * (a_m + b)) * (b - a_m)) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) tmp = 0.0 if (t_0 <= -1.9e-153) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)); elseif (t_0 <= 1e+302) tmp = Float64(sin(Float64(Float64(angle_m * pi) * 0.011111111111111112)) * Float64(b * b)); else tmp = Float64(Float64(Float64(Float64(angle_m * pi) * Float64(a_m + b)) * Float64(b - a_m)) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = 2.0 * ((b ^ 2.0) - (a_m ^ 2.0)); tmp = 0.0; if (t_0 <= -1.9e-153) tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); elseif (t_0 <= 1e+302) tmp = sin(((angle_m * pi) * 0.011111111111111112)) * (b * b); else tmp = (((angle_m * pi) * (a_m + b)) * (b - a_m)) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -1.9e-153], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+302], N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -1.9 \cdot 10^{-153}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
\mathbf{elif}\;t\_0 \leq 10^{+302}:\\
\;\;\;\;\sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -1.90000000000000011e-153Initial program 54.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6450.5
Applied rewrites50.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.6
Applied rewrites50.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6462.1
Applied rewrites62.1%
if -1.90000000000000011e-153 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 1.0000000000000001e302Initial program 64.4%
Taylor expanded in a around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cos.f64N/A
Applied rewrites62.1%
lift-*.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
cos-neg-revN/A
sin-cos-multN/A
lower-/.f64N/A
Applied rewrites62.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.1%
if 1.0000000000000001e302 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 38.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.4
Applied rewrites52.4%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6472.6
Applied rewrites72.6%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 16200000.0)
(* (* (* (* angle_m PI) (+ a_m b)) (- b a_m)) 0.011111111111111112)
(* (* (* PI angle_m) (* (+ b a_m) b)) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 16200000.0) {
tmp = (((angle_m * ((double) M_PI)) * (a_m + b)) * (b - a_m)) * 0.011111111111111112;
} else {
tmp = ((((double) M_PI) * angle_m) * ((b + a_m) * b)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 16200000.0) {
tmp = (((angle_m * Math.PI) * (a_m + b)) * (b - a_m)) * 0.011111111111111112;
} else {
tmp = ((Math.PI * angle_m) * ((b + a_m) * b)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 16200000.0: tmp = (((angle_m * math.pi) * (a_m + b)) * (b - a_m)) * 0.011111111111111112 else: tmp = ((math.pi * angle_m) * ((b + a_m) * b)) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 16200000.0) tmp = Float64(Float64(Float64(Float64(angle_m * pi) * Float64(a_m + b)) * Float64(b - a_m)) * 0.011111111111111112); else tmp = Float64(Float64(Float64(pi * angle_m) * Float64(Float64(b + a_m) * b)) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 16200000.0) tmp = (((angle_m * pi) * (a_m + b)) * (b - a_m)) * 0.011111111111111112; else tmp = ((pi * angle_m) * ((b + a_m) * b)) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 16200000.0], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 16200000:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(\left(b + a\_m\right) \cdot b\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if angle < 1.62e7Initial program 75.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6478.5
Applied rewrites78.5%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6497.8
Applied rewrites97.8%
if 1.62e7 < angle Initial program 31.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6429.6
Applied rewrites29.6%
Taylor expanded in a around 0
Applied rewrites25.5%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 16200000.0)
(* (* (* (* (+ a_m b) PI) angle_m) (- b a_m)) 0.011111111111111112)
(* (* (* PI angle_m) (* (+ b a_m) b)) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 16200000.0) {
tmp = ((((a_m + b) * ((double) M_PI)) * angle_m) * (b - a_m)) * 0.011111111111111112;
} else {
tmp = ((((double) M_PI) * angle_m) * ((b + a_m) * b)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 16200000.0) {
tmp = ((((a_m + b) * Math.PI) * angle_m) * (b - a_m)) * 0.011111111111111112;
} else {
tmp = ((Math.PI * angle_m) * ((b + a_m) * b)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 16200000.0: tmp = ((((a_m + b) * math.pi) * angle_m) * (b - a_m)) * 0.011111111111111112 else: tmp = ((math.pi * angle_m) * ((b + a_m) * b)) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 16200000.0) tmp = Float64(Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(b - a_m)) * 0.011111111111111112); else tmp = Float64(Float64(Float64(pi * angle_m) * Float64(Float64(b + a_m) * b)) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 16200000.0) tmp = ((((a_m + b) * pi) * angle_m) * (b - a_m)) * 0.011111111111111112; else tmp = ((pi * angle_m) * ((b + a_m) * b)) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 16200000.0], N[(N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 16200000:\\
\;\;\;\;\left(\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(\left(b + a\_m\right) \cdot b\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if angle < 1.62e7Initial program 75.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6478.5
Applied rewrites78.5%
Taylor expanded in a around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.8%
Taylor expanded in angle around 0
associate-*r*N/A
+-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
associate-*r*N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
+-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift--.f6497.8
Applied rewrites97.8%
if 1.62e7 < angle Initial program 31.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6429.6
Applied rewrites29.6%
Taylor expanded in a around 0
Applied rewrites25.5%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) -1e-127)
(* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
(* (* (* PI angle_m) (* b (- b a_m))) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= -1e-127) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
} else {
tmp = ((((double) M_PI) * angle_m) * (b * (b - a_m))) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= -1e-127) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
} else {
tmp = ((Math.PI * angle_m) * (b * (b - a_m))) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= -1e-127: tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) else: tmp = ((math.pi * angle_m) * (b * (b - a_m))) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= -1e-127) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)); else tmp = Float64(Float64(Float64(pi * angle_m) * Float64(b * Float64(b - a_m))) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= -1e-127) tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); else tmp = ((pi * angle_m) * (b * (b - a_m))) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-127], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq -1 \cdot 10^{-127}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot \left(b - a\_m\right)\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -1e-127Initial program 54.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6450.9
Applied rewrites50.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6450.7
Applied rewrites50.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.8
Applied rewrites50.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6462.4
Applied rewrites62.4%
if -1e-127 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 53.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6456.5
Applied rewrites56.5%
Taylor expanded in a around 0
Applied rewrites54.7%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) -1.9e-153)
(* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
(* (* (* PI (* b b)) 0.011111111111111112) angle_m))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= -1.9e-153) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
} else {
tmp = ((((double) M_PI) * (b * b)) * 0.011111111111111112) * angle_m;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= -1.9e-153) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
} else {
tmp = ((Math.PI * (b * b)) * 0.011111111111111112) * angle_m;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= -1.9e-153: tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) else: tmp = ((math.pi * (b * b)) * 0.011111111111111112) * angle_m return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= -1.9e-153) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)); else tmp = Float64(Float64(Float64(pi * Float64(b * b)) * 0.011111111111111112) * angle_m); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= -1.9e-153) tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); else tmp = ((pi * (b * b)) * 0.011111111111111112) * angle_m; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.9e-153], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * angle$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq -1.9 \cdot 10^{-153}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot angle\_m\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -1.90000000000000011e-153Initial program 54.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6450.8
Applied rewrites50.8%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6450.5
Applied rewrites50.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.6
Applied rewrites50.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6462.1
Applied rewrites62.1%
if -1.90000000000000011e-153 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 53.5%
Taylor expanded in a around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cos.f64N/A
Applied rewrites56.5%
lift-*.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
cos-neg-revN/A
sin-cos-multN/A
lower-/.f64N/A
Applied rewrites56.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites31.1%
Taylor expanded in angle around 0
*-commutativeN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f6454.7
Applied rewrites54.7%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (* (* PI (* b b)) 0.011111111111111112) angle_m)))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (((((double) M_PI) * (b * b)) * 0.011111111111111112) * angle_m);
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (((Math.PI * (b * b)) * 0.011111111111111112) * angle_m);
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * (((math.pi * (b * b)) * 0.011111111111111112) * angle_m)
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(Float64(Float64(pi * Float64(b * b)) * 0.011111111111111112) * angle_m)) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * (((pi * (b * b)) * 0.011111111111111112) * angle_m); end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(\pi \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\right) \cdot angle\_m\right)
\end{array}
Initial program 53.8%
Taylor expanded in a around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cos.f64N/A
Applied rewrites36.2%
lift-*.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
cos-neg-revN/A
sin-cos-multN/A
lower-/.f64N/A
Applied rewrites36.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites22.9%
Taylor expanded in angle around 0
*-commutativeN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f6435.8
Applied rewrites35.8%
herbie shell --seed 2025114
(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)))))