
(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}
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 3.2e+245)
(*
(* (+ a_m b) (* (- b a_m) (* (sin (* (/ 1.0 (/ 180.0 angle_m)) PI)) 2.0)))
(sin (+ (- (* -0.005555555555555556 (* PI angle_m))) (* 0.5 PI))))
(*
(*
(+ a_m b)
(*
(- b a_m)
(* (sin (/ 0.005555555555555556 (/ 1.0 (* PI angle_m)))) 2.0)))
(cos (* PI (/ angle_m 180.0)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (a_m <= 3.2e+245) {
tmp = ((a_m + b) * ((b - a_m) * (sin(((1.0 / (180.0 / angle_m)) * ((double) M_PI))) * 2.0))) * sin((-(-0.005555555555555556 * (((double) M_PI) * angle_m)) + (0.5 * ((double) M_PI))));
} else {
tmp = ((a_m + b) * ((b - a_m) * (sin((0.005555555555555556 / (1.0 / (((double) M_PI) * angle_m)))) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (a_m <= 3.2e+245) {
tmp = ((a_m + b) * ((b - a_m) * (Math.sin(((1.0 / (180.0 / angle_m)) * Math.PI)) * 2.0))) * Math.sin((-(-0.005555555555555556 * (Math.PI * angle_m)) + (0.5 * Math.PI)));
} else {
tmp = ((a_m + b) * ((b - a_m) * (Math.sin((0.005555555555555556 / (1.0 / (Math.PI * angle_m)))) * 2.0))) * Math.cos((Math.PI * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if a_m <= 3.2e+245: tmp = ((a_m + b) * ((b - a_m) * (math.sin(((1.0 / (180.0 / angle_m)) * math.pi)) * 2.0))) * math.sin((-(-0.005555555555555556 * (math.pi * angle_m)) + (0.5 * math.pi))) else: tmp = ((a_m + b) * ((b - a_m) * (math.sin((0.005555555555555556 / (1.0 / (math.pi * angle_m)))) * 2.0))) * math.cos((math.pi * (angle_m / 180.0))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (a_m <= 3.2e+245) tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(Float64(1.0 / Float64(180.0 / angle_m)) * pi)) * 2.0))) * sin(Float64(Float64(-Float64(-0.005555555555555556 * Float64(pi * angle_m))) + Float64(0.5 * pi)))); else tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(0.005555555555555556 / Float64(1.0 / Float64(pi * angle_m)))) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (a_m <= 3.2e+245) tmp = ((a_m + b) * ((b - a_m) * (sin(((1.0 / (180.0 / angle_m)) * pi)) * 2.0))) * sin((-(-0.005555555555555556 * (pi * angle_m)) + (0.5 * pi))); else tmp = ((a_m + b) * ((b - a_m) * (sin((0.005555555555555556 / (1.0 / (pi * angle_m)))) * 2.0))) * cos((pi * (angle_m / 180.0))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a$95$m, 3.2e+245], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(N[(1.0 / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[((-N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]) + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 / N[(1.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 3.2 \cdot 10^{+245}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\frac{1}{\frac{180}{angle\_m}} \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \sin \left(\left(--0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right) + 0.5 \cdot \pi\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\frac{0.005555555555555556}{\frac{1}{\pi \cdot angle\_m}}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\end{array}
\end{array}
if a < 3.20000000000000024e245Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
frac-2negN/A
div-flipN/A
lower-unsound-/.f32N/A
lower-unsound-/.f32N/A
lower-/.f32N/A
frac-2negN/A
lower-/.f32N/A
lower-/.f64N/A
lower-/.f6467.1
Applied rewrites67.1%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites66.6%
if 3.20000000000000024e245 < a Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-/r*N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6467.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.0
Applied rewrites67.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 180.0))))
(*
angle_s
(if (<= angle_m 3.8e+56)
(* (+ a_m b) (* (- b a_m) (sin (* (* angle_m PI) 0.011111111111111112))))
(if (<= angle_m 1.12e+198)
(*
(* (* (* (- b a_m) (+ b a_m)) 2.0) (sin t_0))
(sin (* PI (fma 0.005555555555555556 angle_m 0.5))))
(*
(* (+ a_m b) (* (- b a_m) (* (sin (/ PI (/ 180.0 angle_m))) 2.0)))
(cos t_0)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double tmp;
if (angle_m <= 3.8e+56) {
tmp = (a_m + b) * ((b - a_m) * sin(((angle_m * ((double) M_PI)) * 0.011111111111111112)));
} else if (angle_m <= 1.12e+198) {
tmp = ((((b - a_m) * (b + a_m)) * 2.0) * sin(t_0)) * sin((((double) M_PI) * fma(0.005555555555555556, angle_m, 0.5)));
} else {
tmp = ((a_m + b) * ((b - a_m) * (sin((((double) M_PI) / (180.0 / angle_m))) * 2.0))) * cos(t_0);
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) tmp = 0.0 if (angle_m <= 3.8e+56) tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * sin(Float64(Float64(angle_m * pi) * 0.011111111111111112)))); elseif (angle_m <= 1.12e+198) tmp = Float64(Float64(Float64(Float64(Float64(b - a_m) * Float64(b + a_m)) * 2.0) * sin(t_0)) * sin(Float64(pi * fma(0.005555555555555556, angle_m, 0.5)))); else tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi / Float64(180.0 / angle_m))) * 2.0))) * cos(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[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 3.8e+56], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 1.12e+198], N[(N[(N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m + 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 3.8 \cdot 10^{+56}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{elif}\;angle\_m \leq 1.12 \cdot 10^{+198}:\\
\;\;\;\;\left(\left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot 2\right) \cdot \sin t\_0\right) \cdot \sin \left(\pi \cdot \mathsf{fma}\left(0.005555555555555556, angle\_m, 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right) \cdot 2\right)\right)\right) \cdot \cos t\_0\\
\end{array}
\end{array}
\end{array}
if angle < 3.79999999999999996e56Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-sin.f64N/A
lift-cos.f64N/A
2-sinN/A
count-2N/A
Applied rewrites67.1%
if 3.79999999999999996e56 < angle < 1.1199999999999999e198Initial program 53.8%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
mult-flipN/A
distribute-lft-outN/A
lower-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval53.3
Applied rewrites53.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6453.3
Applied rewrites57.0%
if 1.1199999999999999e198 < angle Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-flip-revN/A
lower-/.f64N/A
lower-/.f6467.0
Applied rewrites67.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 1.75e+198)
(*
(*
(+ a_m b)
(*
(- b a_m)
(* (sin (* (/ 0.005555555555555556 (/ 1.0 angle_m)) PI)) 2.0)))
(sin (+ (- (* -0.005555555555555556 (* PI angle_m))) (* 0.5 PI))))
(*
(* (+ a_m b) (* (- b a_m) (* (sin (/ PI (/ 180.0 angle_m))) 2.0)))
(cos (* PI (/ angle_m 180.0)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 1.75e+198) {
tmp = ((a_m + b) * ((b - a_m) * (sin(((0.005555555555555556 / (1.0 / angle_m)) * ((double) M_PI))) * 2.0))) * sin((-(-0.005555555555555556 * (((double) M_PI) * angle_m)) + (0.5 * ((double) M_PI))));
} else {
tmp = ((a_m + b) * ((b - a_m) * (sin((((double) M_PI) / (180.0 / angle_m))) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 1.75e+198) {
tmp = ((a_m + b) * ((b - a_m) * (Math.sin(((0.005555555555555556 / (1.0 / angle_m)) * Math.PI)) * 2.0))) * Math.sin((-(-0.005555555555555556 * (Math.PI * angle_m)) + (0.5 * Math.PI)));
} else {
tmp = ((a_m + b) * ((b - a_m) * (Math.sin((Math.PI / (180.0 / angle_m))) * 2.0))) * Math.cos((Math.PI * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 1.75e+198: tmp = ((a_m + b) * ((b - a_m) * (math.sin(((0.005555555555555556 / (1.0 / angle_m)) * math.pi)) * 2.0))) * math.sin((-(-0.005555555555555556 * (math.pi * angle_m)) + (0.5 * math.pi))) else: tmp = ((a_m + b) * ((b - a_m) * (math.sin((math.pi / (180.0 / angle_m))) * 2.0))) * math.cos((math.pi * (angle_m / 180.0))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 1.75e+198) tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(Float64(0.005555555555555556 / Float64(1.0 / angle_m)) * pi)) * 2.0))) * sin(Float64(Float64(-Float64(-0.005555555555555556 * Float64(pi * angle_m))) + Float64(0.5 * pi)))); else tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi / Float64(180.0 / angle_m))) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 1.75e+198) tmp = ((a_m + b) * ((b - a_m) * (sin(((0.005555555555555556 / (1.0 / angle_m)) * pi)) * 2.0))) * sin((-(-0.005555555555555556 * (pi * angle_m)) + (0.5 * pi))); else tmp = ((a_m + b) * ((b - a_m) * (sin((pi / (180.0 / angle_m))) * 2.0))) * cos((pi * (angle_m / 180.0))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 1.75e+198], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[((-N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]) + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $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 1.75 \cdot 10^{+198}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\frac{0.005555555555555556}{\frac{1}{angle\_m}} \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \sin \left(\left(--0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right) + 0.5 \cdot \pi\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\end{array}
\end{array}
if angle < 1.75000000000000006e198Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
frac-2negN/A
div-flipN/A
lower-unsound-/.f32N/A
lower-unsound-/.f32N/A
lower-/.f32N/A
frac-2negN/A
lower-/.f32N/A
lower-/.f64N/A
lower-/.f6467.1
Applied rewrites67.1%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
Applied rewrites66.6%
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-/r*N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6466.6
Applied rewrites66.6%
if 1.75000000000000006e198 < angle Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-flip-revN/A
lower-/.f64N/A
lower-/.f6467.0
Applied rewrites67.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 1.12e+198)
(*
(* (+ a_m b) (* (- b a_m) (* (sin (* (/ 1.0 (/ 180.0 angle_m)) PI)) 2.0)))
(sin (* (fma 0.005555555555555556 angle_m 0.5) PI)))
(*
(* (+ a_m b) (* (- b a_m) (* (sin (/ PI (/ 180.0 angle_m))) 2.0)))
(cos (* PI (/ angle_m 180.0)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 1.12e+198) {
tmp = ((a_m + b) * ((b - a_m) * (sin(((1.0 / (180.0 / angle_m)) * ((double) M_PI))) * 2.0))) * sin((fma(0.005555555555555556, angle_m, 0.5) * ((double) M_PI)));
} else {
tmp = ((a_m + b) * ((b - a_m) * (sin((((double) M_PI) / (180.0 / angle_m))) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 1.12e+198) tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(Float64(1.0 / Float64(180.0 / angle_m)) * pi)) * 2.0))) * sin(Float64(fma(0.005555555555555556, angle_m, 0.5) * pi))); else tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(pi / Float64(180.0 / angle_m))) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0)))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 1.12e+198], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(N[(1.0 / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.005555555555555556 * angle$95$m + 0.5), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $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 1.12 \cdot 10^{+198}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\frac{1}{\frac{180}{angle\_m}} \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556, angle\_m, 0.5\right) \cdot \pi\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\end{array}
\end{array}
if angle < 1.1199999999999999e198Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
frac-2negN/A
div-flipN/A
lower-unsound-/.f32N/A
lower-unsound-/.f32N/A
lower-/.f32N/A
frac-2negN/A
lower-/.f32N/A
lower-/.f64N/A
lower-/.f6467.1
Applied rewrites67.1%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
mult-flipN/A
metadata-evalN/A
distribute-lft-inN/A
Applied rewrites66.6%
if 1.1199999999999999e198 < angle Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-flip-revN/A
lower-/.f64N/A
lower-/.f6467.0
Applied rewrites67.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 (<= a_m 2e+241)
(*
(*
(+ a_m b)
(* (- b a_m) (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0)))
(sin (fma (* PI angle_m) 0.005555555555555556 (* PI 0.5))))
(*
(*
(+ a_m b)
(*
(- b a_m)
(* (sin (/ 0.005555555555555556 (/ 1.0 (* PI angle_m)))) 2.0)))
(cos (* PI (/ angle_m 180.0)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (a_m <= 2e+241) {
tmp = ((a_m + b) * ((b - a_m) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0))) * sin(fma((((double) M_PI) * angle_m), 0.005555555555555556, (((double) M_PI) * 0.5)));
} else {
tmp = ((a_m + b) * ((b - a_m) * (sin((0.005555555555555556 / (1.0 / (((double) M_PI) * angle_m)))) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (a_m <= 2e+241) tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0))) * sin(fma(Float64(pi * angle_m), 0.005555555555555556, Float64(pi * 0.5)))); else tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(0.005555555555555556 / Float64(1.0 / Float64(pi * angle_m)))) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0)))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a$95$m, 2e+241], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556 + N[(Pi * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 / N[(1.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a\_m \leq 2 \cdot 10^{+241}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(\pi \cdot angle\_m, 0.005555555555555556, \pi \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\frac{0.005555555555555556}{\frac{1}{\pi \cdot angle\_m}}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\end{array}
\end{array}
if a < 2.0000000000000001e241Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
lift-cos.f64N/A
sin-+PI/2-revN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
frac-2negN/A
associate-*r/N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
frac-2negN/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f64N/A
lower-sin.f64N/A
Applied rewrites66.8%
if 2.0000000000000001e241 < a Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-/r*N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6467.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.0
Applied rewrites67.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 180.0))) (t_1 (cos t_0)))
(*
angle_s
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) t_1)
-2e+295)
(*
(*
(+ a_m b)
(* (- b a_m) (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0)))
(+ 1.0 (* -1.54320987654321e-5 (* (pow angle_m 2.0) (pow PI 2.0)))))
(*
(*
(+ a_m b)
(* (- b a_m) (* (sin (* (/ 1.0 (/ 180.0 angle_m)) PI)) 2.0)))
t_1)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = cos(t_0);
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * t_1) <= -2e+295) {
tmp = ((a_m + b) * ((b - a_m) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0))) * (1.0 + (-1.54320987654321e-5 * (pow(angle_m, 2.0) * pow(((double) M_PI), 2.0))));
} else {
tmp = ((a_m + b) * ((b - a_m) * (sin(((1.0 / (180.0 / angle_m)) * ((double) M_PI))) * 2.0))) * t_1;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = Math.PI * (angle_m / 180.0);
double t_1 = Math.cos(t_0);
double tmp;
if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) * Math.sin(t_0)) * t_1) <= -2e+295) {
tmp = ((a_m + b) * ((b - a_m) * (Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * 2.0))) * (1.0 + (-1.54320987654321e-5 * (Math.pow(angle_m, 2.0) * Math.pow(Math.PI, 2.0))));
} else {
tmp = ((a_m + b) * ((b - a_m) * (Math.sin(((1.0 / (180.0 / angle_m)) * Math.PI)) * 2.0))) * t_1;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = math.pi * (angle_m / 180.0) t_1 = math.cos(t_0) tmp = 0 if (((2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) * math.sin(t_0)) * t_1) <= -2e+295: tmp = ((a_m + b) * ((b - a_m) * (math.sin(((0.005555555555555556 * angle_m) * math.pi)) * 2.0))) * (1.0 + (-1.54320987654321e-5 * (math.pow(angle_m, 2.0) * math.pow(math.pi, 2.0)))) else: tmp = ((a_m + b) * ((b - a_m) * (math.sin(((1.0 / (180.0 / angle_m)) * math.pi)) * 2.0))) * t_1 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = cos(t_0) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * t_1) <= -2e+295) tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0))) * Float64(1.0 + Float64(-1.54320987654321e-5 * Float64((angle_m ^ 2.0) * (pi ^ 2.0))))); else tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(Float64(1.0 / Float64(180.0 / angle_m)) * pi)) * 2.0))) * t_1); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = pi * (angle_m / 180.0); t_1 = cos(t_0); tmp = 0.0; if ((((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * t_1) <= -2e+295) tmp = ((a_m + b) * ((b - a_m) * (sin(((0.005555555555555556 * angle_m) * pi)) * 2.0))) * (1.0 + (-1.54320987654321e-5 * ((angle_m ^ 2.0) * (pi ^ 2.0)))); else tmp = ((a_m + b) * ((b - a_m) * (sin(((1.0 / (180.0 / angle_m)) * pi)) * 2.0))) * t_1; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[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] * t$95$1), $MachinePrecision], -2e+295], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-1.54320987654321e-5 * N[(N[Power[angle$95$m, 2.0], $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(N[(1.0 / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $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 := \cos t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot t\_1 \leq -2 \cdot 10^{+295}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left({angle\_m}^{2} \cdot {\pi}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\frac{1}{\frac{180}{angle\_m}} \cdot \pi\right) \cdot 2\right)\right)\right) \cdot t\_1\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -2e295Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
Taylor expanded in angle around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-PI.f6462.3
Applied rewrites62.3%
if -2e295 < (*.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 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
frac-2negN/A
div-flipN/A
lower-unsound-/.f32N/A
lower-unsound-/.f32N/A
lower-/.f32N/A
frac-2negN/A
lower-/.f32N/A
lower-/.f64N/A
lower-/.f6467.1
Applied rewrites67.1%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0))))
(*
angle_s
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))
-2e+295)
(*
(*
(+ a_m b)
(* (- b a_m) (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0)))
(+ 1.0 (* -1.54320987654321e-5 (* (pow angle_m 2.0) (pow PI 2.0)))))
(*
(+ a_m b)
(* (- b a_m) (sin (* (* angle_m PI) 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 = ((double) M_PI) * (angle_m / 180.0);
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0)) <= -2e+295) {
tmp = ((a_m + b) * ((b - a_m) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0))) * (1.0 + (-1.54320987654321e-5 * (pow(angle_m, 2.0) * pow(((double) M_PI), 2.0))));
} else {
tmp = (a_m + b) * ((b - a_m) * sin(((angle_m * ((double) M_PI)) * 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 = Math.PI * (angle_m / 180.0);
double tmp;
if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) * Math.sin(t_0)) * Math.cos(t_0)) <= -2e+295) {
tmp = ((a_m + b) * ((b - a_m) * (Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * 2.0))) * (1.0 + (-1.54320987654321e-5 * (Math.pow(angle_m, 2.0) * Math.pow(Math.PI, 2.0))));
} else {
tmp = (a_m + b) * ((b - a_m) * Math.sin(((angle_m * Math.PI) * 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 = math.pi * (angle_m / 180.0) tmp = 0 if (((2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) * math.sin(t_0)) * math.cos(t_0)) <= -2e+295: tmp = ((a_m + b) * ((b - a_m) * (math.sin(((0.005555555555555556 * angle_m) * math.pi)) * 2.0))) * (1.0 + (-1.54320987654321e-5 * (math.pow(angle_m, 2.0) * math.pow(math.pi, 2.0)))) else: tmp = (a_m + b) * ((b - a_m) * math.sin(((angle_m * math.pi) * 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(pi * Float64(angle_m / 180.0)) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) <= -2e+295) tmp = Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0))) * Float64(1.0 + Float64(-1.54320987654321e-5 * Float64((angle_m ^ 2.0) * (pi ^ 2.0))))); else tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * sin(Float64(Float64(angle_m * pi) * 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 = pi * (angle_m / 180.0); tmp = 0.0; if ((((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) <= -2e+295) tmp = ((a_m + b) * ((b - a_m) * (sin(((0.005555555555555556 * angle_m) * pi)) * 2.0))) * (1.0 + (-1.54320987654321e-5 * ((angle_m ^ 2.0) * (pi ^ 2.0)))); else tmp = (a_m + b) * ((b - a_m) * sin(((angle_m * pi) * 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[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[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], -2e+295], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-1.54320987654321e-5 * N[(N[Power[angle$95$m, 2.0], $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $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 := \pi \cdot \frac{angle\_m}{180}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq -2 \cdot 10^{+295}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left({angle\_m}^{2} \cdot {\pi}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\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))))) < -2e295Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.6%
Taylor expanded in angle around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-PI.f6462.3
Applied rewrites62.3%
if -2e295 < (*.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 53.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-sin.f64N/A
lift-cos.f64N/A
2-sinN/A
count-2N/A
Applied rewrites67.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
(*
angle_s
(*
(*
(+ a_m b)
(* (- b a_m) (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0)))
(cos (* PI (/ angle_m 180.0))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (((a_m + b) * ((b - a_m) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0))));
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (((a_m + b) * ((b - a_m) * (Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * 2.0))) * Math.cos((Math.PI * (angle_m / 180.0))));
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * (((a_m + b) * ((b - a_m) * (math.sin(((0.005555555555555556 * angle_m) * math.pi)) * 2.0))) * math.cos((math.pi * (angle_m / 180.0))))
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0))))) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * (((a_m + b) * ((b - a_m) * (sin(((0.005555555555555556 * angle_m) * pi)) * 2.0))) * cos((pi * (angle_m / 180.0)))); end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)
\end{array}
Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.5
Applied rewrites67.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 (* (+ a_m b) (* (- b a_m) (sin (* (* angle_m PI) 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) {
return angle_s * ((a_m + b) * ((b - a_m) * sin(((angle_m * ((double) M_PI)) * 0.011111111111111112))));
}
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 * ((a_m + b) * ((b - a_m) * Math.sin(((angle_m * Math.PI) * 0.011111111111111112))));
}
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 * ((a_m + b) * ((b - a_m) * math.sin(((angle_m * math.pi) * 0.011111111111111112))))
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(a_m + b) * Float64(Float64(b - a_m) * sin(Float64(Float64(angle_m * pi) * 0.011111111111111112))))) 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 * ((a_m + b) * ((b - a_m) * sin(((angle_m * pi) * 0.011111111111111112)))); 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[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\right)
\end{array}
Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-sin.f64N/A
lift-cos.f64N/A
2-sinN/A
count-2N/A
Applied rewrites67.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
(*
angle_s
(if (<= angle_m 1.15e-5)
(* (* (* angle_m (+ b a_m)) (- b a_m)) (* PI 0.011111111111111112))
(*
(* (- b a_m) (+ a_m b))
(sin (* (* angle_m PI) 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 <= 1.15e-5) {
tmp = ((angle_m * (b + a_m)) * (b - a_m)) * (((double) M_PI) * 0.011111111111111112);
} else {
tmp = ((b - a_m) * (a_m + b)) * sin(((angle_m * ((double) M_PI)) * 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 <= 1.15e-5) {
tmp = ((angle_m * (b + a_m)) * (b - a_m)) * (Math.PI * 0.011111111111111112);
} else {
tmp = ((b - a_m) * (a_m + b)) * Math.sin(((angle_m * Math.PI) * 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 <= 1.15e-5: tmp = ((angle_m * (b + a_m)) * (b - a_m)) * (math.pi * 0.011111111111111112) else: tmp = ((b - a_m) * (a_m + b)) * math.sin(((angle_m * math.pi) * 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 <= 1.15e-5) tmp = Float64(Float64(Float64(angle_m * Float64(b + a_m)) * Float64(b - a_m)) * Float64(pi * 0.011111111111111112)); else tmp = Float64(Float64(Float64(b - a_m) * Float64(a_m + b)) * sin(Float64(Float64(angle_m * pi) * 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 <= 1.15e-5) tmp = ((angle_m * (b + a_m)) * (b - a_m)) * (pi * 0.011111111111111112); else tmp = ((b - a_m) * (a_m + b)) * sin(((angle_m * pi) * 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, 1.15e-5], N[(N[(N[(angle$95$m * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $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 1.15 \cdot 10^{-5}:\\
\;\;\;\;\left(\left(angle\_m \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right) \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if angle < 1.15e-5Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
if 1.15e-5 < angle Initial program 53.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-sin.f64N/A
lift-cos.f64N/A
2-sinN/A
count-2N/A
Applied rewrites57.2%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 5e+93)
(* (* (* angle_m (+ b a_m)) (- b a_m)) (* PI 0.011111111111111112))
(* 0.011111111111111112 (* angle_m (* PI (fma (- a_m) a_m (* b b))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 5e+93) {
tmp = ((angle_m * (b + a_m)) * (b - a_m)) * (((double) M_PI) * 0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fma(-a_m, a_m, (b * b))));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 5e+93) tmp = Float64(Float64(Float64(angle_m * Float64(b + a_m)) * Float64(b - a_m)) * Float64(pi * 0.011111111111111112)); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * fma(Float64(-a_m), a_m, Float64(b * b))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 5e+93], N[(N[(N[(angle$95$m * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[((-a$95$m) * a$95$m + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 5 \cdot 10^{+93}:\\
\;\;\;\;\left(\left(angle\_m \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \mathsf{fma}\left(-a\_m, a\_m, b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if angle < 5.0000000000000001e93Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
if 5.0000000000000001e93 < angle Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift--.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lower-fma.f64N/A
lower-neg.f6452.8
Applied rewrites52.8%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 0.000205)
(* (* (* angle_m (+ b a_m)) (- b a_m)) (* PI 0.011111111111111112))
(* (* 0.011111111111111112 (* (* (- b a_m) (+ b a_m)) PI)) 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 (angle_m <= 0.000205) {
tmp = ((angle_m * (b + a_m)) * (b - a_m)) * (((double) M_PI) * 0.011111111111111112);
} else {
tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * ((double) M_PI))) * 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 (angle_m <= 0.000205) {
tmp = ((angle_m * (b + a_m)) * (b - a_m)) * (Math.PI * 0.011111111111111112);
} else {
tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * Math.PI)) * 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 angle_m <= 0.000205: tmp = ((angle_m * (b + a_m)) * (b - a_m)) * (math.pi * 0.011111111111111112) else: tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * math.pi)) * 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 (angle_m <= 0.000205) tmp = Float64(Float64(Float64(angle_m * Float64(b + a_m)) * Float64(b - a_m)) * Float64(pi * 0.011111111111111112)); else tmp = Float64(Float64(0.011111111111111112 * Float64(Float64(Float64(b - a_m) * Float64(b + a_m)) * pi)) * 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 (angle_m <= 0.000205) tmp = ((angle_m * (b + a_m)) * (b - a_m)) * (pi * 0.011111111111111112); else tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * pi)) * 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[angle$95$m, 0.000205], N[(N[(N[(angle$95$m * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(0.011111111111111112 * N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $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}\;angle\_m \leq 0.000205:\\
\;\;\;\;\left(\left(angle\_m \cdot \left(b + a\_m\right)\right) \cdot \left(b - a\_m\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.011111111111111112 \cdot \left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \pi\right)\right) \cdot angle\_m\\
\end{array}
\end{array}
if angle < 2.05e-4Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f6461.5
Applied rewrites61.5%
if 2.05e-4 < angle Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites53.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 5e+78)
(* (* (* 0.011111111111111112 (* angle_m (- b a_m))) (+ b a_m)) PI)
(* (* 0.011111111111111112 (* (* (- b a_m) (+ b a_m)) PI)) 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 (angle_m <= 5e+78) {
tmp = ((0.011111111111111112 * (angle_m * (b - a_m))) * (b + a_m)) * ((double) M_PI);
} else {
tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * ((double) M_PI))) * 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 (angle_m <= 5e+78) {
tmp = ((0.011111111111111112 * (angle_m * (b - a_m))) * (b + a_m)) * Math.PI;
} else {
tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * Math.PI)) * 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 angle_m <= 5e+78: tmp = ((0.011111111111111112 * (angle_m * (b - a_m))) * (b + a_m)) * math.pi else: tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * math.pi)) * 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 (angle_m <= 5e+78) tmp = Float64(Float64(Float64(0.011111111111111112 * Float64(angle_m * Float64(b - a_m))) * Float64(b + a_m)) * pi); else tmp = Float64(Float64(0.011111111111111112 * Float64(Float64(Float64(b - a_m) * Float64(b + a_m)) * pi)) * 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 (angle_m <= 5e+78) tmp = ((0.011111111111111112 * (angle_m * (b - a_m))) * (b + a_m)) * pi; else tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * pi)) * 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[angle$95$m, 5e+78], N[(N[(N[(0.011111111111111112 * N[(angle$95$m * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision], N[(N[(0.011111111111111112 * N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $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}\;angle\_m \leq 5 \cdot 10^{+78}:\\
\;\;\;\;\left(\left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(b - a\_m\right)\right)\right) \cdot \left(b + a\_m\right)\right) \cdot \pi\\
\mathbf{else}:\\
\;\;\;\;\left(0.011111111111111112 \cdot \left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \pi\right)\right) \cdot angle\_m\\
\end{array}
\end{array}
if angle < 4.99999999999999984e78Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.6
lift-+.f64N/A
+-commutativeN/A
lift-+.f6461.6
Applied rewrites61.6%
if 4.99999999999999984e78 < angle Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites53.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 4000000000000.0)
(* 0.011111111111111112 (* (* angle_m (- b a_m)) (* (+ b a_m) PI)))
(* (* 0.011111111111111112 (* (* (- b a_m) (+ b a_m)) PI)) 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 (angle_m <= 4000000000000.0) {
tmp = 0.011111111111111112 * ((angle_m * (b - a_m)) * ((b + a_m) * ((double) M_PI)));
} else {
tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * ((double) M_PI))) * 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 (angle_m <= 4000000000000.0) {
tmp = 0.011111111111111112 * ((angle_m * (b - a_m)) * ((b + a_m) * Math.PI));
} else {
tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * Math.PI)) * 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 angle_m <= 4000000000000.0: tmp = 0.011111111111111112 * ((angle_m * (b - a_m)) * ((b + a_m) * math.pi)) else: tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * math.pi)) * 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 (angle_m <= 4000000000000.0) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64(b - a_m)) * Float64(Float64(b + a_m) * pi))); else tmp = Float64(Float64(0.011111111111111112 * Float64(Float64(Float64(b - a_m) * Float64(b + a_m)) * pi)) * 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 (angle_m <= 4000000000000.0) tmp = 0.011111111111111112 * ((angle_m * (b - a_m)) * ((b + a_m) * pi)); else tmp = (0.011111111111111112 * (((b - a_m) * (b + a_m)) * pi)) * 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[angle$95$m, 4000000000000.0], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.011111111111111112 * N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $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}\;angle\_m \leq 4000000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot \left(b - a\_m\right)\right) \cdot \left(\left(b + a\_m\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.011111111111111112 \cdot \left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \pi\right)\right) \cdot angle\_m\\
\end{array}
\end{array}
if angle < 4e12Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5
lift-+.f64N/A
+-commutativeN/A
lift-+.f6461.5
Applied rewrites61.5%
if 4e12 < angle Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites53.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 5000000000000.0)
(* 0.011111111111111112 (* (* angle_m (- b a_m)) (* (+ b a_m) PI)))
(* 0.011111111111111112 (* (* angle_m (* (- b a_m) (+ b a_m))) PI)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 5000000000000.0) {
tmp = 0.011111111111111112 * ((angle_m * (b - a_m)) * ((b + a_m) * ((double) M_PI)));
} else {
tmp = 0.011111111111111112 * ((angle_m * ((b - a_m) * (b + a_m))) * ((double) M_PI));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 5000000000000.0) {
tmp = 0.011111111111111112 * ((angle_m * (b - a_m)) * ((b + a_m) * Math.PI));
} else {
tmp = 0.011111111111111112 * ((angle_m * ((b - a_m) * (b + a_m))) * Math.PI);
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 5000000000000.0: tmp = 0.011111111111111112 * ((angle_m * (b - a_m)) * ((b + a_m) * math.pi)) else: tmp = 0.011111111111111112 * ((angle_m * ((b - a_m) * (b + a_m))) * math.pi) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 5000000000000.0) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64(b - a_m)) * Float64(Float64(b + a_m) * pi))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64(Float64(b - a_m) * Float64(b + a_m))) * pi)); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 5000000000000.0) tmp = 0.011111111111111112 * ((angle_m * (b - a_m)) * ((b + a_m) * pi)); else tmp = 0.011111111111111112 * ((angle_m * ((b - a_m) * (b + a_m))) * pi); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 5000000000000.0], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $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 5000000000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot \left(b - a\_m\right)\right) \cdot \left(\left(b + a\_m\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\right) \cdot \pi\right)\\
\end{array}
\end{array}
if angle < 5e12Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5
lift-+.f64N/A
+-commutativeN/A
lift-+.f6461.5
Applied rewrites61.5%
if 5e12 < angle Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.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
(let* ((t_0 (* angle_m (- b a_m)))
(t_1 (* 2.0 (- (pow b 2.0) (pow a_m 2.0)))))
(*
angle_s
(if (<= t_1 -5e+133)
(* 0.011111111111111112 (* t_0 (* a_m PI)))
(if (<= t_1 2e+78)
(* 0.011111111111111112 (* (* angle_m (* (- b a_m) (+ b a_m))) PI))
(* 0.011111111111111112 (* t_0 (* b PI))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = angle_m * (b - a_m);
double t_1 = 2.0 * (pow(b, 2.0) - pow(a_m, 2.0));
double tmp;
if (t_1 <= -5e+133) {
tmp = 0.011111111111111112 * (t_0 * (a_m * ((double) M_PI)));
} else if (t_1 <= 2e+78) {
tmp = 0.011111111111111112 * ((angle_m * ((b - a_m) * (b + a_m))) * ((double) M_PI));
} else {
tmp = 0.011111111111111112 * (t_0 * (b * ((double) M_PI)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = angle_m * (b - a_m);
double t_1 = 2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0));
double tmp;
if (t_1 <= -5e+133) {
tmp = 0.011111111111111112 * (t_0 * (a_m * Math.PI));
} else if (t_1 <= 2e+78) {
tmp = 0.011111111111111112 * ((angle_m * ((b - a_m) * (b + a_m))) * Math.PI);
} else {
tmp = 0.011111111111111112 * (t_0 * (b * Math.PI));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = angle_m * (b - a_m) t_1 = 2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0)) tmp = 0 if t_1 <= -5e+133: tmp = 0.011111111111111112 * (t_0 * (a_m * math.pi)) elif t_1 <= 2e+78: tmp = 0.011111111111111112 * ((angle_m * ((b - a_m) * (b + a_m))) * math.pi) else: tmp = 0.011111111111111112 * (t_0 * (b * math.pi)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(angle_m * Float64(b - a_m)) t_1 = Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) tmp = 0.0 if (t_1 <= -5e+133) tmp = Float64(0.011111111111111112 * Float64(t_0 * Float64(a_m * pi))); elseif (t_1 <= 2e+78) tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64(Float64(b - a_m) * Float64(b + a_m))) * pi)); else tmp = Float64(0.011111111111111112 * Float64(t_0 * Float64(b * pi))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = angle_m * (b - a_m); t_1 = 2.0 * ((b ^ 2.0) - (a_m ^ 2.0)); tmp = 0.0; if (t_1 <= -5e+133) tmp = 0.011111111111111112 * (t_0 * (a_m * pi)); elseif (t_1 <= 2e+78) tmp = 0.011111111111111112 * ((angle_m * ((b - a_m) * (b + a_m))) * pi); else tmp = 0.011111111111111112 * (t_0 * (b * pi)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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$1, -5e+133], N[(0.011111111111111112 * N[(t$95$0 * N[(a$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+78], N[(0.011111111111111112 * N[(N[(angle$95$m * N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(t$95$0 * N[(b * Pi), $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 := angle\_m \cdot \left(b - a\_m\right)\\
t_1 := 2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+133}:\\
\;\;\;\;0.011111111111111112 \cdot \left(t\_0 \cdot \left(a\_m \cdot \pi\right)\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+78}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot \left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right)\right) \cdot \pi\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(t\_0 \cdot \left(b \cdot \pi\right)\right)\\
\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)))) < -4.99999999999999961e133Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5
lift-+.f64N/A
+-commutativeN/A
lift-+.f6461.5
Applied rewrites61.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-PI.f6441.1
Applied rewrites41.1%
if -4.99999999999999961e133 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 2.00000000000000002e78Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
if 2.00000000000000002e78 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5
lift-+.f64N/A
+-commutativeN/A
lift-+.f6461.5
Applied rewrites61.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-PI.f6441.4
Applied rewrites41.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 (* angle_m (- b a_m))))
(*
angle_s
(if (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) 2e-263)
(* 0.011111111111111112 (* t_0 (* a_m PI)))
(* 0.011111111111111112 (* t_0 (* b PI)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = angle_m * (b - a_m);
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= 2e-263) {
tmp = 0.011111111111111112 * (t_0 * (a_m * ((double) M_PI)));
} else {
tmp = 0.011111111111111112 * (t_0 * (b * ((double) M_PI)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = angle_m * (b - a_m);
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= 2e-263) {
tmp = 0.011111111111111112 * (t_0 * (a_m * Math.PI));
} else {
tmp = 0.011111111111111112 * (t_0 * (b * Math.PI));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = angle_m * (b - a_m) tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= 2e-263: tmp = 0.011111111111111112 * (t_0 * (a_m * math.pi)) else: tmp = 0.011111111111111112 * (t_0 * (b * math.pi)) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(angle_m * Float64(b - a_m)) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= 2e-263) tmp = Float64(0.011111111111111112 * Float64(t_0 * Float64(a_m * pi))); else tmp = Float64(0.011111111111111112 * Float64(t_0 * Float64(b * pi))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = angle_m * (b - a_m); tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= 2e-263) tmp = 0.011111111111111112 * (t_0 * (a_m * pi)); else tmp = 0.011111111111111112 * (t_0 * (b * pi)); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]}, 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], 2e-263], N[(0.011111111111111112 * N[(t$95$0 * N[(a$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(t$95$0 * N[(b * Pi), $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 := angle\_m \cdot \left(b - a\_m\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq 2 \cdot 10^{-263}:\\
\;\;\;\;0.011111111111111112 \cdot \left(t\_0 \cdot \left(a\_m \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(t\_0 \cdot \left(b \cdot \pi\right)\right)\\
\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)))) < 2e-263Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5
lift-+.f64N/A
+-commutativeN/A
lift-+.f6461.5
Applied rewrites61.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-PI.f6441.1
Applied rewrites41.1%
if 2e-263 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5
lift-+.f64N/A
+-commutativeN/A
lift-+.f6461.5
Applied rewrites61.5%
Taylor expanded in a around 0
lower-*.f64N/A
lower-PI.f6441.4
Applied rewrites41.4%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* (* angle_m (- b a_m)) (* a_m PI)))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (0.011111111111111112 * ((angle_m * (b - a_m)) * (a_m * ((double) M_PI))));
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * (0.011111111111111112 * ((angle_m * (b - a_m)) * (a_m * Math.PI)));
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * (0.011111111111111112 * ((angle_m * (b - a_m)) * (a_m * math.pi)))
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(angle_m * Float64(b - a_m)) * Float64(a_m * pi)))) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * (0.011111111111111112 * ((angle_m * (b - a_m)) * (a_m * pi))); end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(angle$95$m * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(a$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(\left(angle\_m \cdot \left(b - a\_m\right)\right) \cdot \left(a\_m \cdot \pi\right)\right)\right)
\end{array}
Initial program 53.8%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6453.5
lift-+.f64N/A
+-commutativeN/A
lower-+.f6453.5
Applied rewrites53.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.5
lift-+.f64N/A
+-commutativeN/A
lift-+.f6461.5
Applied rewrites61.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-PI.f6441.1
Applied rewrites41.1%
herbie shell --seed 2025154
(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)))))