
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (pow (/ 180.0 angle_m) -0.5)))
(+
(pow (* a (cos (* PI (* t_0 t_0)))) 2.0)
(pow
(*
b
(sin
(*
(pow PI 0.16666666666666666)
(*
(* angle_m (* 0.005555555555555556 (pow PI 0.6666666666666666)))
(pow PI 0.16666666666666666)))))
2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = pow((180.0 / angle_m), -0.5);
return pow((a * cos((((double) M_PI) * (t_0 * t_0)))), 2.0) + pow((b * sin((pow(((double) M_PI), 0.16666666666666666) * ((angle_m * (0.005555555555555556 * pow(((double) M_PI), 0.6666666666666666))) * pow(((double) M_PI), 0.16666666666666666))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.pow((180.0 / angle_m), -0.5);
return Math.pow((a * Math.cos((Math.PI * (t_0 * t_0)))), 2.0) + Math.pow((b * Math.sin((Math.pow(Math.PI, 0.16666666666666666) * ((angle_m * (0.005555555555555556 * Math.pow(Math.PI, 0.6666666666666666))) * Math.pow(Math.PI, 0.16666666666666666))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pow((180.0 / angle_m), -0.5) return math.pow((a * math.cos((math.pi * (t_0 * t_0)))), 2.0) + math.pow((b * math.sin((math.pow(math.pi, 0.16666666666666666) * ((angle_m * (0.005555555555555556 * math.pow(math.pi, 0.6666666666666666))) * math.pow(math.pi, 0.16666666666666666))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(180.0 / angle_m) ^ -0.5 return Float64((Float64(a * cos(Float64(pi * Float64(t_0 * t_0)))) ^ 2.0) + (Float64(b * sin(Float64((pi ^ 0.16666666666666666) * Float64(Float64(angle_m * Float64(0.005555555555555556 * (pi ^ 0.6666666666666666))) * (pi ^ 0.16666666666666666))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = (180.0 / angle_m) ^ -0.5; tmp = ((a * cos((pi * (t_0 * t_0)))) ^ 2.0) + ((b * sin(((pi ^ 0.16666666666666666) * ((angle_m * (0.005555555555555556 * (pi ^ 0.6666666666666666))) * (pi ^ 0.16666666666666666))))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Power[N[(180.0 / angle$95$m), $MachinePrecision], -0.5], $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[N[(Pi * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[Power[Pi, 0.16666666666666666], $MachinePrecision] * N[(N[(angle$95$m * N[(0.005555555555555556 * N[Power[Pi, 0.6666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[Pi, 0.16666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := {\left(\frac{180}{angle\_m}\right)}^{-0.5}\\
{\left(a \cdot \cos \left(\pi \cdot \left(t\_0 \cdot t\_0\right)\right)\right)}^{2} + {\left(b \cdot \sin \left({\pi}^{0.16666666666666666} \cdot \left(\left(angle\_m \cdot \left(0.005555555555555556 \cdot {\pi}^{0.6666666666666666}\right)\right) \cdot {\pi}^{0.16666666666666666}\right)\right)\right)}^{2}
\end{array}
\end{array}
Initial program 81.9%
*-commutativeN/A
add-cube-cbrtN/A
associate-*r*N/A
add-sqr-sqrtN/A
cbrt-prodN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr82.1%
clear-numN/A
inv-powN/A
sqr-powN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
metadata-eval40.2
Applied egg-rr40.2%
Final simplification40.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow
(*
b
(sin
(*
(pow PI 0.16666666666666666)
(*
(* angle_m (* 0.005555555555555556 (pow PI 0.6666666666666666)))
(pow PI 0.16666666666666666)))))
2.0)
(pow (* a (cos (* PI (/ angle_m 180.0)))) 2.0)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((pow(((double) M_PI), 0.16666666666666666) * ((angle_m * (0.005555555555555556 * pow(((double) M_PI), 0.6666666666666666))) * pow(((double) M_PI), 0.16666666666666666))))), 2.0) + pow((a * cos((((double) M_PI) * (angle_m / 180.0)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.pow(Math.PI, 0.16666666666666666) * ((angle_m * (0.005555555555555556 * Math.pow(Math.PI, 0.6666666666666666))) * Math.pow(Math.PI, 0.16666666666666666))))), 2.0) + Math.pow((a * Math.cos((Math.PI * (angle_m / 180.0)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((math.pow(math.pi, 0.16666666666666666) * ((angle_m * (0.005555555555555556 * math.pow(math.pi, 0.6666666666666666))) * math.pow(math.pi, 0.16666666666666666))))), 2.0) + math.pow((a * math.cos((math.pi * (angle_m / 180.0)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64((pi ^ 0.16666666666666666) * Float64(Float64(angle_m * Float64(0.005555555555555556 * (pi ^ 0.6666666666666666))) * (pi ^ 0.16666666666666666))))) ^ 2.0) + (Float64(a * cos(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin(((pi ^ 0.16666666666666666) * ((angle_m * (0.005555555555555556 * (pi ^ 0.6666666666666666))) * (pi ^ 0.16666666666666666))))) ^ 2.0) + ((a * cos((pi * (angle_m / 180.0)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(N[Power[Pi, 0.16666666666666666], $MachinePrecision] * N[(N[(angle$95$m * N[(0.005555555555555556 * N[Power[Pi, 0.6666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[Pi, 0.16666666666666666], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left({\pi}^{0.16666666666666666} \cdot \left(\left(angle\_m \cdot \left(0.005555555555555556 \cdot {\pi}^{0.6666666666666666}\right)\right) \cdot {\pi}^{0.16666666666666666}\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2}
\end{array}
Initial program 81.9%
*-commutativeN/A
add-cube-cbrtN/A
associate-*r*N/A
add-sqr-sqrtN/A
cbrt-prodN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr82.1%
Final simplification82.1%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow (* a (cos (* PI (/ angle_m 180.0)))) 2.0)
(pow
(*
b
(sin
(*
(* angle_m (sqrt (sqrt PI)))
(* 0.005555555555555556 (sqrt (* PI (sqrt PI)))))))
2.0)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * cos((((double) M_PI) * (angle_m / 180.0)))), 2.0) + pow((b * sin(((angle_m * sqrt(sqrt(((double) M_PI)))) * (0.005555555555555556 * sqrt((((double) M_PI) * sqrt(((double) M_PI)))))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.cos((Math.PI * (angle_m / 180.0)))), 2.0) + Math.pow((b * Math.sin(((angle_m * Math.sqrt(Math.sqrt(Math.PI))) * (0.005555555555555556 * Math.sqrt((Math.PI * Math.sqrt(Math.PI))))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.cos((math.pi * (angle_m / 180.0)))), 2.0) + math.pow((b * math.sin(((angle_m * math.sqrt(math.sqrt(math.pi))) * (0.005555555555555556 * math.sqrt((math.pi * math.sqrt(math.pi))))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * cos(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle_m * sqrt(sqrt(pi))) * Float64(0.005555555555555556 * sqrt(Float64(pi * sqrt(pi))))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * cos((pi * (angle_m / 180.0)))) ^ 2.0) + ((b * sin(((angle_m * sqrt(sqrt(pi))) * (0.005555555555555556 * sqrt((pi * sqrt(pi))))))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle$95$m * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(angle\_m \cdot \sqrt{\sqrt{\pi}}\right) \cdot \left(0.005555555555555556 \cdot \sqrt{\pi \cdot \sqrt{\pi}}\right)\right)\right)}^{2}
\end{array}
Initial program 81.9%
*-commutativeN/A
add-cube-cbrtN/A
associate-*r*N/A
add-sqr-sqrtN/A
cbrt-prodN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr82.1%
associate-*r*N/A
pow-prod-upN/A
metadata-evalN/A
pow1/3N/A
associate-*r*N/A
metadata-evalN/A
div-invN/A
sqr-powN/A
pow2N/A
metadata-evalN/A
pow1/3N/A
pow2N/A
associate-*r*N/A
add-cube-cbrtN/A
add-sqr-sqrtN/A
associate-*r*N/A
Applied egg-rr82.1%
Final simplification82.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (cos (/ 1.0 (/ 180.0 (* PI angle_m))))) 2.0) (pow (* b (sin (* PI (/ 0.005555555555555556 (/ 1.0 angle_m))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * cos((1.0 / (180.0 / (((double) M_PI) * angle_m))))), 2.0) + pow((b * sin((((double) M_PI) * (0.005555555555555556 / (1.0 / angle_m))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.cos((1.0 / (180.0 / (Math.PI * angle_m))))), 2.0) + Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 / (1.0 / angle_m))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.cos((1.0 / (180.0 / (math.pi * angle_m))))), 2.0) + math.pow((b * math.sin((math.pi * (0.005555555555555556 / (1.0 / angle_m))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * cos(Float64(1.0 / Float64(180.0 / Float64(pi * angle_m))))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(0.005555555555555556 / Float64(1.0 / angle_m))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * cos((1.0 / (180.0 / (pi * angle_m))))) ^ 2.0) + ((b * sin((pi * (0.005555555555555556 / (1.0 / angle_m))))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Cos[N[(1.0 / N[(180.0 / N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \cos \left(\frac{1}{\frac{180}{\pi \cdot angle\_m}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{0.005555555555555556}{\frac{1}{angle\_m}}\right)\right)}^{2}
\end{array}
Initial program 81.9%
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6482.0
Applied egg-rr82.0%
clear-numN/A
inv-powN/A
pow-to-expN/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f6439.4
Applied egg-rr39.4%
exp-to-powN/A
inv-powN/A
div-invN/A
associate-/r*N/A
metadata-evalN/A
/-lowering-/.f64N/A
/-lowering-/.f6482.0
Applied egg-rr82.0%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* b (sin (* PI (* angle_m 0.005555555555555556))))))
(fma
t_0
t_0
(*
(* a a)
(+
0.5
(*
0.5
(cos
(*
2.0
(* (* 0.005555555555555556 (sqrt PI)) (* angle_m (sqrt PI)))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = b * sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
return fma(t_0, t_0, ((a * a) * (0.5 + (0.5 * cos((2.0 * ((0.005555555555555556 * sqrt(((double) M_PI))) * (angle_m * sqrt(((double) M_PI))))))))));
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(b * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))) return fma(t_0, t_0, Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(0.005555555555555556 * sqrt(pi)) * Float64(angle_m * sqrt(pi))))))))) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(b * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(0.005555555555555556 * N[Sqrt[Pi], $MachinePrecision]), $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 := b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\\
\mathsf{fma}\left(t\_0, t\_0, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(0.005555555555555556 \cdot \sqrt{\pi}\right) \cdot \left(angle\_m \cdot \sqrt{\pi}\right)\right)\right)\right)\right)
\end{array}
\end{array}
Initial program 81.9%
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr82.0%
metadata-evalN/A
div-invN/A
*-commutativeN/A
add-sqr-sqrtN/A
associate-*r*N/A
div-invN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6482.0
Applied egg-rr82.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* PI (* angle_m 0.005555555555555556))) (t_1 (* b (sin t_0)))) (fma t_1 t_1 (* (* a a) (+ 0.5 (* 0.5 (cos (* 2.0 t_0))))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m * 0.005555555555555556);
double t_1 = b * sin(t_0);
return fma(t_1, t_1, ((a * a) * (0.5 + (0.5 * cos((2.0 * t_0))))));
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(angle_m * 0.005555555555555556)) t_1 = Float64(b * sin(t_0)) return fma(t_1, t_1, Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * t_0)))))) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$1 * t$95$1 + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\\
t_1 := b \cdot \sin t\_0\\
\mathsf{fma}\left(t\_1, t\_1, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right)\right)
\end{array}
\end{array}
Initial program 81.9%
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr82.0%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* b (sin (* angle_m (* PI 0.005555555555555556))))))
(fma
t_0
t_0
(* (* a a) (fma 0.5 (cos (* (* PI angle_m) 0.011111111111111112)) 0.5)))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = b * sin((angle_m * (((double) M_PI) * 0.005555555555555556)));
return fma(t_0, t_0, ((a * a) * fma(0.5, cos(((((double) M_PI) * angle_m) * 0.011111111111111112)), 0.5)));
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(b * sin(Float64(angle_m * Float64(pi * 0.005555555555555556)))) return fma(t_0, t_0, Float64(Float64(a * a) * fma(0.5, cos(Float64(Float64(pi * angle_m) * 0.011111111111111112)), 0.5))) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(b * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathsf{fma}\left(t\_0, t\_0, \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right), 0.5\right)\right)
\end{array}
\end{array}
Initial program 81.9%
*-commutativeN/A
add-cube-cbrtN/A
associate-*r*N/A
add-sqr-sqrtN/A
cbrt-prodN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr82.1%
Applied egg-rr82.0%
Final simplification82.0%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow
(*
b
(sin
(*
(* angle_m (sqrt (sqrt PI)))
(* 0.005555555555555556 (sqrt (* PI (sqrt PI)))))))
2.0)
(* a a)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin(((angle_m * sqrt(sqrt(((double) M_PI)))) * (0.005555555555555556 * sqrt((((double) M_PI) * sqrt(((double) M_PI)))))))), 2.0) + (a * a);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin(((angle_m * Math.sqrt(Math.sqrt(Math.PI))) * (0.005555555555555556 * Math.sqrt((Math.PI * Math.sqrt(Math.PI))))))), 2.0) + (a * a);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin(((angle_m * math.sqrt(math.sqrt(math.pi))) * (0.005555555555555556 * math.sqrt((math.pi * math.sqrt(math.pi))))))), 2.0) + (a * a)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(Float64(angle_m * sqrt(sqrt(pi))) * Float64(0.005555555555555556 * sqrt(Float64(pi * sqrt(pi))))))) ^ 2.0) + Float64(a * a)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin(((angle_m * sqrt(sqrt(pi))) * (0.005555555555555556 * sqrt((pi * sqrt(pi))))))) ^ 2.0) + (a * a); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(N[(angle$95$m * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\left(angle\_m \cdot \sqrt{\sqrt{\pi}}\right) \cdot \left(0.005555555555555556 \cdot \sqrt{\pi \cdot \sqrt{\pi}}\right)\right)\right)}^{2} + a \cdot a
\end{array}
Initial program 81.9%
*-commutativeN/A
add-cube-cbrtN/A
associate-*r*N/A
add-sqr-sqrtN/A
cbrt-prodN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr82.1%
associate-*r*N/A
pow-prod-upN/A
metadata-evalN/A
pow1/3N/A
associate-*r*N/A
metadata-evalN/A
div-invN/A
sqr-powN/A
pow2N/A
metadata-evalN/A
pow1/3N/A
pow2N/A
associate-*r*N/A
add-cube-cbrtN/A
add-sqr-sqrtN/A
associate-*r*N/A
Applied egg-rr82.1%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6481.8
Simplified81.8%
Final simplification81.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* b (sin (* PI (* angle_m 0.005555555555555556)))))) (fma t_0 t_0 (* a a))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = b * sin((((double) M_PI) * (angle_m * 0.005555555555555556)));
return fma(t_0, t_0, (a * a));
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(b * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))) return fma(t_0, t_0, Float64(a * a)) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(b * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(a * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\\
\mathsf{fma}\left(t\_0, t\_0, a \cdot a\right)
\end{array}
\end{array}
Initial program 81.9%
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr82.0%
Taylor expanded in angle around 0
Simplified81.8%
Final simplification81.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* b (sin (* angle_m (* PI 0.005555555555555556)))))) (fma t_0 t_0 (* a a))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = b * sin((angle_m * (((double) M_PI) * 0.005555555555555556)));
return fma(t_0, t_0, (a * a));
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(b * sin(Float64(angle_m * Float64(pi * 0.005555555555555556)))) return fma(t_0, t_0, Float64(a * a)) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(b * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 * t$95$0 + N[(a * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathsf{fma}\left(t\_0, t\_0, a \cdot a\right)
\end{array}
\end{array}
Initial program 81.9%
*-commutativeN/A
add-cube-cbrtN/A
associate-*r*N/A
add-sqr-sqrtN/A
cbrt-prodN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr82.1%
Applied egg-rr82.0%
Taylor expanded in angle around 0
Simplified81.7%
Final simplification81.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (* a a) (pow (* b (sin (/ PI (/ 180.0 angle_m)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return (a * a) + pow((b * sin((((double) M_PI) / (180.0 / angle_m)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return (a * a) + Math.pow((b * Math.sin((Math.PI / (180.0 / angle_m)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return (a * a) + math.pow((b * math.sin((math.pi / (180.0 / angle_m)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64(Float64(a * a) + (Float64(b * sin(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = (a * a) + ((b * sin((pi / (180.0 / angle_m)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
a \cdot a + {\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2}
\end{array}
Initial program 81.9%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6482.0
Applied egg-rr82.0%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6481.7
Simplified81.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (* a a) (pow (* b (sin (* PI (/ angle_m 180.0)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return (a * a) + pow((b * sin((((double) M_PI) * (angle_m / 180.0)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return (a * a) + Math.pow((b * Math.sin((Math.PI * (angle_m / 180.0)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return (a * a) + math.pow((b * math.sin((math.pi * (angle_m / 180.0)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64(Float64(a * a) + (Float64(b * sin(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = (a * a) + ((b * sin((pi * (angle_m / 180.0)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[(a * a), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
a \cdot a + {\left(b \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2}
\end{array}
Initial program 81.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6481.7
Simplified81.7%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* b (* 0.005555555555555556 (* PI angle_m)))))
(if (<= b 2.5e-80)
(* (* a a) (fma 0.5 (cos (* (* PI angle_m) 0.011111111111111112)) 0.5))
(fma
t_0
t_0
(*
(* a a)
(+
0.5
(* 0.5 (cos (* 2.0 (* PI (* angle_m 0.005555555555555556)))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = b * (0.005555555555555556 * (((double) M_PI) * angle_m));
double tmp;
if (b <= 2.5e-80) {
tmp = (a * a) * fma(0.5, cos(((((double) M_PI) * angle_m) * 0.011111111111111112)), 0.5);
} else {
tmp = fma(t_0, t_0, ((a * a) * (0.5 + (0.5 * cos((2.0 * (((double) M_PI) * (angle_m * 0.005555555555555556))))))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(b * Float64(0.005555555555555556 * Float64(pi * angle_m))) tmp = 0.0 if (b <= 2.5e-80) tmp = Float64(Float64(a * a) * fma(0.5, cos(Float64(Float64(pi * angle_m) * 0.011111111111111112)), 0.5)); else tmp = fma(t_0, t_0, Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(angle_m * 0.005555555555555556)))))))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(b * N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 2.5e-80], N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$0 + N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\\
\mathbf{if}\;b \leq 2.5 \cdot 10^{-80}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right), 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_0, \left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.5e-80Initial program 82.4%
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr82.5%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6475.4
Simplified75.4%
Taylor expanded in b around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6463.0
Simplified63.0%
if 2.5e-80 < b Initial program 81.0%
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr81.0%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6468.0
Simplified68.0%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6478.1
Simplified78.1%
Final simplification67.7%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= (/ angle_m 180.0) 2e+60)
(fma
(* b (* 0.005555555555555556 (* PI angle_m)))
(* b (sin (* PI (* angle_m 0.005555555555555556))))
(* a a))
(fma
(* angle_m angle_m)
(* PI (* PI (* b (* b 3.08641975308642e-5))))
(* a a))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 2e+60) {
tmp = fma((b * (0.005555555555555556 * (((double) M_PI) * angle_m))), (b * sin((((double) M_PI) * (angle_m * 0.005555555555555556)))), (a * a));
} else {
tmp = fma((angle_m * angle_m), (((double) M_PI) * (((double) M_PI) * (b * (b * 3.08641975308642e-5)))), (a * a));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 2e+60) tmp = fma(Float64(b * Float64(0.005555555555555556 * Float64(pi * angle_m))), Float64(b * sin(Float64(pi * Float64(angle_m * 0.005555555555555556)))), Float64(a * a)); else tmp = fma(Float64(angle_m * angle_m), Float64(pi * Float64(pi * Float64(b * Float64(b * 3.08641975308642e-5)))), Float64(a * a)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 2e+60], N[(N[(b * N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * N[Sin[N[(Pi * N[(angle$95$m * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 2 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right), b \cdot \sin \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right), a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot angle\_m, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.9999999999999999e60Initial program 84.9%
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr85.0%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6479.6
Simplified79.6%
Taylor expanded in angle around 0
Simplified79.2%
if 1.9999999999999999e60 < (/.f64 angle #s(literal 180 binary64)) Initial program 68.3%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified34.0%
Taylor expanded in b around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6456.8
Simplified56.8%
Final simplification75.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 1.1e-79)
(* (* a a) (fma 0.5 (cos (* (* PI angle_m) 0.011111111111111112)) 0.5))
(if (<= b 9.6e+154)
(fma
(* angle_m angle_m)
(* PI (* PI (* b (* b 3.08641975308642e-5))))
(* a a))
(* angle_m (* angle_m (* (* PI (* PI 3.08641975308642e-5)) (* b b)))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.1e-79) {
tmp = (a * a) * fma(0.5, cos(((((double) M_PI) * angle_m) * 0.011111111111111112)), 0.5);
} else if (b <= 9.6e+154) {
tmp = fma((angle_m * angle_m), (((double) M_PI) * (((double) M_PI) * (b * (b * 3.08641975308642e-5)))), (a * a));
} else {
tmp = angle_m * (angle_m * ((((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)) * (b * b)));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.1e-79) tmp = Float64(Float64(a * a) * fma(0.5, cos(Float64(Float64(pi * angle_m) * 0.011111111111111112)), 0.5)); elseif (b <= 9.6e+154) tmp = fma(Float64(angle_m * angle_m), Float64(pi * Float64(pi * Float64(b * Float64(b * 3.08641975308642e-5)))), Float64(a * a)); else tmp = Float64(angle_m * Float64(angle_m * Float64(Float64(pi * Float64(pi * 3.08641975308642e-5)) * Float64(b * b)))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.1e-79], N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.6e+154], N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(angle$95$m * N[(angle$95$m * N[(N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{-79}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(\pi \cdot angle\_m\right) \cdot 0.011111111111111112\right), 0.5\right)\\
\mathbf{elif}\;b \leq 9.6 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot angle\_m, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;angle\_m \cdot \left(angle\_m \cdot \left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.0999999999999999e-79Initial program 82.4%
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr82.5%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6475.4
Simplified75.4%
Taylor expanded in b around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6463.0
Simplified63.0%
if 1.0999999999999999e-79 < b < 9.60000000000000059e154Initial program 64.6%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified28.0%
Taylor expanded in b around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6457.1
Simplified57.1%
if 9.60000000000000059e154 < b Initial program 99.5%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified44.2%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
unpow2N/A
*-lowering-*.f6455.0
Simplified55.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr69.3%
Final simplification62.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 1.2e-79)
(* (* a a) (fma 0.5 (cos (* PI (* angle_m 0.011111111111111112))) 0.5))
(if (<= b 9.6e+154)
(fma
(* angle_m angle_m)
(* PI (* PI (* b (* b 3.08641975308642e-5))))
(* a a))
(* angle_m (* angle_m (* (* PI (* PI 3.08641975308642e-5)) (* b b)))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.2e-79) {
tmp = (a * a) * fma(0.5, cos((((double) M_PI) * (angle_m * 0.011111111111111112))), 0.5);
} else if (b <= 9.6e+154) {
tmp = fma((angle_m * angle_m), (((double) M_PI) * (((double) M_PI) * (b * (b * 3.08641975308642e-5)))), (a * a));
} else {
tmp = angle_m * (angle_m * ((((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)) * (b * b)));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.2e-79) tmp = Float64(Float64(a * a) * fma(0.5, cos(Float64(pi * Float64(angle_m * 0.011111111111111112))), 0.5)); elseif (b <= 9.6e+154) tmp = fma(Float64(angle_m * angle_m), Float64(pi * Float64(pi * Float64(b * Float64(b * 3.08641975308642e-5)))), Float64(a * a)); else tmp = Float64(angle_m * Float64(angle_m * Float64(Float64(pi * Float64(pi * 3.08641975308642e-5)) * Float64(b * b)))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.2e-79], N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.6e+154], N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(angle$95$m * N[(angle$95$m * N[(N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.2 \cdot 10^{-79}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right), 0.5\right)\\
\mathbf{elif}\;b \leq 9.6 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot angle\_m, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;angle\_m \cdot \left(angle\_m \cdot \left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.20000000000000003e-79Initial program 82.4%
+-commutativeN/A
unpow2N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr82.5%
Taylor expanded in b around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f6462.9
Simplified62.9%
if 1.20000000000000003e-79 < b < 9.60000000000000059e154Initial program 64.6%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified28.0%
Taylor expanded in b around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6457.1
Simplified57.1%
if 9.60000000000000059e154 < b Initial program 99.5%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified44.2%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
unpow2N/A
*-lowering-*.f6455.0
Simplified55.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr69.3%
Final simplification62.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 1.25e-80)
(* (* a a) (fma 0.5 (cos (* angle_m (* PI 0.011111111111111112))) 0.5))
(if (<= b 9.6e+154)
(fma
(* angle_m angle_m)
(* PI (* PI (* b (* b 3.08641975308642e-5))))
(* a a))
(* angle_m (* angle_m (* (* PI (* PI 3.08641975308642e-5)) (* b b)))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.25e-80) {
tmp = (a * a) * fma(0.5, cos((angle_m * (((double) M_PI) * 0.011111111111111112))), 0.5);
} else if (b <= 9.6e+154) {
tmp = fma((angle_m * angle_m), (((double) M_PI) * (((double) M_PI) * (b * (b * 3.08641975308642e-5)))), (a * a));
} else {
tmp = angle_m * (angle_m * ((((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)) * (b * b)));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.25e-80) tmp = Float64(Float64(a * a) * fma(0.5, cos(Float64(angle_m * Float64(pi * 0.011111111111111112))), 0.5)); elseif (b <= 9.6e+154) tmp = fma(Float64(angle_m * angle_m), Float64(pi * Float64(pi * Float64(b * Float64(b * 3.08641975308642e-5)))), Float64(a * a)); else tmp = Float64(angle_m * Float64(angle_m * Float64(Float64(pi * Float64(pi * 3.08641975308642e-5)) * Float64(b * b)))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.25e-80], N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(angle$95$m * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.6e+154], N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(angle$95$m * N[(angle$95$m * N[(N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.25 \cdot 10^{-80}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle\_m \cdot \left(\pi \cdot 0.011111111111111112\right)\right), 0.5\right)\\
\mathbf{elif}\;b \leq 9.6 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot angle\_m, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;angle\_m \cdot \left(angle\_m \cdot \left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.25e-80Initial program 82.4%
*-commutativeN/A
add-cube-cbrtN/A
associate-*r*N/A
add-sqr-sqrtN/A
cbrt-prodN/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr82.5%
Applied egg-rr82.5%
Taylor expanded in b around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.9
Simplified62.9%
if 1.25e-80 < b < 9.60000000000000059e154Initial program 64.6%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified28.0%
Taylor expanded in b around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6457.1
Simplified57.1%
if 9.60000000000000059e154 < b Initial program 99.5%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified44.2%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
unpow2N/A
*-lowering-*.f6455.0
Simplified55.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr69.3%
Final simplification62.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 1.05e+153)
(fma
(* angle_m angle_m)
(* PI (* PI (* b (* b 3.08641975308642e-5))))
(* a a))
(* a a)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.05e+153) {
tmp = fma((angle_m * angle_m), (((double) M_PI) * (((double) M_PI) * (b * (b * 3.08641975308642e-5)))), (a * a));
} else {
tmp = a * a;
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 1.05e+153) tmp = fma(Float64(angle_m * angle_m), Float64(pi * Float64(pi * Float64(b * Float64(b * 3.08641975308642e-5)))), Float64(a * a)); else tmp = Float64(a * a); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 1.05e+153], N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.05 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot angle\_m, \pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right), a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a\\
\end{array}
\end{array}
if a < 1.05000000000000008e153Initial program 78.7%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified46.3%
Taylor expanded in b around inf
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6459.9
Simplified59.9%
if 1.05000000000000008e153 < a Initial program 100.0%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 5.8e+159) (* a a) (* angle_m (* angle_m (* (* PI (* PI 3.08641975308642e-5)) (* b b))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 5.8e+159) {
tmp = a * a;
} else {
tmp = angle_m * (angle_m * ((((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)) * (b * b)));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 5.8e+159) {
tmp = a * a;
} else {
tmp = angle_m * (angle_m * ((Math.PI * (Math.PI * 3.08641975308642e-5)) * (b * b)));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 5.8e+159: tmp = a * a else: tmp = angle_m * (angle_m * ((math.pi * (math.pi * 3.08641975308642e-5)) * (b * b))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 5.8e+159) tmp = Float64(a * a); else tmp = Float64(angle_m * Float64(angle_m * Float64(Float64(pi * Float64(pi * 3.08641975308642e-5)) * Float64(b * b)))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 5.8e+159) tmp = a * a; else tmp = angle_m * (angle_m * ((pi * (pi * 3.08641975308642e-5)) * (b * b))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 5.8e+159], N[(a * a), $MachinePrecision], N[(angle$95$m * N[(angle$95$m * N[(N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.8 \cdot 10^{+159}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;angle\_m \cdot \left(angle\_m \cdot \left(\left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 5.80000000000000029e159Initial program 79.2%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6460.0
Simplified60.0%
if 5.80000000000000029e159 < b Initial program 99.6%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified48.1%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
unpow2N/A
*-lowering-*.f6456.9
Simplified56.9%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr69.5%
Final simplification61.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 5.8e+159) (* a a) (* (* angle_m angle_m) (* PI (* 3.08641975308642e-5 (* PI (* b b)))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 5.8e+159) {
tmp = a * a;
} else {
tmp = (angle_m * angle_m) * (((double) M_PI) * (3.08641975308642e-5 * (((double) M_PI) * (b * b))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 5.8e+159) {
tmp = a * a;
} else {
tmp = (angle_m * angle_m) * (Math.PI * (3.08641975308642e-5 * (Math.PI * (b * b))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 5.8e+159: tmp = a * a else: tmp = (angle_m * angle_m) * (math.pi * (3.08641975308642e-5 * (math.pi * (b * b)))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 5.8e+159) tmp = Float64(a * a); else tmp = Float64(Float64(angle_m * angle_m) * Float64(pi * Float64(3.08641975308642e-5 * Float64(pi * Float64(b * b))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 5.8e+159) tmp = a * a; else tmp = (angle_m * angle_m) * (pi * (3.08641975308642e-5 * (pi * (b * b)))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 5.8e+159], N[(a * a), $MachinePrecision], N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(3.08641975308642e-5 * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.8 \cdot 10^{+159}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot angle\_m\right) \cdot \left(\pi \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 5.80000000000000029e159Initial program 79.2%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6460.0
Simplified60.0%
if 5.80000000000000029e159 < b Initial program 99.6%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified48.1%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
unpow2N/A
*-lowering-*.f6456.9
Simplified56.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (* a a))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return a * a;
}
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 = a * a
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return a * a;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return a * a
angle_m = abs(angle) function code(a, b, angle_m) return Float64(a * a) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = a * a; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
a \cdot a
\end{array}
Initial program 81.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6456.0
Simplified56.0%
herbie shell --seed 2024198
(FPCore (a b angle)
:name "ab-angle->ABCF C"
:precision binary64
(+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))