
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1 (* (- PI) (/ angle_m 180.0)))
(t_2 (* (* (+ b a_m) (- b a_m)) 2.0)))
(*
angle_s
(if (<= angle_m 2.5e-46)
(* (* (+ a_m b) (* angle_m PI)) (* (- b a_m) 0.011111111111111112))
(if (<= angle_m 1.7e+194)
(*
t_2
(/ (+ (sin (+ t_0 t_0)) (sin (fma PI (/ angle_m 180.0) t_1))) 2.0))
(* t_2 (* (sin t_0) (sin (+ t_1 (/ PI 2.0))))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = -((double) M_PI) * (angle_m / 180.0);
double t_2 = ((b + a_m) * (b - a_m)) * 2.0;
double tmp;
if (angle_m <= 2.5e-46) {
tmp = ((a_m + b) * (angle_m * ((double) M_PI))) * ((b - a_m) * 0.011111111111111112);
} else if (angle_m <= 1.7e+194) {
tmp = t_2 * ((sin((t_0 + t_0)) + sin(fma(((double) M_PI), (angle_m / 180.0), t_1))) / 2.0);
} else {
tmp = t_2 * (sin(t_0) * sin((t_1 + (((double) M_PI) / 2.0))));
}
return angle_s * tmp;
}
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = Float64(Float64(-pi) * Float64(angle_m / 180.0)) t_2 = Float64(Float64(Float64(b + a_m) * Float64(b - a_m)) * 2.0) tmp = 0.0 if (angle_m <= 2.5e-46) tmp = Float64(Float64(Float64(a_m + b) * Float64(angle_m * pi)) * Float64(Float64(b - a_m) * 0.011111111111111112)); elseif (angle_m <= 1.7e+194) tmp = Float64(t_2 * Float64(Float64(sin(Float64(t_0 + t_0)) + sin(fma(pi, Float64(angle_m / 180.0), t_1))) / 2.0)); else tmp = Float64(t_2 * Float64(sin(t_0) * sin(Float64(t_1 + Float64(pi / 2.0))))); end return Float64(angle_s * tmp) end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-Pi) * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 2.5e-46], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle$95$m, 1.7e+194], N[(t$95$2 * N[(N[(N[Sin[N[(t$95$0 + t$95$0), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(N[Sin[t$95$0], $MachinePrecision] * N[Sin[N[(t$95$1 + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \left(-\pi\right) \cdot \frac{angle\_m}{180}\\
t_2 := \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right) \cdot 2\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.5 \cdot 10^{-46}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{elif}\;angle\_m \leq 1.7 \cdot 10^{+194}:\\
\;\;\;\;t\_2 \cdot \frac{\sin \left(t\_0 + t\_0\right) + \sin \left(\mathsf{fma}\left(\pi, \frac{angle\_m}{180}, t\_1\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(\sin t\_0 \cdot \sin \left(t\_1 + \frac{\pi}{2}\right)\right)\\
\end{array}
\end{array}
\end{array}
if angle < 2.49999999999999996e-46Initial program 74.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6477.2
Applied rewrites77.2%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6499.4
Applied rewrites99.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites99.6%
lift-*.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift-PI.f6499.6
Applied rewrites99.6%
if 2.49999999999999996e-46 < angle < 1.7000000000000001e194Initial program 44.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites48.1%
lift-*.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
cos-neg-revN/A
sin-cos-multN/A
lower-/.f64N/A
Applied rewrites47.8%
if 1.7000000000000001e194 < angle Initial program 30.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites33.3%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lift-PI.f6433.1
Applied rewrites33.1%
Final simplification68.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0))) (t_1 (* (* (+ a_m b) PI) angle_m)))
(*
angle_s
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))
0.0)
(* t_1 (* -0.011111111111111112 a_m))
(* t_1 (* b 0.011111111111111112))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = ((a_m + b) * ((double) M_PI)) * angle_m;
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0)) <= 0.0) {
tmp = t_1 * (-0.011111111111111112 * a_m);
} else {
tmp = t_1 * (b * 0.011111111111111112);
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = Math.PI * (angle_m / 180.0);
double t_1 = ((a_m + b) * Math.PI) * angle_m;
double tmp;
if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) * Math.sin(t_0)) * Math.cos(t_0)) <= 0.0) {
tmp = t_1 * (-0.011111111111111112 * a_m);
} else {
tmp = t_1 * (b * 0.011111111111111112);
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = math.pi * (angle_m / 180.0) t_1 = ((a_m + b) * math.pi) * angle_m tmp = 0 if (((2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) * math.sin(t_0)) * math.cos(t_0)) <= 0.0: tmp = t_1 * (-0.011111111111111112 * a_m) else: tmp = t_1 * (b * 0.011111111111111112) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = Float64(Float64(Float64(a_m + b) * pi) * angle_m) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 0.0) tmp = Float64(t_1 * Float64(-0.011111111111111112 * a_m)); else tmp = Float64(t_1 * Float64(b * 0.011111111111111112)); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = pi * (angle_m / 180.0); t_1 = ((a_m + b) * pi) * angle_m; tmp = 0.0; if ((((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 0.0) tmp = t_1 * (-0.011111111111111112 * a_m); else tmp = t_1 * (b * 0.011111111111111112); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 0.0], N[(t$95$1 * N[(-0.011111111111111112 * a$95$m), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(b * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq 0:\\
\;\;\;\;t\_1 \cdot \left(-0.011111111111111112 \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(b \cdot 0.011111111111111112\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))))) < 0.0Initial program 62.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6459.3
Applied rewrites59.3%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6464.7
Applied rewrites64.7%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites64.7%
Taylor expanded in a around inf
lift-*.f6463.7
Applied rewrites63.7%
if 0.0 < (*.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 47.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6449.6
Applied rewrites49.6%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6461.0
Applied rewrites61.0%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites61.2%
Taylor expanded in a around 0
Applied rewrites58.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0))))
(*
angle_s
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))
0.0)
(* (* (* (+ a_m b) PI) angle_m) (* -0.011111111111111112 a_m))
(* (* (* (* PI angle_m) (+ a_m b)) b) 0.011111111111111112)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0)) <= 0.0) {
tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * (-0.011111111111111112 * a_m);
} else {
tmp = (((((double) M_PI) * angle_m) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = Math.PI * (angle_m / 180.0);
double tmp;
if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) * Math.sin(t_0)) * Math.cos(t_0)) <= 0.0) {
tmp = (((a_m + b) * Math.PI) * angle_m) * (-0.011111111111111112 * a_m);
} else {
tmp = (((Math.PI * angle_m) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = math.pi * (angle_m / 180.0) tmp = 0 if (((2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) * math.sin(t_0)) * math.cos(t_0)) <= 0.0: tmp = (((a_m + b) * math.pi) * angle_m) * (-0.011111111111111112 * a_m) else: tmp = (((math.pi * angle_m) * (a_m + b)) * b) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 0.0) tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(-0.011111111111111112 * a_m)); else tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(a_m + b)) * b) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = pi * (angle_m / 180.0); tmp = 0.0; if ((((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 0.0) tmp = (((a_m + b) * pi) * angle_m) * (-0.011111111111111112 * a_m); else tmp = (((pi * angle_m) * (a_m + b)) * b) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(-0.011111111111111112 * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq 0:\\
\;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(a\_m + b\right)\right) \cdot b\right) \cdot 0.011111111111111112\\
\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))))) < 0.0Initial program 62.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6459.3
Applied rewrites59.3%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6464.7
Applied rewrites64.7%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites64.7%
Taylor expanded in a around inf
lift-*.f6463.7
Applied rewrites63.7%
if 0.0 < (*.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 47.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6449.6
Applied rewrites49.6%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6461.0
Applied rewrites61.0%
Taylor expanded in a around 0
Applied rewrites58.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 2.5e-46)
(* (* (+ a_m b) (* angle_m PI)) (* (- b a_m) 0.011111111111111112))
(*
(* (* (+ b a_m) (- b a_m)) 2.0)
(*
(sin (* PI (/ angle_m 180.0)))
(sin (+ (* (- PI) (/ angle_m 180.0)) (/ PI 2.0))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e-46) {
tmp = ((a_m + b) * (angle_m * ((double) M_PI))) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (((b + a_m) * (b - a_m)) * 2.0) * (sin((((double) M_PI) * (angle_m / 180.0))) * sin(((-((double) M_PI) * (angle_m / 180.0)) + (((double) M_PI) / 2.0))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e-46) {
tmp = ((a_m + b) * (angle_m * Math.PI)) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (((b + a_m) * (b - a_m)) * 2.0) * (Math.sin((Math.PI * (angle_m / 180.0))) * Math.sin(((-Math.PI * (angle_m / 180.0)) + (Math.PI / 2.0))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 2.5e-46: tmp = ((a_m + b) * (angle_m * math.pi)) * ((b - a_m) * 0.011111111111111112) else: tmp = (((b + a_m) * (b - a_m)) * 2.0) * (math.sin((math.pi * (angle_m / 180.0))) * math.sin(((-math.pi * (angle_m / 180.0)) + (math.pi / 2.0)))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 2.5e-46) tmp = Float64(Float64(Float64(a_m + b) * Float64(angle_m * pi)) * Float64(Float64(b - a_m) * 0.011111111111111112)); else tmp = Float64(Float64(Float64(Float64(b + a_m) * Float64(b - a_m)) * 2.0) * Float64(sin(Float64(pi * Float64(angle_m / 180.0))) * sin(Float64(Float64(Float64(-pi) * Float64(angle_m / 180.0)) + Float64(pi / 2.0))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 2.5e-46) tmp = ((a_m + b) * (angle_m * pi)) * ((b - a_m) * 0.011111111111111112); else tmp = (((b + a_m) * (b - a_m)) * 2.0) * (sin((pi * (angle_m / 180.0))) * sin(((-pi * (angle_m / 180.0)) + (pi / 2.0)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2.5e-46], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[((-Pi) * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.5 \cdot 10^{-46}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right) \cdot 2\right) \cdot \left(\sin \left(\pi \cdot \frac{angle\_m}{180}\right) \cdot \sin \left(\left(-\pi\right) \cdot \frac{angle\_m}{180} + \frac{\pi}{2}\right)\right)\\
\end{array}
\end{array}
if angle < 2.49999999999999996e-46Initial program 74.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6477.2
Applied rewrites77.2%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6499.4
Applied rewrites99.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites99.6%
lift-*.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift-PI.f6499.6
Applied rewrites99.6%
if 2.49999999999999996e-46 < angle Initial program 39.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites43.5%
lift-cos.f64N/A
cos-neg-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-+.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lift-PI.f6443.8
Applied rewrites43.8%
Final simplification68.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 2.8e-46)
(* (* (+ a_m b) (* angle_m PI)) (* (- b a_m) 0.011111111111111112))
(*
(* 2.0 (sin (+ (* (* angle_m PI) (- 0.005555555555555556)) (/ PI 2.0))))
(*
(sin (* (* 0.005555555555555556 angle_m) PI))
(* (- b a_m) (+ a_m b)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.8e-46) {
tmp = ((a_m + b) * (angle_m * ((double) M_PI))) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (2.0 * sin((((angle_m * ((double) M_PI)) * -0.005555555555555556) + (((double) M_PI) / 2.0)))) * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * ((b - a_m) * (a_m + b)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.8e-46) {
tmp = ((a_m + b) * (angle_m * Math.PI)) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (2.0 * Math.sin((((angle_m * Math.PI) * -0.005555555555555556) + (Math.PI / 2.0)))) * (Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * ((b - a_m) * (a_m + b)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 2.8e-46: tmp = ((a_m + b) * (angle_m * math.pi)) * ((b - a_m) * 0.011111111111111112) else: tmp = (2.0 * math.sin((((angle_m * math.pi) * -0.005555555555555556) + (math.pi / 2.0)))) * (math.sin(((0.005555555555555556 * angle_m) * math.pi)) * ((b - a_m) * (a_m + b))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 2.8e-46) tmp = Float64(Float64(Float64(a_m + b) * Float64(angle_m * pi)) * Float64(Float64(b - a_m) * 0.011111111111111112)); else tmp = Float64(Float64(2.0 * sin(Float64(Float64(Float64(angle_m * pi) * Float64(-0.005555555555555556)) + Float64(pi / 2.0)))) * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * Float64(Float64(b - a_m) * Float64(a_m + b)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 2.8e-46) tmp = ((a_m + b) * (angle_m * pi)) * ((b - a_m) * 0.011111111111111112); else tmp = (2.0 * sin((((angle_m * pi) * -0.005555555555555556) + (pi / 2.0)))) * (sin(((0.005555555555555556 * angle_m) * pi)) * ((b - a_m) * (a_m + b))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2.8e-46], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sin[N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * (-0.005555555555555556)), $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.8 \cdot 10^{-46}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot \left(-0.005555555555555556\right) + \frac{\pi}{2}\right)\right) \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot \left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right)\right)\\
\end{array}
\end{array}
if angle < 2.7999999999999998e-46Initial program 74.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6477.2
Applied rewrites77.2%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6499.4
Applied rewrites99.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites99.6%
lift-*.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift-PI.f6499.6
Applied rewrites99.6%
if 2.7999999999999998e-46 < angle Initial program 39.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites43.5%
Taylor expanded in angle around inf
Applied rewrites43.3%
lift-cos.f64N/A
cos-neg-revN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-/.f64N/A
lift-PI.f64N/A
lower-+.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6443.8
Applied rewrites43.8%
Final simplification68.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) -5e-218)
(* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
(* (* (* (* PI angle_m) (+ a_m b)) b) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= -5e-218) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
} else {
tmp = (((((double) M_PI) * angle_m) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= -5e-218) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
} else {
tmp = (((Math.PI * angle_m) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= -5e-218: tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) else: tmp = (((math.pi * angle_m) * (a_m + b)) * b) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= -5e-218) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)); else tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(a_m + b)) * b) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= -5e-218) tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); else tmp = (((pi * angle_m) * (a_m + b)) * b) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-218], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq -5 \cdot 10^{-218}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(a\_m + b\right)\right) \cdot b\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)))) < -5.00000000000000041e-218Initial program 55.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6450.8
Applied rewrites50.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.9
Applied rewrites50.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6461.5
Applied rewrites61.5%
if -5.00000000000000041e-218 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.2
Applied rewrites57.2%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6463.7
Applied rewrites63.7%
Taylor expanded in a around 0
Applied rewrites61.9%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) 0.0)
(* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
(* (* (* b PI) angle_m) (* (- b a_m) 0.011111111111111112)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= 0.0) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
} else {
tmp = ((b * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= 0.0) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
} else {
tmp = ((b * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= 0.0: tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) else: tmp = ((b * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= 0.0) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)); else tmp = Float64(Float64(Float64(b * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112)); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= 0.0) tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); else tmp = ((b * pi) * angle_m) * ((b - a_m) * 0.011111111111111112); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq 0:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 0.0Initial program 61.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.2
Applied rewrites57.2%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6457.0
Applied rewrites57.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6457.1
Applied rewrites57.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6463.4
Applied rewrites63.4%
if 0.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 48.9%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.2
Applied rewrites52.2%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6463.0
Applied rewrites63.0%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites63.2%
Taylor expanded in a around 0
+-commutative61.1
Applied rewrites61.1%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) 0.0)
(* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
(* (* (* (* PI b) angle_m) (- b a_m)) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= 0.0) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
} else {
tmp = (((((double) M_PI) * b) * angle_m) * (b - a_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= 0.0) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
} else {
tmp = (((Math.PI * b) * angle_m) * (b - a_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= 0.0: tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) else: tmp = (((math.pi * b) * angle_m) * (b - a_m)) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= 0.0) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)); else tmp = Float64(Float64(Float64(Float64(pi * b) * angle_m) * Float64(b - a_m)) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= 0.0) tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); else tmp = (((pi * b) * angle_m) * (b - a_m)) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * b), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq 0:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot b\right) \cdot angle\_m\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 0.0Initial program 61.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.2
Applied rewrites57.2%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6457.0
Applied rewrites57.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6457.1
Applied rewrites57.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6463.4
Applied rewrites63.4%
if 0.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 48.9%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.2
Applied rewrites52.2%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6463.0
Applied rewrites63.0%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6461.0
Applied rewrites61.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) -5e-218)
(* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
(* (* (* PI angle_m) (* b b)) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= -5e-218) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
} else {
tmp = ((((double) M_PI) * angle_m) * (b * b)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= -5e-218) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
} else {
tmp = ((Math.PI * angle_m) * (b * b)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= -5e-218: tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) else: tmp = ((math.pi * angle_m) * (b * b)) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= -5e-218) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)); else tmp = Float64(Float64(Float64(pi * angle_m) * Float64(b * b)) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= -5e-218) tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); else tmp = ((pi * angle_m) * (b * b)) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-218], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq -5 \cdot 10^{-218}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -5.00000000000000041e-218Initial program 55.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6450.8
Applied rewrites50.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.9
Applied rewrites50.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6461.5
Applied rewrites61.5%
if -5.00000000000000041e-218 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.2
Applied rewrites57.2%
Taylor expanded in a around 0
pow2N/A
lift-*.f6456.0
Applied rewrites56.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) -5e-218)
(* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
(* (* (* PI (* b b)) angle_m) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) <= -5e-218) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
} else {
tmp = ((((double) M_PI) * (b * b)) * angle_m) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0))) <= -5e-218) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
} else {
tmp = ((Math.PI * (b * b)) * angle_m) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0))) <= -5e-218: tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) else: tmp = ((math.pi * (b * b)) * angle_m) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) <= -5e-218) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)); else tmp = Float64(Float64(Float64(pi * Float64(b * b)) * angle_m) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a_m ^ 2.0))) <= -5e-218) tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); else tmp = ((pi * (b * b)) * angle_m) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-218], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a\_m}^{2}\right) \leq -5 \cdot 10^{-218}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\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)))) < -5.00000000000000041e-218Initial program 55.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6450.8
Applied rewrites50.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.9
Applied rewrites50.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6461.5
Applied rewrites61.5%
if -5.00000000000000041e-218 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.2
Applied rewrites57.2%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
pow2N/A
lift-*.f6455.9
Applied rewrites55.9%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 2.5e-46)
(* (* (+ a_m b) (* angle_m PI)) (* (- b a_m) 0.011111111111111112))
(* (* (- b a_m) (+ a_m b)) (sin (* 2.0 (* PI (/ angle_m 180.0))))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e-46) {
tmp = ((a_m + b) * (angle_m * ((double) M_PI))) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = ((b - a_m) * (a_m + b)) * sin((2.0 * (((double) M_PI) * (angle_m / 180.0))));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e-46) {
tmp = ((a_m + b) * (angle_m * Math.PI)) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = ((b - a_m) * (a_m + b)) * Math.sin((2.0 * (Math.PI * (angle_m / 180.0))));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 2.5e-46: tmp = ((a_m + b) * (angle_m * math.pi)) * ((b - a_m) * 0.011111111111111112) else: tmp = ((b - a_m) * (a_m + b)) * math.sin((2.0 * (math.pi * (angle_m / 180.0)))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 2.5e-46) tmp = Float64(Float64(Float64(a_m + b) * Float64(angle_m * pi)) * Float64(Float64(b - a_m) * 0.011111111111111112)); else tmp = Float64(Float64(Float64(b - a_m) * Float64(a_m + b)) * sin(Float64(2.0 * Float64(pi * Float64(angle_m / 180.0))))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 2.5e-46) tmp = ((a_m + b) * (angle_m * pi)) * ((b - a_m) * 0.011111111111111112); else tmp = ((b - a_m) * (a_m + b)) * sin((2.0 * (pi * (angle_m / 180.0)))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2.5e-46], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(2.0 * N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.5 \cdot 10^{-46}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right) \cdot \sin \left(2 \cdot \left(\pi \cdot \frac{angle\_m}{180}\right)\right)\\
\end{array}
\end{array}
if angle < 2.49999999999999996e-46Initial program 74.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6477.2
Applied rewrites77.2%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6499.4
Applied rewrites99.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites99.6%
lift-*.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift-PI.f6499.6
Applied rewrites99.6%
if 2.49999999999999996e-46 < angle Initial program 39.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites43.5%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites43.5%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 6.3e+175)
(* (* (+ a_m b) (* angle_m PI)) (* (- b a_m) 0.011111111111111112))
(*
2.0
(*
(sin (* (* 0.005555555555555556 angle_m) PI))
(* (- b a_m) (+ a_m b)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 6.3e+175) {
tmp = ((a_m + b) * (angle_m * ((double) M_PI))) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = 2.0 * (sin(((0.005555555555555556 * angle_m) * ((double) M_PI))) * ((b - a_m) * (a_m + b)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 6.3e+175) {
tmp = ((a_m + b) * (angle_m * Math.PI)) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = 2.0 * (Math.sin(((0.005555555555555556 * angle_m) * Math.PI)) * ((b - a_m) * (a_m + b)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 6.3e+175: tmp = ((a_m + b) * (angle_m * math.pi)) * ((b - a_m) * 0.011111111111111112) else: tmp = 2.0 * (math.sin(((0.005555555555555556 * angle_m) * math.pi)) * ((b - a_m) * (a_m + b))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 6.3e+175) tmp = Float64(Float64(Float64(a_m + b) * Float64(angle_m * pi)) * Float64(Float64(b - a_m) * 0.011111111111111112)); else tmp = Float64(2.0 * Float64(sin(Float64(Float64(0.005555555555555556 * angle_m) * pi)) * Float64(Float64(b - a_m) * Float64(a_m + b)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 6.3e+175) tmp = ((a_m + b) * (angle_m * pi)) * ((b - a_m) * 0.011111111111111112); else tmp = 2.0 * (sin(((0.005555555555555556 * angle_m) * pi)) * ((b - a_m) * (a_m + b))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 6.3e+175], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Sin[N[(N[(0.005555555555555556 * angle$95$m), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 6.3 \cdot 10^{+175}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\sin \left(\left(0.005555555555555556 \cdot angle\_m\right) \cdot \pi\right) \cdot \left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right)\right)\\
\end{array}
\end{array}
if angle < 6.2999999999999997e175Initial program 61.2%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6461.5
Applied rewrites61.5%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6473.2
Applied rewrites73.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites73.3%
lift-*.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift-PI.f6473.3
Applied rewrites73.3%
if 6.2999999999999997e175 < angle Initial program 30.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites33.3%
Taylor expanded in angle around inf
Applied rewrites33.0%
Taylor expanded in angle around 0
Applied rewrites33.7%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= b 1.65e-97)
(* (* (- a_m) a_m) (sin (* (* PI angle_m) 0.011111111111111112)))
(* (* (+ a_m b) (* angle_m PI)) (* (- b a_m) 0.011111111111111112)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (b <= 1.65e-97) {
tmp = (-a_m * a_m) * sin(((((double) M_PI) * angle_m) * 0.011111111111111112));
} else {
tmp = ((a_m + b) * (angle_m * ((double) M_PI))) * ((b - a_m) * 0.011111111111111112);
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (b <= 1.65e-97) {
tmp = (-a_m * a_m) * Math.sin(((Math.PI * angle_m) * 0.011111111111111112));
} else {
tmp = ((a_m + b) * (angle_m * Math.PI)) * ((b - a_m) * 0.011111111111111112);
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if b <= 1.65e-97: tmp = (-a_m * a_m) * math.sin(((math.pi * angle_m) * 0.011111111111111112)) else: tmp = ((a_m + b) * (angle_m * math.pi)) * ((b - a_m) * 0.011111111111111112) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (b <= 1.65e-97) tmp = Float64(Float64(Float64(-a_m) * a_m) * sin(Float64(Float64(pi * angle_m) * 0.011111111111111112))); else tmp = Float64(Float64(Float64(a_m + b) * Float64(angle_m * pi)) * Float64(Float64(b - a_m) * 0.011111111111111112)); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (b <= 1.65e-97) tmp = (-a_m * a_m) * sin(((pi * angle_m) * 0.011111111111111112)); else tmp = ((a_m + b) * (angle_m * pi)) * ((b - a_m) * 0.011111111111111112); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[b, 1.65e-97], N[(N[((-a$95$m) * a$95$m), $MachinePrecision] * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;b \leq 1.65 \cdot 10^{-97}:\\
\;\;\;\;\left(\left(-a\_m\right) \cdot a\_m\right) \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if b < 1.6500000000000001e-97Initial program 57.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites38.5%
Taylor expanded in a around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
pow2N/A
lift-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
Applied rewrites43.2%
if 1.6500000000000001e-97 < b Initial program 50.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.9
Applied rewrites52.9%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6464.5
Applied rewrites64.5%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites64.6%
lift-*.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift-PI.f6464.6
Applied rewrites64.6%
Final simplification50.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 2.5e+148)
(* (* (+ a_m b) (* angle_m PI)) (* (- b a_m) 0.011111111111111112))
(* (* (* (* PI angle_m) (+ a_m b)) b) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e+148) {
tmp = ((a_m + b) * (angle_m * ((double) M_PI))) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (((((double) M_PI) * angle_m) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e+148) {
tmp = ((a_m + b) * (angle_m * Math.PI)) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (((Math.PI * angle_m) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 2.5e+148: tmp = ((a_m + b) * (angle_m * math.pi)) * ((b - a_m) * 0.011111111111111112) else: tmp = (((math.pi * angle_m) * (a_m + b)) * b) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 2.5e+148) tmp = Float64(Float64(Float64(a_m + b) * Float64(angle_m * pi)) * Float64(Float64(b - a_m) * 0.011111111111111112)); else tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(a_m + b)) * b) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 2.5e+148) tmp = ((a_m + b) * (angle_m * pi)) * ((b - a_m) * 0.011111111111111112); else tmp = (((pi * angle_m) * (a_m + b)) * b) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2.5e+148], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.5 \cdot 10^{+148}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(a\_m + b\right)\right) \cdot b\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if angle < 2.50000000000000012e148Initial program 63.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6463.7
Applied rewrites63.7%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6476.3
Applied rewrites76.3%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites76.4%
lift-*.f64N/A
lift-+.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift-PI.f6476.4
Applied rewrites76.4%
if 2.50000000000000012e148 < angle Initial program 29.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6427.9
Applied rewrites27.9%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6423.3
Applied rewrites23.3%
Taylor expanded in a around 0
Applied rewrites23.8%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 2.5e+148)
(* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112))
(* (* (* (* PI angle_m) (+ a_m b)) b) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e+148) {
tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (((((double) M_PI) * angle_m) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e+148) {
tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (((Math.PI * angle_m) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 2.5e+148: tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112) else: tmp = (((math.pi * angle_m) * (a_m + b)) * b) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 2.5e+148) tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112)); else tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(a_m + b)) * b) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 2.5e+148) tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112); else tmp = (((pi * angle_m) * (a_m + b)) * b) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2.5e+148], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.5 \cdot 10^{+148}:\\
\;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(a\_m + b\right)\right) \cdot b\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if angle < 2.50000000000000012e148Initial program 63.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6463.7
Applied rewrites63.7%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6476.3
Applied rewrites76.3%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites76.4%
if 2.50000000000000012e148 < angle Initial program 29.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6427.9
Applied rewrites27.9%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6423.3
Applied rewrites23.3%
Taylor expanded in a around 0
Applied rewrites23.8%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 2.5e+148)
(* (* (* PI (* angle_m (+ a_m b))) (- b a_m)) 0.011111111111111112)
(* (* (* (* PI angle_m) (+ a_m b)) b) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e+148) {
tmp = ((((double) M_PI) * (angle_m * (a_m + b))) * (b - a_m)) * 0.011111111111111112;
} else {
tmp = (((((double) M_PI) * angle_m) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e+148) {
tmp = ((Math.PI * (angle_m * (a_m + b))) * (b - a_m)) * 0.011111111111111112;
} else {
tmp = (((Math.PI * angle_m) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 2.5e+148: tmp = ((math.pi * (angle_m * (a_m + b))) * (b - a_m)) * 0.011111111111111112 else: tmp = (((math.pi * angle_m) * (a_m + b)) * b) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 2.5e+148) tmp = Float64(Float64(Float64(pi * Float64(angle_m * Float64(a_m + b))) * Float64(b - a_m)) * 0.011111111111111112); else tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(a_m + b)) * b) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 2.5e+148) tmp = ((pi * (angle_m * (a_m + b))) * (b - a_m)) * 0.011111111111111112; else tmp = (((pi * angle_m) * (a_m + b)) * b) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2.5e+148], N[(N[(N[(Pi * N[(angle$95$m * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.5 \cdot 10^{+148}:\\
\;\;\;\;\left(\left(\pi \cdot \left(angle\_m \cdot \left(a\_m + b\right)\right)\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(a\_m + b\right)\right) \cdot b\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if angle < 2.50000000000000012e148Initial program 63.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6463.7
Applied rewrites63.7%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6476.3
Applied rewrites76.3%
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-+.f6476.3
Applied rewrites76.3%
if 2.50000000000000012e148 < angle Initial program 29.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6427.9
Applied rewrites27.9%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6423.3
Applied rewrites23.3%
Taylor expanded in a around 0
Applied rewrites23.8%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m));
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m));
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * ((-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m))
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m))) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * ((-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m)); end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\right)
\end{array}
Initial program 54.9%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.6
Applied rewrites54.6%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6435.0
Applied rewrites35.0%
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
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f6438.3
Applied rewrites38.3%
herbie shell --seed 2025086
(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)))))