
(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}
Sampling outcomes in binary64 precision:
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}
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* PI -0.005555555555555556))) (t_1 (sin t_0)))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+17)
(* (* (cos t_0) 2.0) (* (- a b_m) (* (+ a b_m) t_1)))
(if (<= (/ angle_m 180.0) 2e+246)
(*
2.0
(fma
b_m
(*
(sin (* angle_m (* -0.005555555555555556 (pow (sqrt PI) 2.0))))
(- b_m))
(* t_1 (pow a 2.0))))
(*
(cos (* angle_m (/ PI -180.0)))
(*
2.0
(*
(sin (* angle_m (log (+ 1.0 (expm1 (* PI -0.005555555555555556))))))
(* (- a b_m) (+ a b_m))))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * (((double) M_PI) * -0.005555555555555556);
double t_1 = sin(t_0);
double tmp;
if ((angle_m / 180.0) <= 2e+17) {
tmp = (cos(t_0) * 2.0) * ((a - b_m) * ((a + b_m) * t_1));
} else if ((angle_m / 180.0) <= 2e+246) {
tmp = 2.0 * fma(b_m, (sin((angle_m * (-0.005555555555555556 * pow(sqrt(((double) M_PI)), 2.0)))) * -b_m), (t_1 * pow(a, 2.0)));
} else {
tmp = cos((angle_m * (((double) M_PI) / -180.0))) * (2.0 * (sin((angle_m * log((1.0 + expm1((((double) M_PI) * -0.005555555555555556)))))) * ((a - b_m) * (a + b_m))));
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(angle_m * Float64(pi * -0.005555555555555556)) t_1 = sin(t_0) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e+17) tmp = Float64(Float64(cos(t_0) * 2.0) * Float64(Float64(a - b_m) * Float64(Float64(a + b_m) * t_1))); elseif (Float64(angle_m / 180.0) <= 2e+246) tmp = Float64(2.0 * fma(b_m, Float64(sin(Float64(angle_m * Float64(-0.005555555555555556 * (sqrt(pi) ^ 2.0)))) * Float64(-b_m)), Float64(t_1 * (a ^ 2.0)))); else tmp = Float64(cos(Float64(angle_m * Float64(pi / -180.0))) * Float64(2.0 * Float64(sin(Float64(angle_m * log(Float64(1.0 + expm1(Float64(pi * -0.005555555555555556)))))) * Float64(Float64(a - b_m) * Float64(a + b_m))))); end return Float64(angle_s * tmp) end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+17], N[(N[(N[Cos[t$95$0], $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(a - b$95$m), $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+246], N[(2.0 * N[(b$95$m * N[(N[Sin[N[(angle$95$m * N[(-0.005555555555555556 * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-b$95$m)), $MachinePrecision] + N[(t$95$1 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(angle$95$m * N[Log[N[(1.0 + N[(Exp[N[(Pi * -0.005555555555555556), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
t_1 := \sin t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+17}:\\
\;\;\;\;\left(\cos t\_0 \cdot 2\right) \cdot \left(\left(a - b\_m\right) \cdot \left(\left(a + b\_m\right) \cdot t\_1\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+246}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b\_m, \sin \left(angle\_m \cdot \left(-0.005555555555555556 \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\right) \cdot \left(-b\_m\right), t\_1 \cdot {a}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(\sin \left(angle\_m \cdot \log \left(1 + \mathsf{expm1}\left(\pi \cdot -0.005555555555555556\right)\right)\right) \cdot \left(\left(a - b\_m\right) \cdot \left(a + b\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e17Initial program 65.3%
Simplified65.4%
unpow265.4%
unpow265.4%
difference-of-squares68.0%
Applied egg-rr68.0%
add-cbrt-cube36.5%
pow335.2%
div-inv35.2%
metadata-eval35.2%
Applied egg-rr35.2%
expm1-log1p-u25.4%
expm1-undefine21.4%
Applied egg-rr35.5%
expm1-define51.5%
associate-*r*47.7%
*-commutative47.7%
associate-*l*47.7%
*-commutative47.7%
*-commutative47.7%
+-commutative47.7%
associate-*r*50.6%
*-commutative50.6%
Simplified50.6%
expm1-log1p-u68.0%
associate-*r*68.0%
*-commutative68.0%
associate-*l*82.0%
+-commutative82.0%
*-commutative82.0%
Applied egg-rr82.0%
if 2e17 < (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000014e246Initial program 20.9%
Simplified20.7%
unpow220.7%
unpow220.7%
difference-of-squares29.8%
Applied egg-rr29.8%
Taylor expanded in b around 0 26.0%
fma-define38.1%
+-commutative38.1%
*-commutative38.1%
distribute-rgt1-in38.1%
metadata-eval38.1%
mul0-lft38.1%
associate-*r*38.1%
distribute-rgt-out38.1%
*-commutative38.1%
associate-*l*35.3%
mul-1-neg35.3%
Simplified29.8%
add-sqr-sqrt36.0%
pow236.0%
Applied egg-rr36.0%
Taylor expanded in angle around 0 50.9%
if 2.00000000000000014e246 < (/.f64 angle #s(literal 180 binary64)) Initial program 25.2%
Simplified25.3%
unpow225.3%
unpow225.3%
difference-of-squares30.9%
Applied egg-rr30.9%
log1p-expm1-u30.9%
log1p-undefine42.0%
div-inv42.0%
metadata-eval42.0%
Applied egg-rr42.0%
Final simplification75.2%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (* angle_m PI) (- b_m a))) (t_1 (- (pow b_m 2.0) (pow a 2.0))))
(*
angle_s
(if (<= t_1 (- INFINITY))
(* 0.011111111111111112 (* a t_0))
(if (<= t_1 1e+241)
(*
(* 2.0 (* (* (- a b_m) (+ a b_m)) (sin (* angle_m (/ PI -180.0)))))
(cos (/ angle_m (/ -180.0 PI))))
(if (<= t_1 INFINITY)
(*
0.011111111111111112
(-
(* b_m (+ (* angle_m (* PI (- a a))) (* angle_m (* PI b_m))))
(* (pow a 2.0) (* angle_m PI))))
(* t_0 (* a 0.011111111111111112))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (angle_m * ((double) M_PI)) * (b_m - a);
double t_1 = pow(b_m, 2.0) - pow(a, 2.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 0.011111111111111112 * (a * t_0);
} else if (t_1 <= 1e+241) {
tmp = (2.0 * (((a - b_m) * (a + b_m)) * sin((angle_m * (((double) M_PI) / -180.0))))) * cos((angle_m / (-180.0 / ((double) M_PI))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = 0.011111111111111112 * ((b_m * ((angle_m * (((double) M_PI) * (a - a))) + (angle_m * (((double) M_PI) * b_m)))) - (pow(a, 2.0) * (angle_m * ((double) M_PI))));
} else {
tmp = t_0 * (a * 0.011111111111111112);
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (angle_m * Math.PI) * (b_m - a);
double t_1 = Math.pow(b_m, 2.0) - Math.pow(a, 2.0);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * (a * t_0);
} else if (t_1 <= 1e+241) {
tmp = (2.0 * (((a - b_m) * (a + b_m)) * Math.sin((angle_m * (Math.PI / -180.0))))) * Math.cos((angle_m / (-180.0 / Math.PI)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((b_m * ((angle_m * (Math.PI * (a - a))) + (angle_m * (Math.PI * b_m)))) - (Math.pow(a, 2.0) * (angle_m * Math.PI)));
} else {
tmp = t_0 * (a * 0.011111111111111112);
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = (angle_m * math.pi) * (b_m - a) t_1 = math.pow(b_m, 2.0) - math.pow(a, 2.0) tmp = 0 if t_1 <= -math.inf: tmp = 0.011111111111111112 * (a * t_0) elif t_1 <= 1e+241: tmp = (2.0 * (((a - b_m) * (a + b_m)) * math.sin((angle_m * (math.pi / -180.0))))) * math.cos((angle_m / (-180.0 / math.pi))) elif t_1 <= math.inf: tmp = 0.011111111111111112 * ((b_m * ((angle_m * (math.pi * (a - a))) + (angle_m * (math.pi * b_m)))) - (math.pow(a, 2.0) * (angle_m * math.pi))) else: tmp = t_0 * (a * 0.011111111111111112) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(angle_m * pi) * Float64(b_m - a)) t_1 = Float64((b_m ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(0.011111111111111112 * Float64(a * t_0)); elseif (t_1 <= 1e+241) tmp = Float64(Float64(2.0 * Float64(Float64(Float64(a - b_m) * Float64(a + b_m)) * sin(Float64(angle_m * Float64(pi / -180.0))))) * cos(Float64(angle_m / Float64(-180.0 / pi)))); elseif (t_1 <= Inf) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * Float64(Float64(angle_m * Float64(pi * Float64(a - a))) + Float64(angle_m * Float64(pi * b_m)))) - Float64((a ^ 2.0) * Float64(angle_m * pi)))); else tmp = Float64(t_0 * Float64(a * 0.011111111111111112)); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = (angle_m * pi) * (b_m - a); t_1 = (b_m ^ 2.0) - (a ^ 2.0); tmp = 0.0; if (t_1 <= -Inf) tmp = 0.011111111111111112 * (a * t_0); elseif (t_1 <= 1e+241) tmp = (2.0 * (((a - b_m) * (a + b_m)) * sin((angle_m * (pi / -180.0))))) * cos((angle_m / (-180.0 / pi))); elseif (t_1 <= Inf) tmp = 0.011111111111111112 * ((b_m * ((angle_m * (pi * (a - a))) + (angle_m * (pi * b_m)))) - ((a ^ 2.0) * (angle_m * pi))); else tmp = t_0 * (a * 0.011111111111111112); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(0.011111111111111112 * N[(a * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+241], N[(N[(2.0 * N[(N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle$95$m / N[(-180.0 / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(0.011111111111111112 * N[(N[(b$95$m * N[(N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(a * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(angle\_m \cdot \pi\right) \cdot \left(b\_m - a\right)\\
t_1 := {b\_m}^{2} - {a}^{2}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot t\_0\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+241}:\\
\;\;\;\;\left(2 \cdot \left(\left(\left(a - b\_m\right) \cdot \left(a + b\_m\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right) \cdot \cos \left(\frac{angle\_m}{\frac{-180}{\pi}}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right) + angle\_m \cdot \left(\pi \cdot b\_m\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(a \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 63.1%
Taylor expanded in angle around 0 61.1%
unpow261.1%
unpow261.1%
difference-of-squares61.1%
Applied egg-rr61.1%
Taylor expanded in b around 0 61.1%
Taylor expanded in angle around 0 82.5%
associate-*r*82.6%
Simplified82.6%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.0000000000000001e241Initial program 66.5%
Simplified66.8%
unpow266.8%
unpow266.8%
difference-of-squares66.8%
Applied egg-rr66.8%
clear-num66.8%
un-div-inv67.0%
Applied egg-rr67.0%
if 1.0000000000000001e241 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 44.6%
Taylor expanded in angle around 0 49.6%
unpow249.6%
unpow249.6%
difference-of-squares49.6%
Applied egg-rr49.6%
Taylor expanded in b around 0 71.9%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
Taylor expanded in angle around 0 0.0%
unpow20.0%
unpow20.0%
difference-of-squares64.4%
Applied egg-rr64.4%
Taylor expanded in b around 0 38.9%
Taylor expanded in angle around 0 49.9%
associate-*r*49.9%
associate-*r*50.0%
Simplified50.0%
Final simplification70.2%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (* angle_m PI) (- b_m a)))
(t_1 (- (pow b_m 2.0) (pow a 2.0)))
(t_2 (* angle_m (/ PI -180.0))))
(*
angle_s
(if (<= t_1 (- INFINITY))
(* 0.011111111111111112 (* a t_0))
(if (<= t_1 1e+241)
(* (cos t_2) (* 2.0 (* (* (- a b_m) (+ a b_m)) (sin t_2))))
(if (<= t_1 INFINITY)
(*
0.011111111111111112
(-
(* b_m (+ (* angle_m (* PI (- a a))) (* angle_m (* PI b_m))))
(* (pow a 2.0) (* angle_m PI))))
(* t_0 (* a 0.011111111111111112))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (angle_m * ((double) M_PI)) * (b_m - a);
double t_1 = pow(b_m, 2.0) - pow(a, 2.0);
double t_2 = angle_m * (((double) M_PI) / -180.0);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = 0.011111111111111112 * (a * t_0);
} else if (t_1 <= 1e+241) {
tmp = cos(t_2) * (2.0 * (((a - b_m) * (a + b_m)) * sin(t_2)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = 0.011111111111111112 * ((b_m * ((angle_m * (((double) M_PI) * (a - a))) + (angle_m * (((double) M_PI) * b_m)))) - (pow(a, 2.0) * (angle_m * ((double) M_PI))));
} else {
tmp = t_0 * (a * 0.011111111111111112);
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (angle_m * Math.PI) * (b_m - a);
double t_1 = Math.pow(b_m, 2.0) - Math.pow(a, 2.0);
double t_2 = angle_m * (Math.PI / -180.0);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * (a * t_0);
} else if (t_1 <= 1e+241) {
tmp = Math.cos(t_2) * (2.0 * (((a - b_m) * (a + b_m)) * Math.sin(t_2)));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = 0.011111111111111112 * ((b_m * ((angle_m * (Math.PI * (a - a))) + (angle_m * (Math.PI * b_m)))) - (Math.pow(a, 2.0) * (angle_m * Math.PI)));
} else {
tmp = t_0 * (a * 0.011111111111111112);
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = (angle_m * math.pi) * (b_m - a) t_1 = math.pow(b_m, 2.0) - math.pow(a, 2.0) t_2 = angle_m * (math.pi / -180.0) tmp = 0 if t_1 <= -math.inf: tmp = 0.011111111111111112 * (a * t_0) elif t_1 <= 1e+241: tmp = math.cos(t_2) * (2.0 * (((a - b_m) * (a + b_m)) * math.sin(t_2))) elif t_1 <= math.inf: tmp = 0.011111111111111112 * ((b_m * ((angle_m * (math.pi * (a - a))) + (angle_m * (math.pi * b_m)))) - (math.pow(a, 2.0) * (angle_m * math.pi))) else: tmp = t_0 * (a * 0.011111111111111112) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(angle_m * pi) * Float64(b_m - a)) t_1 = Float64((b_m ^ 2.0) - (a ^ 2.0)) t_2 = Float64(angle_m * Float64(pi / -180.0)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(0.011111111111111112 * Float64(a * t_0)); elseif (t_1 <= 1e+241) tmp = Float64(cos(t_2) * Float64(2.0 * Float64(Float64(Float64(a - b_m) * Float64(a + b_m)) * sin(t_2)))); elseif (t_1 <= Inf) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * Float64(Float64(angle_m * Float64(pi * Float64(a - a))) + Float64(angle_m * Float64(pi * b_m)))) - Float64((a ^ 2.0) * Float64(angle_m * pi)))); else tmp = Float64(t_0 * Float64(a * 0.011111111111111112)); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = (angle_m * pi) * (b_m - a); t_1 = (b_m ^ 2.0) - (a ^ 2.0); t_2 = angle_m * (pi / -180.0); tmp = 0.0; if (t_1 <= -Inf) tmp = 0.011111111111111112 * (a * t_0); elseif (t_1 <= 1e+241) tmp = cos(t_2) * (2.0 * (((a - b_m) * (a + b_m)) * sin(t_2))); elseif (t_1 <= Inf) tmp = 0.011111111111111112 * ((b_m * ((angle_m * (pi * (a - a))) + (angle_m * (pi * b_m)))) - ((a ^ 2.0) * (angle_m * pi))); else tmp = t_0 * (a * 0.011111111111111112); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, (-Infinity)], N[(0.011111111111111112 * N[(a * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+241], N[(N[Cos[t$95$2], $MachinePrecision] * N[(2.0 * N[(N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(0.011111111111111112 * N[(N[(b$95$m * N[(N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(a * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(angle\_m \cdot \pi\right) \cdot \left(b\_m - a\right)\\
t_1 := {b\_m}^{2} - {a}^{2}\\
t_2 := angle\_m \cdot \frac{\pi}{-180}\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot t\_0\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+241}:\\
\;\;\;\;\cos t\_2 \cdot \left(2 \cdot \left(\left(\left(a - b\_m\right) \cdot \left(a + b\_m\right)\right) \cdot \sin t\_2\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right) + angle\_m \cdot \left(\pi \cdot b\_m\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(a \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 63.1%
Taylor expanded in angle around 0 61.1%
unpow261.1%
unpow261.1%
difference-of-squares61.1%
Applied egg-rr61.1%
Taylor expanded in b around 0 61.1%
Taylor expanded in angle around 0 82.5%
associate-*r*82.6%
Simplified82.6%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 1.0000000000000001e241Initial program 66.5%
Simplified66.8%
unpow266.8%
unpow266.8%
difference-of-squares66.8%
Applied egg-rr66.8%
if 1.0000000000000001e241 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < +inf.0Initial program 44.6%
Taylor expanded in angle around 0 49.6%
unpow249.6%
unpow249.6%
difference-of-squares49.6%
Applied egg-rr49.6%
Taylor expanded in b around 0 71.9%
if +inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 0.0%
Taylor expanded in angle around 0 0.0%
unpow20.0%
unpow20.0%
difference-of-squares64.4%
Applied egg-rr64.4%
Taylor expanded in b around 0 38.9%
Taylor expanded in angle around 0 49.9%
associate-*r*49.9%
associate-*r*50.0%
Simplified50.0%
Final simplification70.1%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (- a b_m) (+ a b_m)))
(t_1 (* angle_m (* PI -0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+247)
(* (* (cos t_1) 2.0) (* (- a b_m) (* (+ a b_m) (sin t_1))))
(if (<= (/ angle_m 180.0) 4e+291)
(*
(cos (* angle_m (/ (cbrt (pow PI 3.0)) -180.0)))
(* 2.0 (* t_0 (sin (/ PI (/ 180.0 angle_m))))))
(*
(cos (* angle_m (log (+ 1.0 (expm1 (* PI -0.005555555555555556))))))
(* 2.0 (* t_0 (sin (* angle_m (/ PI -180.0)))))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (a - b_m) * (a + b_m);
double t_1 = angle_m * (((double) M_PI) * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 5e+247) {
tmp = (cos(t_1) * 2.0) * ((a - b_m) * ((a + b_m) * sin(t_1)));
} else if ((angle_m / 180.0) <= 4e+291) {
tmp = cos((angle_m * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * (2.0 * (t_0 * sin((((double) M_PI) / (180.0 / angle_m)))));
} else {
tmp = cos((angle_m * log((1.0 + expm1((((double) M_PI) * -0.005555555555555556)))))) * (2.0 * (t_0 * sin((angle_m * (((double) M_PI) / -180.0)))));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (a - b_m) * (a + b_m);
double t_1 = angle_m * (Math.PI * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 5e+247) {
tmp = (Math.cos(t_1) * 2.0) * ((a - b_m) * ((a + b_m) * Math.sin(t_1)));
} else if ((angle_m / 180.0) <= 4e+291) {
tmp = Math.cos((angle_m * (Math.cbrt(Math.pow(Math.PI, 3.0)) / -180.0))) * (2.0 * (t_0 * Math.sin((Math.PI / (180.0 / angle_m)))));
} else {
tmp = Math.cos((angle_m * Math.log((1.0 + Math.expm1((Math.PI * -0.005555555555555556)))))) * (2.0 * (t_0 * Math.sin((angle_m * (Math.PI / -180.0)))));
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(a - b_m) * Float64(a + b_m)) t_1 = Float64(angle_m * Float64(pi * -0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e+247) tmp = Float64(Float64(cos(t_1) * 2.0) * Float64(Float64(a - b_m) * Float64(Float64(a + b_m) * sin(t_1)))); elseif (Float64(angle_m / 180.0) <= 4e+291) tmp = Float64(cos(Float64(angle_m * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(2.0 * Float64(t_0 * sin(Float64(pi / Float64(180.0 / angle_m)))))); else tmp = Float64(cos(Float64(angle_m * log(Float64(1.0 + expm1(Float64(pi * -0.005555555555555556)))))) * Float64(2.0 * Float64(t_0 * sin(Float64(angle_m * Float64(pi / -180.0)))))); end return Float64(angle_s * tmp) end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+247], N[(N[(N[Cos[t$95$1], $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(a - b$95$m), $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 4e+291], N[(N[Cos[N[(angle$95$m * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(t$95$0 * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle$95$m * N[Log[N[(1.0 + N[(Exp[N[(Pi * -0.005555555555555556), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(t$95$0 * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(a - b\_m\right) \cdot \left(a + b\_m\right)\\
t_1 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+247}:\\
\;\;\;\;\left(\cos t\_1 \cdot 2\right) \cdot \left(\left(a - b\_m\right) \cdot \left(\left(a + b\_m\right) \cdot \sin t\_1\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 4 \cdot 10^{+291}:\\
\;\;\;\;\cos \left(angle\_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(2 \cdot \left(t\_0 \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(angle\_m \cdot \log \left(1 + \mathsf{expm1}\left(\pi \cdot -0.005555555555555556\right)\right)\right) \cdot \left(2 \cdot \left(t\_0 \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000023e247Initial program 59.2%
Simplified59.2%
unpow259.2%
unpow259.2%
difference-of-squares62.7%
Applied egg-rr62.7%
add-cbrt-cube34.4%
pow332.4%
div-inv32.4%
metadata-eval32.4%
Applied egg-rr32.4%
expm1-log1p-u23.6%
expm1-undefine20.2%
Applied egg-rr33.3%
expm1-define47.4%
associate-*r*44.0%
*-commutative44.0%
associate-*l*44.0%
*-commutative44.0%
*-commutative44.0%
+-commutative44.0%
associate-*r*45.8%
*-commutative45.8%
Simplified45.8%
expm1-log1p-u62.7%
associate-*r*62.7%
*-commutative62.7%
associate-*l*74.8%
+-commutative74.8%
*-commutative74.8%
Applied egg-rr74.8%
if 5.00000000000000023e247 < (/.f64 angle #s(literal 180 binary64)) < 3.9999999999999998e291Initial program 10.4%
Simplified10.6%
unpow210.6%
unpow210.6%
difference-of-squares19.7%
Applied egg-rr19.7%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod20.5%
add-sqr-sqrt14.3%
clear-num14.3%
un-div-inv15.4%
Applied egg-rr15.4%
add-cbrt-cube27.8%
pow327.8%
Applied egg-rr27.8%
if 3.9999999999999998e291 < (/.f64 angle #s(literal 180 binary64)) Initial program 48.4%
Simplified48.4%
unpow248.4%
unpow248.4%
difference-of-squares48.4%
Applied egg-rr48.4%
log1p-expm1-u48.4%
log1p-undefine74.3%
div-inv74.3%
metadata-eval74.3%
Applied egg-rr77.5%
Final simplification72.8%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (- a b_m) (+ a b_m)))
(t_1 (* angle_m (* PI -0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 5e+247)
(* (* (cos t_1) 2.0) (* (- a b_m) (* (+ a b_m) (sin t_1))))
(if (<= (/ angle_m 180.0) 1e+293)
(*
(cos (* angle_m (/ (cbrt (pow PI 3.0)) -180.0)))
(* 2.0 (* t_0 (sin (/ PI (/ 180.0 angle_m))))))
(*
(* 2.0 (* t_0 (sin (* angle_m (/ PI -180.0)))))
(cos (* PI (* angle_m -0.005555555555555556)))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (a - b_m) * (a + b_m);
double t_1 = angle_m * (((double) M_PI) * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 5e+247) {
tmp = (cos(t_1) * 2.0) * ((a - b_m) * ((a + b_m) * sin(t_1)));
} else if ((angle_m / 180.0) <= 1e+293) {
tmp = cos((angle_m * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * (2.0 * (t_0 * sin((((double) M_PI) / (180.0 / angle_m)))));
} else {
tmp = (2.0 * (t_0 * sin((angle_m * (((double) M_PI) / -180.0))))) * cos((((double) M_PI) * (angle_m * -0.005555555555555556)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (a - b_m) * (a + b_m);
double t_1 = angle_m * (Math.PI * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 5e+247) {
tmp = (Math.cos(t_1) * 2.0) * ((a - b_m) * ((a + b_m) * Math.sin(t_1)));
} else if ((angle_m / 180.0) <= 1e+293) {
tmp = Math.cos((angle_m * (Math.cbrt(Math.pow(Math.PI, 3.0)) / -180.0))) * (2.0 * (t_0 * Math.sin((Math.PI / (180.0 / angle_m)))));
} else {
tmp = (2.0 * (t_0 * Math.sin((angle_m * (Math.PI / -180.0))))) * Math.cos((Math.PI * (angle_m * -0.005555555555555556)));
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(a - b_m) * Float64(a + b_m)) t_1 = Float64(angle_m * Float64(pi * -0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e+247) tmp = Float64(Float64(cos(t_1) * 2.0) * Float64(Float64(a - b_m) * Float64(Float64(a + b_m) * sin(t_1)))); elseif (Float64(angle_m / 180.0) <= 1e+293) tmp = Float64(cos(Float64(angle_m * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(2.0 * Float64(t_0 * sin(Float64(pi / Float64(180.0 / angle_m)))))); else tmp = Float64(Float64(2.0 * Float64(t_0 * sin(Float64(angle_m * Float64(pi / -180.0))))) * cos(Float64(pi * Float64(angle_m * -0.005555555555555556)))); end return Float64(angle_s * tmp) end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+247], N[(N[(N[Cos[t$95$1], $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(a - b$95$m), $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+293], N[(N[Cos[N[(angle$95$m * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(t$95$0 * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(t$95$0 * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(a - b\_m\right) \cdot \left(a + b\_m\right)\\
t_1 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+247}:\\
\;\;\;\;\left(\cos t\_1 \cdot 2\right) \cdot \left(\left(a - b\_m\right) \cdot \left(\left(a + b\_m\right) \cdot \sin t\_1\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 10^{+293}:\\
\;\;\;\;\cos \left(angle\_m \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(2 \cdot \left(t\_0 \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(t\_0 \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right) \cdot \cos \left(\pi \cdot \left(angle\_m \cdot -0.005555555555555556\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000023e247Initial program 59.2%
Simplified59.2%
unpow259.2%
unpow259.2%
difference-of-squares62.7%
Applied egg-rr62.7%
add-cbrt-cube34.4%
pow332.4%
div-inv32.4%
metadata-eval32.4%
Applied egg-rr32.4%
expm1-log1p-u23.6%
expm1-undefine20.2%
Applied egg-rr33.3%
expm1-define47.4%
associate-*r*44.0%
*-commutative44.0%
associate-*l*44.0%
*-commutative44.0%
*-commutative44.0%
+-commutative44.0%
associate-*r*45.8%
*-commutative45.8%
Simplified45.8%
expm1-log1p-u62.7%
associate-*r*62.7%
*-commutative62.7%
associate-*l*74.8%
+-commutative74.8%
*-commutative74.8%
Applied egg-rr74.8%
if 5.00000000000000023e247 < (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999992e292Initial program 10.8%
Simplified11.0%
unpow211.0%
unpow211.0%
difference-of-squares19.4%
Applied egg-rr19.4%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
associate-*r/0.0%
associate-*r/0.0%
frac-times0.0%
*-commutative0.0%
*-commutative0.0%
metadata-eval0.0%
metadata-eval0.0%
frac-times0.0%
associate-*r/0.0%
associate-*r/0.0%
sqrt-unprod20.5%
add-sqr-sqrt13.4%
clear-num13.4%
un-div-inv14.4%
Applied egg-rr14.4%
add-cbrt-cube26.8%
pow326.8%
Applied egg-rr26.8%
if 9.9999999999999992e292 < (/.f64 angle #s(literal 180 binary64)) Initial program 53.8%
Simplified53.8%
unpow253.8%
unpow253.8%
difference-of-squares53.8%
Applied egg-rr53.8%
Taylor expanded in angle around inf 69.8%
associate-*r*87.2%
Simplified87.2%
Final simplification72.8%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* PI -0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 2e+246)
(* (* (cos t_0) 2.0) (* (- a b_m) (* (+ a b_m) (sin t_0))))
(*
(cos (* angle_m (/ PI -180.0)))
(*
2.0
(*
(sin (* angle_m (log (+ 1.0 (expm1 (* PI -0.005555555555555556))))))
(* (- a b_m) (+ a b_m)))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * (((double) M_PI) * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 2e+246) {
tmp = (cos(t_0) * 2.0) * ((a - b_m) * ((a + b_m) * sin(t_0)));
} else {
tmp = cos((angle_m * (((double) M_PI) / -180.0))) * (2.0 * (sin((angle_m * log((1.0 + expm1((((double) M_PI) * -0.005555555555555556)))))) * ((a - b_m) * (a + b_m))));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = angle_m * (Math.PI * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 2e+246) {
tmp = (Math.cos(t_0) * 2.0) * ((a - b_m) * ((a + b_m) * Math.sin(t_0)));
} else {
tmp = Math.cos((angle_m * (Math.PI / -180.0))) * (2.0 * (Math.sin((angle_m * Math.log((1.0 + Math.expm1((Math.PI * -0.005555555555555556)))))) * ((a - b_m) * (a + b_m))));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = angle_m * (math.pi * -0.005555555555555556) tmp = 0 if (angle_m / 180.0) <= 2e+246: tmp = (math.cos(t_0) * 2.0) * ((a - b_m) * ((a + b_m) * math.sin(t_0))) else: tmp = math.cos((angle_m * (math.pi / -180.0))) * (2.0 * (math.sin((angle_m * math.log((1.0 + math.expm1((math.pi * -0.005555555555555556)))))) * ((a - b_m) * (a + b_m)))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(angle_m * Float64(pi * -0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e+246) tmp = Float64(Float64(cos(t_0) * 2.0) * Float64(Float64(a - b_m) * Float64(Float64(a + b_m) * sin(t_0)))); else tmp = Float64(cos(Float64(angle_m * Float64(pi / -180.0))) * Float64(2.0 * Float64(sin(Float64(angle_m * log(Float64(1.0 + expm1(Float64(pi * -0.005555555555555556)))))) * Float64(Float64(a - b_m) * Float64(a + b_m))))); end return Float64(angle_s * tmp) end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+246], N[(N[(N[Cos[t$95$0], $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(a - b$95$m), $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(angle$95$m * N[Log[N[(1.0 + N[(Exp[N[(Pi * -0.005555555555555556), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+246}:\\
\;\;\;\;\left(\cos t\_0 \cdot 2\right) \cdot \left(\left(a - b\_m\right) \cdot \left(\left(a + b\_m\right) \cdot \sin t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(angle\_m \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(\sin \left(angle\_m \cdot \log \left(1 + \mathsf{expm1}\left(\pi \cdot -0.005555555555555556\right)\right)\right) \cdot \left(\left(a - b\_m\right) \cdot \left(a + b\_m\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.00000000000000014e246Initial program 59.2%
Simplified59.2%
unpow259.2%
unpow259.2%
difference-of-squares62.7%
Applied egg-rr62.7%
add-cbrt-cube34.4%
pow332.4%
div-inv32.4%
metadata-eval32.4%
Applied egg-rr32.4%
expm1-log1p-u23.6%
expm1-undefine20.2%
Applied egg-rr33.3%
expm1-define47.4%
associate-*r*44.0%
*-commutative44.0%
associate-*l*44.0%
*-commutative44.0%
*-commutative44.0%
+-commutative44.0%
associate-*r*45.8%
*-commutative45.8%
Simplified45.8%
expm1-log1p-u62.7%
associate-*r*62.7%
*-commutative62.7%
associate-*l*74.8%
+-commutative74.8%
*-commutative74.8%
Applied egg-rr74.8%
if 2.00000000000000014e246 < (/.f64 angle #s(literal 180 binary64)) Initial program 25.2%
Simplified25.3%
unpow225.3%
unpow225.3%
difference-of-squares30.9%
Applied egg-rr30.9%
log1p-expm1-u30.9%
log1p-undefine42.0%
div-inv42.0%
metadata-eval42.0%
Applied egg-rr42.0%
Final simplification72.5%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* (- a b_m) (+ a b_m)))
(t_1 (* angle_m (* PI -0.005555555555555556))))
(*
angle_s
(if (<= (/ angle_m 180.0) 1e+17)
(* (* (cos t_1) 2.0) (* (- a b_m) (* (+ a b_m) (sin t_1))))
(if (<= (/ angle_m 180.0) 5e+190)
(*
(* 2.0 (* t_0 (sin (/ PI (/ 180.0 angle_m)))))
(cos (* -0.005555555555555556 (* angle_m PI))))
(*
(* 2.0 (* t_0 (sin (* angle_m (/ PI -180.0)))))
(cos (* PI (* angle_m -0.005555555555555556)))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (a - b_m) * (a + b_m);
double t_1 = angle_m * (((double) M_PI) * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e+17) {
tmp = (cos(t_1) * 2.0) * ((a - b_m) * ((a + b_m) * sin(t_1)));
} else if ((angle_m / 180.0) <= 5e+190) {
tmp = (2.0 * (t_0 * sin((((double) M_PI) / (180.0 / angle_m))))) * cos((-0.005555555555555556 * (angle_m * ((double) M_PI))));
} else {
tmp = (2.0 * (t_0 * sin((angle_m * (((double) M_PI) / -180.0))))) * cos((((double) M_PI) * (angle_m * -0.005555555555555556)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = (a - b_m) * (a + b_m);
double t_1 = angle_m * (Math.PI * -0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 1e+17) {
tmp = (Math.cos(t_1) * 2.0) * ((a - b_m) * ((a + b_m) * Math.sin(t_1)));
} else if ((angle_m / 180.0) <= 5e+190) {
tmp = (2.0 * (t_0 * Math.sin((Math.PI / (180.0 / angle_m))))) * Math.cos((-0.005555555555555556 * (angle_m * Math.PI)));
} else {
tmp = (2.0 * (t_0 * Math.sin((angle_m * (Math.PI / -180.0))))) * Math.cos((Math.PI * (angle_m * -0.005555555555555556)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = (a - b_m) * (a + b_m) t_1 = angle_m * (math.pi * -0.005555555555555556) tmp = 0 if (angle_m / 180.0) <= 1e+17: tmp = (math.cos(t_1) * 2.0) * ((a - b_m) * ((a + b_m) * math.sin(t_1))) elif (angle_m / 180.0) <= 5e+190: tmp = (2.0 * (t_0 * math.sin((math.pi / (180.0 / angle_m))))) * math.cos((-0.005555555555555556 * (angle_m * math.pi))) else: tmp = (2.0 * (t_0 * math.sin((angle_m * (math.pi / -180.0))))) * math.cos((math.pi * (angle_m * -0.005555555555555556))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(Float64(a - b_m) * Float64(a + b_m)) t_1 = Float64(angle_m * Float64(pi * -0.005555555555555556)) tmp = 0.0 if (Float64(angle_m / 180.0) <= 1e+17) tmp = Float64(Float64(cos(t_1) * 2.0) * Float64(Float64(a - b_m) * Float64(Float64(a + b_m) * sin(t_1)))); elseif (Float64(angle_m / 180.0) <= 5e+190) tmp = Float64(Float64(2.0 * Float64(t_0 * sin(Float64(pi / Float64(180.0 / angle_m))))) * cos(Float64(-0.005555555555555556 * Float64(angle_m * pi)))); else tmp = Float64(Float64(2.0 * Float64(t_0 * sin(Float64(angle_m * Float64(pi / -180.0))))) * cos(Float64(pi * Float64(angle_m * -0.005555555555555556)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = (a - b_m) * (a + b_m); t_1 = angle_m * (pi * -0.005555555555555556); tmp = 0.0; if ((angle_m / 180.0) <= 1e+17) tmp = (cos(t_1) * 2.0) * ((a - b_m) * ((a + b_m) * sin(t_1))); elseif ((angle_m / 180.0) <= 5e+190) tmp = (2.0 * (t_0 * sin((pi / (180.0 / angle_m))))) * cos((-0.005555555555555556 * (angle_m * pi))); else tmp = (2.0 * (t_0 * sin((angle_m * (pi / -180.0))))) * cos((pi * (angle_m * -0.005555555555555556))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(angle$95$m * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 1e+17], N[(N[(N[Cos[t$95$1], $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(a - b$95$m), $MachinePrecision] * N[(N[(a + b$95$m), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e+190], N[(N[(2.0 * N[(t$95$0 * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(-0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(t$95$0 * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(a - b\_m\right) \cdot \left(a + b\_m\right)\\
t_1 := angle\_m \cdot \left(\pi \cdot -0.005555555555555556\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 10^{+17}:\\
\;\;\;\;\left(\cos t\_1 \cdot 2\right) \cdot \left(\left(a - b\_m\right) \cdot \left(\left(a + b\_m\right) \cdot \sin t\_1\right)\right)\\
\mathbf{elif}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{+190}:\\
\;\;\;\;\left(2 \cdot \left(t\_0 \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)\right) \cdot \cos \left(-0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(t\_0 \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\right) \cdot \cos \left(\pi \cdot \left(angle\_m \cdot -0.005555555555555556\right)\right)\\
\end{array}
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1e17Initial program 65.6%
Simplified65.7%
unpow265.7%
unpow265.7%
difference-of-squares68.3%
Applied egg-rr68.3%
add-cbrt-cube36.6%
pow335.3%
div-inv35.3%
metadata-eval35.3%
Applied egg-rr35.3%
expm1-log1p-u25.5%
expm1-undefine21.5%
Applied egg-rr35.6%
expm1-define51.8%
associate-*r*47.9%
*-commutative47.9%
associate-*l*47.9%
*-commutative47.9%
*-commutative47.9%
+-commutative47.9%
associate-*r*50.8%
*-commutative50.8%
Simplified50.8%
expm1-log1p-u68.3%
associate-*r*68.3%
*-commutative68.3%
associate-*l*82.4%
+-commutative82.4%
*-commutative82.4%
Applied egg-rr82.4%
if 1e17 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000036e190Initial program 19.8%
Simplified19.3%
unpow219.3%
unpow219.3%
difference-of-squares27.0%
Applied egg-rr27.0%
add-sqr-sqrt0.0%
sqrt-unprod38.9%
associate-*r/35.1%
associate-*r/31.2%
frac-times31.2%
*-commutative31.2%
*-commutative31.2%
metadata-eval31.2%
metadata-eval31.2%
frac-times31.2%
associate-*r/27.4%
associate-*r/30.5%
sqrt-unprod34.5%
add-sqr-sqrt39.6%
clear-num44.0%
un-div-inv48.0%
Applied egg-rr48.0%
Taylor expanded in angle around inf 51.9%
if 5.00000000000000036e190 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.3%
Simplified24.6%
unpow224.6%
unpow224.6%
difference-of-squares32.3%
Applied egg-rr32.3%
Taylor expanded in angle around inf 35.3%
associate-*r*36.1%
Simplified36.1%
Final simplification74.6%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= a 2.65e-226)
(* (pow b_m 2.0) (- (sin (* PI (* angle_m -0.011111111111111112)))))
(if (<= a 1.1e+84)
(*
0.011111111111111112
(-
(* b_m (+ (* angle_m (* PI (- a a))) (* angle_m (* PI b_m))))
(* (pow a 2.0) (* angle_m PI))))
(if (<= a 1.8e+160)
(* 2.0 (* (* (- a b_m) (+ a b_m)) (sin (* angle_m (/ PI -180.0)))))
(* 0.011111111111111112 (* a (* (* angle_m PI) (- b_m a)))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (a <= 2.65e-226) {
tmp = pow(b_m, 2.0) * -sin((((double) M_PI) * (angle_m * -0.011111111111111112)));
} else if (a <= 1.1e+84) {
tmp = 0.011111111111111112 * ((b_m * ((angle_m * (((double) M_PI) * (a - a))) + (angle_m * (((double) M_PI) * b_m)))) - (pow(a, 2.0) * (angle_m * ((double) M_PI))));
} else if (a <= 1.8e+160) {
tmp = 2.0 * (((a - b_m) * (a + b_m)) * sin((angle_m * (((double) M_PI) / -180.0))));
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * ((double) M_PI)) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (a <= 2.65e-226) {
tmp = Math.pow(b_m, 2.0) * -Math.sin((Math.PI * (angle_m * -0.011111111111111112)));
} else if (a <= 1.1e+84) {
tmp = 0.011111111111111112 * ((b_m * ((angle_m * (Math.PI * (a - a))) + (angle_m * (Math.PI * b_m)))) - (Math.pow(a, 2.0) * (angle_m * Math.PI)));
} else if (a <= 1.8e+160) {
tmp = 2.0 * (((a - b_m) * (a + b_m)) * Math.sin((angle_m * (Math.PI / -180.0))));
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * Math.PI) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if a <= 2.65e-226: tmp = math.pow(b_m, 2.0) * -math.sin((math.pi * (angle_m * -0.011111111111111112))) elif a <= 1.1e+84: tmp = 0.011111111111111112 * ((b_m * ((angle_m * (math.pi * (a - a))) + (angle_m * (math.pi * b_m)))) - (math.pow(a, 2.0) * (angle_m * math.pi))) elif a <= 1.8e+160: tmp = 2.0 * (((a - b_m) * (a + b_m)) * math.sin((angle_m * (math.pi / -180.0)))) else: tmp = 0.011111111111111112 * (a * ((angle_m * math.pi) * (b_m - a))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (a <= 2.65e-226) tmp = Float64((b_m ^ 2.0) * Float64(-sin(Float64(pi * Float64(angle_m * -0.011111111111111112))))); elseif (a <= 1.1e+84) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * Float64(Float64(angle_m * Float64(pi * Float64(a - a))) + Float64(angle_m * Float64(pi * b_m)))) - Float64((a ^ 2.0) * Float64(angle_m * pi)))); elseif (a <= 1.8e+160) tmp = Float64(2.0 * Float64(Float64(Float64(a - b_m) * Float64(a + b_m)) * sin(Float64(angle_m * Float64(pi / -180.0))))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(Float64(angle_m * pi) * Float64(b_m - a)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (a <= 2.65e-226) tmp = (b_m ^ 2.0) * -sin((pi * (angle_m * -0.011111111111111112))); elseif (a <= 1.1e+84) tmp = 0.011111111111111112 * ((b_m * ((angle_m * (pi * (a - a))) + (angle_m * (pi * b_m)))) - ((a ^ 2.0) * (angle_m * pi))); elseif (a <= 1.8e+160) tmp = 2.0 * (((a - b_m) * (a + b_m)) * sin((angle_m * (pi / -180.0)))); else tmp = 0.011111111111111112 * (a * ((angle_m * pi) * (b_m - a))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 2.65e-226], N[(N[Power[b$95$m, 2.0], $MachinePrecision] * (-N[Sin[N[(Pi * N[(angle$95$m * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[a, 1.1e+84], N[(0.011111111111111112 * N[(N[(b$95$m * N[(N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e+160], N[(2.0 * N[(N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 2.65 \cdot 10^{-226}:\\
\;\;\;\;{b\_m}^{2} \cdot \left(-\sin \left(\pi \cdot \left(angle\_m \cdot -0.011111111111111112\right)\right)\right)\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{+84}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right) + angle\_m \cdot \left(\pi \cdot b\_m\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+160}:\\
\;\;\;\;2 \cdot \left(\left(\left(a - b\_m\right) \cdot \left(a + b\_m\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b\_m - a\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.6500000000000002e-226Initial program 56.9%
Simplified56.7%
Applied egg-rr37.1%
Taylor expanded in a around 0 38.1%
associate-*r*38.1%
mul-1-neg38.1%
associate-*r*38.2%
Simplified38.2%
if 2.6500000000000002e-226 < a < 1.0999999999999999e84Initial program 58.9%
Taylor expanded in angle around 0 60.1%
unpow260.1%
unpow260.1%
difference-of-squares60.1%
Applied egg-rr60.1%
Taylor expanded in b around 0 69.5%
if 1.0999999999999999e84 < a < 1.80000000000000011e160Initial program 77.3%
Simplified77.3%
unpow277.3%
unpow277.3%
difference-of-squares77.3%
Applied egg-rr77.3%
Taylor expanded in angle around 0 92.8%
if 1.80000000000000011e160 < a Initial program 45.5%
Taylor expanded in angle around 0 42.1%
unpow242.1%
unpow242.1%
difference-of-squares60.1%
Applied egg-rr60.1%
Taylor expanded in b around 0 56.6%
Taylor expanded in angle around 0 72.3%
associate-*r*72.3%
Simplified72.3%
Final simplification51.1%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0
(* 2.0 (* (* (- a b_m) (+ a b_m)) (sin (* angle_m (/ PI -180.0)))))))
(*
angle_s
(if (<= a 3.3e-226)
t_0
(if (<= a 1.95e+83)
(*
0.011111111111111112
(-
(* b_m (+ (* angle_m (* PI (- a a))) (* angle_m (* PI b_m))))
(* (pow a 2.0) (* angle_m PI))))
(if (<= a 1.8e+160)
t_0
(* 0.011111111111111112 (* a (* (* angle_m PI) (- b_m a))))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = 2.0 * (((a - b_m) * (a + b_m)) * sin((angle_m * (((double) M_PI) / -180.0))));
double tmp;
if (a <= 3.3e-226) {
tmp = t_0;
} else if (a <= 1.95e+83) {
tmp = 0.011111111111111112 * ((b_m * ((angle_m * (((double) M_PI) * (a - a))) + (angle_m * (((double) M_PI) * b_m)))) - (pow(a, 2.0) * (angle_m * ((double) M_PI))));
} else if (a <= 1.8e+160) {
tmp = t_0;
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * ((double) M_PI)) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = 2.0 * (((a - b_m) * (a + b_m)) * Math.sin((angle_m * (Math.PI / -180.0))));
double tmp;
if (a <= 3.3e-226) {
tmp = t_0;
} else if (a <= 1.95e+83) {
tmp = 0.011111111111111112 * ((b_m * ((angle_m * (Math.PI * (a - a))) + (angle_m * (Math.PI * b_m)))) - (Math.pow(a, 2.0) * (angle_m * Math.PI)));
} else if (a <= 1.8e+160) {
tmp = t_0;
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * Math.PI) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = 2.0 * (((a - b_m) * (a + b_m)) * math.sin((angle_m * (math.pi / -180.0)))) tmp = 0 if a <= 3.3e-226: tmp = t_0 elif a <= 1.95e+83: tmp = 0.011111111111111112 * ((b_m * ((angle_m * (math.pi * (a - a))) + (angle_m * (math.pi * b_m)))) - (math.pow(a, 2.0) * (angle_m * math.pi))) elif a <= 1.8e+160: tmp = t_0 else: tmp = 0.011111111111111112 * (a * ((angle_m * math.pi) * (b_m - a))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(2.0 * Float64(Float64(Float64(a - b_m) * Float64(a + b_m)) * sin(Float64(angle_m * Float64(pi / -180.0))))) tmp = 0.0 if (a <= 3.3e-226) tmp = t_0; elseif (a <= 1.95e+83) tmp = Float64(0.011111111111111112 * Float64(Float64(b_m * Float64(Float64(angle_m * Float64(pi * Float64(a - a))) + Float64(angle_m * Float64(pi * b_m)))) - Float64((a ^ 2.0) * Float64(angle_m * pi)))); elseif (a <= 1.8e+160) tmp = t_0; else tmp = Float64(0.011111111111111112 * Float64(a * Float64(Float64(angle_m * pi) * Float64(b_m - a)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = 2.0 * (((a - b_m) * (a + b_m)) * sin((angle_m * (pi / -180.0)))); tmp = 0.0; if (a <= 3.3e-226) tmp = t_0; elseif (a <= 1.95e+83) tmp = 0.011111111111111112 * ((b_m * ((angle_m * (pi * (a - a))) + (angle_m * (pi * b_m)))) - ((a ^ 2.0) * (angle_m * pi))); elseif (a <= 1.8e+160) tmp = t_0; else tmp = 0.011111111111111112 * (a * ((angle_m * pi) * (b_m - a))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[a, 3.3e-226], t$95$0, If[LessEqual[a, 1.95e+83], N[(0.011111111111111112 * N[(N[(b$95$m * N[(N[(angle$95$m * N[(Pi * N[(a - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(angle$95$m * N[(Pi * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[a, 2.0], $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e+160], t$95$0, N[(0.011111111111111112 * N[(a * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left(\left(\left(a - b\_m\right) \cdot \left(a + b\_m\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 3.3 \cdot 10^{-226}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{+83}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b\_m \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a - a\right)\right) + angle\_m \cdot \left(\pi \cdot b\_m\right)\right) - {a}^{2} \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+160}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b\_m - a\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if a < 3.3e-226 or 1.9500000000000001e83 < a < 1.80000000000000011e160Initial program 58.0%
Simplified57.8%
unpow257.8%
unpow257.8%
difference-of-squares59.7%
Applied egg-rr59.7%
Taylor expanded in angle around 0 60.8%
if 3.3e-226 < a < 1.9500000000000001e83Initial program 58.9%
Taylor expanded in angle around 0 60.1%
unpow260.1%
unpow260.1%
difference-of-squares60.1%
Applied egg-rr60.1%
Taylor expanded in b around 0 69.5%
if 1.80000000000000011e160 < a Initial program 45.5%
Taylor expanded in angle around 0 42.1%
unpow242.1%
unpow242.1%
difference-of-squares60.1%
Applied egg-rr60.1%
Taylor expanded in b around 0 56.6%
Taylor expanded in angle around 0 72.3%
associate-*r*72.3%
Simplified72.3%
Final simplification64.1%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= a 3.3e+162)
(* 2.0 (* (* (- a b_m) (+ a b_m)) (sin (* angle_m (/ PI -180.0)))))
(* 0.011111111111111112 (* a (* (* angle_m PI) (- b_m a)))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (a <= 3.3e+162) {
tmp = 2.0 * (((a - b_m) * (a + b_m)) * sin((angle_m * (((double) M_PI) / -180.0))));
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * ((double) M_PI)) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (a <= 3.3e+162) {
tmp = 2.0 * (((a - b_m) * (a + b_m)) * Math.sin((angle_m * (Math.PI / -180.0))));
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * Math.PI) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if a <= 3.3e+162: tmp = 2.0 * (((a - b_m) * (a + b_m)) * math.sin((angle_m * (math.pi / -180.0)))) else: tmp = 0.011111111111111112 * (a * ((angle_m * math.pi) * (b_m - a))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (a <= 3.3e+162) tmp = Float64(2.0 * Float64(Float64(Float64(a - b_m) * Float64(a + b_m)) * sin(Float64(angle_m * Float64(pi / -180.0))))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(Float64(angle_m * pi) * Float64(b_m - a)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (a <= 3.3e+162) tmp = 2.0 * (((a - b_m) * (a + b_m)) * sin((angle_m * (pi / -180.0)))); else tmp = 0.011111111111111112 * (a * ((angle_m * pi) * (b_m - a))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 3.3e+162], N[(2.0 * N[(N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(angle$95$m * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 3.3 \cdot 10^{+162}:\\
\;\;\;\;2 \cdot \left(\left(\left(a - b\_m\right) \cdot \left(a + b\_m\right)\right) \cdot \sin \left(angle\_m \cdot \frac{\pi}{-180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b\_m - a\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.29999999999999987e162Initial program 58.2%
Simplified58.7%
unpow258.7%
unpow258.7%
difference-of-squares60.1%
Applied egg-rr60.1%
Taylor expanded in angle around 0 59.6%
if 3.29999999999999987e162 < a Initial program 45.5%
Taylor expanded in angle around 0 42.1%
unpow242.1%
unpow242.1%
difference-of-squares60.1%
Applied egg-rr60.1%
Taylor expanded in b around 0 56.6%
Taylor expanded in angle around 0 72.3%
associate-*r*72.3%
Simplified72.3%
Final simplification61.1%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= a 4.2e+155)
(* 0.011111111111111112 (* angle_m (* PI (* (+ a b_m) (- b_m a)))))
(* 0.011111111111111112 (* a (* (* angle_m PI) (- b_m a)))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (a <= 4.2e+155) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * ((a + b_m) * (b_m - a))));
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * ((double) M_PI)) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (a <= 4.2e+155) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * ((a + b_m) * (b_m - a))));
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * Math.PI) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if a <= 4.2e+155: tmp = 0.011111111111111112 * (angle_m * (math.pi * ((a + b_m) * (b_m - a)))) else: tmp = 0.011111111111111112 * (a * ((angle_m * math.pi) * (b_m - a))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (a <= 4.2e+155) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(Float64(a + b_m) * Float64(b_m - a))))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(Float64(angle_m * pi) * Float64(b_m - a)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (a <= 4.2e+155) tmp = 0.011111111111111112 * (angle_m * (pi * ((a + b_m) * (b_m - a)))); else tmp = 0.011111111111111112 * (a * ((angle_m * pi) * (b_m - a))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 4.2e+155], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(N[(a + b$95$m), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 4.2 \cdot 10^{+155}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(\left(a + b\_m\right) \cdot \left(b\_m - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b\_m - a\right)\right)\right)\\
\end{array}
\end{array}
if a < 4.2e155Initial program 58.5%
Taylor expanded in angle around 0 56.5%
unpow256.5%
unpow256.5%
difference-of-squares58.7%
Applied egg-rr58.7%
if 4.2e155 < a Initial program 44.0%
Taylor expanded in angle around 0 40.7%
unpow240.7%
unpow240.7%
difference-of-squares58.1%
Applied egg-rr58.1%
Taylor expanded in b around 0 54.7%
Taylor expanded in angle around 0 69.9%
associate-*r*69.9%
Simplified69.9%
Final simplification60.0%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= a 1.3e+125)
(* -0.011111111111111112 (* (* (- a b_m) (+ a b_m)) (* angle_m PI)))
(* 0.011111111111111112 (* a (* (* angle_m PI) (- b_m a)))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (a <= 1.3e+125) {
tmp = -0.011111111111111112 * (((a - b_m) * (a + b_m)) * (angle_m * ((double) M_PI)));
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * ((double) M_PI)) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (a <= 1.3e+125) {
tmp = -0.011111111111111112 * (((a - b_m) * (a + b_m)) * (angle_m * Math.PI));
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * Math.PI) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if a <= 1.3e+125: tmp = -0.011111111111111112 * (((a - b_m) * (a + b_m)) * (angle_m * math.pi)) else: tmp = 0.011111111111111112 * (a * ((angle_m * math.pi) * (b_m - a))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (a <= 1.3e+125) tmp = Float64(-0.011111111111111112 * Float64(Float64(Float64(a - b_m) * Float64(a + b_m)) * Float64(angle_m * pi))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(Float64(angle_m * pi) * Float64(b_m - a)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (a <= 1.3e+125) tmp = -0.011111111111111112 * (((a - b_m) * (a + b_m)) * (angle_m * pi)); else tmp = 0.011111111111111112 * (a * ((angle_m * pi) * (b_m - a))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 1.3e+125], N[(-0.011111111111111112 * N[(N[(N[(a - b$95$m), $MachinePrecision] * N[(a + b$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 1.3 \cdot 10^{+125}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(a - b\_m\right) \cdot \left(a + b\_m\right)\right) \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b\_m - a\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.30000000000000002e125Initial program 58.0%
Simplified58.5%
unpow258.5%
unpow258.5%
difference-of-squares59.9%
Applied egg-rr59.9%
add-cbrt-cube32.0%
pow330.8%
div-inv30.8%
metadata-eval30.8%
Applied egg-rr30.8%
expm1-log1p-u24.5%
expm1-undefine20.8%
Applied egg-rr31.9%
expm1-define46.7%
associate-*r*42.9%
*-commutative42.9%
associate-*l*42.9%
*-commutative42.9%
*-commutative42.9%
+-commutative42.9%
associate-*r*45.3%
*-commutative45.3%
Simplified45.3%
Taylor expanded in angle around 0 58.7%
associate-*r*58.7%
Simplified58.7%
if 1.30000000000000002e125 < a Initial program 49.1%
Taylor expanded in angle around 0 43.4%
unpow243.4%
unpow243.4%
difference-of-squares58.3%
Applied egg-rr58.3%
Taylor expanded in b around 0 55.4%
Taylor expanded in angle around 0 68.4%
associate-*r*68.4%
Simplified68.4%
Final simplification60.0%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(*
angle_s
(if (<= a 1160000000.0)
(* 0.011111111111111112 (* angle_m (* PI (* b_m (- b_m a)))))
(* 0.011111111111111112 (* a (* (* angle_m PI) (- b_m a)))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (a <= 1160000000.0) {
tmp = 0.011111111111111112 * (angle_m * (((double) M_PI) * (b_m * (b_m - a))));
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * ((double) M_PI)) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double tmp;
if (a <= 1160000000.0) {
tmp = 0.011111111111111112 * (angle_m * (Math.PI * (b_m * (b_m - a))));
} else {
tmp = 0.011111111111111112 * (a * ((angle_m * Math.PI) * (b_m - a)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): tmp = 0 if a <= 1160000000.0: tmp = 0.011111111111111112 * (angle_m * (math.pi * (b_m * (b_m - a)))) else: tmp = 0.011111111111111112 * (a * ((angle_m * math.pi) * (b_m - a))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) tmp = 0.0 if (a <= 1160000000.0) tmp = Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b_m * Float64(b_m - a))))); else tmp = Float64(0.011111111111111112 * Float64(a * Float64(Float64(angle_m * pi) * Float64(b_m - a)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) tmp = 0.0; if (a <= 1160000000.0) tmp = 0.011111111111111112 * (angle_m * (pi * (b_m * (b_m - a)))); else tmp = 0.011111111111111112 * (a * ((angle_m * pi) * (b_m - a))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * If[LessEqual[a, 1160000000.0], N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b$95$m * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(a * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;a \leq 1160000000:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m \cdot \left(b\_m - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b\_m - a\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.16e9Initial program 55.9%
Taylor expanded in angle around 0 54.5%
unpow254.5%
unpow254.5%
difference-of-squares56.9%
Applied egg-rr56.9%
Taylor expanded in b around inf 41.3%
if 1.16e9 < a Initial program 60.7%
Taylor expanded in angle around 0 55.4%
unpow255.4%
unpow255.4%
difference-of-squares66.2%
Applied egg-rr66.2%
Taylor expanded in b around 0 55.8%
Taylor expanded in angle around 0 65.2%
associate-*r*65.2%
Simplified65.2%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* a (* (* angle_m PI) (- b_m a))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (a * ((angle_m * ((double) M_PI)) * (b_m - a))));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (a * ((angle_m * Math.PI) * (b_m - a))));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * (0.011111111111111112 * (a * ((angle_m * math.pi) * (b_m - a))))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(a * Float64(Float64(angle_m * pi) * Float64(b_m - a))))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * (0.011111111111111112 * (a * ((angle_m * pi) * (b_m - a)))); end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(a * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(a \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(b\_m - a\right)\right)\right)\right)
\end{array}
Initial program 56.8%
Taylor expanded in angle around 0 54.6%
unpow254.6%
unpow254.6%
difference-of-squares58.7%
Applied egg-rr58.7%
Taylor expanded in b around 0 41.7%
Taylor expanded in angle around 0 46.7%
associate-*r*46.7%
Simplified46.7%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* a (* angle_m (* PI (- b_m a)))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (a * (angle_m * (((double) M_PI) * (b_m - a)))));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (a * (angle_m * (Math.PI * (b_m - a)))));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * (0.011111111111111112 * (a * (angle_m * (math.pi * (b_m - a)))))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(a * Float64(angle_m * Float64(pi * Float64(b_m - a)))))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * (0.011111111111111112 * (a * (angle_m * (pi * (b_m - a))))); end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(a * N[(angle$95$m * N[(Pi * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m - a\right)\right)\right)\right)\right)
\end{array}
Initial program 56.8%
Taylor expanded in angle around 0 54.6%
unpow254.6%
unpow254.6%
difference-of-squares58.7%
Applied egg-rr58.7%
Taylor expanded in b around 0 41.7%
Taylor expanded in angle around 0 46.7%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* angle_m (* a (* PI b_m))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (a * (((double) M_PI) * b_m))));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (angle_m * (a * (Math.PI * b_m))));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * (0.011111111111111112 * (angle_m * (a * (math.pi * b_m))))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(angle_m * Float64(a * Float64(pi * b_m))))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * (0.011111111111111112 * (angle_m * (a * (pi * b_m)))); end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(angle$95$m * N[(a * N[(Pi * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(a \cdot \left(\pi \cdot b\_m\right)\right)\right)\right)
\end{array}
Initial program 56.8%
Taylor expanded in angle around 0 54.6%
unpow254.6%
unpow254.6%
difference-of-squares58.7%
Applied egg-rr58.7%
Taylor expanded in b around 0 41.7%
Taylor expanded in a around 0 20.1%
*-commutative20.1%
Simplified20.1%
b_m = (fabs.f64 b) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a b_m angle_m) :precision binary64 (* angle_s (* 0.011111111111111112 (* a (* angle_m (* PI b_m))))))
b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (a * (angle_m * (((double) M_PI) * b_m))));
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
return angle_s * (0.011111111111111112 * (a * (angle_m * (Math.PI * b_m))));
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): return angle_s * (0.011111111111111112 * (a * (angle_m * (math.pi * b_m))))
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) return Float64(angle_s * Float64(0.011111111111111112 * Float64(a * Float64(angle_m * Float64(pi * b_m))))) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a, b_m, angle_m) tmp = angle_s * (0.011111111111111112 * (a * (angle_m * (pi * b_m)))); end
b_m = N[Abs[b], $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_, b$95$m_, angle$95$m_] := N[(angle$95$s * N[(0.011111111111111112 * N[(a * N[(angle$95$m * N[(Pi * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(0.011111111111111112 \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot b\_m\right)\right)\right)\right)
\end{array}
Initial program 56.8%
Taylor expanded in angle around 0 54.6%
unpow254.6%
unpow254.6%
difference-of-squares58.7%
Applied egg-rr58.7%
Taylor expanded in b around 0 41.7%
Taylor expanded in a around 0 20.0%
*-commutative20.0%
Simplified20.0%
herbie shell --seed 2024151
(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)))))