
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0
(*
(* (sin (* (* 0.005555555555555556 angle_m) PI)) (+ a b_m))
(- b_m a))))
(*
angle_s
(if (<= b_m 3.45e+174)
(*
(* 2.0 (sin (fma (* 0.005555555555555556 angle_m) PI (/ PI 2.0))))
t_0)
(* 2.0 t_0)))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * (a + b_m)) * (b_m - a);
double tmp;
if (b_m <= 3.45e+174) {
tmp = (2.0 * sin(fma((0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)))) * t_0;
} else {
tmp = 2.0 * t_0;
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * Float64(a + b_m)) * Float64(b_m - a)) tmp = 0.0 if (b_m <= 3.45e+174) tmp = Float64(Float64(2.0 * sin(fma(Float64(0.005555555555555556 * angle_m), pi, Float64(pi / 2.0)))) * t_0); else tmp = Float64(2.0 * t_0); end return Float64(angle_s * tmp) end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b$95$m, 3.45e+174], 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[(2.0 * t$95$0), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\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 + b\_m\right)\right) \cdot \left(b\_m - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b\_m \leq 3.45 \cdot 10^{+174}:\\
\;\;\;\;\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}:\\
\;\;\;\;2 \cdot t\_0\\
\end{array}
\end{array}
\end{array}
if b < 3.4500000000000001e174Initial program 57.5%
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 rewrites58.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.6%
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
sin-+PI/2-revN/A
*-commutativeN/A
*-commutativeN/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6465.0
Applied rewrites65.0%
if 3.4500000000000001e174 < b Initial program 38.6%
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.2%
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 rewrites73.9%
Taylor expanded in angle around 0
Applied rewrites74.8%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle_m) PI)))
(*
angle_s
(if (<= angle_m 1.15e+62)
(* (* 2.0 (cos t_0)) (* (* (sin t_0) (+ a b_m)) (- b_m a)))
(*
(* 2.0 (sin (fma (* 0.005555555555555556 angle_m) PI (/ PI 2.0))))
(*
(sin (* (* PI angle_m) 0.005555555555555556))
(* (+ b_m a) (- b_m a))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (0.005555555555555556 * angle_m) * ((double) M_PI);
double tmp;
if (angle_m <= 1.15e+62) {
tmp = (2.0 * cos(t_0)) * ((sin(t_0) * (a + b_m)) * (b_m - a));
} else {
tmp = (2.0 * sin(fma((0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)))) * (sin(((((double) M_PI) * angle_m) * 0.005555555555555556)) * ((b_m + a) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(0.005555555555555556 * angle_m) * pi) tmp = 0.0 if (angle_m <= 1.15e+62) tmp = Float64(Float64(2.0 * cos(t_0)) * Float64(Float64(sin(t_0) * Float64(a + b_m)) * Float64(b_m - a))); else tmp = Float64(Float64(2.0 * sin(fma(Float64(0.005555555555555556 * angle_m), pi, Float64(pi / 2.0)))) * Float64(sin(Float64(Float64(pi * angle_m) * 0.005555555555555556)) * Float64(Float64(b_m + a) * Float64(b_m - a)))); end return Float64(angle_s * tmp) end
b_m = N[Abs[b], $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_, b$95$m_, 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, 1.15e+62], N[(N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $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[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\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 1.15 \cdot 10^{+62}:\\
\;\;\;\;\left(2 \cdot \cos t\_0\right) \cdot \left(\left(\sin t\_0 \cdot \left(a + b\_m\right)\right) \cdot \left(b\_m - a\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(\sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 1.14999999999999992e62Initial program 69.5%
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 rewrites73.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 rewrites90.8%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f6490.8
Applied rewrites90.8%
if 1.14999999999999992e62 < angle Initial program 29.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.5%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6432.6
Applied rewrites32.6%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 angle_m) PI))
(t_1 (* (* (sin t_0) (+ a b_m)) (- b_m a))))
(*
angle_s
(if (<= angle_m 3.8e+42) (* (* 2.0 (cos t_0)) t_1) (* 2.0 t_1)))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (0.005555555555555556 * angle_m) * ((double) M_PI);
double t_1 = (sin(t_0) * (a + b_m)) * (b_m - a);
double tmp;
if (angle_m <= 3.8e+42) {
tmp = (2.0 * cos(t_0)) * t_1;
} else {
tmp = 2.0 * t_1;
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (0.005555555555555556 * angle_m) * Math.PI;
double t_1 = (Math.sin(t_0) * (a + b_m)) * (b_m - a);
double tmp;
if (angle_m <= 3.8e+42) {
tmp = (2.0 * Math.cos(t_0)) * t_1;
} else {
tmp = 2.0 * t_1;
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = (0.005555555555555556 * angle_m) * math.pi t_1 = (math.sin(t_0) * (a + b_m)) * (b_m - a) tmp = 0 if angle_m <= 3.8e+42: tmp = (2.0 * math.cos(t_0)) * t_1 else: tmp = 2.0 * t_1 return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(0.005555555555555556 * angle_m) * pi) t_1 = Float64(Float64(sin(t_0) * Float64(a + b_m)) * Float64(b_m - a)) tmp = 0.0 if (angle_m <= 3.8e+42) tmp = Float64(Float64(2.0 * cos(t_0)) * t_1); else tmp = Float64(2.0 * t_1); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = (0.005555555555555556 * angle_m) * pi; t_1 = (sin(t_0) * (a + b_m)) * (b_m - a); tmp = 0.0; if (angle_m <= 3.8e+42) tmp = (2.0 * cos(t_0)) * t_1; else tmp = 2.0 * t_1; end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 3.8e+42], N[(N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(2.0 * t$95$1), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\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 := \left(\sin t\_0 \cdot \left(a + b\_m\right)\right) \cdot \left(b\_m - a\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 3.8 \cdot 10^{+42}:\\
\;\;\;\;\left(2 \cdot \cos t\_0\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;2 \cdot t\_1\\
\end{array}
\end{array}
\end{array}
if angle < 3.7999999999999998e42Initial program 71.5%
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 rewrites76.0%
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 rewrites94.0%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f6493.9
Applied rewrites93.9%
if 3.7999999999999998e42 < angle Initial program 29.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 rewrites32.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 rewrites32.1%
Taylor expanded in angle around 0
Applied rewrites33.5%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (sin (* (* 0.005555555555555556 angle_m) PI))))
(*
angle_s
(if (<= a 5.2e-192)
(*
(* 2.0 (cos (* (* PI angle_m) 0.005555555555555556)))
(* (* t_0 b_m) (- b_m a)))
(* 2.0 (* (* t_0 (+ a b_m)) (- b_m a)))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = sin(((0.005555555555555556 * angle_m) * ((double) M_PI)));
double tmp;
if (a <= 5.2e-192) {
tmp = (2.0 * cos(((((double) M_PI) * angle_m) * 0.005555555555555556))) * ((t_0 * b_m) * (b_m - a));
} else {
tmp = 2.0 * ((t_0 * (a + b_m)) * (b_m - a));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = Math.sin(((0.005555555555555556 * angle_m) * Math.PI));
double tmp;
if (a <= 5.2e-192) {
tmp = (2.0 * Math.cos(((Math.PI * angle_m) * 0.005555555555555556))) * ((t_0 * b_m) * (b_m - a));
} else {
tmp = 2.0 * ((t_0 * (a + b_m)) * (b_m - a));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = math.sin(((0.005555555555555556 * angle_m) * math.pi)) tmp = 0 if a <= 5.2e-192: tmp = (2.0 * math.cos(((math.pi * angle_m) * 0.005555555555555556))) * ((t_0 * b_m) * (b_m - a)) else: tmp = 2.0 * ((t_0 * (a + b_m)) * (b_m - a)) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) tmp = 0.0 if (a <= 5.2e-192) tmp = Float64(Float64(2.0 * cos(Float64(Float64(pi * angle_m) * 0.005555555555555556))) * Float64(Float64(t_0 * b_m) * Float64(b_m - a))); else tmp = Float64(2.0 * Float64(Float64(t_0 * Float64(a + b_m)) * Float64(b_m - a))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = sin(((0.005555555555555556 * angle_m) * pi)); tmp = 0.0; if (a <= 5.2e-192) tmp = (2.0 * cos(((pi * angle_m) * 0.005555555555555556))) * ((t_0 * b_m) * (b_m - a)); else tmp = 2.0 * ((t_0 * (a + b_m)) * (b_m - a)); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, 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, 5.2e-192], N[(N[(2.0 * N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t$95$0 * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\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 \leq 5.2 \cdot 10^{-192}:\\
\;\;\;\;\left(2 \cdot \cos \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right) \cdot \left(\left(t\_0 \cdot b\_m\right) \cdot \left(b\_m - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(t\_0 \cdot \left(a + b\_m\right)\right) \cdot \left(b\_m - a\right)\right)\\
\end{array}
\end{array}
\end{array}
if a < 5.2000000000000003e-192Initial program 55.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 rewrites58.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 rewrites67.7%
Taylor expanded in a around 0
Applied rewrites45.2%
if 5.2000000000000003e-192 < a Initial program 50.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 rewrites55.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 rewrites67.0%
Taylor expanded in angle around 0
Applied rewrites65.1%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* (* 2.0 (cos (* (* PI angle_m) 0.005555555555555556))) (* (* (sin (* (* 0.005555555555555556 angle_m) PI)) (+ a b_m)) (- b_m a)))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, 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 + b_m)) * (b_m - a)));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, 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 + b_m)) * (b_m - a)));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * ((2.0 * math.cos(((math.pi * angle_m) * 0.005555555555555556))) * ((math.sin(((0.005555555555555556 * angle_m) * math.pi)) * (a + b_m)) * (b_m - a)))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, 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 + b_m)) * Float64(b_m - a)))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * ((2.0 * cos(((pi * angle_m) * 0.005555555555555556))) * ((sin(((0.005555555555555556 * angle_m) * pi)) * (a + b_m)) * (b_m - a))); end
b_m = N[Abs[b], $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_, b$95$m_, 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 + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\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 + b\_m\right)\right) \cdot \left(b\_m - a\right)\right)\right)
\end{array}
Initial program 53.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 rewrites57.4%
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 rewrites67.4%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* 2.0 (* (* (sin (* (* 0.005555555555555556 angle_m) PI)) (+ a b_m)) (- b_m a)))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (2.0 * ((sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * (a + b_m)) * (b_m - a)));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (2.0 * ((Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * (a + b_m)) * (b_m - a)));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * (2.0 * ((math.sin(((0.005555555555555556 * angle_m) * math.pi)) * (a + b_m)) * (b_m - a)))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(2.0 * Float64(Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * Float64(a + b_m)) * Float64(b_m - a)))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * (2.0 * ((sin(((0.005555555555555556 * angle_m) * pi)) * (a + b_m)) * (b_m - a))); end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(2.0 * N[(N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(2 \cdot \left(\left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot \left(a + b\_m\right)\right) \cdot \left(b\_m - a\right)\right)\right)
\end{array}
Initial program 53.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 rewrites57.4%
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 rewrites67.4%
Taylor expanded in angle around 0
Applied rewrites66.5%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 9e+41)
(* (* (* (* angle_m PI) (+ a b_m)) (- b_m a)) 0.011111111111111112)
(*
2.0
(*
(sin (* (* PI angle_m) 0.005555555555555556))
(* (+ b_m a) (- b_m a)))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (angle_m <= 9e+41) {
tmp = (((angle_m * ((double) M_PI)) * (a + b_m)) * (b_m - a)) * 0.011111111111111112;
} else {
tmp = 2.0 * (sin(((((double) M_PI) * angle_m) * 0.005555555555555556)) * ((b_m + a) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (angle_m <= 9e+41) {
tmp = (((angle_m * Math.PI) * (a + b_m)) * (b_m - a)) * 0.011111111111111112;
} else {
tmp = 2.0 * (Math.sin(((Math.PI * angle_m) * 0.005555555555555556)) * ((b_m + a) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if angle_m <= 9e+41: tmp = (((angle_m * math.pi) * (a + b_m)) * (b_m - a)) * 0.011111111111111112 else: tmp = 2.0 * (math.sin(((math.pi * angle_m) * 0.005555555555555556)) * ((b_m + a) * (b_m - a))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (angle_m <= 9e+41) tmp = Float64(Float64(Float64(Float64(angle_m * pi) * Float64(a + b_m)) * Float64(b_m - a)) * 0.011111111111111112); else tmp = Float64(2.0 * Float64(sin(Float64(Float64(pi * angle_m) * 0.005555555555555556)) * Float64(Float64(b_m + a) * Float64(b_m - a)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (angle_m <= 9e+41) tmp = (((angle_m * pi) * (a + b_m)) * (b_m - a)) * 0.011111111111111112; else tmp = 2.0 * (sin(((pi * angle_m) * 0.005555555555555556)) * ((b_m + a) * (b_m - a))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 9e+41], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $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$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\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 9 \cdot 10^{+41}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a + b\_m\right)\right) \cdot \left(b\_m - a\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\_m + a\right) \cdot \left(b\_m - a\right)\right)\right)\\
\end{array}
\end{array}
if angle < 9.0000000000000002e41Initial program 71.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--.f6473.2
Applied rewrites73.2%
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--.f6491.1
Applied rewrites91.1%
if 9.0000000000000002e41 < angle Initial program 29.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 rewrites32.6%
Taylor expanded in angle around 0
Applied rewrites33.2%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 5.9e+23)
(* (* (* (* angle_m PI) (+ a b_m)) (- b_m a)) 0.011111111111111112)
(if (<= angle_m 6.1e+165)
(log (exp (* PI (* (* -0.011111111111111112 (* a a)) angle_m))))
(* (* angle_m PI) (* (* (- b_m a) (+ a b_m)) 0.011111111111111112))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (angle_m <= 5.9e+23) {
tmp = (((angle_m * ((double) M_PI)) * (a + b_m)) * (b_m - a)) * 0.011111111111111112;
} else if (angle_m <= 6.1e+165) {
tmp = log(exp((((double) M_PI) * ((-0.011111111111111112 * (a * a)) * angle_m))));
} else {
tmp = (angle_m * ((double) M_PI)) * (((b_m - a) * (a + b_m)) * 0.011111111111111112);
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (angle_m <= 5.9e+23) {
tmp = (((angle_m * Math.PI) * (a + b_m)) * (b_m - a)) * 0.011111111111111112;
} else if (angle_m <= 6.1e+165) {
tmp = Math.log(Math.exp((Math.PI * ((-0.011111111111111112 * (a * a)) * angle_m))));
} else {
tmp = (angle_m * Math.PI) * (((b_m - a) * (a + b_m)) * 0.011111111111111112);
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if angle_m <= 5.9e+23: tmp = (((angle_m * math.pi) * (a + b_m)) * (b_m - a)) * 0.011111111111111112 elif angle_m <= 6.1e+165: tmp = math.log(math.exp((math.pi * ((-0.011111111111111112 * (a * a)) * angle_m)))) else: tmp = (angle_m * math.pi) * (((b_m - a) * (a + b_m)) * 0.011111111111111112) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (angle_m <= 5.9e+23) tmp = Float64(Float64(Float64(Float64(angle_m * pi) * Float64(a + b_m)) * Float64(b_m - a)) * 0.011111111111111112); elseif (angle_m <= 6.1e+165) tmp = log(exp(Float64(pi * Float64(Float64(-0.011111111111111112 * Float64(a * a)) * angle_m)))); else tmp = Float64(Float64(angle_m * pi) * Float64(Float64(Float64(b_m - a) * Float64(a + b_m)) * 0.011111111111111112)); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (angle_m <= 5.9e+23) tmp = (((angle_m * pi) * (a + b_m)) * (b_m - a)) * 0.011111111111111112; elseif (angle_m <= 6.1e+165) tmp = log(exp((pi * ((-0.011111111111111112 * (a * a)) * angle_m)))); else tmp = (angle_m * pi) * (((b_m - a) * (a + b_m)) * 0.011111111111111112); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 5.9e+23], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], If[LessEqual[angle$95$m, 6.1e+165], N[Log[N[Exp[N[(Pi * N[(N[(-0.011111111111111112 * N[(a * a), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\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 5.9 \cdot 10^{+23}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a + b\_m\right)\right) \cdot \left(b\_m - a\right)\right) \cdot 0.011111111111111112\\
\mathbf{elif}\;angle\_m \leq 6.1 \cdot 10^{+165}:\\
\;\;\;\;\log \left(e^{\pi \cdot \left(\left(-0.011111111111111112 \cdot \left(a \cdot a\right)\right) \cdot angle\_m\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(\left(\left(b\_m - a\right) \cdot \left(a + b\_m\right)\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if angle < 5.89999999999999987e23Initial program 73.9%
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--.f6475.6
Applied rewrites75.6%
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--.f6494.4
Applied rewrites94.4%
if 5.89999999999999987e23 < angle < 6.09999999999999965e165Initial program 28.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--.f6428.4
Applied rewrites28.4%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
lift-PI.f6420.8
Applied rewrites20.8%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
add-log-expN/A
log-pow-revN/A
lower-log.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lift-PI.f64N/A
lower-*.f6423.5
Applied rewrites23.5%
lift-pow.f64N/A
lift-PI.f64N/A
lift-exp.f64N/A
pow-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lift-PI.f6423.5
Applied rewrites23.5%
if 6.09999999999999965e165 < angle Initial program 29.6%
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--.f6427.3
Applied rewrites27.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l*N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6427.4
Applied rewrites27.4%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= b_m 7.5e-112)
(* (* (* (sin (* (* PI angle_m) 0.005555555555555556)) (* a a)) -2.0) 1.0)
(* (* (* (* angle_m PI) (+ a b_m)) (- b_m a)) 0.011111111111111112))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (b_m <= 7.5e-112) {
tmp = ((sin(((((double) M_PI) * angle_m) * 0.005555555555555556)) * (a * a)) * -2.0) * 1.0;
} else {
tmp = (((angle_m * ((double) M_PI)) * (a + b_m)) * (b_m - a)) * 0.011111111111111112;
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (b_m <= 7.5e-112) {
tmp = ((Math.sin(((Math.PI * angle_m) * 0.005555555555555556)) * (a * a)) * -2.0) * 1.0;
} else {
tmp = (((angle_m * Math.PI) * (a + b_m)) * (b_m - a)) * 0.011111111111111112;
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if b_m <= 7.5e-112: tmp = ((math.sin(((math.pi * angle_m) * 0.005555555555555556)) * (a * a)) * -2.0) * 1.0 else: tmp = (((angle_m * math.pi) * (a + b_m)) * (b_m - a)) * 0.011111111111111112 return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (b_m <= 7.5e-112) tmp = Float64(Float64(Float64(sin(Float64(Float64(pi * angle_m) * 0.005555555555555556)) * Float64(a * a)) * -2.0) * 1.0); else tmp = Float64(Float64(Float64(Float64(angle_m * pi) * Float64(a + b_m)) * Float64(b_m - a)) * 0.011111111111111112); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (b_m <= 7.5e-112) tmp = ((sin(((pi * angle_m) * 0.005555555555555556)) * (a * a)) * -2.0) * 1.0; else tmp = (((angle_m * pi) * (a + b_m)) * (b_m - a)) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b$95$m, 7.5e-112], N[(N[(N[(N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b\_m \leq 7.5 \cdot 10^{-112}:\\
\;\;\;\;\left(\left(\sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot \left(a \cdot a\right)\right) \cdot -2\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a + b\_m\right)\right) \cdot \left(b\_m - a\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if b < 7.5000000000000002e-112Initial program 64.2%
Taylor expanded in a around inf
*-commutativeN/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
unpow2N/A
lower-*.f6463.7
Applied rewrites63.7%
Taylor expanded in angle around 0
Applied rewrites61.7%
if 7.5000000000000002e-112 < b Initial program 48.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--.f6451.0
Applied rewrites51.0%
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--.f6463.5
Applied rewrites63.5%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* (* (* (* angle_m PI) (+ a b_m)) (- b_m a)) 0.011111111111111112)))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * ((((angle_m * ((double) M_PI)) * (a + b_m)) * (b_m - a)) * 0.011111111111111112);
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * ((((angle_m * Math.PI) * (a + b_m)) * (b_m - a)) * 0.011111111111111112);
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * ((((angle_m * math.pi) * (a + b_m)) * (b_m - a)) * 0.011111111111111112)
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(Float64(Float64(Float64(angle_m * pi) * Float64(a + b_m)) * Float64(b_m - a)) * 0.011111111111111112)) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * ((((angle_m * pi) * (a + b_m)) * (b_m - a)) * 0.011111111111111112); end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a + b\_m\right)\right) \cdot \left(b\_m - a\right)\right) \cdot 0.011111111111111112\right)
\end{array}
Initial program 53.4%
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--.f6453.7
Applied rewrites53.7%
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--.f6462.2
Applied rewrites62.2%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (- (pow b_m 2.0) (pow a 2.0)))))
(*
angle_s
(if (<= t_0 -8.15e-215)
(* (* (* (* angle_m PI) -0.011111111111111112) a) a)
(if (<= t_0 INFINITY)
(* (* (* PI angle_m) (* b_m b_m)) 0.011111111111111112)
(* (* (* PI angle_m) (* a (- b_m a))) 0.011111111111111112))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = 2.0 * (pow(b_m, 2.0) - pow(a, 2.0));
double tmp;
if (t_0 <= -8.15e-215) {
tmp = (((angle_m * ((double) M_PI)) * -0.011111111111111112) * a) * a;
} else if (t_0 <= ((double) INFINITY)) {
tmp = ((((double) M_PI) * angle_m) * (b_m * b_m)) * 0.011111111111111112;
} else {
tmp = ((((double) M_PI) * angle_m) * (a * (b_m - a))) * 0.011111111111111112;
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = 2.0 * (Math.pow(b_m, 2.0) - Math.pow(a, 2.0));
double tmp;
if (t_0 <= -8.15e-215) {
tmp = (((angle_m * Math.PI) * -0.011111111111111112) * a) * a;
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = ((Math.PI * angle_m) * (b_m * b_m)) * 0.011111111111111112;
} else {
tmp = ((Math.PI * angle_m) * (a * (b_m - a))) * 0.011111111111111112;
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = 2.0 * (math.pow(b_m, 2.0) - math.pow(a, 2.0)) tmp = 0 if t_0 <= -8.15e-215: tmp = (((angle_m * math.pi) * -0.011111111111111112) * a) * a elif t_0 <= math.inf: tmp = ((math.pi * angle_m) * (b_m * b_m)) * 0.011111111111111112 else: tmp = ((math.pi * angle_m) * (a * (b_m - a))) * 0.011111111111111112 return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(2.0 * Float64((b_m ^ 2.0) - (a ^ 2.0))) tmp = 0.0 if (t_0 <= -8.15e-215) tmp = Float64(Float64(Float64(Float64(angle_m * pi) * -0.011111111111111112) * a) * a); elseif (t_0 <= Inf) tmp = Float64(Float64(Float64(pi * angle_m) * Float64(b_m * b_m)) * 0.011111111111111112); else tmp = Float64(Float64(Float64(pi * angle_m) * Float64(a * Float64(b_m - a))) * 0.011111111111111112); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = 2.0 * ((b_m ^ 2.0) - (a ^ 2.0)); tmp = 0.0; if (t_0 <= -8.15e-215) tmp = (((angle_m * pi) * -0.011111111111111112) * a) * a; elseif (t_0 <= Inf) tmp = ((pi * angle_m) * (b_m * b_m)) * 0.011111111111111112; else tmp = ((pi * angle_m) * (a * (b_m - a))) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -8.15e-215], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(a * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left({b\_m}^{2} - {a}^{2}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -8.15 \cdot 10^{-215}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot -0.011111111111111112\right) \cdot a\right) \cdot a\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(b\_m \cdot b\_m\right)\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(a \cdot \left(b\_m - a\right)\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)))) < -8.15e-215Initial program 55.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--.f6451.1
Applied rewrites51.1%
Taylor expanded in a around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.5%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6450.9
Applied rewrites50.9%
lift-*.f64N/A
Applied rewrites61.7%
if -8.15e-215 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < +inf.0Initial program 58.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--.f6454.9
Applied rewrites54.9%
Taylor expanded in a around 0
difference-of-squares-revN/A
unpow2N/A
pow2N/A
metadata-evalN/A
pow-flipN/A
unpow2N/A
lower-*.f6454.7
Applied rewrites54.7%
if +inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 0.0%
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--.f6460.4
Applied rewrites60.4%
Taylor expanded in a around inf
Applied rewrites52.5%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b_m 2.0) (pow a 2.0))) -2e-143)
(* (* (* (* angle_m PI) -0.011111111111111112) a) a)
(* (* angle_m PI) (* (* (- b_m a) (+ a b_m)) 0.011111111111111112)))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if ((2.0 * (pow(b_m, 2.0) - pow(a, 2.0))) <= -2e-143) {
tmp = (((angle_m * ((double) M_PI)) * -0.011111111111111112) * a) * a;
} else {
tmp = (angle_m * ((double) M_PI)) * (((b_m - a) * (a + b_m)) * 0.011111111111111112);
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b_m, 2.0) - Math.pow(a, 2.0))) <= -2e-143) {
tmp = (((angle_m * Math.PI) * -0.011111111111111112) * a) * a;
} else {
tmp = (angle_m * Math.PI) * (((b_m - a) * (a + b_m)) * 0.011111111111111112);
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if (2.0 * (math.pow(b_m, 2.0) - math.pow(a, 2.0))) <= -2e-143: tmp = (((angle_m * math.pi) * -0.011111111111111112) * a) * a else: tmp = (angle_m * math.pi) * (((b_m - a) * (a + b_m)) * 0.011111111111111112) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b_m ^ 2.0) - (a ^ 2.0))) <= -2e-143) tmp = Float64(Float64(Float64(Float64(angle_m * pi) * -0.011111111111111112) * a) * a); else tmp = Float64(Float64(angle_m * pi) * Float64(Float64(Float64(b_m - a) * Float64(a + b_m)) * 0.011111111111111112)); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if ((2.0 * ((b_m ^ 2.0) - (a ^ 2.0))) <= -2e-143) tmp = (((angle_m * pi) * -0.011111111111111112) * a) * a; else tmp = (angle_m * pi) * (((b_m - a) * (a + b_m)) * 0.011111111111111112); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-143], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision], N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(N[(N[(b$95$m - a), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\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\_m}^{2} - {a}^{2}\right) \leq -2 \cdot 10^{-143}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot -0.011111111111111112\right) \cdot a\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot \pi\right) \cdot \left(\left(\left(b\_m - a\right) \cdot \left(a + b\_m\right)\right) \cdot 0.011111111111111112\right)\\
\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.9999999999999999e-143Initial program 55.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--.f6451.4
Applied rewrites51.4%
Taylor expanded in a around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.8%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6451.2
Applied rewrites51.2%
lift-*.f64N/A
Applied rewrites62.5%
if -1.9999999999999999e-143 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 52.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--.f6455.2
Applied rewrites55.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*l*N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6455.3
Applied rewrites55.3%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b_m 2.0) (pow a 2.0))) -8.15e-215)
(* (* (* (* angle_m PI) -0.011111111111111112) a) a)
(* (* (* PI angle_m) (* b_m (- b_m a))) 0.011111111111111112))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if ((2.0 * (pow(b_m, 2.0) - pow(a, 2.0))) <= -8.15e-215) {
tmp = (((angle_m * ((double) M_PI)) * -0.011111111111111112) * a) * a;
} else {
tmp = ((((double) M_PI) * angle_m) * (b_m * (b_m - a))) * 0.011111111111111112;
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b_m, 2.0) - Math.pow(a, 2.0))) <= -8.15e-215) {
tmp = (((angle_m * Math.PI) * -0.011111111111111112) * a) * a;
} else {
tmp = ((Math.PI * angle_m) * (b_m * (b_m - a))) * 0.011111111111111112;
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if (2.0 * (math.pow(b_m, 2.0) - math.pow(a, 2.0))) <= -8.15e-215: tmp = (((angle_m * math.pi) * -0.011111111111111112) * a) * a else: tmp = ((math.pi * angle_m) * (b_m * (b_m - a))) * 0.011111111111111112 return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b_m ^ 2.0) - (a ^ 2.0))) <= -8.15e-215) tmp = Float64(Float64(Float64(Float64(angle_m * pi) * -0.011111111111111112) * a) * a); else tmp = Float64(Float64(Float64(pi * angle_m) * Float64(b_m * Float64(b_m - a))) * 0.011111111111111112); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if ((2.0 * ((b_m ^ 2.0) - (a ^ 2.0))) <= -8.15e-215) tmp = (((angle_m * pi) * -0.011111111111111112) * a) * a; else tmp = ((pi * angle_m) * (b_m * (b_m - a))) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -8.15e-215], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b$95$m * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\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\_m}^{2} - {a}^{2}\right) \leq -8.15 \cdot 10^{-215}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot -0.011111111111111112\right) \cdot a\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(b\_m \cdot \left(b\_m - a\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)))) < -8.15e-215Initial program 55.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--.f6451.1
Applied rewrites51.1%
Taylor expanded in a around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.5%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6450.9
Applied rewrites50.9%
lift-*.f64N/A
Applied rewrites61.7%
if -8.15e-215 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 52.1%
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--.f6455.5
Applied rewrites55.5%
Taylor expanded in a around 0
Applied rewrites54.3%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b_m 2.0) (pow a 2.0))) -8.15e-215)
(* (* (* (* angle_m PI) -0.011111111111111112) a) a)
(* (* (* PI angle_m) (* b_m b_m)) 0.011111111111111112))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if ((2.0 * (pow(b_m, 2.0) - pow(a, 2.0))) <= -8.15e-215) {
tmp = (((angle_m * ((double) M_PI)) * -0.011111111111111112) * a) * a;
} else {
tmp = ((((double) M_PI) * angle_m) * (b_m * b_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b_m, 2.0) - Math.pow(a, 2.0))) <= -8.15e-215) {
tmp = (((angle_m * Math.PI) * -0.011111111111111112) * a) * a;
} else {
tmp = ((Math.PI * angle_m) * (b_m * b_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if (2.0 * (math.pow(b_m, 2.0) - math.pow(a, 2.0))) <= -8.15e-215: tmp = (((angle_m * math.pi) * -0.011111111111111112) * a) * a else: tmp = ((math.pi * angle_m) * (b_m * b_m)) * 0.011111111111111112 return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b_m ^ 2.0) - (a ^ 2.0))) <= -8.15e-215) tmp = Float64(Float64(Float64(Float64(angle_m * pi) * -0.011111111111111112) * a) * a); else tmp = Float64(Float64(Float64(pi * angle_m) * Float64(b_m * b_m)) * 0.011111111111111112); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if ((2.0 * ((b_m ^ 2.0) - (a ^ 2.0))) <= -8.15e-215) tmp = (((angle_m * pi) * -0.011111111111111112) * a) * a; else tmp = ((pi * angle_m) * (b_m * b_m)) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -8.15e-215], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\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\_m}^{2} - {a}^{2}\right) \leq -8.15 \cdot 10^{-215}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot -0.011111111111111112\right) \cdot a\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(b\_m \cdot b\_m\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)))) < -8.15e-215Initial program 55.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--.f6451.1
Applied rewrites51.1%
Taylor expanded in a around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.5%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6450.9
Applied rewrites50.9%
lift-*.f64N/A
Applied rewrites61.7%
if -8.15e-215 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 52.1%
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--.f6455.5
Applied rewrites55.5%
Taylor expanded in a around 0
difference-of-squares-revN/A
unpow2N/A
pow2N/A
metadata-evalN/A
pow-flipN/A
unpow2N/A
lower-*.f6453.7
Applied rewrites53.7%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b_m 2.0) (pow a 2.0))) -8.15e-215)
(* (* (* (* angle_m PI) -0.011111111111111112) a) a)
(* (* (* PI (* b_m b_m)) angle_m) 0.011111111111111112))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if ((2.0 * (pow(b_m, 2.0) - pow(a, 2.0))) <= -8.15e-215) {
tmp = (((angle_m * ((double) M_PI)) * -0.011111111111111112) * a) * a;
} else {
tmp = ((((double) M_PI) * (b_m * b_m)) * angle_m) * 0.011111111111111112;
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b_m, 2.0) - Math.pow(a, 2.0))) <= -8.15e-215) {
tmp = (((angle_m * Math.PI) * -0.011111111111111112) * a) * a;
} else {
tmp = ((Math.PI * (b_m * b_m)) * angle_m) * 0.011111111111111112;
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if (2.0 * (math.pow(b_m, 2.0) - math.pow(a, 2.0))) <= -8.15e-215: tmp = (((angle_m * math.pi) * -0.011111111111111112) * a) * a else: tmp = ((math.pi * (b_m * b_m)) * angle_m) * 0.011111111111111112 return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b_m ^ 2.0) - (a ^ 2.0))) <= -8.15e-215) tmp = Float64(Float64(Float64(Float64(angle_m * pi) * -0.011111111111111112) * a) * a); else tmp = Float64(Float64(Float64(pi * Float64(b_m * b_m)) * angle_m) * 0.011111111111111112); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if ((2.0 * ((b_m ^ 2.0) - (a ^ 2.0))) <= -8.15e-215) tmp = (((angle_m * pi) * -0.011111111111111112) * a) * a; else tmp = ((pi * (b_m * b_m)) * angle_m) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -8.15e-215], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision], N[(N[(N[(Pi * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\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\_m}^{2} - {a}^{2}\right) \leq -8.15 \cdot 10^{-215}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot -0.011111111111111112\right) \cdot a\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot \left(b\_m \cdot b\_m\right)\right) \cdot angle\_m\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)))) < -8.15e-215Initial program 55.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--.f6451.1
Applied rewrites51.1%
Taylor expanded in a around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.5%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6450.9
Applied rewrites50.9%
lift-*.f64N/A
Applied rewrites61.7%
if -8.15e-215 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 52.1%
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--.f6455.5
Applied rewrites55.5%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
lower-*.f6453.7
Applied rewrites53.7%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* (* (* (* angle_m PI) -0.011111111111111112) a) a)))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * ((((angle_m * ((double) M_PI)) * -0.011111111111111112) * a) * a);
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * ((((angle_m * Math.PI) * -0.011111111111111112) * a) * a);
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * ((((angle_m * math.pi) * -0.011111111111111112) * a) * a)
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(Float64(Float64(Float64(angle_m * pi) * -0.011111111111111112) * a) * a)) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * ((((angle_m * pi) * -0.011111111111111112) * a) * a); end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(\left(angle\_m \cdot \pi\right) \cdot -0.011111111111111112\right) \cdot a\right) \cdot a\right)
\end{array}
Initial program 53.4%
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--.f6453.7
Applied rewrites53.7%
Taylor expanded in a around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites45.0%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6434.8
Applied rewrites34.8%
lift-*.f64N/A
Applied rewrites38.3%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* (* (* -0.011111111111111112 angle_m) PI) (* a a))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (((-0.011111111111111112 * angle_m) * ((double) M_PI)) * (a * a));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (((-0.011111111111111112 * angle_m) * Math.PI) * (a * a));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * (((-0.011111111111111112 * angle_m) * math.pi) * (a * a))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(Float64(Float64(-0.011111111111111112 * angle_m) * pi) * Float64(a * a))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * (((-0.011111111111111112 * angle_m) * pi) * (a * a)); end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(-0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(-0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right) \cdot \left(a \cdot a\right)\right)
\end{array}
Initial program 53.4%
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--.f6453.7
Applied rewrites53.7%
Taylor expanded in a around -inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites45.0%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6434.8
Applied rewrites34.8%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (log 1.0)))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * log(1.0);
}
b_m = private
angle\_m = private
angle\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(angle_s, a, b_m, angle_m)
use fmin_fmax_functions
real(8), intent (in) :: angle_s
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: angle_m
code = angle_s * log(1.0d0)
end function
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * Math.log(1.0);
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * math.log(1.0)
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * log(1.0)) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * log(1.0); end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[Log[1.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \log 1
\end{array}
Initial program 53.4%
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--.f6453.7
Applied rewrites53.7%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
lift-PI.f6434.8
Applied rewrites34.8%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
add-log-expN/A
log-pow-revN/A
lower-log.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lift-PI.f64N/A
lower-*.f6427.0
Applied rewrites27.0%
Taylor expanded in a around 0
Applied rewrites13.3%
herbie shell --seed 2025113
(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)))))