
(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 13 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
(* angle_m angle_m)
(* -2.8577960676726107e-8 (* PI PI))
0.005555555555555556)))
(if (<= (/ angle_m 180.0) 100000000000.0)
(fma
(* a angle_m)
(* (* PI t_0) (* t_0 (* angle_m (* a PI))))
(*
b
(*
b
(+
0.5
(* 0.5 (cos (* 2.0 (* angle_m (* 0.005555555555555556 PI)))))))))
(/
1.0
(/
1.0
(fma
a
(fma
a
0.5
(* a (* (cos (* PI (* angle_m 0.011111111111111112))) -0.5)))
(* (* b b) (+ 0.5 0.5))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = fma((angle_m * angle_m), (-2.8577960676726107e-8 * (((double) M_PI) * ((double) M_PI))), 0.005555555555555556);
double tmp;
if ((angle_m / 180.0) <= 100000000000.0) {
tmp = fma((a * angle_m), ((((double) M_PI) * t_0) * (t_0 * (angle_m * (a * ((double) M_PI))))), (b * (b * (0.5 + (0.5 * cos((2.0 * (angle_m * (0.005555555555555556 * ((double) M_PI))))))))));
} else {
tmp = 1.0 / (1.0 / fma(a, fma(a, 0.5, (a * (cos((((double) M_PI) * (angle_m * 0.011111111111111112))) * -0.5))), ((b * b) * (0.5 + 0.5))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = fma(Float64(angle_m * angle_m), Float64(-2.8577960676726107e-8 * Float64(pi * pi)), 0.005555555555555556) tmp = 0.0 if (Float64(angle_m / 180.0) <= 100000000000.0) tmp = fma(Float64(a * angle_m), Float64(Float64(pi * t_0) * Float64(t_0 * Float64(angle_m * Float64(a * pi)))), Float64(b * Float64(b * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(angle_m * Float64(0.005555555555555556 * pi))))))))); else tmp = Float64(1.0 / Float64(1.0 / fma(a, fma(a, 0.5, Float64(a * Float64(cos(Float64(pi * Float64(angle_m * 0.011111111111111112))) * -0.5))), Float64(Float64(b * b) * Float64(0.5 + 0.5))))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(-2.8577960676726107e-8 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] + 0.005555555555555556), $MachinePrecision]}, If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 100000000000.0], N[(N[(a * angle$95$m), $MachinePrecision] * N[(N[(Pi * t$95$0), $MachinePrecision] * N[(t$95$0 * N[(angle$95$m * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(b * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(a * N[(a * 0.5 + N[(a * N[(N[Cos[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(angle\_m \cdot angle\_m, -2.8577960676726107 \cdot 10^{-8} \cdot \left(\pi \cdot \pi\right), 0.005555555555555556\right)\\
\mathbf{if}\;\frac{angle\_m}{180} \leq 100000000000:\\
\;\;\;\;\mathsf{fma}\left(a \cdot angle\_m, \left(\pi \cdot t\_0\right) \cdot \left(t\_0 \cdot \left(angle\_m \cdot \left(a \cdot \pi\right)\right)\right), b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5, a \cdot \left(\cos \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot -0.5\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1e11Initial program 87.5%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
Simplified81.8%
Applied egg-rr81.9%
if 1e11 < (/.f64 angle #s(literal 180 binary64)) Initial program 56.1%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr56.3%
sub-negN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Applied egg-rr56.3%
Taylor expanded in angle around 0
Simplified56.5%
Final simplification75.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow
(*
a
(sin
(*
(* (* angle_m 0.005555555555555556) (sqrt (* PI (sqrt PI))))
(sqrt (sqrt PI)))))
2.0)
(pow (* b (cos (* PI (/ angle_m 180.0)))) 2.0)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin((((angle_m * 0.005555555555555556) * sqrt((((double) M_PI) * sqrt(((double) M_PI))))) * sqrt(sqrt(((double) M_PI)))))), 2.0) + pow((b * 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((a * Math.sin((((angle_m * 0.005555555555555556) * Math.sqrt((Math.PI * Math.sqrt(Math.PI)))) * Math.sqrt(Math.sqrt(Math.PI))))), 2.0) + Math.pow((b * Math.cos((Math.PI * (angle_m / 180.0)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin((((angle_m * 0.005555555555555556) * math.sqrt((math.pi * math.sqrt(math.pi)))) * math.sqrt(math.sqrt(math.pi))))), 2.0) + math.pow((b * math.cos((math.pi * (angle_m / 180.0)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(Float64(angle_m * 0.005555555555555556) * sqrt(Float64(pi * sqrt(pi)))) * sqrt(sqrt(pi))))) ^ 2.0) + (Float64(b * cos(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin((((angle_m * 0.005555555555555556) * sqrt((pi * sqrt(pi)))) * sqrt(sqrt(pi))))) ^ 2.0) + ((b * 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[(a * N[Sin[N[(N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * 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(a \cdot \sin \left(\left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \sqrt{\pi \cdot \sqrt{\pi}}\right) \cdot \sqrt{\sqrt{\pi}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2}
\end{array}
Initial program 79.3%
add-sqr-sqrtN/A
associate-*r*N/A
rem-square-sqrtN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
div-invN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
Applied egg-rr79.4%
*-lowering-*.f64N/A
Applied egg-rr79.4%
Final simplification79.4%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* PI (/ angle_m 180.0)))) 2.0) (pow (* b (cos (/ PI (/ 180.0 angle_m)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin((((double) M_PI) * (angle_m / 180.0)))), 2.0) + pow((b * cos((((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 Math.pow((a * Math.sin((Math.PI * (angle_m / 180.0)))), 2.0) + Math.pow((b * Math.cos((Math.PI / (180.0 / angle_m)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin((math.pi * (angle_m / 180.0)))), 2.0) + math.pow((b * math.cos((math.pi / (180.0 / angle_m)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0) + (Float64(b * cos(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin((pi * (angle_m / 180.0)))) ^ 2.0) + ((b * cos((pi / (180.0 / angle_m)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2}
\end{array}
Initial program 79.3%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6479.3
Applied egg-rr79.3%
Final simplification79.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* PI (/ angle_m 180.0)))) 2.0) (pow (* b (cos (* angle_m (* 0.005555555555555556 PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin((((double) M_PI) * (angle_m / 180.0)))), 2.0) + pow((b * cos((angle_m * (0.005555555555555556 * ((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.sin((Math.PI * (angle_m / 180.0)))), 2.0) + Math.pow((b * Math.cos((angle_m * (0.005555555555555556 * Math.PI)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin((math.pi * (angle_m / 180.0)))), 2.0) + math.pow((b * math.cos((angle_m * (0.005555555555555556 * math.pi)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0) + (Float64(b * cos(Float64(angle_m * Float64(0.005555555555555556 * pi)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin((pi * (angle_m / 180.0)))) ^ 2.0) + ((b * cos((angle_m * (0.005555555555555556 * pi)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 79.3%
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval79.3
Applied egg-rr79.3%
Final simplification79.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (cos (* PI (/ angle_m 180.0)))) 2.0) (pow (* a (sin (* 0.005555555555555556 (* angle_m PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * cos((((double) M_PI) * (angle_m / 180.0)))), 2.0) + pow((a * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.cos((Math.PI * (angle_m / 180.0)))), 2.0) + Math.pow((a * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.cos((math.pi * (angle_m / 180.0)))), 2.0) + math.pow((a * math.sin((0.005555555555555556 * (angle_m * math.pi)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * cos(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0) + (Float64(a * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * cos((pi * (angle_m / 180.0)))) ^ 2.0) + ((a * sin((0.005555555555555556 * (angle_m * pi)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} + {\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 79.3%
associate-*l/N/A
div-invN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval79.3
Applied egg-rr79.3%
Final simplification79.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow
(*
a
(sin
(*
(* (* angle_m 0.005555555555555556) (sqrt (* PI (sqrt PI))))
(sqrt (sqrt PI)))))
2.0)
(pow b 2.0)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin((((angle_m * 0.005555555555555556) * sqrt((((double) M_PI) * sqrt(((double) M_PI))))) * sqrt(sqrt(((double) M_PI)))))), 2.0) + pow(b, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin((((angle_m * 0.005555555555555556) * Math.sqrt((Math.PI * Math.sqrt(Math.PI)))) * Math.sqrt(Math.sqrt(Math.PI))))), 2.0) + Math.pow(b, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin((((angle_m * 0.005555555555555556) * math.sqrt((math.pi * math.sqrt(math.pi)))) * math.sqrt(math.sqrt(math.pi))))), 2.0) + math.pow(b, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(Float64(angle_m * 0.005555555555555556) * sqrt(Float64(pi * sqrt(pi)))) * sqrt(sqrt(pi))))) ^ 2.0) + (b ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin((((angle_m * 0.005555555555555556) * sqrt((pi * sqrt(pi)))) * sqrt(sqrt(pi))))) ^ 2.0) + (b ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \sqrt{\pi \cdot \sqrt{\pi}}\right) \cdot \sqrt{\sqrt{\pi}}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 79.3%
add-sqr-sqrtN/A
associate-*r*N/A
rem-square-sqrtN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
div-invN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
Applied egg-rr79.4%
*-lowering-*.f64N/A
Applied egg-rr79.4%
Taylor expanded in angle around 0
Simplified79.1%
Final simplification79.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* PI (/ angle_m 180.0)))) 2.0) (pow b 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin((((double) M_PI) * (angle_m / 180.0)))), 2.0) + pow(b, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin((Math.PI * (angle_m / 180.0)))), 2.0) + Math.pow(b, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin((math.pi * (angle_m / 180.0)))), 2.0) + math.pow(b, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0) + (b ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin((pi * (angle_m / 180.0)))) ^ 2.0) + (b ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 79.3%
Taylor expanded in angle around 0
Simplified79.0%
Final simplification79.0%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= (/ angle_m 180.0) 100000000000.0)
(/
1.0
(/
1.0
(fma
a
(fma angle_m (* angle_m (* a (* (* PI PI) 3.08641975308642e-5))) 0.0)
(*
(* b b)
(+
0.5
(* 0.5 (cos (* 2.0 (* (* angle_m 0.005555555555555556) PI)))))))))
(/
1.0
(/
1.0
(fma
a
(fma a 0.5 (* a (* (cos (* PI (* angle_m 0.011111111111111112))) -0.5)))
(* (* b b) (+ 0.5 0.5)))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 100000000000.0) {
tmp = 1.0 / (1.0 / fma(a, fma(angle_m, (angle_m * (a * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5))), 0.0), ((b * b) * (0.5 + (0.5 * cos((2.0 * ((angle_m * 0.005555555555555556) * ((double) M_PI)))))))));
} else {
tmp = 1.0 / (1.0 / fma(a, fma(a, 0.5, (a * (cos((((double) M_PI) * (angle_m * 0.011111111111111112))) * -0.5))), ((b * b) * (0.5 + 0.5))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 100000000000.0) tmp = Float64(1.0 / Float64(1.0 / fma(a, fma(angle_m, Float64(angle_m * Float64(a * Float64(Float64(pi * pi) * 3.08641975308642e-5))), 0.0), Float64(Float64(b * b) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(angle_m * 0.005555555555555556) * pi))))))))); else tmp = Float64(1.0 / Float64(1.0 / fma(a, fma(a, 0.5, Float64(a * Float64(cos(Float64(pi * Float64(angle_m * 0.011111111111111112))) * -0.5))), Float64(Float64(b * b) * Float64(0.5 + 0.5))))); 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], 100000000000.0], N[(1.0 / N[(1.0 / N[(a * N[(angle$95$m * N[(angle$95$m * N[(a * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(angle$95$m * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(a * N[(a * 0.5 + N[(a * N[(N[Cos[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 100000000000:\\
\;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(angle\_m, angle\_m \cdot \left(a \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right), 0\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle\_m \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5, a \cdot \left(\cos \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot -0.5\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1e11Initial program 87.5%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr71.8%
sub-negN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Applied egg-rr71.8%
Taylor expanded in angle around 0
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
distribute-rgt-outN/A
metadata-evalN/A
mul0-rgtN/A
accelerator-lowering-fma.f64N/A
Simplified80.5%
if 1e11 < (/.f64 angle #s(literal 180 binary64)) Initial program 56.1%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr56.3%
sub-negN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Applied egg-rr56.3%
Taylor expanded in angle around 0
Simplified56.5%
Final simplification74.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 2.05e+21)
(fma
(*
angle_m
(fma a (* a 3.08641975308642e-5) (* b (* b -3.08641975308642e-5))))
(* angle_m (* PI PI))
(* b b))
(/
1.0
(/
1.0
(fma
a
(fma a 0.5 (* a (* (cos (* PI (* angle_m 0.011111111111111112))) -0.5)))
(* (* b b) (+ 0.5 0.5)))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 2.05e+21) {
tmp = fma((angle_m * fma(a, (a * 3.08641975308642e-5), (b * (b * -3.08641975308642e-5)))), (angle_m * (((double) M_PI) * ((double) M_PI))), (b * b));
} else {
tmp = 1.0 / (1.0 / fma(a, fma(a, 0.5, (a * (cos((((double) M_PI) * (angle_m * 0.011111111111111112))) * -0.5))), ((b * b) * (0.5 + 0.5))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 2.05e+21) tmp = fma(Float64(angle_m * fma(a, Float64(a * 3.08641975308642e-5), Float64(b * Float64(b * -3.08641975308642e-5)))), Float64(angle_m * Float64(pi * pi)), Float64(b * b)); else tmp = Float64(1.0 / Float64(1.0 / fma(a, fma(a, 0.5, Float64(a * Float64(cos(Float64(pi * Float64(angle_m * 0.011111111111111112))) * -0.5))), Float64(Float64(b * b) * Float64(0.5 + 0.5))))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 2.05e+21], N[(N[(angle$95$m * N[(a * N[(a * 3.08641975308642e-5), $MachinePrecision] + N[(b * N[(b * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(a * N[(a * 0.5 + N[(a * N[(N[Cos[N[(Pi * N[(angle$95$m * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.05 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot \mathsf{fma}\left(a, a \cdot 3.08641975308642 \cdot 10^{-5}, b \cdot \left(b \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), angle\_m \cdot \left(\pi \cdot \pi\right), b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 0.5, a \cdot \left(\cos \left(\pi \cdot \left(angle\_m \cdot 0.011111111111111112\right)\right) \cdot -0.5\right)\right), \left(b \cdot b\right) \cdot \left(0.5 + 0.5\right)\right)}}\\
\end{array}
\end{array}
if b < 2.05e21Initial program 76.1%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Simplified45.2%
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr52.3%
if 2.05e21 < b Initial program 89.5%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
Applied egg-rr86.5%
sub-negN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
Applied egg-rr86.5%
Taylor expanded in angle around 0
Simplified86.6%
Final simplification60.6%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 2.7e+131)
(fma
(*
angle_m
(fma a (* a 3.08641975308642e-5) (* b (* b -3.08641975308642e-5))))
(* angle_m (* PI PI))
(* b b))
(* b b)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 2.7e+131) {
tmp = fma((angle_m * fma(a, (a * 3.08641975308642e-5), (b * (b * -3.08641975308642e-5)))), (angle_m * (((double) M_PI) * ((double) M_PI))), (b * b));
} else {
tmp = b * b;
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 2.7e+131) tmp = fma(Float64(angle_m * fma(a, Float64(a * 3.08641975308642e-5), Float64(b * Float64(b * -3.08641975308642e-5)))), Float64(angle_m * Float64(pi * pi)), 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, 2.7e+131], N[(N[(angle$95$m * N[(a * N[(a * 3.08641975308642e-5), $MachinePrecision] + N[(b * N[(b * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(b * b), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.7 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot \mathsf{fma}\left(a, a \cdot 3.08641975308642 \cdot 10^{-5}, b \cdot \left(b \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), angle\_m \cdot \left(\pi \cdot \pi\right), b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 2.70000000000000004e131Initial program 75.7%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Simplified45.8%
*-commutativeN/A
associate-*r*N/A
accelerator-lowering-fma.f64N/A
Applied egg-rr52.2%
if 2.70000000000000004e131 < b Initial program 100.0%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f64100.0
Simplified100.0%
Final simplification59.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 1.3e-55)
(* b b)
(fma
(* angle_m (* angle_m (* PI PI)))
(* 3.08641975308642e-5 (* a a))
(* b b))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.3e-55) {
tmp = b * b;
} else {
tmp = fma((angle_m * (angle_m * (((double) M_PI) * ((double) M_PI)))), (3.08641975308642e-5 * (a * a)), (b * b));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 1.3e-55) tmp = Float64(b * b); else tmp = fma(Float64(angle_m * Float64(angle_m * Float64(pi * pi))), Float64(3.08641975308642e-5 * Float64(a * a)), Float64(b * b)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 1.3e-55], N[(b * b), $MachinePrecision], N[(N[(angle$95$m * N[(angle$95$m * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(3.08641975308642e-5 * N[(a * a), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.3 \cdot 10^{-55}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot \left(angle\_m \cdot \left(\pi \cdot \pi\right)\right), 3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right), b \cdot b\right)\\
\end{array}
\end{array}
if a < 1.2999999999999999e-55Initial program 76.1%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6459.4
Simplified59.4%
if 1.2999999999999999e-55 < a Initial program 85.2%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Simplified35.4%
Taylor expanded in b around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.6
Simplified63.6%
Final simplification60.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 3.7e+104) (* b b) (* (* 3.08641975308642e-5 (* a a)) (* (* angle_m PI) (* angle_m PI)))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 3.7e+104) {
tmp = b * b;
} else {
tmp = (3.08641975308642e-5 * (a * 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 <= 3.7e+104) {
tmp = b * b;
} else {
tmp = (3.08641975308642e-5 * (a * 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 <= 3.7e+104: tmp = b * b else: tmp = (3.08641975308642e-5 * (a * 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 <= 3.7e+104) tmp = Float64(b * b); else tmp = Float64(Float64(3.08641975308642e-5 * Float64(a * a)) * Float64(Float64(angle_m * 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 <= 3.7e+104) tmp = b * b; else tmp = (3.08641975308642e-5 * (a * 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, 3.7e+104], N[(b * b), $MachinePrecision], N[(N[(3.08641975308642e-5 * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.7 \cdot 10^{+104}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(3.08641975308642 \cdot 10^{-5} \cdot \left(a \cdot a\right)\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(angle\_m \cdot \pi\right)\right)\\
\end{array}
\end{array}
if a < 3.6999999999999998e104Initial program 75.8%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6460.4
Simplified60.4%
if 3.6999999999999998e104 < a Initial program 91.4%
Taylor expanded in angle around 0
distribute-rgt-inN/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
distribute-rgt-outN/A
Simplified39.0%
Taylor expanded in b around 0
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6460.0
Simplified60.0%
Final simplification60.3%
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 79.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6454.9
Simplified54.9%
herbie shell --seed 2024199
(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)))