
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (/ angle 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\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 (* (/ angle 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0
(fma
PI
(* PI (* (* angle_m angle_m) -2.8577960676726107e-8))
0.005555555555555556)))
(if (<= (/ angle_m 180.0) 2000000000.0)
(fma
(* a angle_m)
(* (* PI t_0) (* angle_m (* PI (* a t_0))))
(* (* b b) (fma 0.5 (cos (* PI (* angle_m 0.011111111111111112))) 0.5)))
(fma
1.0
(* b b)
(*
a
(*
a
(+ 0.5 (* -0.5 (cos (* 0.011111111111111112 (* angle_m PI)))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = fma(((double) M_PI), (((double) M_PI) * ((angle_m * angle_m) * -2.8577960676726107e-8)), 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 2000000000.0) {
tmp = fma((a * angle_m), ((((double) M_PI) * t_0) * (angle_m * (((double) M_PI) * (a * t_0)))), ((b * b) * fma(0.5, cos((((double) M_PI) * (angle_m * 0.011111111111111112))), 0.5)));
} else {
tmp = fma(1.0, (b * b), (a * (a * (0.5 + (-0.5 * cos((0.011111111111111112 * (angle_m * ((double) M_PI)))))))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = fma(pi, Float64(pi * Float64(Float64(angle_m * angle_m) * -2.8577960676726107e-8)), 0.005555555555555556) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2000000000.0) tmp = fma(Float64(a * angle_m), Float64(Float64(pi * t_0) * Float64(angle_m * Float64(pi * Float64(a * t_0)))), Float64(Float64(b * b) * fma(0.5, cos(Float64(pi * Float64(angle_m * 0.011111111111111112))), 0.5))); else tmp = fma(1.0, Float64(b * b), Float64(a * Float64(a * Float64(0.5 + Float64(-0.5 * cos(Float64(0.011111111111111112 * Float64(angle_m * pi)))))))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(Pi * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * -2.8577960676726107e-8), $MachinePrecision]), $MachinePrecision] + 0.005555555555555556), $MachinePrecision]}, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2000000000.0], N[(N[(a * angle$95$m), $MachinePrecision] * N[(N[(Pi * t$95$0), $MachinePrecision] * N[(angle$95$m * N[(Pi * N[(a * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 * N[Cos[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(b * b), $MachinePrecision] + N[(a * N[(a * N[(0.5 + N[(-0.5 * N[Cos[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\pi, \pi \cdot \left(\left(angle\_m \cdot angle\_m\right) \cdot -2.8577960676726107 \cdot 10^{-8}\right), 0.005555555555555556\right)\\
\mathbf{if}\;\frac{angle\_m}{180} \leq 2000000000:\\
\;\;\;\;\mathsf{fma}\left(a \cdot angle\_m, \left(\pi \cdot t\_0\right) \cdot \left(angle\_m \cdot \left(\pi \cdot \left(a \cdot t\_0\right)\right)\right), \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right), 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, b \cdot b, a \cdot \left(a \cdot \left(0.5 + -0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e9Initial program 91.4%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
Simplified89.7%
Applied egg-rr89.8%
if 2e9 < (/.f64 angle #s(literal 180 binary64)) Initial program 52.6%
Applied egg-rr53.0%
*-commutativeN/A
lift-PI.f64N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f6447.8
Applied egg-rr47.8%
Applied egg-rr52.5%
Taylor expanded in angle around 0
Simplified53.0%
Final simplification82.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* a (sin (* (* angle_m 0.005555555555555556) PI))))
(t_1 (pow (cbrt (sqrt PI)) 3.0)))
(fma
t_0
t_0
(*
(* b b)
(+
0.5
(*
0.5
(cos
(*
2.0
(* (/ (sqrt (* t_1 t_1)) 180.0) (/ (sqrt PI) (/ 1.0 angle_m)))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = a * sin(((angle_m * 0.005555555555555556) * ((double) M_PI)));
double t_1 = pow(cbrt(sqrt(((double) M_PI))), 3.0);
return fma(t_0, t_0, ((b * b) * (0.5 + (0.5 * cos((2.0 * ((sqrt((t_1 * t_1)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle_m)))))))));
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(a * sin(Float64(Float64(angle_m * 0.005555555555555556) * pi))) t_1 = cbrt(sqrt(pi)) ^ 3.0 return fma(t_0, t_0, Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(sqrt(Float64(t_1 * t_1)) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle_m))))))))) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(a * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\
t_1 := {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\\
\mathsf{fma}\left(t\_0, t\_0, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{t\_1 \cdot t\_1}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle\_m}}\right)\right)\right)\right)
\end{array}
\end{array}
Initial program 83.5%
Applied egg-rr83.6%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
associate-*l/N/A
*-lft-identityN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6483.7
Applied egg-rr83.7%
add-cube-cbrtN/A
pow3N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
cbrt-prodN/A
unpow-prod-downN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cbrt.f64N/A
lower-pow.f64N/A
lower-cbrt.f6483.7
Applied egg-rr83.7%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* a (sin (* (* angle_m 0.005555555555555556) PI)))))
(fma
t_0
t_0
(*
(* b b)
(+
0.5
(*
0.5
(cos
(*
2.0
(* (/ (sqrt PI) 180.0) (/ 1.0 (/ 1.0 (* angle_m (sqrt PI)))))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = a * sin(((angle_m * 0.005555555555555556) * ((double) M_PI)));
return fma(t_0, t_0, ((b * b) * (0.5 + (0.5 * cos((2.0 * ((sqrt(((double) M_PI)) / 180.0) * (1.0 / (1.0 / (angle_m * sqrt(((double) M_PI))))))))))));
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(a * sin(Float64(Float64(angle_m * 0.005555555555555556) * pi))) return fma(t_0, t_0, Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(sqrt(pi) / 180.0) * Float64(1.0 / Float64(1.0 / Float64(angle_m * sqrt(pi))))))))))) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(a * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(1.0 / N[(1.0 / N[(angle$95$m * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\
\mathsf{fma}\left(t\_0, t\_0, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \frac{1}{\frac{1}{angle\_m \cdot \sqrt{\pi}}}\right)\right)\right)\right)
\end{array}
\end{array}
Initial program 83.5%
Applied egg-rr83.6%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
associate-*l/N/A
*-lft-identityN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6483.7
Applied egg-rr83.7%
lift-PI.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
lift-/.f64N/A
lower-/.f6483.7
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
lower-*.f6483.7
Applied egg-rr83.7%
Final simplification83.7%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* a (sin (* (* angle_m 0.005555555555555556) PI)))))
(fma
t_0
t_0
(*
(* b b)
(+
0.5
(* 0.5 (cos (* 2.0 (* (/ (sqrt PI) 180.0) (* angle_m (sqrt PI)))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = a * sin(((angle_m * 0.005555555555555556) * ((double) M_PI)));
return fma(t_0, t_0, ((b * b) * (0.5 + (0.5 * cos((2.0 * ((sqrt(((double) M_PI)) / 180.0) * (angle_m * sqrt(((double) M_PI))))))))));
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(a * sin(Float64(Float64(angle_m * 0.005555555555555556) * pi))) return fma(t_0, t_0, Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(sqrt(pi) / 180.0) * Float64(angle_m * sqrt(pi))))))))) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(a * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(angle$95$m * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\
\mathsf{fma}\left(t\_0, t\_0, \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\frac{\sqrt{\pi}}{180} \cdot \left(angle\_m \cdot \sqrt{\pi}\right)\right)\right)\right)\right)
\end{array}
\end{array}
Initial program 83.5%
Applied egg-rr83.6%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
associate-*l/N/A
*-lft-identityN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6483.7
Applied egg-rr83.7%
lift-PI.f64N/A
lift-sqrt.f64N/A
associate-/r/N/A
/-rgt-identityN/A
lower-*.f6483.7
Applied egg-rr83.7%
Final simplification83.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* a (sin (* (* angle_m 0.005555555555555556) PI))))) (fma t_0 t_0 (* b b))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = a * sin(((angle_m * 0.005555555555555556) * ((double) M_PI)));
return fma(t_0, t_0, (b * b));
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(a * sin(Float64(Float64(angle_m * 0.005555555555555556) * pi))) return fma(t_0, t_0, Float64(b * b)) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(a * N[Sin[N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(b * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := a \cdot \sin \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\\
\mathsf{fma}\left(t\_0, t\_0, b \cdot b\right)
\end{array}
\end{array}
Initial program 83.5%
Applied egg-rr83.6%
Taylor expanded in angle around 0
Simplified83.6%
Final simplification83.6%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (cos (* 0.011111111111111112 (* angle_m PI)))))
(if (<= (/ angle_m 180.0) 2e+29)
(fma
(fma 0.5 t_0 0.5)
(* b b)
(* a (* angle_m (* angle_m (* a (* 3.08641975308642e-5 (* PI PI)))))))
(fma 1.0 (* b b) (* a (* a (+ 0.5 (* -0.5 t_0))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = cos((0.011111111111111112 * (angle_m * ((double) M_PI))));
double tmp;
if ((angle_m / 180.0) <= 2e+29) {
tmp = fma(fma(0.5, t_0, 0.5), (b * b), (a * (angle_m * (angle_m * (a * (3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI))))))));
} else {
tmp = fma(1.0, (b * b), (a * (a * (0.5 + (-0.5 * t_0)))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = cos(Float64(0.011111111111111112 * Float64(angle_m * pi))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e+29) tmp = fma(fma(0.5, t_0, 0.5), Float64(b * b), Float64(a * Float64(angle_m * Float64(angle_m * Float64(a * Float64(3.08641975308642e-5 * Float64(pi * pi))))))); else tmp = fma(1.0, Float64(b * b), Float64(a * Float64(a * Float64(0.5 + Float64(-0.5 * t_0))))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Cos[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+29], N[(N[(0.5 * t$95$0 + 0.5), $MachinePrecision] * N[(b * b), $MachinePrecision] + N[(a * N[(angle$95$m * N[(angle$95$m * N[(a * N[(3.08641975308642e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(b * b), $MachinePrecision] + N[(a * N[(a * N[(0.5 + N[(-0.5 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \cos \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.5, t\_0, 0.5\right), b \cdot b, a \cdot \left(angle\_m \cdot \left(angle\_m \cdot \left(a \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, b \cdot b, a \cdot \left(a \cdot \left(0.5 + -0.5 \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999983e29Initial program 91.0%
Applied egg-rr91.0%
*-commutativeN/A
lift-PI.f64N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f6490.1
Applied egg-rr90.1%
Applied egg-rr71.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6488.7
Simplified88.7%
if 1.99999999999999983e29 < (/.f64 angle #s(literal 180 binary64)) Initial program 53.3%
Applied egg-rr53.7%
*-commutativeN/A
lift-PI.f64N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f6448.4
Applied egg-rr48.4%
Applied egg-rr53.2%
Taylor expanded in angle around 0
Simplified53.6%
Final simplification81.7%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (cos (* 0.011111111111111112 (* angle_m PI)))))
(if (<= (/ angle_m 180.0) 2e+29)
(fma
(* (* a 3.08641975308642e-5) (* PI (* PI (* angle_m angle_m))))
a
(* (* b b) (fma 0.5 t_0 0.5)))
(fma 1.0 (* b b) (* a (* a (+ 0.5 (* -0.5 t_0))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = cos((0.011111111111111112 * (angle_m * ((double) M_PI))));
double tmp;
if ((angle_m / 180.0) <= 2e+29) {
tmp = fma(((a * 3.08641975308642e-5) * (((double) M_PI) * (((double) M_PI) * (angle_m * angle_m)))), a, ((b * b) * fma(0.5, t_0, 0.5)));
} else {
tmp = fma(1.0, (b * b), (a * (a * (0.5 + (-0.5 * t_0)))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = cos(Float64(0.011111111111111112 * Float64(angle_m * pi))) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e+29) tmp = fma(Float64(Float64(a * 3.08641975308642e-5) * Float64(pi * Float64(pi * Float64(angle_m * angle_m)))), a, Float64(Float64(b * b) * fma(0.5, t_0, 0.5))); else tmp = fma(1.0, Float64(b * b), Float64(a * Float64(a * Float64(0.5 + Float64(-0.5 * t_0))))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Cos[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+29], N[(N[(N[(a * 3.08641975308642e-5), $MachinePrecision] * N[(Pi * N[(Pi * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a + N[(N[(b * b), $MachinePrecision] * N[(0.5 * t$95$0 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(b * b), $MachinePrecision] + N[(a * N[(a * N[(0.5 + N[(-0.5 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \cos \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\\
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(\left(a \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \left(\pi \cdot \left(angle\_m \cdot angle\_m\right)\right)\right), a, \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, t\_0, 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, b \cdot b, a \cdot \left(a \cdot \left(0.5 + -0.5 \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999983e29Initial program 91.0%
lift-PI.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6491.1
Applied egg-rr91.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6471.4
Simplified71.4%
Applied egg-rr82.6%
if 1.99999999999999983e29 < (/.f64 angle #s(literal 180 binary64)) Initial program 53.3%
Applied egg-rr53.7%
*-commutativeN/A
lift-PI.f64N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f6448.4
Applied egg-rr48.4%
Applied egg-rr53.2%
Taylor expanded in angle around 0
Simplified53.6%
Final simplification76.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 7e+23)
(fma
(*
(* angle_m PI)
(* PI (fma b (* b -3.08641975308642e-5) (* 3.08641975308642e-5 (* a a)))))
angle_m
(* b b))
(fma
1.0
(* b b)
(*
a
(* a (+ 0.5 (* -0.5 (cos (* 0.011111111111111112 (* angle_m PI))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 7e+23) {
tmp = fma(((angle_m * ((double) M_PI)) * (((double) M_PI) * fma(b, (b * -3.08641975308642e-5), (3.08641975308642e-5 * (a * a))))), angle_m, (b * b));
} else {
tmp = fma(1.0, (b * b), (a * (a * (0.5 + (-0.5 * cos((0.011111111111111112 * (angle_m * ((double) M_PI)))))))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 7e+23) tmp = fma(Float64(Float64(angle_m * pi) * Float64(pi * fma(b, Float64(b * -3.08641975308642e-5), Float64(3.08641975308642e-5 * Float64(a * a))))), angle_m, Float64(b * b)); else tmp = fma(1.0, Float64(b * b), Float64(a * Float64(a * Float64(0.5 + Float64(-0.5 * cos(Float64(0.011111111111111112 * Float64(angle_m * pi)))))))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 7e+23], N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(Pi * N[(b * N[(b * -3.08641975308642e-5), $MachinePrecision] + N[(3.08641975308642e-5 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle$95$m + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(b * b), $MachinePrecision] + N[(a * N[(a * N[(0.5 + N[(-0.5 * N[Cos[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle\_m \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(b, b \cdot -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right)\right), angle\_m, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, b \cdot b, a \cdot \left(a \cdot \left(0.5 + -0.5 \cdot \cos \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 7.0000000000000004e23Initial program 82.5%
Applied egg-rr82.7%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified47.5%
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied egg-rr56.4%
if 7.0000000000000004e23 < b Initial program 87.2%
Applied egg-rr87.2%
*-commutativeN/A
lift-PI.f64N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f6485.3
Applied egg-rr85.3%
Applied egg-rr83.9%
Taylor expanded in angle around 0
Simplified82.2%
Final simplification61.7%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 1.35e+29)
(fma
(*
(* angle_m PI)
(* PI (fma b (* b -3.08641975308642e-5) (* 3.08641975308642e-5 (* a a)))))
angle_m
(* b b))
(* (* b b) (fma 0.5 (cos (* angle_m (* PI 0.011111111111111112))) 0.5))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.35e+29) {
tmp = fma(((angle_m * ((double) M_PI)) * (((double) M_PI) * fma(b, (b * -3.08641975308642e-5), (3.08641975308642e-5 * (a * a))))), angle_m, (b * b));
} else {
tmp = (b * b) * fma(0.5, cos((angle_m * (((double) M_PI) * 0.011111111111111112))), 0.5);
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.35e+29) tmp = fma(Float64(Float64(angle_m * pi) * Float64(pi * fma(b, Float64(b * -3.08641975308642e-5), Float64(3.08641975308642e-5 * Float64(a * a))))), angle_m, Float64(b * b)); else tmp = Float64(Float64(b * b) * fma(0.5, cos(Float64(angle_m * Float64(pi * 0.011111111111111112))), 0.5)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.35e+29], N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(Pi * N[(b * N[(b * -3.08641975308642e-5), $MachinePrecision] + N[(3.08641975308642e-5 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle$95$m + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(b * b), $MachinePrecision] * N[(0.5 * N[Cos[N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.35 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle\_m \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(b, b \cdot -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right)\right), angle\_m, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right), 0.5\right)\\
\end{array}
\end{array}
if b < 1.35e29Initial program 82.5%
Applied egg-rr82.7%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified47.5%
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied egg-rr56.4%
if 1.35e29 < b Initial program 87.2%
Applied egg-rr87.2%
*-commutativeN/A
lift-PI.f64N/A
associate-*r*N/A
metadata-evalN/A
lift-*.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f6485.3
Applied egg-rr85.3%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6480.0
Simplified80.0%
Final simplification61.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 1.35e+29)
(fma
(*
(* angle_m PI)
(* PI (fma b (* b -3.08641975308642e-5) (* 3.08641975308642e-5 (* a a)))))
angle_m
(* b b))
(* (* b b) (fma 0.5 (cos (* 0.011111111111111112 (* angle_m PI))) 0.5))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.35e+29) {
tmp = fma(((angle_m * ((double) M_PI)) * (((double) M_PI) * fma(b, (b * -3.08641975308642e-5), (3.08641975308642e-5 * (a * a))))), angle_m, (b * b));
} else {
tmp = (b * b) * fma(0.5, cos((0.011111111111111112 * (angle_m * ((double) M_PI)))), 0.5);
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.35e+29) tmp = fma(Float64(Float64(angle_m * pi) * Float64(pi * fma(b, Float64(b * -3.08641975308642e-5), Float64(3.08641975308642e-5 * Float64(a * a))))), angle_m, Float64(b * b)); else tmp = Float64(Float64(b * b) * fma(0.5, cos(Float64(0.011111111111111112 * Float64(angle_m * pi))), 0.5)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.35e+29], N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(Pi * N[(b * N[(b * -3.08641975308642e-5), $MachinePrecision] + N[(3.08641975308642e-5 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle$95$m + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(b * b), $MachinePrecision] * N[(0.5 * N[Cos[N[(0.011111111111111112 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.35 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle\_m \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(b, b \cdot -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right)\right), angle\_m, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, \cos \left(0.011111111111111112 \cdot \left(angle\_m \cdot \pi\right)\right), 0.5\right)\\
\end{array}
\end{array}
if b < 1.35e29Initial program 82.5%
Applied egg-rr82.7%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified47.5%
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied egg-rr56.4%
if 1.35e29 < b Initial program 87.2%
Applied egg-rr87.2%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6480.0
Simplified80.0%
Final simplification61.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 1.35e+29)
(fma
(*
(* angle_m PI)
(* PI (fma b (* b -3.08641975308642e-5) (* 3.08641975308642e-5 (* a a)))))
angle_m
(* b b))
(* b b)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.35e+29) {
tmp = fma(((angle_m * ((double) M_PI)) * (((double) M_PI) * fma(b, (b * -3.08641975308642e-5), (3.08641975308642e-5 * (a * a))))), angle_m, (b * b));
} else {
tmp = b * b;
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.35e+29) tmp = fma(Float64(Float64(angle_m * pi) * Float64(pi * fma(b, Float64(b * -3.08641975308642e-5), Float64(3.08641975308642e-5 * Float64(a * a))))), angle_m, Float64(b * b)); else tmp = Float64(b * b); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.35e+29], N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(Pi * N[(b * N[(b * -3.08641975308642e-5), $MachinePrecision] + N[(3.08641975308642e-5 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle$95$m + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(b * b), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.35 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle\_m \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(b, b \cdot -3.08641975308642 \cdot 10^{-5}, 3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right)\right), angle\_m, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 1.35e29Initial program 82.5%
Applied egg-rr82.7%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified47.5%
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied egg-rr56.4%
if 1.35e29 < b Initial program 87.2%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6478.3
Simplified78.3%
Final simplification60.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 9.4e-123)
(* b b)
(if (<= a 1.4e+154)
(fma
(* angle_m angle_m)
(* (* PI PI) (* 3.08641975308642e-5 (* a a)))
(* b b))
(* (* a 3.08641975308642e-5) (* a (* angle_m (* PI (* angle_m PI))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 9.4e-123) {
tmp = b * b;
} else if (a <= 1.4e+154) {
tmp = fma((angle_m * angle_m), ((((double) M_PI) * ((double) M_PI)) * (3.08641975308642e-5 * (a * a))), (b * b));
} else {
tmp = (a * 3.08641975308642e-5) * (a * (angle_m * (((double) M_PI) * (angle_m * ((double) M_PI)))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 9.4e-123) tmp = Float64(b * b); elseif (a <= 1.4e+154) tmp = fma(Float64(angle_m * angle_m), Float64(Float64(pi * pi) * Float64(3.08641975308642e-5 * Float64(a * a))), Float64(b * b)); else tmp = Float64(Float64(a * 3.08641975308642e-5) * Float64(a * Float64(angle_m * Float64(pi * Float64(angle_m * pi))))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 9.4e-123], N[(b * b), $MachinePrecision], If[LessEqual[a, 1.4e+154], N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(3.08641975308642e-5 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(a * 3.08641975308642e-5), $MachinePrecision] * N[(a * N[(angle$95$m * N[(Pi * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 9.4 \cdot 10^{-123}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot angle\_m, \left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right), b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 9.4000000000000004e-123Initial program 83.2%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6465.6
Simplified65.6%
if 9.4000000000000004e-123 < a < 1.4e154Initial program 77.2%
Applied egg-rr77.2%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified45.9%
Taylor expanded in b around 0
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6470.4
Simplified70.4%
if 1.4e154 < a Initial program 99.5%
Applied egg-rr99.6%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified17.9%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6437.9
Simplified37.9%
associate-*r*N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6461.3
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6461.3
Applied egg-rr61.3%
Final simplification66.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* angle_m PI))))
(if (<= a 3.7e+117)
(* b b)
(if (<= a 3e+201)
(* angle_m (* (* 3.08641975308642e-5 (* a a)) t_0))
(* (* a 3.08641975308642e-5) (* a (* angle_m t_0)))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * ((double) M_PI));
double tmp;
if (a <= 3.7e+117) {
tmp = b * b;
} else if (a <= 3e+201) {
tmp = angle_m * ((3.08641975308642e-5 * (a * a)) * t_0);
} else {
tmp = (a * 3.08641975308642e-5) * (a * (angle_m * t_0));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.PI * (angle_m * Math.PI);
double tmp;
if (a <= 3.7e+117) {
tmp = b * b;
} else if (a <= 3e+201) {
tmp = angle_m * ((3.08641975308642e-5 * (a * a)) * t_0);
} else {
tmp = (a * 3.08641975308642e-5) * (a * (angle_m * t_0));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pi * (angle_m * math.pi) tmp = 0 if a <= 3.7e+117: tmp = b * b elif a <= 3e+201: tmp = angle_m * ((3.08641975308642e-5 * (a * a)) * t_0) else: tmp = (a * 3.08641975308642e-5) * (a * (angle_m * t_0)) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * pi)) tmp = 0.0 if (a <= 3.7e+117) tmp = Float64(b * b); elseif (a <= 3e+201) tmp = Float64(angle_m * Float64(Float64(3.08641975308642e-5 * Float64(a * a)) * t_0)); else tmp = Float64(Float64(a * 3.08641975308642e-5) * Float64(a * Float64(angle_m * t_0))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = pi * (angle_m * pi); tmp = 0.0; if (a <= 3.7e+117) tmp = b * b; elseif (a <= 3e+201) tmp = angle_m * ((3.08641975308642e-5 * (a * a)) * t_0); else tmp = (a * 3.08641975308642e-5) * (a * (angle_m * t_0)); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 3.7e+117], N[(b * b), $MachinePrecision], If[LessEqual[a, 3e+201], N[(angle$95$m * N[(N[(3.08641975308642e-5 * N[(a * a), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(a * 3.08641975308642e-5), $MachinePrecision] * N[(a * N[(angle$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot \pi\right)\\
\mathbf{if}\;a \leq 3.7 \cdot 10^{+117}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 3 \cdot 10^{+201}:\\
\;\;\;\;angle\_m \cdot \left(\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot \left(angle\_m \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if a < 3.6999999999999999e117Initial program 82.5%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6465.6
Simplified65.6%
if 3.6999999999999999e117 < a < 3.00000000000000025e201Initial program 79.5%
Applied egg-rr79.6%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified27.8%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6434.3
Simplified34.3%
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6453.0
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6453.0
Applied egg-rr53.0%
if 3.00000000000000025e201 < a Initial program 99.5%
Applied egg-rr99.6%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified18.7%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6440.9
Simplified40.9%
associate-*r*N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6462.7
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6462.7
Applied egg-rr62.7%
Final simplification64.6%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 1.66e+118) (* b b) (* (* a 3.08641975308642e-5) (* a (* angle_m (* PI (* angle_m PI)))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.66e+118) {
tmp = b * b;
} else {
tmp = (a * 3.08641975308642e-5) * (a * (angle_m * (((double) M_PI) * (angle_m * ((double) M_PI)))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.66e+118) {
tmp = b * b;
} else {
tmp = (a * 3.08641975308642e-5) * (a * (angle_m * (Math.PI * (angle_m * Math.PI))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 1.66e+118: tmp = b * b else: tmp = (a * 3.08641975308642e-5) * (a * (angle_m * (math.pi * (angle_m * math.pi)))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 1.66e+118) tmp = Float64(b * b); else tmp = Float64(Float64(a * 3.08641975308642e-5) * Float64(a * Float64(angle_m * Float64(pi * Float64(angle_m * pi))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 1.66e+118) tmp = b * b; else tmp = (a * 3.08641975308642e-5) * (a * (angle_m * (pi * (angle_m * pi)))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 1.66e+118], N[(b * b), $MachinePrecision], N[(N[(a * 3.08641975308642e-5), $MachinePrecision] * N[(a * N[(angle$95$m * N[(Pi * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.66 \cdot 10^{+118}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(a \cdot \left(angle\_m \cdot \left(\pi \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.66e118Initial program 82.5%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6465.6
Simplified65.6%
if 1.66e118 < a Initial program 90.1%
Applied egg-rr90.2%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified23.0%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6437.8
Simplified37.8%
associate-*r*N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6454.9
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lower-*.f6454.9
Applied egg-rr54.9%
Final simplification64.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (* b b))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return b * b;
}
angle_m = abs(angle)
real(8) function code(a, b, angle_m)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle_m
code = b * b
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return b * b;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return b * b
angle_m = abs(angle) function code(a, b, angle_m) return Float64(b * b) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = b * b; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
b \cdot b
\end{array}
Initial program 83.5%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6461.4
Simplified61.4%
herbie shell --seed 2024211
(FPCore (a b angle)
:name "ab-angle->ABCF A"
:precision binary64
(+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)))