
(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 12 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
(if (<= (/ angle_m 180.0) 5e-10)
(+ (pow a 2.0) (pow (* 0.005555555555555556 (* angle_m (* PI b))) 2.0))
(+
(pow a 2.0)
(*
b
(*
b
(-
0.5
(* 0.5 (cos (* 2.0 (* 0.005555555555555556 (* angle_m PI)))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 5e-10) {
tmp = pow(a, 2.0) + pow((0.005555555555555556 * (angle_m * (((double) M_PI) * b))), 2.0);
} else {
tmp = pow(a, 2.0) + (b * (b * (0.5 - (0.5 * cos((2.0 * (0.005555555555555556 * (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 ((angle_m / 180.0) <= 5e-10) {
tmp = Math.pow(a, 2.0) + Math.pow((0.005555555555555556 * (angle_m * (Math.PI * b))), 2.0);
} else {
tmp = Math.pow(a, 2.0) + (b * (b * (0.5 - (0.5 * Math.cos((2.0 * (0.005555555555555556 * (angle_m * Math.PI))))))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 5e-10: tmp = math.pow(a, 2.0) + math.pow((0.005555555555555556 * (angle_m * (math.pi * b))), 2.0) else: tmp = math.pow(a, 2.0) + (b * (b * (0.5 - (0.5 * math.cos((2.0 * (0.005555555555555556 * (angle_m * math.pi)))))))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-10) tmp = Float64((a ^ 2.0) + (Float64(0.005555555555555556 * Float64(angle_m * Float64(pi * b))) ^ 2.0)); else tmp = Float64((a ^ 2.0) + Float64(b * Float64(b * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(0.005555555555555556 * Float64(angle_m * pi))))))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 5e-10) tmp = (a ^ 2.0) + ((0.005555555555555556 * (angle_m * (pi * b))) ^ 2.0); else tmp = (a ^ 2.0) + (b * (b * (0.5 - (0.5 * cos((2.0 * (0.005555555555555556 * (angle_m * pi)))))))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-10], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(0.005555555555555556 * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(b * N[(b * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-10}:\\
\;\;\;\;{a}^{2} + {\left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000031e-10Initial program 86.9%
Taylor expanded in angle around 0
Simplified87.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-sin.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6487.1
Simplified87.1%
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6487.1
Applied egg-rr87.1%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6484.5
Simplified84.5%
if 5.00000000000000031e-10 < (/.f64 angle #s(literal 180 binary64)) Initial program 58.8%
Taylor expanded in angle around 0
Simplified59.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-sin.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6459.4
Simplified59.4%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
unpow-prod-downN/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
Applied egg-rr59.4%
Final simplification77.4%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow a 2.0) (pow (* (sin (* 0.005555555555555556 (* angle_m PI))) b) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(a, 2.0) + pow((sin((0.005555555555555556 * (angle_m * ((double) M_PI)))) * b), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow(a, 2.0) + Math.pow((Math.sin((0.005555555555555556 * (angle_m * Math.PI))) * b), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(a, 2.0) + math.pow((math.sin((0.005555555555555556 * (angle_m * math.pi))) * b), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((a ^ 2.0) + (Float64(sin(Float64(0.005555555555555556 * Float64(angle_m * pi))) * b) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = (a ^ 2.0) + ((sin((0.005555555555555556 * (angle_m * pi))) * b) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{a}^{2} + {\left(\sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right) \cdot b\right)}^{2}
\end{array}
Initial program 78.9%
Taylor expanded in angle around 0
Simplified79.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-sin.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6479.2
Simplified79.2%
Final simplification79.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow a 2.0) (pow (* b (sin (* angle_m (* 0.005555555555555556 PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(a, 2.0) + pow((b * sin((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, 2.0) + Math.pow((b * Math.sin((angle_m * (0.005555555555555556 * Math.PI)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(a, 2.0) + math.pow((b * math.sin((angle_m * (0.005555555555555556 * math.pi)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((a ^ 2.0) + (Float64(b * sin(Float64(angle_m * Float64(0.005555555555555556 * pi)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = (a ^ 2.0) + ((b * sin((angle_m * (0.005555555555555556 * pi)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(angle$95$m * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{a}^{2} + {\left(b \cdot \sin \left(angle\_m \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 78.9%
Taylor expanded in angle around 0
Simplified79.0%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.1
Applied egg-rr79.1%
Final simplification79.1%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= (/ angle_m 180.0) 5e-10)
(+ (pow a 2.0) (pow (* 0.005555555555555556 (* angle_m (* PI b))) 2.0))
(+
(pow a 2.0)
(*
b
(*
b
(-
0.5
(* 0.5 (cos (* 2.0 (* PI (* 0.005555555555555556 angle_m)))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 5e-10) {
tmp = pow(a, 2.0) + pow((0.005555555555555556 * (angle_m * (((double) M_PI) * b))), 2.0);
} else {
tmp = pow(a, 2.0) + (b * (b * (0.5 - (0.5 * cos((2.0 * (((double) M_PI) * (0.005555555555555556 * angle_m))))))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 5e-10) {
tmp = Math.pow(a, 2.0) + Math.pow((0.005555555555555556 * (angle_m * (Math.PI * b))), 2.0);
} else {
tmp = Math.pow(a, 2.0) + (b * (b * (0.5 - (0.5 * Math.cos((2.0 * (Math.PI * (0.005555555555555556 * angle_m))))))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if (angle_m / 180.0) <= 5e-10: tmp = math.pow(a, 2.0) + math.pow((0.005555555555555556 * (angle_m * (math.pi * b))), 2.0) else: tmp = math.pow(a, 2.0) + (b * (b * (0.5 - (0.5 * math.cos((2.0 * (math.pi * (0.005555555555555556 * angle_m)))))))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5e-10) tmp = Float64((a ^ 2.0) + (Float64(0.005555555555555556 * Float64(angle_m * Float64(pi * b))) ^ 2.0)); else tmp = Float64((a ^ 2.0) + Float64(b * Float64(b * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(0.005555555555555556 * angle_m))))))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if ((angle_m / 180.0) <= 5e-10) tmp = (a ^ 2.0) + ((0.005555555555555556 * (angle_m * (pi * b))) ^ 2.0); else tmp = (a ^ 2.0) + (b * (b * (0.5 - (0.5 * cos((2.0 * (pi * (0.005555555555555556 * angle_m)))))))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[N[(angle$95$m / 180.0), $MachinePrecision], 5e-10], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(0.005555555555555556 * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(b * N[(b * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5 \cdot 10^{-10}:\\
\;\;\;\;{a}^{2} + {\left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + b \cdot \left(b \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000031e-10Initial program 86.9%
Taylor expanded in angle around 0
Simplified87.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-sin.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6487.1
Simplified87.1%
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6487.1
Applied egg-rr87.1%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6484.5
Simplified84.5%
if 5.00000000000000031e-10 < (/.f64 angle #s(literal 180 binary64)) Initial program 58.8%
Taylor expanded in angle around 0
Simplified59.0%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
unpow1N/A
metadata-evalN/A
pow2N/A
sqr-powN/A
lift-*.f64N/A
unpow-prod-downN/A
pow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
Applied egg-rr59.0%
Final simplification77.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 1.16e-57) (* a a) (+ (pow a 2.0) (pow (* 0.005555555555555556 (* angle_m (* PI b))) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.16e-57) {
tmp = a * a;
} else {
tmp = pow(a, 2.0) + pow((0.005555555555555556 * (angle_m * (((double) M_PI) * b))), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.16e-57) {
tmp = a * a;
} else {
tmp = Math.pow(a, 2.0) + Math.pow((0.005555555555555556 * (angle_m * (Math.PI * b))), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 1.16e-57: tmp = a * a else: tmp = math.pow(a, 2.0) + math.pow((0.005555555555555556 * (angle_m * (math.pi * b))), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.16e-57) tmp = Float64(a * a); else tmp = Float64((a ^ 2.0) + (Float64(0.005555555555555556 * Float64(angle_m * Float64(pi * b))) ^ 2.0)); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 1.16e-57) tmp = a * a; else tmp = (a ^ 2.0) + ((0.005555555555555556 * (angle_m * (pi * b))) ^ 2.0); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.16e-57], N[(a * a), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(0.005555555555555556 * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.16 \cdot 10^{-57}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + {\left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if b < 1.15999999999999996e-57Initial program 78.0%
Taylor expanded in angle around 0
Simplified78.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6463.7
Simplified63.7%
Taylor expanded in a around inf
unpow2N/A
lower-*.f6461.6
Simplified61.6%
if 1.15999999999999996e-57 < b Initial program 81.4%
Taylor expanded in angle around 0
Simplified81.3%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-sin.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6481.3
Simplified81.3%
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6481.4
Applied egg-rr81.4%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6478.9
Simplified78.9%
Final simplification66.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (* PI b) (* angle_m -0.005555555555555556)))) (if (<= b 1.16e-57) (* a a) (fma t_0 t_0 (* a a)))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (((double) M_PI) * b) * (angle_m * -0.005555555555555556);
double tmp;
if (b <= 1.16e-57) {
tmp = a * a;
} else {
tmp = fma(t_0, t_0, (a * a));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(pi * b) * Float64(angle_m * -0.005555555555555556)) tmp = 0.0 if (b <= 1.16e-57) tmp = Float64(a * a); else tmp = fma(t_0, t_0, Float64(a * a)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * b), $MachinePrecision] * N[(angle$95$m * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 1.16e-57], N[(a * a), $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 := \left(\pi \cdot b\right) \cdot \left(angle\_m \cdot -0.005555555555555556\right)\\
\mathbf{if}\;b \leq 1.16 \cdot 10^{-57}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_0, a \cdot a\right)\\
\end{array}
\end{array}
if b < 1.15999999999999996e-57Initial program 78.0%
Taylor expanded in angle around 0
Simplified78.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6463.7
Simplified63.7%
Taylor expanded in a around inf
unpow2N/A
lower-*.f6461.6
Simplified61.6%
if 1.15999999999999996e-57 < b Initial program 81.4%
Taylor expanded in angle around 0
Simplified81.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6463.0
Simplified63.0%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr78.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 1.4e+154)
(fma
(* (* angle_m (* angle_m (* b b))) (* PI PI))
3.08641975308642e-5
(* a a))
(fma
(* b (* (* angle_m PI) (* angle_m PI)))
(* b 3.08641975308642e-5)
(* a a))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.4e+154) {
tmp = fma(((angle_m * (angle_m * (b * b))) * (((double) M_PI) * ((double) M_PI))), 3.08641975308642e-5, (a * a));
} else {
tmp = fma((b * ((angle_m * ((double) M_PI)) * (angle_m * ((double) M_PI)))), (b * 3.08641975308642e-5), (a * a));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.4e+154) tmp = fma(Float64(Float64(angle_m * Float64(angle_m * Float64(b * b))) * Float64(pi * pi)), 3.08641975308642e-5, Float64(a * a)); else tmp = fma(Float64(b * Float64(Float64(angle_m * pi) * Float64(angle_m * pi))), 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[b, 1.4e+154], N[(N[(N[(angle$95$m * N[(angle$95$m * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] * 3.08641975308642e-5 + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * 3.08641975308642e-5), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle\_m \cdot \left(angle\_m \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\pi \cdot \pi\right), 3.08641975308642 \cdot 10^{-5}, a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot \left(\left(angle\_m \cdot \pi\right) \cdot \left(angle\_m \cdot \pi\right)\right), b \cdot 3.08641975308642 \cdot 10^{-5}, a \cdot a\right)\\
\end{array}
\end{array}
if b < 1.4e154Initial program 76.6%
Taylor expanded in angle around 0
Simplified76.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6463.4
Simplified63.4%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr69.3%
if 1.4e154 < b Initial program 99.7%
Taylor expanded in angle around 0
Simplified99.7%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6464.8
Simplified64.8%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr84.8%
Final simplification70.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 1.4e+154)
(fma
(* (* angle_m (* angle_m (* b b))) (* PI PI))
3.08641975308642e-5
(* a a))
(fma
b
(* (* b (* (* PI PI) 3.08641975308642e-5)) (* angle_m angle_m))
(* a a))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.4e+154) {
tmp = fma(((angle_m * (angle_m * (b * b))) * (((double) M_PI) * ((double) M_PI))), 3.08641975308642e-5, (a * a));
} else {
tmp = fma(b, ((b * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5)) * (angle_m * angle_m)), (a * a));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.4e+154) tmp = fma(Float64(Float64(angle_m * Float64(angle_m * Float64(b * b))) * Float64(pi * pi)), 3.08641975308642e-5, Float64(a * a)); else tmp = fma(b, Float64(Float64(b * Float64(Float64(pi * pi) * 3.08641975308642e-5)) * Float64(angle_m * angle_m)), Float64(a * a)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.4e+154], N[(N[(N[(angle$95$m * N[(angle$95$m * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] * 3.08641975308642e-5 + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(b * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle\_m \cdot \left(angle\_m \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\pi \cdot \pi\right), 3.08641975308642 \cdot 10^{-5}, a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(angle\_m \cdot angle\_m\right), a \cdot a\right)\\
\end{array}
\end{array}
if b < 1.4e154Initial program 76.6%
Taylor expanded in angle around 0
Simplified76.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6463.4
Simplified63.4%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr69.3%
if 1.4e154 < b Initial program 99.7%
Taylor expanded in angle around 0
Simplified99.7%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6464.8
Simplified64.8%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr84.8%
Final simplification70.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* (* PI PI) 3.08641975308642e-5)))
(if (<= b 1.3e+154)
(fma (* angle_m (* angle_m (* b b))) t_0 (* a a))
(fma b (* (* b t_0) (* angle_m angle_m)) (* a a)))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5;
double tmp;
if (b <= 1.3e+154) {
tmp = fma((angle_m * (angle_m * (b * b))), t_0, (a * a));
} else {
tmp = fma(b, ((b * t_0) * (angle_m * angle_m)), (a * a));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(pi * pi) * 3.08641975308642e-5) tmp = 0.0 if (b <= 1.3e+154) tmp = fma(Float64(angle_m * Float64(angle_m * Float64(b * b))), t_0, Float64(a * a)); else tmp = fma(b, Float64(Float64(b * t_0) * Float64(angle_m * angle_m)), Float64(a * a)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]}, If[LessEqual[b, 1.3e+154], N[(N[(angle$95$m * N[(angle$95$m * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0 + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(b * t$95$0), $MachinePrecision] * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\\
\mathbf{if}\;b \leq 1.3 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(angle\_m \cdot \left(angle\_m \cdot \left(b \cdot b\right)\right), t\_0, a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, \left(b \cdot t\_0\right) \cdot \left(angle\_m \cdot angle\_m\right), a \cdot a\right)\\
\end{array}
\end{array}
if b < 1.29999999999999994e154Initial program 76.6%
Taylor expanded in angle around 0
Simplified76.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6463.4
Simplified63.4%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
Applied egg-rr69.3%
if 1.29999999999999994e154 < b Initial program 99.7%
Taylor expanded in angle around 0
Simplified99.7%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6464.8
Simplified64.8%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr84.8%
Final simplification70.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 1.16e-57)
(* a a)
(fma
b
(* (* b (* (* PI PI) 3.08641975308642e-5)) (* angle_m angle_m))
(* a a))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.16e-57) {
tmp = a * a;
} else {
tmp = fma(b, ((b * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5)) * (angle_m * angle_m)), (a * a));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.16e-57) tmp = Float64(a * a); else tmp = fma(b, Float64(Float64(b * Float64(Float64(pi * pi) * 3.08641975308642e-5)) * Float64(angle_m * angle_m)), Float64(a * a)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.16e-57], N[(a * a), $MachinePrecision], N[(b * N[(N[(b * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.16 \cdot 10^{-57}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, \left(b \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right) \cdot \left(angle\_m \cdot angle\_m\right), a \cdot a\right)\\
\end{array}
\end{array}
if b < 1.15999999999999996e-57Initial program 78.0%
Taylor expanded in angle around 0
Simplified78.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6463.7
Simplified63.7%
Taylor expanded in a around inf
unpow2N/A
lower-*.f6461.6
Simplified61.6%
if 1.15999999999999996e-57 < b Initial program 81.4%
Taylor expanded in angle around 0
Simplified81.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6463.0
Simplified63.0%
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr70.5%
Final simplification63.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 7.5e+162) (* a a) (* (* angle_m angle_m) (* PI (* PI (* (* b b) 3.08641975308642e-5))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 7.5e+162) {
tmp = a * a;
} else {
tmp = (angle_m * angle_m) * (((double) M_PI) * (((double) M_PI) * ((b * b) * 3.08641975308642e-5)));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 7.5e+162) {
tmp = a * a;
} else {
tmp = (angle_m * angle_m) * (Math.PI * (Math.PI * ((b * b) * 3.08641975308642e-5)));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 7.5e+162: tmp = a * a else: tmp = (angle_m * angle_m) * (math.pi * (math.pi * ((b * b) * 3.08641975308642e-5))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 7.5e+162) tmp = Float64(a * a); else tmp = Float64(Float64(angle_m * angle_m) * Float64(pi * Float64(pi * Float64(Float64(b * b) * 3.08641975308642e-5)))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 7.5e+162) tmp = a * a; else tmp = (angle_m * angle_m) * (pi * (pi * ((b * b) * 3.08641975308642e-5))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 7.5e+162], N[(a * a), $MachinePrecision], N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.5 \cdot 10^{+162}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(angle\_m \cdot angle\_m\right) \cdot \left(\pi \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\end{array}
\end{array}
if b < 7.50000000000000033e162Initial program 76.6%
Taylor expanded in angle around 0
Simplified76.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6463.4
Simplified63.4%
Taylor expanded in a around inf
unpow2N/A
lower-*.f6458.8
Simplified58.8%
if 7.50000000000000033e162 < b Initial program 99.7%
Taylor expanded in angle around 0
Simplified99.7%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6464.8
Simplified64.8%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.8
Simplified64.8%
Final simplification59.4%
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 78.9%
Taylor expanded in angle around 0
Simplified79.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6463.5
Simplified63.5%
Taylor expanded in a around inf
unpow2N/A
lower-*.f6456.4
Simplified56.4%
herbie shell --seed 2024215
(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)))