
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0
(* 2.0 (sin (fma (* 0.005555555555555556 angle_m) PI (/ PI 2.0))))))
(*
angle_s
(if (<= angle_m 2.35e+83)
(*
t_0
(* (* (sin (* angle_m (* 0.005555555555555556 PI))) (+ a b)) (- b a)))
(if (<= angle_m 4.5e+195)
(*
2.0
(* (* (sin (* (* angle_m PI) 0.005555555555555556)) (+ a b)) (- b a)))
(*
t_0
(*
(sin (* (* PI angle_m) 0.005555555555555556))
(* (+ b a) (- b a)))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = 2.0 * sin(fma((0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)));
double tmp;
if (angle_m <= 2.35e+83) {
tmp = t_0 * ((sin((angle_m * (0.005555555555555556 * ((double) M_PI)))) * (a + b)) * (b - a));
} else if (angle_m <= 4.5e+195) {
tmp = 2.0 * ((sin(((angle_m * ((double) M_PI)) * 0.005555555555555556)) * (a + b)) * (b - a));
} else {
tmp = t_0 * (sin(((((double) M_PI) * angle_m) * 0.005555555555555556)) * ((b + a) * (b - a)));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(2.0 * sin(fma(Float64(0.005555555555555556 * angle_m), pi, Float64(pi / 2.0)))) tmp = 0.0 if (angle_m <= 2.35e+83) tmp = Float64(t_0 * Float64(Float64(sin(Float64(angle_m * Float64(0.005555555555555556 * pi))) * Float64(a + b)) * Float64(b - a))); elseif (angle_m <= 4.5e+195) tmp = Float64(2.0 * Float64(Float64(sin(Float64(Float64(angle_m * pi) * 0.005555555555555556)) * Float64(a + b)) * Float64(b - a))); else tmp = Float64(t_0 * Float64(sin(Float64(Float64(pi * angle_m) * 0.005555555555555556)) * Float64(Float64(b + a) * Float64(b - a)))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 2.35e+83], N[(t$95$0 * N[(N[(N[Sin[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 4.5e+195], N[(2.0 * N[(N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \pi, \frac{\pi}{2}\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.35 \cdot 10^{+83}:\\
\;\;\;\;t\_0 \cdot \left(\left(\sin \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{elif}\;angle\_m \leq 4.5 \cdot 10^{+195}:\\
\;\;\;\;2 \cdot \left(\left(\sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 2.3499999999999999e83Initial program 68.8%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites72.3%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites87.7%
lift-cos.f64N/A
sin-+PI/2-revN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6487.8
Applied rewrites87.8%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6487.8
Applied rewrites87.8%
if 2.3499999999999999e83 < angle < 4.50000000000000009e195Initial program 31.3%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites33.0%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites33.0%
Taylor expanded in angle around 0
Applied rewrites34.9%
if 4.50000000000000009e195 < angle Initial program 30.2%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites32.0%
lift-cos.f64N/A
sin-+PI/2-revN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-sin.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-PI.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-PI.f6433.4
Applied rewrites33.4%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* (* PI angle_m) 0.005555555555555556)))
(*
angle_s
(if (<= angle_m 2.6e-63)
(*
(* 2.0 (cos t_0))
(*
(*
(fma
(* (* (* (* PI PI) PI) (+ a b)) (* angle_m angle_m))
-2.8577960676726107e-8
(* (* (+ a b) PI) 0.005555555555555556))
angle_m)
(- b a)))
(*
(* 2.0 (sin (fma (* 0.005555555555555556 angle_m) PI (/ PI 2.0))))
(* (sin t_0) (* (+ b a) (- b a))))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (((double) M_PI) * angle_m) * 0.005555555555555556;
double tmp;
if (angle_m <= 2.6e-63) {
tmp = (2.0 * cos(t_0)) * ((fma(((((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)) * (a + b)) * (angle_m * angle_m)), -2.8577960676726107e-8, (((a + b) * ((double) M_PI)) * 0.005555555555555556)) * angle_m) * (b - a));
} else {
tmp = (2.0 * sin(fma((0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)))) * (sin(t_0) * ((b + a) * (b - a)));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(pi * angle_m) * 0.005555555555555556) tmp = 0.0 if (angle_m <= 2.6e-63) tmp = Float64(Float64(2.0 * cos(t_0)) * Float64(Float64(fma(Float64(Float64(Float64(Float64(pi * pi) * pi) * Float64(a + b)) * Float64(angle_m * angle_m)), -2.8577960676726107e-8, Float64(Float64(Float64(a + b) * pi) * 0.005555555555555556)) * angle_m) * Float64(b - a))); else tmp = Float64(Float64(2.0 * sin(fma(Float64(0.005555555555555556 * angle_m), pi, Float64(pi / 2.0)))) * Float64(sin(t_0) * Float64(Float64(b + a) * Float64(b - a)))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 2.6e-63], N[(N[(2.0 * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * -2.8577960676726107e-8 + N[(N[(N[(a + b), $MachinePrecision] * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.6 \cdot 10^{-63}:\\
\;\;\;\;\left(2 \cdot \cos t\_0\right) \cdot \left(\left(\mathsf{fma}\left(\left(\left(\left(\pi \cdot \pi\right) \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(angle\_m \cdot angle\_m\right), -2.8577960676726107 \cdot 10^{-8}, \left(\left(a + b\right) \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \pi, \frac{\pi}{2}\right)\right)\right) \cdot \left(\sin t\_0 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 2.6000000000000001e-63Initial program 72.9%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites76.3%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.5%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.1%
if 2.6000000000000001e-63 < angle Initial program 43.0%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites45.4%
lift-cos.f64N/A
sin-+PI/2-revN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-sin.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-PI.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-PI.f6446.2
Applied rewrites46.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 (* (* 2.0 (sin (fma (* 0.005555555555555556 angle_m) PI (/ PI 2.0)))) (* (* (sin (* (* angle_m PI) 0.005555555555555556)) (+ a b)) (- b a)))))
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 * ((2.0 * sin(fma((0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)))) * ((sin(((angle_m * ((double) M_PI)) * 0.005555555555555556)) * (a + b)) * (b - a)));
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(2.0 * sin(fma(Float64(0.005555555555555556 * angle_m), pi, Float64(pi / 2.0)))) * Float64(Float64(sin(Float64(Float64(angle_m * pi) * 0.005555555555555556)) * Float64(a + b)) * Float64(b - a)))) 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[(2.0 * N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $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(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \pi, \frac{\pi}{2}\right)\right)\right) \cdot \left(\left(\sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\right)
\end{array}
Initial program 54.9%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites57.8%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.6%
lift-cos.f64N/A
sin-+PI/2-revN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6468.0
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
(let* ((t_0 (sin (* (* angle_m PI) 0.005555555555555556))))
(*
angle_s
(if (<= b 1e+251)
(* 2.0 (* (* t_0 (+ a b)) (- b a)))
(*
(* 2.0 (sin (fma (* 0.005555555555555556 angle_m) PI (/ PI 2.0))))
(* (* t_0 b) (- b a)))))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double t_0 = sin(((angle_m * ((double) M_PI)) * 0.005555555555555556));
double tmp;
if (b <= 1e+251) {
tmp = 2.0 * ((t_0 * (a + b)) * (b - a));
} else {
tmp = (2.0 * sin(fma((0.005555555555555556 * angle_m), ((double) M_PI), (((double) M_PI) / 2.0)))) * ((t_0 * b) * (b - a));
}
return angle_s * tmp;
}
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = sin(Float64(Float64(angle_m * pi) * 0.005555555555555556)) tmp = 0.0 if (b <= 1e+251) tmp = Float64(2.0 * Float64(Float64(t_0 * Float64(a + b)) * Float64(b - a))); else tmp = Float64(Float64(2.0 * sin(fma(Float64(0.005555555555555556 * angle_m), pi, Float64(pi / 2.0)))) * Float64(Float64(t_0 * b) * Float64(b - a))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[b, 1e+251], N[(2.0 * N[(N[(t$95$0 * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$0 * b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 10^{+251}:\\
\;\;\;\;2 \cdot \left(\left(t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot angle\_m, \pi, \frac{\pi}{2}\right)\right)\right) \cdot \left(\left(t\_0 \cdot b\right) \cdot \left(b - a\right)\right)\\
\end{array}
\end{array}
\end{array}
if b < 1e251Initial program 55.2%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites57.4%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.2%
Taylor expanded in angle around 0
Applied rewrites66.2%
if 1e251 < b Initial program 48.6%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites65.0%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites75.0%
lift-cos.f64N/A
sin-+PI/2-revN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-sin.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6478.8
Applied rewrites78.8%
Taylor expanded in a around 0
Applied rewrites77.5%
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))))
(*
angle_s
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
-1e+305)
(*
(* 2.0 (cos (* (* PI angle_m) 0.005555555555555556)))
(*
(*
(fma
(* (* (* (* PI PI) PI) (+ a b)) (* angle_m angle_m))
-2.8577960676726107e-8
(* (* (+ a b) PI) 0.005555555555555556))
angle_m)
(- b a)))
(*
2.0
(*
(* (sin (* (* angle_m PI) 0.005555555555555556)) (+ a b))
(- b a)))))))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 tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0)) <= -1e+305) {
tmp = (2.0 * cos(((((double) M_PI) * angle_m) * 0.005555555555555556))) * ((fma(((((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)) * (a + b)) * (angle_m * angle_m)), -2.8577960676726107e-8, (((a + b) * ((double) M_PI)) * 0.005555555555555556)) * angle_m) * (b - a));
} else {
tmp = 2.0 * ((sin(((angle_m * ((double) M_PI)) * 0.005555555555555556)) * (a + b)) * (b - a));
}
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)) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= -1e+305) tmp = Float64(Float64(2.0 * cos(Float64(Float64(pi * angle_m) * 0.005555555555555556))) * Float64(Float64(fma(Float64(Float64(Float64(Float64(pi * pi) * pi) * Float64(a + b)) * Float64(angle_m * angle_m)), -2.8577960676726107e-8, Float64(Float64(Float64(a + b) * pi) * 0.005555555555555556)) * angle_m) * Float64(b - a))); else tmp = Float64(2.0 * Float64(Float64(sin(Float64(Float64(angle_m * pi) * 0.005555555555555556)) * Float64(a + b)) * Float64(b - a))); end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(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, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], -1e+305], N[(N[(2.0 * N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * -2.8577960676726107e-8 + N[(N[(N[(a + b), $MachinePrecision] * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
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 \cos t\_0 \leq -1 \cdot 10^{+305}:\\
\;\;\;\;\left(2 \cdot \cos \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right) \cdot \left(\left(\mathsf{fma}\left(\left(\left(\left(\pi \cdot \pi\right) \cdot \pi\right) \cdot \left(a + b\right)\right) \cdot \left(angle\_m \cdot angle\_m\right), -2.8577960676726107 \cdot 10^{-8}, \left(\left(a + b\right) \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot angle\_m\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\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))))) < -9.9999999999999994e304Initial program 51.4%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites49.4%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites74.9%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.9%
if -9.9999999999999994e304 < (*.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 55.8%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites59.7%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites65.9%
Taylor expanded in angle around 0
Applied rewrites64.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 (<= b 1.32e+271)
(*
2.0
(* (* (sin (* (* angle_m PI) 0.005555555555555556)) (+ a b)) (- b a)))
(*
(* (* (* b b) 2.0) (* (* PI angle_m) 0.005555555555555556))
(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 <= 1.32e+271) {
tmp = 2.0 * ((sin(((angle_m * ((double) M_PI)) * 0.005555555555555556)) * (a + b)) * (b - a));
} else {
tmp = (((b * b) * 2.0) * ((((double) M_PI) * angle_m) * 0.005555555555555556)) * cos((((double) M_PI) * (angle_m / 180.0)));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if (b <= 1.32e+271) {
tmp = 2.0 * ((Math.sin(((angle_m * Math.PI) * 0.005555555555555556)) * (a + b)) * (b - a));
} else {
tmp = (((b * b) * 2.0) * ((Math.PI * angle_m) * 0.005555555555555556)) * Math.cos((Math.PI * (angle_m / 180.0)));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if b <= 1.32e+271: tmp = 2.0 * ((math.sin(((angle_m * math.pi) * 0.005555555555555556)) * (a + b)) * (b - a)) else: tmp = (((b * b) * 2.0) * ((math.pi * angle_m) * 0.005555555555555556)) * math.cos((math.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 <= 1.32e+271) tmp = Float64(2.0 * Float64(Float64(sin(Float64(Float64(angle_m * pi) * 0.005555555555555556)) * Float64(a + b)) * Float64(b - a))); else tmp = Float64(Float64(Float64(Float64(b * b) * 2.0) * Float64(Float64(pi * angle_m) * 0.005555555555555556)) * cos(Float64(pi * Float64(angle_m / 180.0)))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if (b <= 1.32e+271) tmp = 2.0 * ((sin(((angle_m * pi) * 0.005555555555555556)) * (a + b)) * (b - a)); else tmp = (((b * b) * 2.0) * ((pi * angle_m) * 0.005555555555555556)) * cos((pi * (angle_m / 180.0))); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 1.32e+271], N[(2.0 * N[(N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b * b), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $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 1.32 \cdot 10^{+271}:\\
\;\;\;\;2 \cdot \left(\left(\sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b \cdot b\right) \cdot 2\right) \cdot \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\end{array}
\end{array}
if b < 1.31999999999999997e271Initial program 55.1%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites57.5%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.3%
Taylor expanded in angle around 0
Applied rewrites66.4%
if 1.31999999999999997e271 < b Initial program 49.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6447.0
Applied rewrites47.0%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6461.2
Applied rewrites61.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 (* (* angle_m PI) 0.005555555555555556)))
(*
angle_s
(if (<= angle_m 3.9e+195)
(* 2.0 (* (* (sin t_0) (+ a b)) (- b a)))
(* (sin (* 2.0 t_0)) (* (- b a) (+ a b)))))))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 = (angle_m * ((double) M_PI)) * 0.005555555555555556;
double tmp;
if (angle_m <= 3.9e+195) {
tmp = 2.0 * ((sin(t_0) * (a + b)) * (b - a));
} else {
tmp = sin((2.0 * t_0)) * ((b - a) * (a + b));
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double t_0 = (angle_m * Math.PI) * 0.005555555555555556;
double tmp;
if (angle_m <= 3.9e+195) {
tmp = 2.0 * ((Math.sin(t_0) * (a + b)) * (b - a));
} else {
tmp = Math.sin((2.0 * t_0)) * ((b - a) * (a + b));
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): t_0 = (angle_m * math.pi) * 0.005555555555555556 tmp = 0 if angle_m <= 3.9e+195: tmp = 2.0 * ((math.sin(t_0) * (a + b)) * (b - a)) else: tmp = math.sin((2.0 * t_0)) * ((b - a) * (a + b)) return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) t_0 = Float64(Float64(angle_m * pi) * 0.005555555555555556) tmp = 0.0 if (angle_m <= 3.9e+195) tmp = Float64(2.0 * Float64(Float64(sin(t_0) * Float64(a + b)) * Float64(b - a))); else tmp = Float64(sin(Float64(2.0 * t_0)) * Float64(Float64(b - a) * Float64(a + b))); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) t_0 = (angle_m * pi) * 0.005555555555555556; tmp = 0.0; if (angle_m <= 3.9e+195) tmp = 2.0 * ((sin(t_0) * (a + b)) * (b - a)); else tmp = sin((2.0 * t_0)) * ((b - a) * (a + b)); end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 3.9e+195], N[(2.0 * N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 3.9 \cdot 10^{+195}:\\
\;\;\;\;2 \cdot \left(\left(\sin t\_0 \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(2 \cdot t\_0\right) \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 3.8999999999999998e195Initial program 60.3%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites63.4%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites75.3%
Taylor expanded in angle around 0
Applied rewrites74.1%
if 3.8999999999999998e195 < angle Initial program 30.3%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites31.9%
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
Applied rewrites31.9%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (- (pow b 2.0) (pow a 2.0))))
(t_1
(*
2.0
(*
(sin (* (* PI angle_m) 0.005555555555555556))
(* (+ b a) (- b a))))))
(*
angle_s
(if (<= t_0 (- INFINITY))
(* (* -0.011111111111111112 a) (* (* angle_m PI) a))
(if (<= t_0 5e+254)
t_1
(if (<= t_0 INFINITY)
(fma
(* -0.011111111111111112 (* a a))
(* angle_m PI)
(*
(*
0.011111111111111112
(fma (* PI b) angle_m (* (* (* 0.0 a) PI) angle_m)))
b))
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 = 2.0 * (pow(b, 2.0) - pow(a, 2.0));
double t_1 = 2.0 * (sin(((((double) M_PI) * angle_m) * 0.005555555555555556)) * ((b + a) * (b - a)));
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (-0.011111111111111112 * a) * ((angle_m * ((double) M_PI)) * a);
} else if (t_0 <= 5e+254) {
tmp = t_1;
} else if (t_0 <= ((double) INFINITY)) {
tmp = fma((-0.011111111111111112 * (a * a)), (angle_m * ((double) M_PI)), ((0.011111111111111112 * fma((((double) M_PI) * b), angle_m, (((0.0 * a) * ((double) M_PI)) * angle_m))) * b));
} else {
tmp = 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(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) t_1 = Float64(2.0 * Float64(sin(Float64(Float64(pi * angle_m) * 0.005555555555555556)) * Float64(Float64(b + a) * Float64(b - a)))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(-0.011111111111111112 * a) * Float64(Float64(angle_m * pi) * a)); elseif (t_0 <= 5e+254) tmp = t_1; elseif (t_0 <= Inf) tmp = fma(Float64(-0.011111111111111112 * Float64(a * a)), Float64(angle_m * pi), Float64(Float64(0.011111111111111112 * fma(Float64(pi * b), angle_m, Float64(Float64(Float64(0.0 * a) * pi) * angle_m))) * b)); else tmp = t_1; end return Float64(angle_s * tmp) end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, (-Infinity)], N[(N[(-0.011111111111111112 * a), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+254], t$95$1, If[LessEqual[t$95$0, Infinity], N[(N[(-0.011111111111111112 * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision] + N[(N[(0.011111111111111112 * N[(N[(Pi * b), $MachinePrecision] * angle$95$m + N[(N[(N[(0.0 * a), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]), $MachinePrecision]]]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left({b}^{2} - {a}^{2}\right)\\
t_1 := 2 \cdot \left(\sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-0.011111111111111112 \cdot \left(a \cdot a\right), angle\_m \cdot \pi, \left(0.011111111111111112 \cdot \mathsf{fma}\left(\pi \cdot b, angle\_m, \left(\left(0 \cdot a\right) \cdot \pi\right) \cdot angle\_m\right)\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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)))) < -inf.0Initial program 51.8%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6450.0
Applied rewrites50.0%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6450.2
Applied rewrites50.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.7
Applied rewrites50.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6476.2
Applied rewrites76.2%
if -inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 4.99999999999999994e254 or +inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 56.1%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites61.7%
Taylor expanded in angle around 0
Applied rewrites60.3%
if 4.99999999999999994e254 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < +inf.0Initial program 54.3%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.9
Applied rewrites52.9%
Taylor expanded in b around 0
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.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 (* 2.0 (* (* (sin (* (* angle_m PI) 0.005555555555555556)) (+ a b)) (- b a)))))
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 * (2.0 * ((sin(((angle_m * ((double) M_PI)) * 0.005555555555555556)) * (a + b)) * (b - a)));
}
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 * (2.0 * ((Math.sin(((angle_m * Math.PI) * 0.005555555555555556)) * (a + b)) * (b - a)));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * (2.0 * ((math.sin(((angle_m * math.pi) * 0.005555555555555556)) * (a + b)) * (b - a)))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(2.0 * Float64(Float64(sin(Float64(Float64(angle_m * pi) * 0.005555555555555556)) * Float64(a + b)) * Float64(b - a)))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * (2.0 * ((sin(((angle_m * pi) * 0.005555555555555556)) * (a + b)) * (b - a))); 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[(2.0 * N[(N[(N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(2 \cdot \left(\left(\sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot \left(a + b\right)\right) \cdot \left(b - a\right)\right)\right)
\end{array}
Initial program 54.9%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites57.8%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.6%
Taylor expanded in angle around 0
Applied rewrites66.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 (<= a 5.8e+153)
(fma
(* -0.011111111111111112 (* a a))
(* angle_m PI)
(*
(*
0.011111111111111112
(fma (* PI b) angle_m (* (* (* 0.0 a) PI) angle_m)))
b))
(if (<= a 9.5e+263)
(* (* -0.011111111111111112 a) (* (* angle_m PI) a))
(*
(* (* a a) angle_m)
(fma
-0.011111111111111112
PI
(*
(* 2.2862368541380886e-7 (* angle_m angle_m))
(* (* PI PI) 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 (a <= 5.8e+153) {
tmp = fma((-0.011111111111111112 * (a * a)), (angle_m * ((double) M_PI)), ((0.011111111111111112 * fma((((double) M_PI) * b), angle_m, (((0.0 * a) * ((double) M_PI)) * angle_m))) * b));
} else if (a <= 9.5e+263) {
tmp = (-0.011111111111111112 * a) * ((angle_m * ((double) M_PI)) * a);
} else {
tmp = ((a * a) * angle_m) * fma(-0.011111111111111112, ((double) M_PI), ((2.2862368541380886e-7 * (angle_m * angle_m)) * ((((double) M_PI) * ((double) M_PI)) * ((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 (a <= 5.8e+153) tmp = fma(Float64(-0.011111111111111112 * Float64(a * a)), Float64(angle_m * pi), Float64(Float64(0.011111111111111112 * fma(Float64(pi * b), angle_m, Float64(Float64(Float64(0.0 * a) * pi) * angle_m))) * b)); elseif (a <= 9.5e+263) tmp = Float64(Float64(-0.011111111111111112 * a) * Float64(Float64(angle_m * pi) * a)); else tmp = Float64(Float64(Float64(a * a) * angle_m) * fma(-0.011111111111111112, pi, Float64(Float64(2.2862368541380886e-7 * Float64(angle_m * angle_m)) * Float64(Float64(pi * pi) * 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[a, 5.8e+153], N[(N[(-0.011111111111111112 * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision] + N[(N[(0.011111111111111112 * N[(N[(Pi * b), $MachinePrecision] * angle$95$m + N[(N[(N[(0.0 * a), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e+263], N[(N[(-0.011111111111111112 * a), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * a), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(-0.011111111111111112 * Pi + N[(N[(2.2862368541380886e-7 * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 5.8 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(-0.011111111111111112 \cdot \left(a \cdot a\right), angle\_m \cdot \pi, \left(0.011111111111111112 \cdot \mathsf{fma}\left(\pi \cdot b, angle\_m, \left(\left(0 \cdot a\right) \cdot \pi\right) \cdot angle\_m\right)\right) \cdot b\right)\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{+263}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a \cdot a\right) \cdot angle\_m\right) \cdot \mathsf{fma}\left(-0.011111111111111112, \pi, \left(2.2862368541380886 \cdot 10^{-7} \cdot \left(angle\_m \cdot angle\_m\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\right)\\
\end{array}
\end{array}
if a < 5.80000000000000004e153Initial program 57.0%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6455.3
Applied rewrites55.3%
Taylor expanded in b around 0
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.1%
if 5.80000000000000004e153 < a < 9.5000000000000004e263Initial program 32.7%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6445.9
Applied rewrites45.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6441.5
Applied rewrites41.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6442.0
Applied rewrites42.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6468.9
Applied rewrites68.9%
if 9.5000000000000004e263 < a Initial program 59.3%
Taylor expanded in angle around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites74.2%
Taylor expanded in angle around 0
Applied rewrites0.0%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-fma.f64N/A
lift-PI.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow3N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
Applied rewrites66.3%
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) -2e-244)
(* (* -0.011111111111111112 a) (* (* angle_m PI) a))
(* (* (* PI (* b b)) angle_m) 0.011111111111111112))))angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) <= -2e-244) {
tmp = (-0.011111111111111112 * a) * ((angle_m * ((double) M_PI)) * a);
} else {
tmp = ((((double) M_PI) * (b * b)) * angle_m) * 0.011111111111111112;
}
return angle_s * tmp;
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) <= -2e-244) {
tmp = (-0.011111111111111112 * a) * ((angle_m * Math.PI) * a);
} else {
tmp = ((Math.PI * (b * b)) * angle_m) * 0.011111111111111112;
}
return angle_s * tmp;
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) <= -2e-244: tmp = (-0.011111111111111112 * a) * ((angle_m * math.pi) * a) else: tmp = ((math.pi * (b * b)) * angle_m) * 0.011111111111111112 return angle_s * tmp
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) <= -2e-244) tmp = Float64(Float64(-0.011111111111111112 * a) * Float64(Float64(angle_m * pi) * a)); else tmp = Float64(Float64(Float64(pi * Float64(b * b)) * angle_m) * 0.011111111111111112); end return Float64(angle_s * tmp) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b, angle_m) tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) <= -2e-244) tmp = (-0.011111111111111112 * a) * ((angle_m * pi) * a); else tmp = ((pi * (b * b)) * angle_m) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-244], N[(N[(-0.011111111111111112 * a), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision] * 0.011111111111111112), $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 -2 \cdot 10^{-244}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot \left(b \cdot b\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -1.9999999999999999e-244Initial program 54.3%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6450.6
Applied rewrites50.6%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6450.5
Applied rewrites50.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.7
Applied rewrites50.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6462.0
Applied rewrites62.0%
if -1.9999999999999999e-244 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 55.4%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6458.2
Applied rewrites58.2%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
lower-*.f6456.5
Applied rewrites56.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 (* (* -0.011111111111111112 a) (* (* angle_m PI) a))))
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((-0.011111111111111112 * a) * ((angle_m * ((double) M_PI)) * a));
}
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b, double angle_m) {
return angle_s * ((-0.011111111111111112 * a) * ((angle_m * Math.PI) * a));
}
angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b, angle_m): return angle_s * ((-0.011111111111111112 * a) * ((angle_m * math.pi) * a))
angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b, angle_m) return Float64(angle_s * Float64(Float64(-0.011111111111111112 * a) * Float64(Float64(angle_m * pi) * a))) end
angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b, angle_m) tmp = angle_s * ((-0.011111111111111112 * a) * ((angle_m * pi) * a)); 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[(-0.011111111111111112 * a), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(-0.011111111111111112 \cdot a\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\right)\right)
\end{array}
Initial program 54.9%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6455.0
Applied rewrites55.0%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6434.9
Applied rewrites34.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6435.0
Applied rewrites35.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6438.5
Applied rewrites38.5%
herbie shell --seed 2025110
(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)))))