
(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 15 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)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (sin (* -0.005555555555555556 (* angle PI))))
(t_1 (cos (* angle (/ PI -180.0)))))
(if (<= a_m 1.01)
(* t_1 (* 2.0 (fma b (* t_0 (- b)) (* t_0 (pow a_m 2.0)))))
(if (<= a_m 1.58e+153)
(*
(*
2.0
(*
(sin (* angle (/ (cbrt (pow PI 3.0)) -180.0)))
(* (+ a_m b) (- a_m b))))
(cos (/ (* angle PI) -180.0)))
(if (<= a_m 1.9e+195)
(*
2.0
(*
-0.005555555555555556
(- (* a_m (* a_m (* angle PI))) (* angle (* PI (pow b 2.0))))))
(* t_1 (* 2.0 (* a_m (* a_m t_0)))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = sin((-0.005555555555555556 * (angle * ((double) M_PI))));
double t_1 = cos((angle * (((double) M_PI) / -180.0)));
double tmp;
if (a_m <= 1.01) {
tmp = t_1 * (2.0 * fma(b, (t_0 * -b), (t_0 * pow(a_m, 2.0))));
} else if (a_m <= 1.58e+153) {
tmp = (2.0 * (sin((angle * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * ((a_m + b) * (a_m - b)))) * cos(((angle * ((double) M_PI)) / -180.0));
} else if (a_m <= 1.9e+195) {
tmp = 2.0 * (-0.005555555555555556 * ((a_m * (a_m * (angle * ((double) M_PI)))) - (angle * (((double) M_PI) * pow(b, 2.0)))));
} else {
tmp = t_1 * (2.0 * (a_m * (a_m * t_0)));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = sin(Float64(-0.005555555555555556 * Float64(angle * pi))) t_1 = cos(Float64(angle * Float64(pi / -180.0))) tmp = 0.0 if (a_m <= 1.01) tmp = Float64(t_1 * Float64(2.0 * fma(b, Float64(t_0 * Float64(-b)), Float64(t_0 * (a_m ^ 2.0))))); elseif (a_m <= 1.58e+153) tmp = Float64(Float64(2.0 * Float64(sin(Float64(angle * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(Float64(a_m + b) * Float64(a_m - b)))) * cos(Float64(Float64(angle * pi) / -180.0))); elseif (a_m <= 1.9e+195) tmp = Float64(2.0 * Float64(-0.005555555555555556 * Float64(Float64(a_m * Float64(a_m * Float64(angle * pi))) - Float64(angle * Float64(pi * (b ^ 2.0)))))); else tmp = Float64(t_1 * Float64(2.0 * Float64(a_m * Float64(a_m * t_0)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a$95$m, 1.01], N[(t$95$1 * N[(2.0 * N[(b * N[(t$95$0 * (-b)), $MachinePrecision] + N[(t$95$0 * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 1.58e+153], N[(N[(2.0 * N[(N[Sin[N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 1.9e+195], N[(2.0 * N[(-0.005555555555555556 * N[(N[(a$95$m * N[(a$95$m * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(angle * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(a$95$m * N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
t_1 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
\mathbf{if}\;a\_m \leq 1.01:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\right)\\
\mathbf{elif}\;a\_m \leq 1.58 \cdot 10^{+153}:\\
\;\;\;\;\left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right)\right)\right) \cdot \cos \left(\frac{angle \cdot \pi}{-180}\right)\\
\mathbf{elif}\;a\_m \leq 1.9 \cdot 10^{+195}:\\
\;\;\;\;2 \cdot \left(-0.005555555555555556 \cdot \left(a\_m \cdot \left(a\_m \cdot \left(angle \cdot \pi\right)\right) - angle \cdot \left(\pi \cdot {b}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.01000000000000001Initial program 53.2%
Simplified55.2%
unpow255.2%
unpow255.2%
difference-of-squares57.4%
Applied egg-rr57.4%
Taylor expanded in b around 0 60.4%
fma-define62.0%
+-commutative62.0%
fma-define62.0%
distribute-rgt1-in62.0%
metadata-eval62.0%
mul0-lft62.0%
mul-1-neg62.0%
fmm-def62.0%
*-commutative62.0%
distribute-lft-out--62.0%
neg-sub062.0%
*-commutative62.0%
Simplified62.0%
if 1.01000000000000001 < a < 1.58e153Initial program 56.2%
Simplified60.2%
unpow260.2%
unpow260.2%
difference-of-squares60.2%
Applied egg-rr60.2%
add-cbrt-cube54.6%
pow354.6%
Applied egg-rr54.6%
associate-*r/58.8%
Applied egg-rr58.8%
if 1.58e153 < a < 1.9e195Initial program 24.2%
Simplified24.2%
unpow224.2%
unpow224.2%
difference-of-squares35.7%
Applied egg-rr35.7%
Taylor expanded in angle around 0 46.8%
Taylor expanded in angle around 0 46.8%
Taylor expanded in a around 0 77.9%
+-commutative77.9%
mul-1-neg77.9%
unsub-neg77.9%
+-commutative77.9%
associate-*r*77.9%
distribute-rgt1-in77.9%
metadata-eval77.9%
mul0-lft77.9%
*-commutative77.9%
distribute-lft-out77.9%
Simplified77.9%
if 1.9e195 < a Initial program 55.2%
Simplified55.2%
unpow255.2%
unpow255.2%
difference-of-squares64.3%
Applied egg-rr64.3%
add-cbrt-cube64.3%
pow364.3%
Applied egg-rr64.3%
Taylor expanded in b around 0 64.3%
associate-*r*64.3%
fma-define64.3%
distribute-rgt1-in64.3%
metadata-eval64.3%
mul0-lft64.3%
fma-undefine64.3%
Simplified87.4%
Final simplification64.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (sin (* -0.005555555555555556 (* angle PI))))
(t_1 (* a_m (* a_m t_0)))
(t_2 (cos (* angle (/ PI -180.0)))))
(if (<= a_m 4.4e+43)
(* t_2 (* 2.0 (fma b (* t_0 (- b)) (* t_0 (pow a_m 2.0)))))
(if (<= a_m 1.2e+192)
(*
(cos (expm1 (log1p (* PI (* angle 0.005555555555555556)))))
(* 2.0 (- t_1 (* t_0 (pow b 2.0)))))
(* t_2 (* 2.0 t_1))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = sin((-0.005555555555555556 * (angle * ((double) M_PI))));
double t_1 = a_m * (a_m * t_0);
double t_2 = cos((angle * (((double) M_PI) / -180.0)));
double tmp;
if (a_m <= 4.4e+43) {
tmp = t_2 * (2.0 * fma(b, (t_0 * -b), (t_0 * pow(a_m, 2.0))));
} else if (a_m <= 1.2e+192) {
tmp = cos(expm1(log1p((((double) M_PI) * (angle * 0.005555555555555556))))) * (2.0 * (t_1 - (t_0 * pow(b, 2.0))));
} else {
tmp = t_2 * (2.0 * t_1);
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = sin(Float64(-0.005555555555555556 * Float64(angle * pi))) t_1 = Float64(a_m * Float64(a_m * t_0)) t_2 = cos(Float64(angle * Float64(pi / -180.0))) tmp = 0.0 if (a_m <= 4.4e+43) tmp = Float64(t_2 * Float64(2.0 * fma(b, Float64(t_0 * Float64(-b)), Float64(t_0 * (a_m ^ 2.0))))); elseif (a_m <= 1.2e+192) tmp = Float64(cos(expm1(log1p(Float64(pi * Float64(angle * 0.005555555555555556))))) * Float64(2.0 * Float64(t_1 - Float64(t_0 * (b ^ 2.0))))); else tmp = Float64(t_2 * Float64(2.0 * t_1)); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(a$95$m * N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a$95$m, 4.4e+43], N[(t$95$2 * N[(2.0 * N[(b * N[(t$95$0 * (-b)), $MachinePrecision] + N[(t$95$0 * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 1.2e+192], N[(N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(t$95$1 - N[(t$95$0 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
t_1 := a\_m \cdot \left(a\_m \cdot t\_0\right)\\
t_2 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
\mathbf{if}\;a\_m \leq 4.4 \cdot 10^{+43}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\right)\\
\mathbf{elif}\;a\_m \leq 1.2 \cdot 10^{+192}:\\
\;\;\;\;\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \left(t\_1 - t\_0 \cdot {b}^{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(2 \cdot t\_1\right)\\
\end{array}
\end{array}
if a < 4.40000000000000001e43Initial program 54.0%
Simplified55.9%
unpow255.9%
unpow255.9%
difference-of-squares58.0%
Applied egg-rr58.0%
Taylor expanded in b around 0 60.9%
fma-define62.5%
+-commutative62.5%
fma-define62.5%
distribute-rgt1-in62.5%
metadata-eval62.5%
mul0-lft62.5%
mul-1-neg62.5%
fmm-def62.5%
*-commutative62.5%
distribute-lft-out--62.5%
neg-sub062.5%
*-commutative62.5%
Simplified62.5%
if 4.40000000000000001e43 < a < 1.1999999999999999e192Initial program 43.2%
Simplified46.7%
unpow246.7%
unpow246.7%
difference-of-squares50.0%
Applied egg-rr50.0%
Taylor expanded in a around 0 52.7%
+-commutative52.7%
mul-1-neg52.7%
unsub-neg52.7%
Simplified52.7%
associate-*r/58.6%
div-inv55.3%
metadata-eval55.3%
*-commutative55.3%
add-sqr-sqrt30.9%
sqrt-unprod53.5%
swap-sqr56.8%
metadata-eval56.8%
metadata-eval56.8%
swap-sqr53.5%
sqrt-unprod30.4%
add-sqr-sqrt55.3%
expm1-log1p-u52.1%
associate-*r*52.1%
Applied egg-rr52.1%
if 1.1999999999999999e192 < a Initial program 55.0%
Simplified55.0%
unpow255.0%
unpow255.0%
difference-of-squares63.4%
Applied egg-rr63.4%
add-cbrt-cube63.4%
pow363.4%
Applied egg-rr63.4%
Taylor expanded in b around 0 63.4%
associate-*r*63.4%
fma-define63.4%
distribute-rgt1-in63.4%
metadata-eval63.4%
mul0-lft63.4%
fma-undefine63.4%
Simplified88.3%
Final simplification63.8%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (sin (* -0.005555555555555556 (* angle PI)))))
(if (<= b 6.2e+144)
(*
(cos (* angle (/ PI -180.0)))
(* 2.0 (- (* a_m (* a_m t_0)) (* t_0 (pow b 2.0)))))
(if (<= b 5e+241)
(* 2.0 (fma b (* t_0 (- b)) (* t_0 (pow a_m 2.0))))
(*
(cos (expm1 (log1p (* PI (* angle 0.005555555555555556)))))
(*
2.0
(*
(sin (* angle (/ (cbrt (pow PI 3.0)) -180.0)))
(* (+ a_m b) (- a_m b)))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = sin((-0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (b <= 6.2e+144) {
tmp = cos((angle * (((double) M_PI) / -180.0))) * (2.0 * ((a_m * (a_m * t_0)) - (t_0 * pow(b, 2.0))));
} else if (b <= 5e+241) {
tmp = 2.0 * fma(b, (t_0 * -b), (t_0 * pow(a_m, 2.0)));
} else {
tmp = cos(expm1(log1p((((double) M_PI) * (angle * 0.005555555555555556))))) * (2.0 * (sin((angle * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * ((a_m + b) * (a_m - b))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = sin(Float64(-0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (b <= 6.2e+144) tmp = Float64(cos(Float64(angle * Float64(pi / -180.0))) * Float64(2.0 * Float64(Float64(a_m * Float64(a_m * t_0)) - Float64(t_0 * (b ^ 2.0))))); elseif (b <= 5e+241) tmp = Float64(2.0 * fma(b, Float64(t_0 * Float64(-b)), Float64(t_0 * (a_m ^ 2.0)))); else tmp = Float64(cos(expm1(log1p(Float64(pi * Float64(angle * 0.005555555555555556))))) * Float64(2.0 * Float64(sin(Float64(angle * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(Float64(a_m + b) * Float64(a_m - b))))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, 6.2e+144], N[(N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[(a$95$m * N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e+241], N[(2.0 * N[(b * N[(t$95$0 * (-b)), $MachinePrecision] + N[(t$95$0 * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Exp[N[Log[1 + N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(N[Sin[N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;b \leq 6.2 \cdot 10^{+144}:\\
\;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_0\right) - t\_0 \cdot {b}^{2}\right)\right)\\
\mathbf{elif}\;b \leq 5 \cdot 10^{+241}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right) \cdot \left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 6.2000000000000003e144Initial program 56.5%
Simplified57.8%
unpow257.8%
unpow257.8%
difference-of-squares59.8%
Applied egg-rr59.8%
Taylor expanded in a around 0 64.6%
+-commutative64.6%
mul-1-neg64.6%
unsub-neg64.6%
Simplified64.6%
if 6.2000000000000003e144 < b < 5.00000000000000025e241Initial program 23.8%
Simplified27.4%
unpow227.4%
unpow227.4%
difference-of-squares35.6%
Applied egg-rr35.6%
Taylor expanded in angle around 0 39.8%
Taylor expanded in b around 0 59.2%
fma-define58.5%
+-commutative58.5%
fma-define58.5%
distribute-rgt1-in58.5%
metadata-eval58.5%
mul0-lft58.5%
mul-1-neg58.5%
fmm-def58.5%
*-commutative58.5%
distribute-lft-out--58.5%
neg-sub058.5%
*-commutative58.5%
Simplified62.7%
if 5.00000000000000025e241 < b Initial program 54.0%
Simplified61.7%
unpow261.7%
unpow261.7%
difference-of-squares69.4%
Applied egg-rr69.4%
add-cbrt-cube77.0%
pow377.0%
Applied egg-rr77.0%
associate-*r/69.4%
div-inv69.4%
metadata-eval69.4%
*-commutative69.4%
add-sqr-sqrt46.2%
sqrt-unprod69.4%
swap-sqr69.4%
metadata-eval69.4%
metadata-eval69.4%
swap-sqr69.4%
sqrt-unprod23.2%
add-sqr-sqrt69.4%
expm1-log1p-u61.7%
associate-*r*61.7%
Applied egg-rr61.7%
Final simplification64.3%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* -0.005555555555555556 (* angle PI))) (t_1 (sin t_0)))
(if (<= a_m 1.45e-18)
(* 2.0 (fma b (* t_1 (- b)) (* t_1 (pow a_m 2.0))))
(if (<= a_m 1.25e+150)
(*
(*
2.0
(*
(sin (* angle (/ (cbrt (pow PI 3.0)) -180.0)))
(* (+ a_m b) (- a_m b))))
(cos t_0))
(* (cos (* angle (/ PI -180.0))) (* 2.0 (* a_m (* a_m t_1))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = -0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double tmp;
if (a_m <= 1.45e-18) {
tmp = 2.0 * fma(b, (t_1 * -b), (t_1 * pow(a_m, 2.0)));
} else if (a_m <= 1.25e+150) {
tmp = (2.0 * (sin((angle * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * ((a_m + b) * (a_m - b)))) * cos(t_0);
} else {
tmp = cos((angle * (((double) M_PI) / -180.0))) * (2.0 * (a_m * (a_m * t_1)));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(-0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) tmp = 0.0 if (a_m <= 1.45e-18) tmp = Float64(2.0 * fma(b, Float64(t_1 * Float64(-b)), Float64(t_1 * (a_m ^ 2.0)))); elseif (a_m <= 1.25e+150) tmp = Float64(Float64(2.0 * Float64(sin(Float64(angle * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(Float64(a_m + b) * Float64(a_m - b)))) * cos(t_0)); else tmp = Float64(cos(Float64(angle * Float64(pi / -180.0))) * Float64(2.0 * Float64(a_m * Float64(a_m * t_1)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[a$95$m, 1.45e-18], N[(2.0 * N[(b * N[(t$95$1 * (-b)), $MachinePrecision] + N[(t$95$1 * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 1.25e+150], N[(N[(2.0 * N[(N[Sin[N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(a$95$m * N[(a$95$m * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := -0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
\mathbf{if}\;a\_m \leq 1.45 \cdot 10^{-18}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_1 \cdot \left(-b\right), t\_1 \cdot {a\_m}^{2}\right)\\
\mathbf{elif}\;a\_m \leq 1.25 \cdot 10^{+150}:\\
\;\;\;\;\left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right)\right)\right) \cdot \cos t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_1\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.45e-18Initial program 53.3%
Simplified55.2%
unpow255.2%
unpow255.2%
difference-of-squares57.5%
Applied egg-rr57.5%
Taylor expanded in angle around 0 53.7%
Taylor expanded in b around 0 56.7%
fma-define62.1%
+-commutative62.1%
fma-define62.1%
distribute-rgt1-in62.1%
metadata-eval62.1%
mul0-lft62.1%
mul-1-neg62.1%
fmm-def62.1%
*-commutative62.1%
distribute-lft-out--62.1%
neg-sub062.1%
*-commutative62.1%
Simplified58.9%
if 1.45e-18 < a < 1.25000000000000002e150Initial program 55.8%
Simplified59.6%
unpow259.6%
unpow259.6%
difference-of-squares59.6%
Applied egg-rr59.6%
add-cbrt-cube54.3%
pow354.3%
Applied egg-rr54.3%
Taylor expanded in angle around inf 57.8%
if 1.25000000000000002e150 < a Initial program 46.7%
Simplified46.7%
unpow246.7%
unpow246.7%
difference-of-squares56.5%
Applied egg-rr56.5%
add-cbrt-cube59.5%
pow359.5%
Applied egg-rr59.5%
Taylor expanded in b around 0 53.4%
associate-*r*53.4%
fma-define53.4%
distribute-rgt1-in53.4%
metadata-eval53.4%
mul0-lft53.4%
fma-undefine53.4%
Simplified78.7%
Final simplification61.3%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (sin (* -0.005555555555555556 (* angle PI)))))
(if (<= a_m 1.55e-18)
(* 2.0 (fma b (* t_0 (- b)) (* t_0 (pow a_m 2.0))))
(if (<= a_m 1.45e+153)
(*
(*
2.0
(*
(sin (* angle (/ (cbrt (pow PI 3.0)) -180.0)))
(* (+ a_m b) (- a_m b))))
(cos (/ (* angle PI) -180.0)))
(* (cos (* angle (/ PI -180.0))) (* 2.0 (* a_m (* a_m t_0))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = sin((-0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (a_m <= 1.55e-18) {
tmp = 2.0 * fma(b, (t_0 * -b), (t_0 * pow(a_m, 2.0)));
} else if (a_m <= 1.45e+153) {
tmp = (2.0 * (sin((angle * (cbrt(pow(((double) M_PI), 3.0)) / -180.0))) * ((a_m + b) * (a_m - b)))) * cos(((angle * ((double) M_PI)) / -180.0));
} else {
tmp = cos((angle * (((double) M_PI) / -180.0))) * (2.0 * (a_m * (a_m * t_0)));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = sin(Float64(-0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (a_m <= 1.55e-18) tmp = Float64(2.0 * fma(b, Float64(t_0 * Float64(-b)), Float64(t_0 * (a_m ^ 2.0)))); elseif (a_m <= 1.45e+153) tmp = Float64(Float64(2.0 * Float64(sin(Float64(angle * Float64(cbrt((pi ^ 3.0)) / -180.0))) * Float64(Float64(a_m + b) * Float64(a_m - b)))) * cos(Float64(Float64(angle * pi) / -180.0))); else tmp = Float64(cos(Float64(angle * Float64(pi / -180.0))) * Float64(2.0 * Float64(a_m * Float64(a_m * t_0)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a$95$m, 1.55e-18], N[(2.0 * N[(b * N[(t$95$0 * (-b)), $MachinePrecision] + N[(t$95$0 * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 1.45e+153], N[(N[(2.0 * N[(N[Sin[N[(angle * N[(N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision] / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle * Pi), $MachinePrecision] / -180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(a$95$m * N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;a\_m \leq 1.55 \cdot 10^{-18}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\\
\mathbf{elif}\;a\_m \leq 1.45 \cdot 10^{+153}:\\
\;\;\;\;\left(2 \cdot \left(\sin \left(angle \cdot \frac{\sqrt[3]{{\pi}^{3}}}{-180}\right) \cdot \left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right)\right)\right) \cdot \cos \left(\frac{angle \cdot \pi}{-180}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.55000000000000003e-18Initial program 53.3%
Simplified55.2%
unpow255.2%
unpow255.2%
difference-of-squares57.5%
Applied egg-rr57.5%
Taylor expanded in angle around 0 53.7%
Taylor expanded in b around 0 56.7%
fma-define62.1%
+-commutative62.1%
fma-define62.1%
distribute-rgt1-in62.1%
metadata-eval62.1%
mul0-lft62.1%
mul-1-neg62.1%
fmm-def62.1%
*-commutative62.1%
distribute-lft-out--62.1%
neg-sub062.1%
*-commutative62.1%
Simplified58.9%
if 1.55000000000000003e-18 < a < 1.45000000000000001e153Initial program 55.8%
Simplified59.6%
unpow259.6%
unpow259.6%
difference-of-squares59.6%
Applied egg-rr59.6%
add-cbrt-cube54.3%
pow354.3%
Applied egg-rr54.3%
associate-*r/58.2%
Applied egg-rr58.2%
if 1.45000000000000001e153 < a Initial program 46.7%
Simplified46.7%
unpow246.7%
unpow246.7%
difference-of-squares56.5%
Applied egg-rr56.5%
add-cbrt-cube59.5%
pow359.5%
Applied egg-rr59.5%
Taylor expanded in b around 0 53.4%
associate-*r*53.4%
fma-define53.4%
distribute-rgt1-in53.4%
metadata-eval53.4%
mul0-lft53.4%
fma-undefine53.4%
Simplified78.7%
Final simplification61.3%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (sin (* -0.005555555555555556 (* angle PI)))))
(if (<= a_m 1.9e+58)
(* 2.0 (fma b (* t_0 (- b)) (* t_0 (pow a_m 2.0))))
(if (<= a_m 2.6e+150)
(*
(pow a_m 2.0)
(*
(sin (* angle (* PI 0.011111111111111112)))
(fma b (/ b (pow a_m 2.0)) -1.0)))
(* (cos (* angle (/ PI -180.0))) (* 2.0 (* a_m (* a_m t_0))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = sin((-0.005555555555555556 * (angle * ((double) M_PI))));
double tmp;
if (a_m <= 1.9e+58) {
tmp = 2.0 * fma(b, (t_0 * -b), (t_0 * pow(a_m, 2.0)));
} else if (a_m <= 2.6e+150) {
tmp = pow(a_m, 2.0) * (sin((angle * (((double) M_PI) * 0.011111111111111112))) * fma(b, (b / pow(a_m, 2.0)), -1.0));
} else {
tmp = cos((angle * (((double) M_PI) / -180.0))) * (2.0 * (a_m * (a_m * t_0)));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = sin(Float64(-0.005555555555555556 * Float64(angle * pi))) tmp = 0.0 if (a_m <= 1.9e+58) tmp = Float64(2.0 * fma(b, Float64(t_0 * Float64(-b)), Float64(t_0 * (a_m ^ 2.0)))); elseif (a_m <= 2.6e+150) tmp = Float64((a_m ^ 2.0) * Float64(sin(Float64(angle * Float64(pi * 0.011111111111111112))) * fma(b, Float64(b / (a_m ^ 2.0)), -1.0))); else tmp = Float64(cos(Float64(angle * Float64(pi / -180.0))) * Float64(2.0 * Float64(a_m * Float64(a_m * t_0)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a$95$m, 1.9e+58], N[(2.0 * N[(b * N[(t$95$0 * (-b)), $MachinePrecision] + N[(t$95$0 * N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 2.6e+150], N[(N[Power[a$95$m, 2.0], $MachinePrecision] * N[(N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b * N[(b / N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(a$95$m * N[(a$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\\
\mathbf{if}\;a\_m \leq 1.9 \cdot 10^{+58}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(b, t\_0 \cdot \left(-b\right), t\_0 \cdot {a\_m}^{2}\right)\\
\mathbf{elif}\;a\_m \leq 2.6 \cdot 10^{+150}:\\
\;\;\;\;{a\_m}^{2} \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \mathsf{fma}\left(b, \frac{b}{{a\_m}^{2}}, -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.8999999999999999e58Initial program 55.1%
Simplified57.0%
unpow257.0%
unpow257.0%
difference-of-squares59.1%
Applied egg-rr59.1%
Taylor expanded in angle around 0 55.5%
Taylor expanded in b around 0 58.3%
fma-define63.4%
+-commutative63.4%
fma-define63.4%
distribute-rgt1-in63.4%
metadata-eval63.4%
mul0-lft63.4%
mul-1-neg63.4%
fmm-def63.4%
*-commutative63.4%
distribute-lft-out--63.4%
neg-sub063.4%
*-commutative63.4%
Simplified60.3%
if 1.8999999999999999e58 < a < 2.60000000000000006e150Initial program 38.5%
associate-*l*38.5%
*-commutative38.5%
associate-*l*38.5%
Simplified38.5%
*-commutative38.5%
flip--2.2%
associate-*r/2.2%
Applied egg-rr1.8%
associate-/l*1.8%
*-commutative1.8%
associate-*r*2.0%
*-commutative2.0%
associate-*l*2.0%
metadata-eval2.0%
Simplified2.0%
Taylor expanded in a around inf 42.8%
*-commutative42.8%
*-commutative42.8%
associate-/l*42.8%
distribute-lft-out42.8%
*-commutative42.8%
associate-*r*44.0%
+-commutative44.0%
metadata-eval44.0%
sub-neg44.0%
unpow244.0%
associate-/l*44.0%
fmm-def44.0%
metadata-eval44.0%
Simplified44.0%
if 2.60000000000000006e150 < a Initial program 46.7%
Simplified46.7%
unpow246.7%
unpow246.7%
difference-of-squares56.5%
Applied egg-rr56.5%
add-cbrt-cube59.5%
pow359.5%
Applied egg-rr59.5%
Taylor expanded in b around 0 53.4%
associate-*r*53.4%
fma-define53.4%
distribute-rgt1-in53.4%
metadata-eval53.4%
mul0-lft53.4%
fma-undefine53.4%
Simplified78.7%
Final simplification61.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* angle (* PI 0.005555555555555556))))
(if (<= a_m 2.6e+150)
(* 2.0 (* (sin t_0) (* (- (pow b 2.0) (pow a_m 2.0)) (cos t_0))))
(*
(cos (* angle (/ PI -180.0)))
(* 2.0 (* a_m (* a_m (sin (* -0.005555555555555556 (* angle PI))))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = angle * (((double) M_PI) * 0.005555555555555556);
double tmp;
if (a_m <= 2.6e+150) {
tmp = 2.0 * (sin(t_0) * ((pow(b, 2.0) - pow(a_m, 2.0)) * cos(t_0)));
} else {
tmp = cos((angle * (((double) M_PI) / -180.0))) * (2.0 * (a_m * (a_m * sin((-0.005555555555555556 * (angle * ((double) M_PI)))))));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = angle * (Math.PI * 0.005555555555555556);
double tmp;
if (a_m <= 2.6e+150) {
tmp = 2.0 * (Math.sin(t_0) * ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) * Math.cos(t_0)));
} else {
tmp = Math.cos((angle * (Math.PI / -180.0))) * (2.0 * (a_m * (a_m * Math.sin((-0.005555555555555556 * (angle * Math.PI))))));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = angle * (math.pi * 0.005555555555555556) tmp = 0 if a_m <= 2.6e+150: tmp = 2.0 * (math.sin(t_0) * ((math.pow(b, 2.0) - math.pow(a_m, 2.0)) * math.cos(t_0))) else: tmp = math.cos((angle * (math.pi / -180.0))) * (2.0 * (a_m * (a_m * math.sin((-0.005555555555555556 * (angle * math.pi)))))) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(angle * Float64(pi * 0.005555555555555556)) tmp = 0.0 if (a_m <= 2.6e+150) tmp = Float64(2.0 * Float64(sin(t_0) * Float64(Float64((b ^ 2.0) - (a_m ^ 2.0)) * cos(t_0)))); else tmp = Float64(cos(Float64(angle * Float64(pi / -180.0))) * Float64(2.0 * Float64(a_m * Float64(a_m * sin(Float64(-0.005555555555555556 * Float64(angle * pi))))))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = angle * (pi * 0.005555555555555556); tmp = 0.0; if (a_m <= 2.6e+150) tmp = 2.0 * (sin(t_0) * (((b ^ 2.0) - (a_m ^ 2.0)) * cos(t_0))); else tmp = cos((angle * (pi / -180.0))) * (2.0 * (a_m * (a_m * sin((-0.005555555555555556 * (angle * pi)))))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 2.6e+150], N[(2.0 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(a$95$m * N[(a$95$m * N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
\mathbf{if}\;a\_m \leq 2.6 \cdot 10^{+150}:\\
\;\;\;\;2 \cdot \left(\sin t\_0 \cdot \left(\left({b}^{2} - {a\_m}^{2}\right) \cdot \cos t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.60000000000000006e150Initial program 53.7%
associate-*l*53.7%
*-commutative53.7%
associate-*l*53.7%
Simplified53.7%
Taylor expanded in angle around inf 56.2%
*-commutative56.2%
*-commutative56.2%
*-commutative56.2%
associate-*r*54.7%
*-commutative54.7%
*-commutative54.7%
associate-*r*54.0%
associate-*l*54.0%
associate-*r*55.4%
*-commutative55.4%
associate-*l*54.4%
Simplified55.9%
if 2.60000000000000006e150 < a Initial program 46.7%
Simplified46.7%
unpow246.7%
unpow246.7%
difference-of-squares56.5%
Applied egg-rr56.5%
add-cbrt-cube59.5%
pow359.5%
Applied egg-rr59.5%
Taylor expanded in b around 0 53.4%
associate-*r*53.4%
fma-define53.4%
distribute-rgt1-in53.4%
metadata-eval53.4%
mul0-lft53.4%
fma-undefine53.4%
Simplified78.7%
Final simplification58.8%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= (pow a_m 2.0) 2e+300)
(* 2.0 (* (* (+ a_m b) (- a_m b)) (sin (* PI (/ angle -180.0)))))
(*
(cos (* angle (/ PI -180.0)))
(* 2.0 (* a_m (* a_m (sin (* -0.005555555555555556 (* angle PI)))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (pow(a_m, 2.0) <= 2e+300) {
tmp = 2.0 * (((a_m + b) * (a_m - b)) * sin((((double) M_PI) * (angle / -180.0))));
} else {
tmp = cos((angle * (((double) M_PI) / -180.0))) * (2.0 * (a_m * (a_m * sin((-0.005555555555555556 * (angle * ((double) M_PI)))))));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if (Math.pow(a_m, 2.0) <= 2e+300) {
tmp = 2.0 * (((a_m + b) * (a_m - b)) * Math.sin((Math.PI * (angle / -180.0))));
} else {
tmp = Math.cos((angle * (Math.PI / -180.0))) * (2.0 * (a_m * (a_m * Math.sin((-0.005555555555555556 * (angle * Math.PI))))));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if math.pow(a_m, 2.0) <= 2e+300: tmp = 2.0 * (((a_m + b) * (a_m - b)) * math.sin((math.pi * (angle / -180.0)))) else: tmp = math.cos((angle * (math.pi / -180.0))) * (2.0 * (a_m * (a_m * math.sin((-0.005555555555555556 * (angle * math.pi)))))) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if ((a_m ^ 2.0) <= 2e+300) tmp = Float64(2.0 * Float64(Float64(Float64(a_m + b) * Float64(a_m - b)) * sin(Float64(pi * Float64(angle / -180.0))))); else tmp = Float64(cos(Float64(angle * Float64(pi / -180.0))) * Float64(2.0 * Float64(a_m * Float64(a_m * sin(Float64(-0.005555555555555556 * Float64(angle * pi))))))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if ((a_m ^ 2.0) <= 2e+300) tmp = 2.0 * (((a_m + b) * (a_m - b)) * sin((pi * (angle / -180.0)))); else tmp = cos((angle * (pi / -180.0))) * (2.0 * (a_m * (a_m * sin((-0.005555555555555556 * (angle * pi)))))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[Power[a$95$m, 2.0], $MachinePrecision], 2e+300], N[(2.0 * N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[(a$95$m * N[(a$95$m * N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{a\_m}^{2} \leq 2 \cdot 10^{+300}:\\
\;\;\;\;2 \cdot \left(\left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{-180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(angle \cdot \frac{\pi}{-180}\right) \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 2.0000000000000001e300Initial program 56.6%
Simplified58.8%
unpow258.8%
unpow258.8%
difference-of-squares58.8%
Applied egg-rr58.8%
Taylor expanded in angle around 0 54.4%
clear-num54.4%
un-div-inv54.3%
Applied egg-rr54.3%
associate-/r/56.2%
*-commutative56.2%
Simplified56.2%
if 2.0000000000000001e300 < (pow.f64 a #s(literal 2 binary64)) Initial program 42.3%
Simplified43.5%
unpow243.5%
unpow243.5%
difference-of-squares54.3%
Applied egg-rr54.3%
add-cbrt-cube51.7%
pow351.7%
Applied egg-rr51.7%
Taylor expanded in b around 0 53.0%
associate-*r*53.0%
fma-define53.0%
distribute-rgt1-in53.0%
metadata-eval53.0%
mul0-lft53.0%
fma-undefine53.0%
Simplified78.4%
Final simplification62.2%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* angle (/ PI -180.0)))
(t_1 (* -0.005555555555555556 (* angle PI))))
(if (<= a_m 1.25e+150)
(* (cos t_1) (* 2.0 (* (* (+ a_m b) (- a_m b)) (sin t_0))))
(* (cos t_0) (* 2.0 (* a_m (* a_m (sin t_1))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = angle * (((double) M_PI) / -180.0);
double t_1 = -0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (a_m <= 1.25e+150) {
tmp = cos(t_1) * (2.0 * (((a_m + b) * (a_m - b)) * sin(t_0)));
} else {
tmp = cos(t_0) * (2.0 * (a_m * (a_m * sin(t_1))));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = angle * (Math.PI / -180.0);
double t_1 = -0.005555555555555556 * (angle * Math.PI);
double tmp;
if (a_m <= 1.25e+150) {
tmp = Math.cos(t_1) * (2.0 * (((a_m + b) * (a_m - b)) * Math.sin(t_0)));
} else {
tmp = Math.cos(t_0) * (2.0 * (a_m * (a_m * Math.sin(t_1))));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = angle * (math.pi / -180.0) t_1 = -0.005555555555555556 * (angle * math.pi) tmp = 0 if a_m <= 1.25e+150: tmp = math.cos(t_1) * (2.0 * (((a_m + b) * (a_m - b)) * math.sin(t_0))) else: tmp = math.cos(t_0) * (2.0 * (a_m * (a_m * math.sin(t_1)))) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(angle * Float64(pi / -180.0)) t_1 = Float64(-0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (a_m <= 1.25e+150) tmp = Float64(cos(t_1) * Float64(2.0 * Float64(Float64(Float64(a_m + b) * Float64(a_m - b)) * sin(t_0)))); else tmp = Float64(cos(t_0) * Float64(2.0 * Float64(a_m * Float64(a_m * sin(t_1))))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = angle * (pi / -180.0); t_1 = -0.005555555555555556 * (angle * pi); tmp = 0.0; if (a_m <= 1.25e+150) tmp = cos(t_1) * (2.0 * (((a_m + b) * (a_m - b)) * sin(t_0))); else tmp = cos(t_0) * (2.0 * (a_m * (a_m * sin(t_1)))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a$95$m, 1.25e+150], N[(N[Cos[t$95$1], $MachinePrecision] * N[(2.0 * N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$0], $MachinePrecision] * N[(2.0 * N[(a$95$m * N[(a$95$m * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := angle \cdot \frac{\pi}{-180}\\
t_1 := -0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;a\_m \leq 1.25 \cdot 10^{+150}:\\
\;\;\;\;\cos t\_1 \cdot \left(2 \cdot \left(\left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right) \cdot \sin t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos t\_0 \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot \sin t\_1\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.25000000000000002e150Initial program 53.7%
Simplified55.9%
unpow255.9%
unpow255.9%
difference-of-squares57.8%
Applied egg-rr57.8%
Taylor expanded in angle around inf 57.2%
if 1.25000000000000002e150 < a Initial program 46.7%
Simplified46.7%
unpow246.7%
unpow246.7%
difference-of-squares56.5%
Applied egg-rr56.5%
add-cbrt-cube59.5%
pow359.5%
Applied egg-rr59.5%
Taylor expanded in b around 0 53.4%
associate-*r*53.4%
fma-define53.4%
distribute-rgt1-in53.4%
metadata-eval53.4%
mul0-lft53.4%
fma-undefine53.4%
Simplified78.7%
Final simplification60.0%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* angle (/ PI -180.0))) (t_1 (cos t_0)))
(if (<= a_m 2.6e+150)
(* t_1 (* 2.0 (* (* (+ a_m b) (- a_m b)) (sin t_0))))
(*
t_1
(* 2.0 (* a_m (* a_m (sin (* -0.005555555555555556 (* angle PI))))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = angle * (((double) M_PI) / -180.0);
double t_1 = cos(t_0);
double tmp;
if (a_m <= 2.6e+150) {
tmp = t_1 * (2.0 * (((a_m + b) * (a_m - b)) * sin(t_0)));
} else {
tmp = t_1 * (2.0 * (a_m * (a_m * sin((-0.005555555555555556 * (angle * ((double) M_PI)))))));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = angle * (Math.PI / -180.0);
double t_1 = Math.cos(t_0);
double tmp;
if (a_m <= 2.6e+150) {
tmp = t_1 * (2.0 * (((a_m + b) * (a_m - b)) * Math.sin(t_0)));
} else {
tmp = t_1 * (2.0 * (a_m * (a_m * Math.sin((-0.005555555555555556 * (angle * Math.PI))))));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = angle * (math.pi / -180.0) t_1 = math.cos(t_0) tmp = 0 if a_m <= 2.6e+150: tmp = t_1 * (2.0 * (((a_m + b) * (a_m - b)) * math.sin(t_0))) else: tmp = t_1 * (2.0 * (a_m * (a_m * math.sin((-0.005555555555555556 * (angle * math.pi)))))) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(angle * Float64(pi / -180.0)) t_1 = cos(t_0) tmp = 0.0 if (a_m <= 2.6e+150) tmp = Float64(t_1 * Float64(2.0 * Float64(Float64(Float64(a_m + b) * Float64(a_m - b)) * sin(t_0)))); else tmp = Float64(t_1 * Float64(2.0 * Float64(a_m * Float64(a_m * sin(Float64(-0.005555555555555556 * Float64(angle * pi))))))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = angle * (pi / -180.0); t_1 = cos(t_0); tmp = 0.0; if (a_m <= 2.6e+150) tmp = t_1 * (2.0 * (((a_m + b) * (a_m - b)) * sin(t_0))); else tmp = t_1 * (2.0 * (a_m * (a_m * sin((-0.005555555555555556 * (angle * pi)))))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[a$95$m, 2.6e+150], N[(t$95$1 * N[(2.0 * N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(2.0 * N[(a$95$m * N[(a$95$m * N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := angle \cdot \frac{\pi}{-180}\\
t_1 := \cos t\_0\\
\mathbf{if}\;a\_m \leq 2.6 \cdot 10^{+150}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(\left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right) \cdot \sin t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(a\_m \cdot \left(a\_m \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.60000000000000006e150Initial program 53.7%
Simplified55.9%
unpow255.9%
unpow255.9%
difference-of-squares57.8%
Applied egg-rr57.8%
if 2.60000000000000006e150 < a Initial program 46.7%
Simplified46.7%
unpow246.7%
unpow246.7%
difference-of-squares56.5%
Applied egg-rr56.5%
add-cbrt-cube59.5%
pow359.5%
Applied egg-rr59.5%
Taylor expanded in b around 0 53.4%
associate-*r*53.4%
fma-define53.4%
distribute-rgt1-in53.4%
metadata-eval53.4%
mul0-lft53.4%
fma-undefine53.4%
Simplified78.7%
Final simplification60.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* (+ a_m b) (- a_m b))))
(if (<= angle 16000000000000.0)
(*
2.0
(*
-0.005555555555555556
(- (* a_m (* a_m (* angle PI))) (* angle (* PI (pow b 2.0))))))
(if (<= angle 4.5e+45)
(* 2.0 (* (sin (* -0.005555555555555556 (* angle PI))) t_0))
(if (<= angle 5.5e+121)
(* 2.0 (* t_0 (sin (* PI (* angle 0.005555555555555556)))))
(* 2.0 (* t_0 (sin (* PI (/ angle -180.0))))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = (a_m + b) * (a_m - b);
double tmp;
if (angle <= 16000000000000.0) {
tmp = 2.0 * (-0.005555555555555556 * ((a_m * (a_m * (angle * ((double) M_PI)))) - (angle * (((double) M_PI) * pow(b, 2.0)))));
} else if (angle <= 4.5e+45) {
tmp = 2.0 * (sin((-0.005555555555555556 * (angle * ((double) M_PI)))) * t_0);
} else if (angle <= 5.5e+121) {
tmp = 2.0 * (t_0 * sin((((double) M_PI) * (angle * 0.005555555555555556))));
} else {
tmp = 2.0 * (t_0 * sin((((double) M_PI) * (angle / -180.0))));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = (a_m + b) * (a_m - b);
double tmp;
if (angle <= 16000000000000.0) {
tmp = 2.0 * (-0.005555555555555556 * ((a_m * (a_m * (angle * Math.PI))) - (angle * (Math.PI * Math.pow(b, 2.0)))));
} else if (angle <= 4.5e+45) {
tmp = 2.0 * (Math.sin((-0.005555555555555556 * (angle * Math.PI))) * t_0);
} else if (angle <= 5.5e+121) {
tmp = 2.0 * (t_0 * Math.sin((Math.PI * (angle * 0.005555555555555556))));
} else {
tmp = 2.0 * (t_0 * Math.sin((Math.PI * (angle / -180.0))));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = (a_m + b) * (a_m - b) tmp = 0 if angle <= 16000000000000.0: tmp = 2.0 * (-0.005555555555555556 * ((a_m * (a_m * (angle * math.pi))) - (angle * (math.pi * math.pow(b, 2.0))))) elif angle <= 4.5e+45: tmp = 2.0 * (math.sin((-0.005555555555555556 * (angle * math.pi))) * t_0) elif angle <= 5.5e+121: tmp = 2.0 * (t_0 * math.sin((math.pi * (angle * 0.005555555555555556)))) else: tmp = 2.0 * (t_0 * math.sin((math.pi * (angle / -180.0)))) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(a_m + b) * Float64(a_m - b)) tmp = 0.0 if (angle <= 16000000000000.0) tmp = Float64(2.0 * Float64(-0.005555555555555556 * Float64(Float64(a_m * Float64(a_m * Float64(angle * pi))) - Float64(angle * Float64(pi * (b ^ 2.0)))))); elseif (angle <= 4.5e+45) tmp = Float64(2.0 * Float64(sin(Float64(-0.005555555555555556 * Float64(angle * pi))) * t_0)); elseif (angle <= 5.5e+121) tmp = Float64(2.0 * Float64(t_0 * sin(Float64(pi * Float64(angle * 0.005555555555555556))))); else tmp = Float64(2.0 * Float64(t_0 * sin(Float64(pi * Float64(angle / -180.0))))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (a_m + b) * (a_m - b); tmp = 0.0; if (angle <= 16000000000000.0) tmp = 2.0 * (-0.005555555555555556 * ((a_m * (a_m * (angle * pi))) - (angle * (pi * (b ^ 2.0))))); elseif (angle <= 4.5e+45) tmp = 2.0 * (sin((-0.005555555555555556 * (angle * pi))) * t_0); elseif (angle <= 5.5e+121) tmp = 2.0 * (t_0 * sin((pi * (angle * 0.005555555555555556)))); else tmp = 2.0 * (t_0 * sin((pi * (angle / -180.0)))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, 16000000000000.0], N[(2.0 * N[(-0.005555555555555556 * N[(N[(a$95$m * N[(a$95$m * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(angle * N[(Pi * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 4.5e+45], N[(2.0 * N[(N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 5.5e+121], N[(2.0 * N[(t$95$0 * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$0 * N[Sin[N[(Pi * N[(angle / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(a\_m + b\right) \cdot \left(a\_m - b\right)\\
\mathbf{if}\;angle \leq 16000000000000:\\
\;\;\;\;2 \cdot \left(-0.005555555555555556 \cdot \left(a\_m \cdot \left(a\_m \cdot \left(angle \cdot \pi\right)\right) - angle \cdot \left(\pi \cdot {b}^{2}\right)\right)\right)\\
\mathbf{elif}\;angle \leq 4.5 \cdot 10^{+45}:\\
\;\;\;\;2 \cdot \left(\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot t\_0\right)\\
\mathbf{elif}\;angle \leq 5.5 \cdot 10^{+121}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \sin \left(\pi \cdot \frac{angle}{-180}\right)\right)\\
\end{array}
\end{array}
if angle < 1.6e13Initial program 60.9%
Simplified62.9%
unpow262.9%
unpow262.9%
difference-of-squares66.2%
Applied egg-rr66.2%
Taylor expanded in angle around 0 58.5%
Taylor expanded in angle around 0 59.6%
Taylor expanded in a around 0 61.5%
+-commutative61.5%
mul-1-neg61.5%
unsub-neg61.5%
+-commutative61.5%
associate-*r*61.5%
distribute-rgt1-in61.5%
metadata-eval61.5%
mul0-lft61.5%
*-commutative61.5%
distribute-lft-out61.5%
Simplified61.5%
if 1.6e13 < angle < 4.4999999999999998e45Initial program 0.2%
Simplified3.8%
unpow23.8%
unpow23.8%
difference-of-squares23.8%
Applied egg-rr23.8%
Taylor expanded in angle around 0 60.2%
Taylor expanded in angle around inf 67.8%
*-commutative67.8%
Simplified67.8%
if 4.4999999999999998e45 < angle < 5.4999999999999998e121Initial program 25.3%
Simplified21.8%
unpow221.8%
unpow221.8%
difference-of-squares21.8%
Applied egg-rr21.8%
Taylor expanded in angle around 0 24.3%
*-un-lft-identity24.3%
*-commutative24.3%
Applied egg-rr30.7%
if 5.4999999999999998e121 < angle Initial program 28.7%
Simplified32.4%
unpow232.4%
unpow232.4%
difference-of-squares32.4%
Applied egg-rr32.4%
Taylor expanded in angle around 0 41.5%
clear-num41.5%
un-div-inv41.5%
Applied egg-rr41.5%
associate-/r/43.1%
*-commutative43.1%
Simplified43.1%
Final simplification57.0%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* (+ a_m b) (- a_m b))))
(if (<= b 1e+175)
(* 2.0 (* t_0 (sin (* angle (/ PI -180.0)))))
(* 2.0 (* -0.005555555555555556 (* angle (* PI t_0)))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = (a_m + b) * (a_m - b);
double tmp;
if (b <= 1e+175) {
tmp = 2.0 * (t_0 * sin((angle * (((double) M_PI) / -180.0))));
} else {
tmp = 2.0 * (-0.005555555555555556 * (angle * (((double) M_PI) * t_0)));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = (a_m + b) * (a_m - b);
double tmp;
if (b <= 1e+175) {
tmp = 2.0 * (t_0 * Math.sin((angle * (Math.PI / -180.0))));
} else {
tmp = 2.0 * (-0.005555555555555556 * (angle * (Math.PI * t_0)));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = (a_m + b) * (a_m - b) tmp = 0 if b <= 1e+175: tmp = 2.0 * (t_0 * math.sin((angle * (math.pi / -180.0)))) else: tmp = 2.0 * (-0.005555555555555556 * (angle * (math.pi * t_0))) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(a_m + b) * Float64(a_m - b)) tmp = 0.0 if (b <= 1e+175) tmp = Float64(2.0 * Float64(t_0 * sin(Float64(angle * Float64(pi / -180.0))))); else tmp = Float64(2.0 * Float64(-0.005555555555555556 * Float64(angle * Float64(pi * t_0)))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (a_m + b) * (a_m - b); tmp = 0.0; if (b <= 1e+175) tmp = 2.0 * (t_0 * sin((angle * (pi / -180.0)))); else tmp = 2.0 * (-0.005555555555555556 * (angle * (pi * t_0))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 1e+175], N[(2.0 * N[(t$95$0 * N[Sin[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(-0.005555555555555556 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(a\_m + b\right) \cdot \left(a\_m - b\right)\\
\mathbf{if}\;b \leq 10^{+175}:\\
\;\;\;\;2 \cdot \left(t\_0 \cdot \sin \left(angle \cdot \frac{\pi}{-180}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if b < 9.9999999999999994e174Initial program 55.2%
Simplified56.5%
unpow256.5%
unpow256.5%
difference-of-squares58.5%
Applied egg-rr58.5%
Taylor expanded in angle around 0 54.3%
if 9.9999999999999994e174 < b Initial program 36.6%
Simplified42.5%
unpow242.5%
unpow242.5%
difference-of-squares51.9%
Applied egg-rr51.9%
Taylor expanded in angle around 0 51.9%
Taylor expanded in angle around 0 63.7%
Final simplification55.5%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* 2.0 (* (* (+ a_m b) (- a_m b)) (sin (* PI (* angle -0.005555555555555556))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return 2.0 * (((a_m + b) * (a_m - b)) * sin((((double) M_PI) * (angle * -0.005555555555555556))));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return 2.0 * (((a_m + b) * (a_m - b)) * Math.sin((Math.PI * (angle * -0.005555555555555556))));
}
a_m = math.fabs(a) def code(a_m, b, angle): return 2.0 * (((a_m + b) * (a_m - b)) * math.sin((math.pi * (angle * -0.005555555555555556))))
a_m = abs(a) function code(a_m, b, angle) return Float64(2.0 * Float64(Float64(Float64(a_m + b) * Float64(a_m - b)) * sin(Float64(pi * Float64(angle * -0.005555555555555556))))) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = 2.0 * (((a_m + b) * (a_m - b)) * sin((pi * (angle * -0.005555555555555556)))); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(2.0 * N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
2 \cdot \left(\left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)\right)
\end{array}
Initial program 52.8%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares57.6%
Applied egg-rr57.6%
Taylor expanded in angle around 0 54.0%
Taylor expanded in angle around inf 55.0%
*-commutative55.0%
*-commutative55.0%
associate-*l*55.4%
Simplified55.4%
Final simplification55.4%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* 2.0 (* (* (+ a_m b) (- a_m b)) (sin (* PI (/ angle -180.0))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return 2.0 * (((a_m + b) * (a_m - b)) * sin((((double) M_PI) * (angle / -180.0))));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return 2.0 * (((a_m + b) * (a_m - b)) * Math.sin((Math.PI * (angle / -180.0))));
}
a_m = math.fabs(a) def code(a_m, b, angle): return 2.0 * (((a_m + b) * (a_m - b)) * math.sin((math.pi * (angle / -180.0))))
a_m = abs(a) function code(a_m, b, angle) return Float64(2.0 * Float64(Float64(Float64(a_m + b) * Float64(a_m - b)) * sin(Float64(pi * Float64(angle / -180.0))))) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = 2.0 * (((a_m + b) * (a_m - b)) * sin((pi * (angle / -180.0)))); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(2.0 * N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
2 \cdot \left(\left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{-180}\right)\right)
\end{array}
Initial program 52.8%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares57.6%
Applied egg-rr57.6%
Taylor expanded in angle around 0 54.0%
clear-num54.0%
un-div-inv53.9%
Applied egg-rr53.9%
associate-/r/56.5%
*-commutative56.5%
Simplified56.5%
Final simplification56.5%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* 2.0 (* -0.005555555555555556 (* angle (* PI (* (+ a_m b) (- a_m b)))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return 2.0 * (-0.005555555555555556 * (angle * (((double) M_PI) * ((a_m + b) * (a_m - b)))));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return 2.0 * (-0.005555555555555556 * (angle * (Math.PI * ((a_m + b) * (a_m - b)))));
}
a_m = math.fabs(a) def code(a_m, b, angle): return 2.0 * (-0.005555555555555556 * (angle * (math.pi * ((a_m + b) * (a_m - b)))))
a_m = abs(a) function code(a_m, b, angle) return Float64(2.0 * Float64(-0.005555555555555556 * Float64(angle * Float64(pi * Float64(Float64(a_m + b) * Float64(a_m - b)))))) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = 2.0 * (-0.005555555555555556 * (angle * (pi * ((a_m + b) * (a_m - b))))); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(2.0 * N[(-0.005555555555555556 * N[(angle * N[(Pi * N[(N[(a$95$m + b), $MachinePrecision] * N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
2 \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a\_m + b\right) \cdot \left(a\_m - b\right)\right)\right)\right)\right)
\end{array}
Initial program 52.8%
Simplified54.7%
unpow254.7%
unpow254.7%
difference-of-squares57.6%
Applied egg-rr57.6%
Taylor expanded in angle around 0 54.0%
Taylor expanded in angle around 0 52.3%
Final simplification52.3%
herbie shell --seed 2024076
(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)))))