
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 6.2e+43)
(*
(* (+ a b) (* (- b a) (* (sin (* (/ 1.0 (/ 180.0 angle_m)) PI)) 2.0)))
(cos (* PI (/ angle_m 180.0))))
(if (<= angle_m 3.2e+221)
(*
(*
(* (- b a) (+ a b))
(* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0))
(sin (fma -0.005555555555555556 (* PI angle_m) (* PI 0.5))))
(* (* (- b a) (+ b a)) (sin (* (* 0.011111111111111112 angle_m) PI)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 6.2e+43) {
tmp = ((a + b) * ((b - a) * (sin(((1.0 / (180.0 / angle_m)) * ((double) M_PI))) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0)));
} else if (angle_m <= 3.2e+221) {
tmp = (((b - a) * (a + b)) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0)) * sin(fma(-0.005555555555555556, (((double) M_PI) * angle_m), (((double) M_PI) * 0.5)));
} else {
tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 6.2e+43) tmp = Float64(Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(1.0 / Float64(180.0 / angle_m)) * pi)) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0)))); elseif (angle_m <= 3.2e+221) tmp = Float64(Float64(Float64(Float64(b - a) * Float64(a + b)) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0)) * sin(fma(-0.005555555555555556, Float64(pi * angle_m), Float64(pi * 0.5)))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * pi))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 6.2e+43], N[(N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $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[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 3.2e+221], N[(N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision] + N[(Pi * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 6.2 \cdot 10^{+43}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\frac{1}{\frac{180}{angle\_m}} \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\mathbf{elif}\;angle\_m \leq 3.2 \cdot 10^{+221}:\\
\;\;\;\;\left(\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right) \cdot \sin \left(\mathsf{fma}\left(-0.005555555555555556, \pi \cdot angle\_m, \pi \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right)\\
\end{array}
\end{array}
if angle < 6.2000000000000003e43Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6467.7
Applied rewrites67.7%
if 6.2000000000000003e43 < angle < 3.2e221Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f6458.2
Applied rewrites58.3%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
mult-flipN/A
Applied rewrites58.0%
if 3.2e221 < angle Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
Applied rewrites58.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f6458.2
Applied rewrites58.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 3.2e+221)
(*
(*
(+ a b)
(* (- b a) (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0)))
(sin (fma -0.005555555555555556 (* PI angle_m) (* PI 0.5))))
(* (* (- b a) (+ b a)) (sin (* (* 0.011111111111111112 angle_m) PI))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 3.2e+221) {
tmp = ((a + b) * ((b - a) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0))) * sin(fma(-0.005555555555555556, (((double) M_PI) * angle_m), (((double) M_PI) * 0.5)));
} else {
tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 3.2e+221) tmp = Float64(Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0))) * sin(fma(-0.005555555555555556, Float64(pi * angle_m), Float64(pi * 0.5)))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * pi))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 3.2e+221], N[(N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(-0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision] + N[(Pi * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 3.2 \cdot 10^{+221}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(\left(b - a\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(-0.005555555555555556, \pi \cdot angle\_m, \pi \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right)\\
\end{array}
\end{array}
if angle < 3.2e221Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
mult-flipN/A
Applied rewrites67.6%
if 3.2e221 < angle Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
Applied rewrites58.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f6458.2
Applied rewrites58.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1 (cos t_0))
(t_2
(*
(+ a b)
(* (- b a) (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0)))))
(*
angle_s
(if (<= (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) t_1) -1e+295)
(*
t_2
(+ 1.0 (* -1.54320987654321e-5 (* (pow angle_m 2.0) (pow PI 2.0)))))
(* t_2 t_1)))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = cos(t_0);
double t_2 = (a + b) * ((b - a) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0));
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * t_1) <= -1e+295) {
tmp = t_2 * (1.0 + (-1.54320987654321e-5 * (pow(angle_m, 2.0) * pow(((double) M_PI), 2.0))));
} else {
tmp = t_2 * t_1;
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m / 180.0);
double t_1 = Math.cos(t_0);
double t_2 = (a + b) * ((b - a) * (Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * 2.0));
double tmp;
if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * t_1) <= -1e+295) {
tmp = t_2 * (1.0 + (-1.54320987654321e-5 * (Math.pow(angle_m, 2.0) * Math.pow(Math.PI, 2.0))));
} else {
tmp = t_2 * t_1;
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = math.pi * (angle_m / 180.0) t_1 = math.cos(t_0) t_2 = (a + b) * ((b - a) * (math.sin(((0.005555555555555556 * angle_m) * math.pi)) * 2.0)) tmp = 0 if (((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * t_1) <= -1e+295: tmp = t_2 * (1.0 + (-1.54320987654321e-5 * (math.pow(angle_m, 2.0) * math.pow(math.pi, 2.0)))) else: tmp = t_2 * t_1 return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = cos(t_0) t_2 = Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0))) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * t_1) <= -1e+295) tmp = Float64(t_2 * Float64(1.0 + Float64(-1.54320987654321e-5 * Float64((angle_m ^ 2.0) * (pi ^ 2.0))))); else tmp = Float64(t_2 * t_1); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = pi * (angle_m / 180.0); t_1 = cos(t_0); t_2 = (a + b) * ((b - a) * (sin(((0.005555555555555556 * angle_m) * pi)) * 2.0)); tmp = 0.0; if ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * t_1) <= -1e+295) tmp = t_2 * (1.0 + (-1.54320987654321e-5 * ((angle_m ^ 2.0) * (pi ^ 2.0)))); else tmp = t_2 * t_1; end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[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] * t$95$1), $MachinePrecision], -1e+295], N[(t$95$2 * 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[(t$95$2 * t$95$1), $MachinePrecision]]), $MachinePrecision]]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \cos t\_0\\
t_2 := \left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot t\_1 \leq -1 \cdot 10^{+295}:\\
\;\;\;\;t\_2 \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left({angle\_m}^{2} \cdot {\pi}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \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))))) < -9.9999999999999998e294Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
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.7
Applied rewrites62.7%
if -9.9999999999999998e294 < (*.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 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= b 6e+180)
(*
(*
(+ a b)
(* (- b a) (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0)))
(sin (* PI (fma -0.005555555555555556 angle_m 0.5))))
(*
(* (+ a b) (* (- b a) (* (sin (/ (* PI angle_m) 180.0)) 2.0)))
(cos (* PI (/ angle_m 180.0)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 6e+180) {
tmp = ((a + b) * ((b - a) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0))) * sin((((double) M_PI) * fma(-0.005555555555555556, angle_m, 0.5)));
} else {
tmp = ((a + b) * ((b - a) * (sin(((((double) M_PI) * angle_m) / 180.0)) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0)));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (b <= 6e+180) tmp = Float64(Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0))) * sin(Float64(pi * fma(-0.005555555555555556, angle_m, 0.5)))); else tmp = Float64(Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(pi * angle_m) / 180.0)) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0)))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 6e+180], N[(N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(-0.005555555555555556 * angle$95$m + 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $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}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 6 \cdot 10^{+180}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot 2\right)\right)\right) \cdot \sin \left(\pi \cdot \mathsf{fma}\left(-0.005555555555555556, angle\_m, 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\frac{\pi \cdot angle\_m}{180}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\end{array}
\end{array}
if b < 6.00000000000000006e180Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
mult-flipN/A
Applied rewrites67.6%
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6467.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.6
Applied rewrites67.6%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
distribute-lft-outN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6467.4
Applied rewrites67.4%
if 6.00000000000000006e180 < b Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flip-revN/A
lower-/.f6467.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.9
Applied rewrites67.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 2e+255)
(*
(* (+ a b) (* (- b a) (* (sin (/ (* PI angle_m) 180.0)) 2.0)))
(cos (* PI (/ angle_m 180.0))))
(* (* (- b a) (+ b a)) (sin (* (* 0.011111111111111112 angle_m) PI))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 2e+255) {
tmp = ((a + b) * ((b - a) * (sin(((((double) M_PI) * angle_m) / 180.0)) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0)));
} else {
tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 2e+255) {
tmp = ((a + b) * ((b - a) * (Math.sin(((Math.PI * angle_m) / 180.0)) * 2.0))) * Math.cos((Math.PI * (angle_m / 180.0)));
} else {
tmp = ((b - a) * (b + a)) * Math.sin(((0.011111111111111112 * angle_m) * Math.PI));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if angle_m <= 2e+255: tmp = ((a + b) * ((b - a) * (math.sin(((math.pi * angle_m) / 180.0)) * 2.0))) * math.cos((math.pi * (angle_m / 180.0))) else: tmp = ((b - a) * (b + a)) * math.sin(((0.011111111111111112 * angle_m) * math.pi)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 2e+255) tmp = Float64(Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(pi * angle_m) / 180.0)) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0)))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * pi))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (angle_m <= 2e+255) tmp = ((a + b) * ((b - a) * (sin(((pi * angle_m) / 180.0)) * 2.0))) * cos((pi * (angle_m / 180.0))); else tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * pi)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2e+255], N[(N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2 \cdot 10^{+255}:\\
\;\;\;\;\left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\frac{\pi \cdot angle\_m}{180}\right) \cdot 2\right)\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right)\\
\end{array}
\end{array}
if angle < 1.99999999999999998e255Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flip-revN/A
lower-/.f6467.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.9
Applied rewrites67.9%
if 1.99999999999999998e255 < angle Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
Applied rewrites58.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f6458.2
Applied rewrites58.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(*
(*
(+ a b)
(* (- b a) (* (sin (* (* 0.005555555555555556 angle_m) PI)) 2.0)))
(cos (* PI (/ angle_m 180.0))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (((a + b) * ((b - a) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * 2.0))) * cos((((double) M_PI) * (angle_m / 180.0))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (((a + b) * ((b - a) * (Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * 2.0))) * Math.cos((Math.PI * (angle_m / 180.0))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (((a + b) * ((b - a) * (math.sin(((0.005555555555555556 * angle_m) * math.pi)) * 2.0))) * math.cos((math.pi * (angle_m / 180.0))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * 2.0))) * cos(Float64(pi * Float64(angle_m / 180.0))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (((a + b) * ((b - a) * (sin(((0.005555555555555556 * angle_m) * pi)) * 2.0))) * cos((pi * (angle_m / 180.0)))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $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}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(a + b\right) \cdot \left(\left(b - a\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 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 1.7e+40)
(* (- b a) (* (sin (* 0.011111111111111112 (* PI angle_m))) (+ b a)))
(* (* (- b a) (+ b a)) (sin (* (* 0.011111111111111112 angle_m) PI))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 1.7e+40) {
tmp = (b - a) * (sin((0.011111111111111112 * (((double) M_PI) * angle_m))) * (b + a));
} else {
tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 1.7e+40) {
tmp = (b - a) * (Math.sin((0.011111111111111112 * (Math.PI * angle_m))) * (b + a));
} else {
tmp = ((b - a) * (b + a)) * Math.sin(((0.011111111111111112 * angle_m) * Math.PI));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if angle_m <= 1.7e+40: tmp = (b - a) * (math.sin((0.011111111111111112 * (math.pi * angle_m))) * (b + a)) else: tmp = ((b - a) * (b + a)) * math.sin(((0.011111111111111112 * angle_m) * math.pi)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 1.7e+40) tmp = Float64(Float64(b - a) * Float64(sin(Float64(0.011111111111111112 * Float64(pi * angle_m))) * Float64(b + a))); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * pi))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (angle_m <= 1.7e+40) tmp = (b - a) * (sin((0.011111111111111112 * (pi * angle_m))) * (b + a)); else tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * pi)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 1.7e+40], N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(0.011111111111111112 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 1.7 \cdot 10^{+40}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right) \cdot \left(b + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right)\\
\end{array}
\end{array}
if angle < 1.69999999999999994e40Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
mult-flipN/A
Applied rewrites67.6%
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6467.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.6
Applied rewrites67.6%
Applied rewrites67.8%
if 1.69999999999999994e40 < angle Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
Applied rewrites58.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f6458.2
Applied rewrites58.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 7.5e-92)
(* (* (* angle_m (+ b a)) (- b a)) (* PI 0.011111111111111112))
(* (* (- b a) (+ b a)) (sin (* (* 0.011111111111111112 angle_m) PI))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 7.5e-92) {
tmp = ((angle_m * (b + a)) * (b - a)) * (((double) M_PI) * 0.011111111111111112);
} else {
tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 7.5e-92) {
tmp = ((angle_m * (b + a)) * (b - a)) * (Math.PI * 0.011111111111111112);
} else {
tmp = ((b - a) * (b + a)) * Math.sin(((0.011111111111111112 * angle_m) * Math.PI));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if angle_m <= 7.5e-92: tmp = ((angle_m * (b + a)) * (b - a)) * (math.pi * 0.011111111111111112) else: tmp = ((b - a) * (b + a)) * math.sin(((0.011111111111111112 * angle_m) * math.pi)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 7.5e-92) tmp = Float64(Float64(Float64(angle_m * Float64(b + a)) * Float64(b - a)) * Float64(pi * 0.011111111111111112)); else tmp = Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(Float64(Float64(0.011111111111111112 * angle_m) * pi))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (angle_m <= 7.5e-92) tmp = ((angle_m * (b + a)) * (b - a)) * (pi * 0.011111111111111112); else tmp = ((b - a) * (b + a)) * sin(((0.011111111111111112 * angle_m) * pi)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 7.5e-92], N[(N[(N[(angle$95$m * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 7.5 \cdot 10^{-92}:\\
\;\;\;\;\left(\left(angle\_m \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin \left(\left(0.011111111111111112 \cdot angle\_m\right) \cdot \pi\right)\\
\end{array}
\end{array}
if angle < 7.5000000000000005e-92Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
if 7.5000000000000005e-92 < angle Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
Applied rewrites58.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
lower-*.f6458.2
Applied rewrites58.2%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (- b a) (* (+ b a) (sin (* 2.0 (* (* angle_m 0.005555555555555556) PI)))))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((b - a) * ((b + a) * sin((2.0 * ((angle_m * 0.005555555555555556) * ((double) M_PI))))));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((b - a) * ((b + a) * Math.sin((2.0 * ((angle_m * 0.005555555555555556) * Math.PI)))));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * ((b - a) * ((b + a) * math.sin((2.0 * ((angle_m * 0.005555555555555556) * math.pi)))))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(2.0 * Float64(Float64(angle_m * 0.005555555555555556) * pi)))))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * ((b - a) * ((b + a) * sin((2.0 * ((angle_m * 0.005555555555555556) * pi))))); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(2.0 * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(2 \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 54.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.8
Applied rewrites68.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites67.8%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 7.5e-92)
(* (* (* angle_m (+ b a)) (- b a)) (* PI 0.011111111111111112))
(* (* (- b a) (+ a b)) (sin (* (* angle_m PI) 0.011111111111111112))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 7.5e-92) {
tmp = ((angle_m * (b + a)) * (b - a)) * (((double) M_PI) * 0.011111111111111112);
} else {
tmp = ((b - a) * (a + b)) * sin(((angle_m * ((double) M_PI)) * 0.011111111111111112));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 7.5e-92) {
tmp = ((angle_m * (b + a)) * (b - a)) * (Math.PI * 0.011111111111111112);
} else {
tmp = ((b - a) * (a + b)) * Math.sin(((angle_m * Math.PI) * 0.011111111111111112));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if angle_m <= 7.5e-92: tmp = ((angle_m * (b + a)) * (b - a)) * (math.pi * 0.011111111111111112) else: tmp = ((b - a) * (a + b)) * math.sin(((angle_m * math.pi) * 0.011111111111111112)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 7.5e-92) tmp = Float64(Float64(Float64(angle_m * Float64(b + a)) * Float64(b - a)) * Float64(pi * 0.011111111111111112)); else tmp = Float64(Float64(Float64(b - a) * Float64(a + b)) * sin(Float64(Float64(angle_m * pi) * 0.011111111111111112))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (angle_m <= 7.5e-92) tmp = ((angle_m * (b + a)) * (b - a)) * (pi * 0.011111111111111112); else tmp = ((b - a) * (a + b)) * sin(((angle_m * pi) * 0.011111111111111112)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 7.5e-92], N[(N[(N[(angle$95$m * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 7.5 \cdot 10^{-92}:\\
\;\;\;\;\left(\left(angle\_m \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\right) \cdot \left(a + b\right)\right) \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if angle < 7.5000000000000005e-92Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
if 7.5000000000000005e-92 < angle Initial program 54.6%
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 rewrites58.2%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 2.6e+74)
(* (* (* angle_m (+ b a)) (- b a)) (* PI 0.011111111111111112))
(* 0.011111111111111112 (* angle_m (* (pow b 2.0) PI))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 2.6e+74) {
tmp = ((angle_m * (b + a)) * (b - a)) * (((double) M_PI) * 0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle_m * (pow(b, 2.0) * ((double) M_PI)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 2.6e+74) {
tmp = ((angle_m * (b + a)) * (b - a)) * (Math.PI * 0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle_m * (Math.pow(b, 2.0) * Math.PI));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if angle_m <= 2.6e+74: tmp = ((angle_m * (b + a)) * (b - a)) * (math.pi * 0.011111111111111112) else: tmp = 0.011111111111111112 * (angle_m * (math.pow(b, 2.0) * math.pi)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 2.6e+74) tmp = Float64(Float64(Float64(angle_m * Float64(b + a)) * Float64(b - a)) * Float64(pi * 0.011111111111111112)); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64((b ^ 2.0) * pi))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (angle_m <= 2.6e+74) tmp = ((angle_m * (b + a)) * (b - a)) * (pi * 0.011111111111111112); else tmp = 0.011111111111111112 * (angle_m * ((b ^ 2.0) * pi)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2.6e+74], N[(N[(N[(angle$95$m * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(N[Power[b, 2.0], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.6 \cdot 10^{+74}:\\
\;\;\;\;\left(\left(angle\_m \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left({b}^{2} \cdot \pi\right)\right)\\
\end{array}
\end{array}
if angle < 2.6000000000000001e74Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
if 2.6000000000000001e74 < angle Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
Taylor expanded in a around 0
lower-*.f64N/A
lower-pow.f64N/A
lower-PI.f6434.9
Applied rewrites34.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 1e-77)
(* (* (* angle_m (+ b a)) (- b a)) (* PI 0.011111111111111112))
(* 0.011111111111111112 (* (* angle_m (fma (- a) a (* b b))) PI)))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 1e-77) {
tmp = ((angle_m * (b + a)) * (b - a)) * (((double) M_PI) * 0.011111111111111112);
} else {
tmp = 0.011111111111111112 * ((angle_m * fma(-a, a, (b * b))) * ((double) M_PI));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 1e-77) tmp = Float64(Float64(Float64(angle_m * Float64(b + a)) * Float64(b - a)) * Float64(pi * 0.011111111111111112)); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle_m * fma(Float64(-a), a, Float64(b * b))) * pi)); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 1e-77], N[(N[(N[(angle$95$m * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle$95$m * N[((-a) * a + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 10^{-77}:\\
\;\;\;\;\left(\left(angle\_m \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle\_m \cdot \mathsf{fma}\left(-a, a, b \cdot b\right)\right) \cdot \pi\right)\\
\end{array}
\end{array}
if angle < 9.9999999999999993e-78Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
if 9.9999999999999993e-78 < angle Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squares-revN/A
unpow2N/A
unpow2N/A
lift-pow.f64N/A
sub-flipN/A
+-commutativeN/A
unpow2N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6453.7
lift-pow.f64N/A
unpow2N/A
lower-*.f6453.7
Applied rewrites53.7%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 1e+72)
(* (* (* angle_m (+ b a)) (- b a)) (* PI 0.011111111111111112))
(* 0.011111111111111112 (* angle_m (* PI (fma (- a) a (* b b))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (angle_m <= 1e+72) {
tmp = ((angle_m * (b + a)) * (b - a)) * (((double) M_PI) * 0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * fma(-a, a, (b * b))));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (angle_m <= 1e+72) tmp = Float64(Float64(Float64(angle_m * Float64(b + a)) * Float64(b - a)) * Float64(pi * 0.011111111111111112)); else tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * fma(Float64(-a), a, Float64(b * b))))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 1e+72], N[(N[(N[(angle$95$m * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[((-a) * a + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 10^{+72}:\\
\;\;\;\;\left(\left(angle\_m \cdot \left(b + a\right)\right) \cdot \left(b - a\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, a, b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if angle < 9.99999999999999944e71Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
if 9.99999999999999944e71 < angle Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6453.6
lift-pow.f64N/A
unpow2N/A
lower-*.f6453.6
Applied rewrites53.6%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* (* (* angle_m (+ b a)) (- b a)) (* PI 0.011111111111111112))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (((angle_m * (b + a)) * (b - a)) * (((double) M_PI) * 0.011111111111111112));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (((angle_m * (b + a)) * (b - a)) * (Math.PI * 0.011111111111111112));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (((angle_m * (b + a)) * (b - a)) * (math.pi * 0.011111111111111112))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(Float64(angle_m * Float64(b + a)) * Float64(b - a)) * Float64(pi * 0.011111111111111112))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (((angle_m * (b + a)) * (b - a)) * (pi * 0.011111111111111112)); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(N[(angle$95$m * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(\left(angle\_m \cdot \left(b + a\right)\right) \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)
\end{array}
Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6462.6
Applied rewrites62.6%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* (* (- b a) (* (+ b a) angle_m)) PI))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (((b - a) * ((b + a) * angle_m)) * ((double) M_PI)));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (((b - a) * ((b + a) * angle_m)) * Math.PI));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (0.011111111111111112 * (((b - a) * ((b + a) * angle_m)) * math.pi))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * Float64(Float64(b + a) * angle_m)) * pi))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (0.011111111111111112 * (((b - a) * ((b + a) * angle_m)) * pi)); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot angle\_m\right)\right) \cdot \pi\right)\right)
\end{array}
Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6462.5
Applied rewrites62.5%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) 9e-67)
(* 0.011111111111111112 (* (* (- b a) (* a angle_m)) PI))
(* 0.011111111111111112 (* (* (- b a) (* angle_m b)) PI)))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) <= 9e-67) {
tmp = 0.011111111111111112 * (((b - a) * (a * angle_m)) * ((double) M_PI));
} else {
tmp = 0.011111111111111112 * (((b - a) * (angle_m * b)) * ((double) M_PI));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) <= 9e-67) {
tmp = 0.011111111111111112 * (((b - a) * (a * angle_m)) * Math.PI);
} else {
tmp = 0.011111111111111112 * (((b - a) * (angle_m * b)) * Math.PI);
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) <= 9e-67: tmp = 0.011111111111111112 * (((b - a) * (a * angle_m)) * math.pi) else: tmp = 0.011111111111111112 * (((b - a) * (angle_m * b)) * math.pi) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) <= 9e-67) tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * Float64(a * angle_m)) * pi)); else tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * Float64(angle_m * b)) * pi)); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) <= 9e-67) tmp = 0.011111111111111112 * (((b - a) * (a * angle_m)) * pi); else tmp = 0.011111111111111112 * (((b - a) * (angle_m * b)) * pi); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 9e-67], N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * N[(angle$95$m * b), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq 9 \cdot 10^{-67}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\_m\right)\right) \cdot \pi\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(angle\_m \cdot b\right)\right) \cdot \pi\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 9.00000000000000031e-67Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6462.5
Applied rewrites62.5%
Taylor expanded in a around inf
lower-*.f6440.5
Applied rewrites40.5%
if 9.00000000000000031e-67 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-pow.f64N/A
lower-pow.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6462.5
Applied rewrites62.5%
Taylor expanded in a around 0
lower-*.f6440.0
Applied rewrites40.0%
angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* (* (- b a) (* a angle_m)) PI))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (((b - a) * (a * angle_m)) * ((double) M_PI)));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * (0.011111111111111112 * (((b - a) * (a * angle_m)) * Math.PI));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (0.011111111111111112 * (((b - a) * (a * angle_m)) * math.pi))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * Float64(a * angle_m)) * pi))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (0.011111111111111112 * (((b - a) * (a * angle_m)) * pi)); end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot \left(a \cdot angle\_m\right)\right) \cdot \pi\right)\right)
\end{array}
Initial program 54.6%
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.f6451.3
Applied rewrites51.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.4
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f6454.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6462.5
Applied rewrites62.5%
Taylor expanded in a around inf
lower-*.f6440.5
Applied rewrites40.5%
herbie shell --seed 2025155
(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)))))