
(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}
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}
Herbie found 16 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}
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}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 (fabs angle)) PI))
(t_1 (* (sin t_0) (+ (fabs a) b)))
(t_2 (- b (fabs a)))
(t_3 (* PI (fabs angle)))
(t_4 (* t_1 t_2)))
(*
(copysign 1.0 angle)
(if (<= (fabs a) 2.5e+25)
(* (* (* t_2 (sin (fma t_3 0.005555555555555556 (* 0.5 PI)))) 2.0) t_1)
(if (<= (fabs a) 2.02e+192)
(*
t_4
(*
(-
(sin
(-
(* -0.5 PI)
(* (fabs (fabs angle)) (* PI -0.005555555555555556)))))
2.0))
(*
t_4
(*
2.0
(*
(cos (/ (fma -0.005555555555555556 (* (fabs angle) PI) t_0) 2.0))
(sin (/ (fma t_3 -0.011111111111111112 PI) 2.0))))))))))double code(double a, double b, double angle) {
double t_0 = (0.005555555555555556 * fabs(angle)) * ((double) M_PI);
double t_1 = sin(t_0) * (fabs(a) + b);
double t_2 = b - fabs(a);
double t_3 = ((double) M_PI) * fabs(angle);
double t_4 = t_1 * t_2;
double tmp;
if (fabs(a) <= 2.5e+25) {
tmp = ((t_2 * sin(fma(t_3, 0.005555555555555556, (0.5 * ((double) M_PI))))) * 2.0) * t_1;
} else if (fabs(a) <= 2.02e+192) {
tmp = t_4 * (-sin(((-0.5 * ((double) M_PI)) - (fabs(fabs(angle)) * (((double) M_PI) * -0.005555555555555556)))) * 2.0);
} else {
tmp = t_4 * (2.0 * (cos((fma(-0.005555555555555556, (fabs(angle) * ((double) M_PI)), t_0) / 2.0)) * sin((fma(t_3, -0.011111111111111112, ((double) M_PI)) / 2.0))));
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) t_0 = Float64(Float64(0.005555555555555556 * abs(angle)) * pi) t_1 = Float64(sin(t_0) * Float64(abs(a) + b)) t_2 = Float64(b - abs(a)) t_3 = Float64(pi * abs(angle)) t_4 = Float64(t_1 * t_2) tmp = 0.0 if (abs(a) <= 2.5e+25) tmp = Float64(Float64(Float64(t_2 * sin(fma(t_3, 0.005555555555555556, Float64(0.5 * pi)))) * 2.0) * t_1); elseif (abs(a) <= 2.02e+192) tmp = Float64(t_4 * Float64(Float64(-sin(Float64(Float64(-0.5 * pi) - Float64(abs(abs(angle)) * Float64(pi * -0.005555555555555556))))) * 2.0)); else tmp = Float64(t_4 * Float64(2.0 * Float64(cos(Float64(fma(-0.005555555555555556, Float64(abs(angle) * pi), t_0) / 2.0)) * sin(Float64(fma(t_3, -0.011111111111111112, pi) / 2.0))))); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * N[Abs[angle], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[Abs[a], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b - N[Abs[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[Abs[angle], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * t$95$2), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[a], $MachinePrecision], 2.5e+25], N[(N[(N[(t$95$2 * N[Sin[N[(t$95$3 * 0.005555555555555556 + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[N[Abs[a], $MachinePrecision], 2.02e+192], N[(t$95$4 * N[((-N[Sin[N[(N[(-0.5 * Pi), $MachinePrecision] - N[(N[Abs[N[Abs[angle], $MachinePrecision]], $MachinePrecision] * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[(2.0 * N[(N[Cos[N[(N[(-0.005555555555555556 * N[(N[Abs[angle], $MachinePrecision] * Pi), $MachinePrecision] + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$3 * -0.011111111111111112 + Pi), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot \left|angle\right|\right) \cdot \pi\\
t_1 := \sin t\_0 \cdot \left(\left|a\right| + b\right)\\
t_2 := b - \left|a\right|\\
t_3 := \pi \cdot \left|angle\right|\\
t_4 := t\_1 \cdot t\_2\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|a\right| \leq 2.5 \cdot 10^{+25}:\\
\;\;\;\;\left(\left(t\_2 \cdot \sin \left(\mathsf{fma}\left(t\_3, 0.005555555555555556, 0.5 \cdot \pi\right)\right)\right) \cdot 2\right) \cdot t\_1\\
\mathbf{elif}\;\left|a\right| \leq 2.02 \cdot 10^{+192}:\\
\;\;\;\;t\_4 \cdot \left(\left(-\sin \left(-0.5 \cdot \pi - \left|\left|angle\right|\right| \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4 \cdot \left(2 \cdot \left(\cos \left(\frac{\mathsf{fma}\left(-0.005555555555555556, \left|angle\right| \cdot \pi, t\_0\right)}{2}\right) \cdot \sin \left(\frac{\mathsf{fma}\left(t\_3, -0.011111111111111112, \pi\right)}{2}\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.50000000000000012e25Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.1%
lift-cos.f64N/A
lift-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
Applied rewrites67.3%
if 2.50000000000000012e25 < a < 2.02e192Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
Applied rewrites67.2%
if 2.02e192 < a Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
Applied rewrites67.6%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites67.4%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (* 0.005555555555555556 (fabs angle)) PI))
(t_1 (- (fabs b) (fabs a)))
(t_2 (+ (fabs a) (fabs b))))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 7e+129)
(*
(* (* t_1 (cos (* -0.005555555555555556 (* (fabs angle) PI)))) 2.0)
(* (sin (* (/ 1.0 (/ 180.0 (fabs angle))) PI)) t_2))
(if (<= (fabs angle) 2.2e+287)
(* (* (* (sin t_0) t_2) t_1) (* (sin (fma 0.5 PI t_0)) 2.0))
(*
t_1
(*
(*
(fabs angle)
(fma
-2.2862368541380886e-7
(* (pow (fabs angle) 2.0) (pow PI 3.0))
(* 0.011111111111111112 PI)))
(fabs b))))))))double code(double a, double b, double angle) {
double t_0 = (0.005555555555555556 * fabs(angle)) * ((double) M_PI);
double t_1 = fabs(b) - fabs(a);
double t_2 = fabs(a) + fabs(b);
double tmp;
if (fabs(angle) <= 7e+129) {
tmp = ((t_1 * cos((-0.005555555555555556 * (fabs(angle) * ((double) M_PI))))) * 2.0) * (sin(((1.0 / (180.0 / fabs(angle))) * ((double) M_PI))) * t_2);
} else if (fabs(angle) <= 2.2e+287) {
tmp = ((sin(t_0) * t_2) * t_1) * (sin(fma(0.5, ((double) M_PI), t_0)) * 2.0);
} else {
tmp = t_1 * ((fabs(angle) * fma(-2.2862368541380886e-7, (pow(fabs(angle), 2.0) * pow(((double) M_PI), 3.0)), (0.011111111111111112 * ((double) M_PI)))) * fabs(b));
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) t_0 = Float64(Float64(0.005555555555555556 * abs(angle)) * pi) t_1 = Float64(abs(b) - abs(a)) t_2 = Float64(abs(a) + abs(b)) tmp = 0.0 if (abs(angle) <= 7e+129) tmp = Float64(Float64(Float64(t_1 * cos(Float64(-0.005555555555555556 * Float64(abs(angle) * pi)))) * 2.0) * Float64(sin(Float64(Float64(1.0 / Float64(180.0 / abs(angle))) * pi)) * t_2)); elseif (abs(angle) <= 2.2e+287) tmp = Float64(Float64(Float64(sin(t_0) * t_2) * t_1) * Float64(sin(fma(0.5, pi, t_0)) * 2.0)); else tmp = Float64(t_1 * Float64(Float64(abs(angle) * fma(-2.2862368541380886e-7, Float64((abs(angle) ^ 2.0) * (pi ^ 3.0)), Float64(0.011111111111111112 * pi))) * abs(b))); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * N[Abs[angle], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 7e+129], N[(N[(N[(t$95$1 * N[Cos[N[(-0.005555555555555556 * N[(N[Abs[angle], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[Sin[N[(N[(1.0 / N[(180.0 / N[Abs[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[angle], $MachinePrecision], 2.2e+287], N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[Sin[N[(0.5 * Pi + t$95$0), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(N[Abs[angle], $MachinePrecision] * N[(-2.2862368541380886e-7 * N[(N[Power[N[Abs[angle], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left(0.005555555555555556 \cdot \left|angle\right|\right) \cdot \pi\\
t_1 := \left|b\right| - \left|a\right|\\
t_2 := \left|a\right| + \left|b\right|\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 7 \cdot 10^{+129}:\\
\;\;\;\;\left(\left(t\_1 \cdot \cos \left(-0.005555555555555556 \cdot \left(\left|angle\right| \cdot \pi\right)\right)\right) \cdot 2\right) \cdot \left(\sin \left(\frac{1}{\frac{180}{\left|angle\right|}} \cdot \pi\right) \cdot t\_2\right)\\
\mathbf{elif}\;\left|angle\right| \leq 2.2 \cdot 10^{+287}:\\
\;\;\;\;\left(\left(\sin t\_0 \cdot t\_2\right) \cdot t\_1\right) \cdot \left(\sin \left(\mathsf{fma}\left(0.5, \pi, t\_0\right)\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\left(\left|angle\right| \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, {\left(\left|angle\right|\right)}^{2} \cdot {\pi}^{3}, 0.011111111111111112 \cdot \pi\right)\right) \cdot \left|b\right|\right)\\
\end{array}
\end{array}
if angle < 6.9999999999999997e129Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.1%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flip-revN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6467.5
Applied rewrites67.5%
if 6.9999999999999997e129 < angle < 2.20000000000000003e287Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
lift-cos.f64N/A
sin-+PI/2-revN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-sin.f64N/A
lift-PI.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6466.9
lift-*.f64N/A
*-commutativeN/A
Applied rewrites67.2%
if 2.20000000000000003e287 < angle Initial program 54.4%
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 rewrites68.0%
Taylor expanded in a around 0
Applied rewrites42.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6442.4
Applied rewrites42.4%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f6440.2
Applied rewrites40.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (sin (* (* 0.005555555555555556 (fabs angle)) PI)) (+ a b))))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 9.6e+144)
(*
(* t_0 (- b a))
(*
(-
(sin
(-
(* -0.5 PI)
(* (fabs (fabs angle)) (* PI -0.005555555555555556)))))
2.0))
(*
(*
(*
(- b a)
(sin (fma (* PI (fabs angle)) 0.005555555555555556 (* 0.5 PI))))
2.0)
t_0)))))double code(double a, double b, double angle) {
double t_0 = sin(((0.005555555555555556 * fabs(angle)) * ((double) M_PI))) * (a + b);
double tmp;
if (fabs(angle) <= 9.6e+144) {
tmp = (t_0 * (b - a)) * (-sin(((-0.5 * ((double) M_PI)) - (fabs(fabs(angle)) * (((double) M_PI) * -0.005555555555555556)))) * 2.0);
} else {
tmp = (((b - a) * sin(fma((((double) M_PI) * fabs(angle)), 0.005555555555555556, (0.5 * ((double) M_PI))))) * 2.0) * t_0;
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) t_0 = Float64(sin(Float64(Float64(0.005555555555555556 * abs(angle)) * pi)) * Float64(a + b)) tmp = 0.0 if (abs(angle) <= 9.6e+144) tmp = Float64(Float64(t_0 * Float64(b - a)) * Float64(Float64(-sin(Float64(Float64(-0.5 * pi) - Float64(abs(abs(angle)) * Float64(pi * -0.005555555555555556))))) * 2.0)); else tmp = Float64(Float64(Float64(Float64(b - a) * sin(fma(Float64(pi * abs(angle)), 0.005555555555555556, Float64(0.5 * pi)))) * 2.0) * t_0); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Sin[N[(N[(0.005555555555555556 * N[Abs[angle], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 9.6e+144], N[(N[(t$95$0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[((-N[Sin[N[(N[(-0.5 * Pi), $MachinePrecision] - N[(N[Abs[N[Abs[angle], $MachinePrecision]], $MachinePrecision] * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(Pi * N[Abs[angle], $MachinePrecision]), $MachinePrecision] * 0.005555555555555556 + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t$95$0), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \sin \left(\left(0.005555555555555556 \cdot \left|angle\right|\right) \cdot \pi\right) \cdot \left(a + b\right)\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 9.6 \cdot 10^{+144}:\\
\;\;\;\;\left(t\_0 \cdot \left(b - a\right)\right) \cdot \left(\left(-\sin \left(-0.5 \cdot \pi - \left|\left|angle\right|\right| \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b - a\right) \cdot \sin \left(\mathsf{fma}\left(\pi \cdot \left|angle\right|, 0.005555555555555556, 0.5 \cdot \pi\right)\right)\right) \cdot 2\right) \cdot t\_0\\
\end{array}
\end{array}
if angle < 9.6000000000000002e144Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
Applied rewrites67.2%
if 9.6000000000000002e144 < angle Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.1%
lift-cos.f64N/A
lift-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
Applied rewrites67.3%
(FPCore (a b angle)
:precision binary64
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 7e+129)
(*
(* (* (- b a) (cos (* -0.005555555555555556 (* (fabs angle) PI)))) 2.0)
(* (sin (* (/ 1.0 (/ 180.0 (fabs angle))) PI)) (+ a b)))
(*
(*
(*
(- b a)
(sin (fma (* PI (fabs angle)) 0.005555555555555556 (* 0.5 PI))))
2.0)
(* (sin (* (* 0.005555555555555556 (fabs angle)) PI)) (+ a b))))))double code(double a, double b, double angle) {
double tmp;
if (fabs(angle) <= 7e+129) {
tmp = (((b - a) * cos((-0.005555555555555556 * (fabs(angle) * ((double) M_PI))))) * 2.0) * (sin(((1.0 / (180.0 / fabs(angle))) * ((double) M_PI))) * (a + b));
} else {
tmp = (((b - a) * sin(fma((((double) M_PI) * fabs(angle)), 0.005555555555555556, (0.5 * ((double) M_PI))))) * 2.0) * (sin(((0.005555555555555556 * fabs(angle)) * ((double) M_PI))) * (a + b));
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) tmp = 0.0 if (abs(angle) <= 7e+129) tmp = Float64(Float64(Float64(Float64(b - a) * cos(Float64(-0.005555555555555556 * Float64(abs(angle) * pi)))) * 2.0) * Float64(sin(Float64(Float64(1.0 / Float64(180.0 / abs(angle))) * pi)) * Float64(a + b))); else tmp = Float64(Float64(Float64(Float64(b - a) * sin(fma(Float64(pi * abs(angle)), 0.005555555555555556, Float64(0.5 * pi)))) * 2.0) * Float64(sin(Float64(Float64(0.005555555555555556 * abs(angle)) * pi)) * Float64(a + b))); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 7e+129], N[(N[(N[(N[(b - a), $MachinePrecision] * N[Cos[N[(-0.005555555555555556 * N[(N[Abs[angle], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[Sin[N[(N[(1.0 / N[(180.0 / N[Abs[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(Pi * N[Abs[angle], $MachinePrecision]), $MachinePrecision] * 0.005555555555555556 + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * N[Abs[angle], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 7 \cdot 10^{+129}:\\
\;\;\;\;\left(\left(\left(b - a\right) \cdot \cos \left(-0.005555555555555556 \cdot \left(\left|angle\right| \cdot \pi\right)\right)\right) \cdot 2\right) \cdot \left(\sin \left(\frac{1}{\frac{180}{\left|angle\right|}} \cdot \pi\right) \cdot \left(a + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b - a\right) \cdot \sin \left(\mathsf{fma}\left(\pi \cdot \left|angle\right|, 0.005555555555555556, 0.5 \cdot \pi\right)\right)\right) \cdot 2\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot \left|angle\right|\right) \cdot \pi\right) \cdot \left(a + b\right)\right)\\
\end{array}
if angle < 6.9999999999999997e129Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.1%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flip-revN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6467.5
Applied rewrites67.5%
if 6.9999999999999997e129 < angle Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.1%
lift-cos.f64N/A
lift-*.f64N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
metadata-evalN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
Applied rewrites67.3%
(FPCore (a b angle)
:precision binary64
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 9.2e+142)
(*
(*
(* (- b (fabs a)) (cos (* -0.005555555555555556 (* (fabs angle) PI))))
2.0)
(* (sin (* (/ (fabs angle) 180.0) PI)) (+ (fabs a) b)))
(*
0.011111111111111112
(* (* (fabs angle) (fma b b (* (- (fabs a)) (fabs a)))) PI)))))double code(double a, double b, double angle) {
double tmp;
if (fabs(angle) <= 9.2e+142) {
tmp = (((b - fabs(a)) * cos((-0.005555555555555556 * (fabs(angle) * ((double) M_PI))))) * 2.0) * (sin(((fabs(angle) / 180.0) * ((double) M_PI))) * (fabs(a) + b));
} else {
tmp = 0.011111111111111112 * ((fabs(angle) * fma(b, b, (-fabs(a) * fabs(a)))) * ((double) M_PI));
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) tmp = 0.0 if (abs(angle) <= 9.2e+142) tmp = Float64(Float64(Float64(Float64(b - abs(a)) * cos(Float64(-0.005555555555555556 * Float64(abs(angle) * pi)))) * 2.0) * Float64(sin(Float64(Float64(abs(angle) / 180.0) * pi)) * Float64(abs(a) + b))); else tmp = Float64(0.011111111111111112 * Float64(Float64(abs(angle) * fma(b, b, Float64(Float64(-abs(a)) * abs(a)))) * pi)); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 9.2e+142], N[(N[(N[(N[(b - N[Abs[a], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(-0.005555555555555556 * N[(N[Abs[angle], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[Sin[N[(N[(N[Abs[angle], $MachinePrecision] / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[Abs[a], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[Abs[angle], $MachinePrecision] * N[(b * b + N[((-N[Abs[a], $MachinePrecision]) * N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 9.2 \cdot 10^{+142}:\\
\;\;\;\;\left(\left(\left(b - \left|a\right|\right) \cdot \cos \left(-0.005555555555555556 \cdot \left(\left|angle\right| \cdot \pi\right)\right)\right) \cdot 2\right) \cdot \left(\sin \left(\frac{\left|angle\right|}{180} \cdot \pi\right) \cdot \left(\left|a\right| + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left|angle\right| \cdot \mathsf{fma}\left(b, b, \left(-\left|a\right|\right) \cdot \left|a\right|\right)\right) \cdot \pi\right)\\
\end{array}
if angle < 9.20000000000000009e142Initial program 54.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.1%
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
mult-flip-revN/A
lower-/.f6467.9
Applied rewrites67.9%
if 9.20000000000000009e142 < angle Initial program 54.4%
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.1
Applied rewrites51.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6455.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6455.3
Applied rewrites55.3%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squares-revN/A
unpow2N/A
lift-pow.f64N/A
fp-cancel-sub-sign-invN/A
lift-pow.f64N/A
unpow2N/A
lift-neg.f64N/A
lift-*.f64N/A
lower-fma.f6453.9
Applied rewrites53.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) (fabs a))) (t_1 (+ (fabs a) (fabs b))))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 5e-11)
(* t_1 (* 0.011111111111111112 (* (fabs angle) (* PI t_0))))
(if (<= (fabs angle) 9.6e+144)
(* (* t_0 t_1) (sin (* (* (fabs angle) PI) 0.011111111111111112)))
(*
0.011111111111111112
(*
(* (fabs angle) (fma (fabs b) (fabs b) (* (- (fabs a)) (fabs a))))
PI)))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - fabs(a);
double t_1 = fabs(a) + fabs(b);
double tmp;
if (fabs(angle) <= 5e-11) {
tmp = t_1 * (0.011111111111111112 * (fabs(angle) * (((double) M_PI) * t_0)));
} else if (fabs(angle) <= 9.6e+144) {
tmp = (t_0 * t_1) * sin(((fabs(angle) * ((double) M_PI)) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * ((fabs(angle) * fma(fabs(b), fabs(b), (-fabs(a) * fabs(a)))) * ((double) M_PI));
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) t_0 = Float64(abs(b) - abs(a)) t_1 = Float64(abs(a) + abs(b)) tmp = 0.0 if (abs(angle) <= 5e-11) tmp = Float64(t_1 * Float64(0.011111111111111112 * Float64(abs(angle) * Float64(pi * t_0)))); elseif (abs(angle) <= 9.6e+144) tmp = Float64(Float64(t_0 * t_1) * sin(Float64(Float64(abs(angle) * pi) * 0.011111111111111112))); else tmp = Float64(0.011111111111111112 * Float64(Float64(abs(angle) * fma(abs(b), abs(b), Float64(Float64(-abs(a)) * abs(a)))) * pi)); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 5e-11], N[(t$95$1 * N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[angle], $MachinePrecision], 9.6e+144], N[(N[(t$95$0 * t$95$1), $MachinePrecision] * N[Sin[N[(N[(N[Abs[angle], $MachinePrecision] * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[Abs[angle], $MachinePrecision] * N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision] + N[((-N[Abs[a], $MachinePrecision]) * N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - \left|a\right|\\
t_1 := \left|a\right| + \left|b\right|\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 5 \cdot 10^{-11}:\\
\;\;\;\;t\_1 \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot t\_0\right)\right)\right)\\
\mathbf{elif}\;\left|angle\right| \leq 9.6 \cdot 10^{+144}:\\
\;\;\;\;\left(t\_0 \cdot t\_1\right) \cdot \sin \left(\left(\left|angle\right| \cdot \pi\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left|angle\right| \cdot \mathsf{fma}\left(\left|b\right|, \left|b\right|, \left(-\left|a\right|\right) \cdot \left|a\right|\right)\right) \cdot \pi\right)\\
\end{array}
\end{array}
if angle < 5.00000000000000018e-11Initial program 54.4%
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 rewrites68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6462.8
Applied rewrites62.8%
if 5.00000000000000018e-11 < angle < 9.6000000000000002e144Initial program 54.4%
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.6%
if 9.6000000000000002e144 < angle Initial program 54.4%
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.1
Applied rewrites51.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6455.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6455.3
Applied rewrites55.3%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squares-revN/A
unpow2N/A
lift-pow.f64N/A
fp-cancel-sub-sign-invN/A
lift-pow.f64N/A
unpow2N/A
lift-neg.f64N/A
lift-*.f64N/A
lower-fma.f6453.9
Applied rewrites53.9%
(FPCore (a b angle)
:precision binary64
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 9.6e+144)
(* (- b a) (* (sin (* 0.011111111111111112 (* PI (fabs angle)))) (+ b a)))
(* 0.011111111111111112 (* (* (fabs angle) (fma b b (* (- a) a))) PI)))))double code(double a, double b, double angle) {
double tmp;
if (fabs(angle) <= 9.6e+144) {
tmp = (b - a) * (sin((0.011111111111111112 * (((double) M_PI) * fabs(angle)))) * (b + a));
} else {
tmp = 0.011111111111111112 * ((fabs(angle) * fma(b, b, (-a * a))) * ((double) M_PI));
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) tmp = 0.0 if (abs(angle) <= 9.6e+144) tmp = Float64(Float64(b - a) * Float64(sin(Float64(0.011111111111111112 * Float64(pi * abs(angle)))) * Float64(b + a))); else tmp = Float64(0.011111111111111112 * Float64(Float64(abs(angle) * fma(b, b, Float64(Float64(-a) * a))) * pi)); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 9.6e+144], N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(0.011111111111111112 * N[(Pi * N[Abs[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[Abs[angle], $MachinePrecision] * N[(b * b + N[((-a) * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 9.6 \cdot 10^{+144}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(\pi \cdot \left|angle\right|\right)\right) \cdot \left(b + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left|angle\right| \cdot \mathsf{fma}\left(b, b, \left(-a\right) \cdot a\right)\right) \cdot \pi\right)\\
\end{array}
if angle < 9.6000000000000002e144Initial program 54.4%
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 rewrites68.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6468.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6468.0
Applied rewrites68.0%
if 9.6000000000000002e144 < angle Initial program 54.4%
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.1
Applied rewrites51.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6455.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6455.3
Applied rewrites55.3%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squares-revN/A
unpow2N/A
lift-pow.f64N/A
fp-cancel-sub-sign-invN/A
lift-pow.f64N/A
unpow2N/A
lift-neg.f64N/A
lift-*.f64N/A
lower-fma.f6453.9
Applied rewrites53.9%
(FPCore (a b angle)
:precision binary64
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 3.1e+25)
(*
(+ (fabs a) (fabs b))
(* 0.011111111111111112 (* (fabs angle) (* PI (- (fabs b) (fabs a))))))
(if (<= (fabs angle) 1.4e+50)
(*
(fabs b)
(* (fabs b) (sin (* (* (fabs angle) PI) 0.011111111111111112))))
(*
0.011111111111111112
(*
(* (fabs angle) (fma (fabs b) (fabs b) (* (- (fabs a)) (fabs a))))
PI))))))double code(double a, double b, double angle) {
double tmp;
if (fabs(angle) <= 3.1e+25) {
tmp = (fabs(a) + fabs(b)) * (0.011111111111111112 * (fabs(angle) * (((double) M_PI) * (fabs(b) - fabs(a)))));
} else if (fabs(angle) <= 1.4e+50) {
tmp = fabs(b) * (fabs(b) * sin(((fabs(angle) * ((double) M_PI)) * 0.011111111111111112)));
} else {
tmp = 0.011111111111111112 * ((fabs(angle) * fma(fabs(b), fabs(b), (-fabs(a) * fabs(a)))) * ((double) M_PI));
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) tmp = 0.0 if (abs(angle) <= 3.1e+25) tmp = Float64(Float64(abs(a) + abs(b)) * Float64(0.011111111111111112 * Float64(abs(angle) * Float64(pi * Float64(abs(b) - abs(a)))))); elseif (abs(angle) <= 1.4e+50) tmp = Float64(abs(b) * Float64(abs(b) * sin(Float64(Float64(abs(angle) * pi) * 0.011111111111111112)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(abs(angle) * fma(abs(b), abs(b), Float64(Float64(-abs(a)) * abs(a)))) * pi)); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 3.1e+25], N[(N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[(Pi * N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[angle], $MachinePrecision], 1.4e+50], N[(N[Abs[b], $MachinePrecision] * N[(N[Abs[b], $MachinePrecision] * N[Sin[N[(N[(N[Abs[angle], $MachinePrecision] * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[Abs[angle], $MachinePrecision] * N[(N[Abs[b], $MachinePrecision] * N[Abs[b], $MachinePrecision] + N[((-N[Abs[a], $MachinePrecision]) * N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 3.1 \cdot 10^{+25}:\\
\;\;\;\;\left(\left|a\right| + \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot \left(\left|b\right| - \left|a\right|\right)\right)\right)\right)\\
\mathbf{elif}\;\left|angle\right| \leq 1.4 \cdot 10^{+50}:\\
\;\;\;\;\left|b\right| \cdot \left(\left|b\right| \cdot \sin \left(\left(\left|angle\right| \cdot \pi\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left|angle\right| \cdot \mathsf{fma}\left(\left|b\right|, \left|b\right|, \left(-\left|a\right|\right) \cdot \left|a\right|\right)\right) \cdot \pi\right)\\
\end{array}
if angle < 3.0999999999999998e25Initial program 54.4%
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 rewrites68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6462.8
Applied rewrites62.8%
if 3.0999999999999998e25 < angle < 1.3999999999999999e50Initial program 54.4%
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 rewrites68.0%
Taylor expanded in a around 0
Applied rewrites42.4%
Taylor expanded in a around 0
Applied rewrites40.9%
if 1.3999999999999999e50 < angle Initial program 54.4%
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.1
Applied rewrites51.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6455.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6455.3
Applied rewrites55.3%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squares-revN/A
unpow2N/A
lift-pow.f64N/A
fp-cancel-sub-sign-invN/A
lift-pow.f64N/A
unpow2N/A
lift-neg.f64N/A
lift-*.f64N/A
lower-fma.f6453.9
Applied rewrites53.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) (fabs a))))
(if (<= (* 2.0 (- (pow (fabs b) 2.0) (pow (fabs a) 2.0))) 5e-229)
(* t_0 (* (fabs a) (sin (* 0.011111111111111112 (* angle PI)))))
(* (+ (fabs a) (fabs b)) (* 0.011111111111111112 (* angle (* PI t_0)))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - fabs(a);
double tmp;
if ((2.0 * (pow(fabs(b), 2.0) - pow(fabs(a), 2.0))) <= 5e-229) {
tmp = t_0 * (fabs(a) * sin((0.011111111111111112 * (angle * ((double) M_PI)))));
} else {
tmp = (fabs(a) + fabs(b)) * (0.011111111111111112 * (angle * (((double) M_PI) * t_0)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - Math.abs(a);
double tmp;
if ((2.0 * (Math.pow(Math.abs(b), 2.0) - Math.pow(Math.abs(a), 2.0))) <= 5e-229) {
tmp = t_0 * (Math.abs(a) * Math.sin((0.011111111111111112 * (angle * Math.PI))));
} else {
tmp = (Math.abs(a) + Math.abs(b)) * (0.011111111111111112 * (angle * (Math.PI * t_0)));
}
return tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - math.fabs(a) tmp = 0 if (2.0 * (math.pow(math.fabs(b), 2.0) - math.pow(math.fabs(a), 2.0))) <= 5e-229: tmp = t_0 * (math.fabs(a) * math.sin((0.011111111111111112 * (angle * math.pi)))) else: tmp = (math.fabs(a) + math.fabs(b)) * (0.011111111111111112 * (angle * (math.pi * t_0))) return tmp
function code(a, b, angle) t_0 = Float64(abs(b) - abs(a)) tmp = 0.0 if (Float64(2.0 * Float64((abs(b) ^ 2.0) - (abs(a) ^ 2.0))) <= 5e-229) tmp = Float64(t_0 * Float64(abs(a) * sin(Float64(0.011111111111111112 * Float64(angle * pi))))); else tmp = Float64(Float64(abs(a) + abs(b)) * Float64(0.011111111111111112 * Float64(angle * Float64(pi * t_0)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - abs(a); tmp = 0.0; if ((2.0 * ((abs(b) ^ 2.0) - (abs(a) ^ 2.0))) <= 5e-229) tmp = t_0 * (abs(a) * sin((0.011111111111111112 * (angle * pi)))); else tmp = (abs(a) + abs(b)) * (0.011111111111111112 * (angle * (pi * t_0))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(2.0 * N[(N[Power[N[Abs[b], $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[Abs[a], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e-229], N[(t$95$0 * N[(N[Abs[a], $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - \left|a\right|\\
\mathbf{if}\;2 \cdot \left({\left(\left|b\right|\right)}^{2} - {\left(\left|a\right|\right)}^{2}\right) \leq 5 \cdot 10^{-229}:\\
\;\;\;\;t\_0 \cdot \left(\left|a\right| \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left|a\right| + \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t\_0\right)\right)\right)\\
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 5.00000000000000016e-229Initial program 54.4%
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 rewrites68.0%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6468.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6468.0
Applied rewrites68.0%
Taylor expanded in a around inf
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6442.6
Applied rewrites42.6%
if 5.00000000000000016e-229 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.4%
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 rewrites68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6462.8
Applied rewrites62.8%
(FPCore (a b angle) :precision binary64 (* (+ (fabs a) (fabs b)) (* 0.011111111111111112 (* angle (* PI (- (fabs b) (fabs a)))))))
double code(double a, double b, double angle) {
return (fabs(a) + fabs(b)) * (0.011111111111111112 * (angle * (((double) M_PI) * (fabs(b) - fabs(a)))));
}
public static double code(double a, double b, double angle) {
return (Math.abs(a) + Math.abs(b)) * (0.011111111111111112 * (angle * (Math.PI * (Math.abs(b) - Math.abs(a)))));
}
def code(a, b, angle): return (math.fabs(a) + math.fabs(b)) * (0.011111111111111112 * (angle * (math.pi * (math.fabs(b) - math.fabs(a)))))
function code(a, b, angle) return Float64(Float64(abs(a) + abs(b)) * Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(abs(b) - abs(a)))))) end
function tmp = code(a, b, angle) tmp = (abs(a) + abs(b)) * (0.011111111111111112 * (angle * (pi * (abs(b) - abs(a))))); end
code[a_, b_, angle_] := N[(N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(\left|a\right| + \left|b\right|\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left|b\right| - \left|a\right|\right)\right)\right)\right)
Initial program 54.4%
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 rewrites68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6462.8
Applied rewrites62.8%
(FPCore (a b angle) :precision binary64 (* (* (* 0.011111111111111112 (* angle (- (fabs b) (fabs a)))) (+ (fabs a) (fabs b))) PI))
double code(double a, double b, double angle) {
return ((0.011111111111111112 * (angle * (fabs(b) - fabs(a)))) * (fabs(a) + fabs(b))) * ((double) M_PI);
}
public static double code(double a, double b, double angle) {
return ((0.011111111111111112 * (angle * (Math.abs(b) - Math.abs(a)))) * (Math.abs(a) + Math.abs(b))) * Math.PI;
}
def code(a, b, angle): return ((0.011111111111111112 * (angle * (math.fabs(b) - math.fabs(a)))) * (math.fabs(a) + math.fabs(b))) * math.pi
function code(a, b, angle) return Float64(Float64(Float64(0.011111111111111112 * Float64(angle * Float64(abs(b) - abs(a)))) * Float64(abs(a) + abs(b))) * pi) end
function tmp = code(a, b, angle) tmp = ((0.011111111111111112 * (angle * (abs(b) - abs(a)))) * (abs(a) + abs(b))) * pi; end
code[a_, b_, angle_] := N[(N[(N[(0.011111111111111112 * N[(angle * N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]
\left(\left(0.011111111111111112 \cdot \left(angle \cdot \left(\left|b\right| - \left|a\right|\right)\right)\right) \cdot \left(\left|a\right| + \left|b\right|\right)\right) \cdot \pi
Initial program 54.4%
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.1
Applied rewrites51.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6455.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6455.3
Applied rewrites55.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6462.8
lift-+.f64N/A
+-commutativeN/A
lift-+.f6462.8
Applied rewrites62.8%
(FPCore (a b angle)
:precision binary64
(if (<= (fabs b) 1.56e+162)
(*
(* 0.011111111111111112 angle)
(* (+ (fabs a) (fabs b)) (* (- (fabs b) (fabs a)) PI)))
(* (fabs b) (* 0.011111111111111112 (* angle (* (fabs b) PI))))))double code(double a, double b, double angle) {
double tmp;
if (fabs(b) <= 1.56e+162) {
tmp = (0.011111111111111112 * angle) * ((fabs(a) + fabs(b)) * ((fabs(b) - fabs(a)) * ((double) M_PI)));
} else {
tmp = fabs(b) * (0.011111111111111112 * (angle * (fabs(b) * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (Math.abs(b) <= 1.56e+162) {
tmp = (0.011111111111111112 * angle) * ((Math.abs(a) + Math.abs(b)) * ((Math.abs(b) - Math.abs(a)) * Math.PI));
} else {
tmp = Math.abs(b) * (0.011111111111111112 * (angle * (Math.abs(b) * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if math.fabs(b) <= 1.56e+162: tmp = (0.011111111111111112 * angle) * ((math.fabs(a) + math.fabs(b)) * ((math.fabs(b) - math.fabs(a)) * math.pi)) else: tmp = math.fabs(b) * (0.011111111111111112 * (angle * (math.fabs(b) * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (abs(b) <= 1.56e+162) tmp = Float64(Float64(0.011111111111111112 * angle) * Float64(Float64(abs(a) + abs(b)) * Float64(Float64(abs(b) - abs(a)) * pi))); else tmp = Float64(abs(b) * Float64(0.011111111111111112 * Float64(angle * Float64(abs(b) * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (abs(b) <= 1.56e+162) tmp = (0.011111111111111112 * angle) * ((abs(a) + abs(b)) * ((abs(b) - abs(a)) * pi)); else tmp = abs(b) * (0.011111111111111112 * (angle * (abs(b) * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[Abs[b], $MachinePrecision], 1.56e+162], N[(N[(0.011111111111111112 * angle), $MachinePrecision] * N[(N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[b], $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[Abs[b], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|b\right| \leq 1.56 \cdot 10^{+162}:\\
\;\;\;\;\left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(\left|a\right| + \left|b\right|\right) \cdot \left(\left(\left|b\right| - \left|a\right|\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|b\right| \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left|b\right| \cdot \pi\right)\right)\right)\\
\end{array}
if b < 1.5600000000000001e162Initial program 54.4%
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.1
Applied rewrites51.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6455.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6455.3
Applied rewrites55.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f6455.3
Applied rewrites55.3%
if 1.5600000000000001e162 < b Initial program 54.4%
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 rewrites68.0%
Taylor expanded in a around 0
Applied rewrites42.4%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6441.7
Applied rewrites41.7%
Taylor expanded in a around 0
lower-*.f64N/A
lower-PI.f6438.3
Applied rewrites38.3%
(FPCore (a b angle) :precision binary64 (if (<= (fabs b) 1.56e+162) (* 0.011111111111111112 (* (* angle (* (- (fabs b) a) (+ (fabs b) a))) PI)) (* (fabs b) (* 0.011111111111111112 (* angle (* (fabs b) PI))))))
double code(double a, double b, double angle) {
double tmp;
if (fabs(b) <= 1.56e+162) {
tmp = 0.011111111111111112 * ((angle * ((fabs(b) - a) * (fabs(b) + a))) * ((double) M_PI));
} else {
tmp = fabs(b) * (0.011111111111111112 * (angle * (fabs(b) * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (Math.abs(b) <= 1.56e+162) {
tmp = 0.011111111111111112 * ((angle * ((Math.abs(b) - a) * (Math.abs(b) + a))) * Math.PI);
} else {
tmp = Math.abs(b) * (0.011111111111111112 * (angle * (Math.abs(b) * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if math.fabs(b) <= 1.56e+162: tmp = 0.011111111111111112 * ((angle * ((math.fabs(b) - a) * (math.fabs(b) + a))) * math.pi) else: tmp = math.fabs(b) * (0.011111111111111112 * (angle * (math.fabs(b) * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (abs(b) <= 1.56e+162) tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(Float64(abs(b) - a) * Float64(abs(b) + a))) * pi)); else tmp = Float64(abs(b) * Float64(0.011111111111111112 * Float64(angle * Float64(abs(b) * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (abs(b) <= 1.56e+162) tmp = 0.011111111111111112 * ((angle * ((abs(b) - a) * (abs(b) + a))) * pi); else tmp = abs(b) * (0.011111111111111112 * (angle * (abs(b) * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[Abs[b], $MachinePrecision], 1.56e+162], N[(0.011111111111111112 * N[(N[(angle * N[(N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision] * N[(N[Abs[b], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision], N[(N[Abs[b], $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[Abs[b], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|b\right| \leq 1.56 \cdot 10^{+162}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(\left(\left|b\right| - a\right) \cdot \left(\left|b\right| + a\right)\right)\right) \cdot \pi\right)\\
\mathbf{else}:\\
\;\;\;\;\left|b\right| \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left|b\right| \cdot \pi\right)\right)\right)\\
\end{array}
if b < 1.5600000000000001e162Initial program 54.4%
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.1
Applied rewrites51.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6455.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6455.3
Applied rewrites55.3%
if 1.5600000000000001e162 < b Initial program 54.4%
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 rewrites68.0%
Taylor expanded in a around 0
Applied rewrites42.4%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6441.7
Applied rewrites41.7%
Taylor expanded in a around 0
lower-*.f64N/A
lower-PI.f6438.3
Applied rewrites38.3%
(FPCore (a b angle) :precision binary64 (* (fabs b) (* 0.011111111111111112 (* angle (* PI (- (fabs b) a))))))
double code(double a, double b, double angle) {
return fabs(b) * (0.011111111111111112 * (angle * (((double) M_PI) * (fabs(b) - a))));
}
public static double code(double a, double b, double angle) {
return Math.abs(b) * (0.011111111111111112 * (angle * (Math.PI * (Math.abs(b) - a))));
}
def code(a, b, angle): return math.fabs(b) * (0.011111111111111112 * (angle * (math.pi * (math.fabs(b) - a))))
function code(a, b, angle) return Float64(abs(b) * Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(abs(b) - a))))) end
function tmp = code(a, b, angle) tmp = abs(b) * (0.011111111111111112 * (angle * (pi * (abs(b) - a)))); end
code[a_, b_, angle_] := N[(N[Abs[b], $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left|b\right| \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left|b\right| - a\right)\right)\right)\right)
Initial program 54.4%
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 rewrites68.0%
Taylor expanded in a around 0
Applied rewrites42.4%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6441.7
Applied rewrites41.7%
(FPCore (a b angle) :precision binary64 (if (<= (* 2.0 (- (pow (fabs b) 2.0) (pow a 2.0))) -2e-206) (* (fabs b) (* -0.011111111111111112 (* a (* angle PI)))) (* (fabs b) (* 0.011111111111111112 (* angle (* (fabs b) PI))))))
double code(double a, double b, double angle) {
double tmp;
if ((2.0 * (pow(fabs(b), 2.0) - pow(a, 2.0))) <= -2e-206) {
tmp = fabs(b) * (-0.011111111111111112 * (a * (angle * ((double) M_PI))));
} else {
tmp = fabs(b) * (0.011111111111111112 * (angle * (fabs(b) * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((2.0 * (Math.pow(Math.abs(b), 2.0) - Math.pow(a, 2.0))) <= -2e-206) {
tmp = Math.abs(b) * (-0.011111111111111112 * (a * (angle * Math.PI)));
} else {
tmp = Math.abs(b) * (0.011111111111111112 * (angle * (Math.abs(b) * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (2.0 * (math.pow(math.fabs(b), 2.0) - math.pow(a, 2.0))) <= -2e-206: tmp = math.fabs(b) * (-0.011111111111111112 * (a * (angle * math.pi))) else: tmp = math.fabs(b) * (0.011111111111111112 * (angle * (math.fabs(b) * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(2.0 * Float64((abs(b) ^ 2.0) - (a ^ 2.0))) <= -2e-206) tmp = Float64(abs(b) * Float64(-0.011111111111111112 * Float64(a * Float64(angle * pi)))); else tmp = Float64(abs(b) * Float64(0.011111111111111112 * Float64(angle * Float64(abs(b) * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((2.0 * ((abs(b) ^ 2.0) - (a ^ 2.0))) <= -2e-206) tmp = abs(b) * (-0.011111111111111112 * (a * (angle * pi))); else tmp = abs(b) * (0.011111111111111112 * (angle * (abs(b) * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(2.0 * N[(N[Power[N[Abs[b], $MachinePrecision], 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2e-206], N[(N[Abs[b], $MachinePrecision] * N[(-0.011111111111111112 * N[(a * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[b], $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[Abs[b], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;2 \cdot \left({\left(\left|b\right|\right)}^{2} - {a}^{2}\right) \leq -2 \cdot 10^{-206}:\\
\;\;\;\;\left|b\right| \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|b\right| \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left|b\right| \cdot \pi\right)\right)\right)\\
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -2.00000000000000006e-206Initial program 54.4%
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 rewrites68.0%
Taylor expanded in a around 0
Applied rewrites42.4%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6441.7
Applied rewrites41.7%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6420.4
Applied rewrites20.4%
if -2.00000000000000006e-206 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.4%
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 rewrites68.0%
Taylor expanded in a around 0
Applied rewrites42.4%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6441.7
Applied rewrites41.7%
Taylor expanded in a around 0
lower-*.f64N/A
lower-PI.f6438.3
Applied rewrites38.3%
(FPCore (a b angle) :precision binary64 (* (fabs b) (* -0.011111111111111112 (* a (* angle PI)))))
double code(double a, double b, double angle) {
return fabs(b) * (-0.011111111111111112 * (a * (angle * ((double) M_PI))));
}
public static double code(double a, double b, double angle) {
return Math.abs(b) * (-0.011111111111111112 * (a * (angle * Math.PI)));
}
def code(a, b, angle): return math.fabs(b) * (-0.011111111111111112 * (a * (angle * math.pi)))
function code(a, b, angle) return Float64(abs(b) * Float64(-0.011111111111111112 * Float64(a * Float64(angle * pi)))) end
function tmp = code(a, b, angle) tmp = abs(b) * (-0.011111111111111112 * (a * (angle * pi))); end
code[a_, b_, angle_] := N[(N[Abs[b], $MachinePrecision] * N[(-0.011111111111111112 * N[(a * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left|b\right| \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \pi\right)\right)\right)
Initial program 54.4%
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 rewrites68.0%
Taylor expanded in a around 0
Applied rewrites42.4%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6441.7
Applied rewrites41.7%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6420.4
Applied rewrites20.4%
herbie shell --seed 2025171
(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)))))