
(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 14 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
(if (<= (/ angle_m 180.0) 5000.0)
(fma
(* (* PI PI) 3.08641975308642e-5)
(* (* a angle_m) (* a angle_m))
(*
b
(*
b
(+ 0.5 (* 0.5 (cos (* 2.0 (* (* angle_m PI) 0.005555555555555556))))))))
(/
1.0
(/
1.0
(fma
a
(*
a
(- 0.5 (* 0.5 (cos (* 2.0 (* PI (* angle_m 0.005555555555555556)))))))
(* b b))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if ((angle_m / 180.0) <= 5000.0) {
tmp = fma(((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5), ((a * angle_m) * (a * angle_m)), (b * (b * (0.5 + (0.5 * cos((2.0 * ((angle_m * ((double) M_PI)) * 0.005555555555555556))))))));
} else {
tmp = 1.0 / (1.0 / fma(a, (a * (0.5 - (0.5 * cos((2.0 * (((double) M_PI) * (angle_m * 0.005555555555555556))))))), (b * b)));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (Float64(angle_m / 180.0) <= 5000.0) tmp = fma(Float64(Float64(pi * pi) * 3.08641975308642e-5), Float64(Float64(a * angle_m) * Float64(a * angle_m)), Float64(b * Float64(b * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(angle_m * pi) * 0.005555555555555556)))))))); else tmp = Float64(1.0 / Float64(1.0 / fma(a, Float64(a * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(angle_m * 0.005555555555555556))))))), Float64(b * b)))); 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], 5000.0], N[(N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision] * N[(N[(a * angle$95$m), $MachinePrecision] * N[(a * angle$95$m), $MachinePrecision]), $MachinePrecision] + N[(b * N[(b * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(1.0 / N[(a * N[(a * 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] + N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle\_m}{180} \leq 5000:\\
\;\;\;\;\mathsf{fma}\left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}, \left(a \cdot angle\_m\right) \cdot \left(a \cdot angle\_m\right), b \cdot \left(b \cdot \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left(a, a \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right)\right), b \cdot b\right)}}\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5e3Initial program 89.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6485.4
Simplified85.4%
Applied egg-rr85.5%
if 5e3 < (/.f64 angle #s(literal 180 binary64)) Initial program 59.4%
Taylor expanded in angle around 0
Simplified59.4%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
flip-+N/A
Applied egg-rr59.6%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0)
(pow
(*
b
(cos
(*
(/ 1.0 (/ 180.0 (* angle_m (pow PI 0.8333333333333334))))
(pow PI 0.16666666666666666))))
2.0)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((1.0 / (180.0 / (angle_m * pow(((double) M_PI), 0.8333333333333334)))) * pow(((double) M_PI), 0.16666666666666666)))), 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 / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((1.0 / (180.0 / (angle_m * Math.pow(Math.PI, 0.8333333333333334)))) * Math.pow(Math.PI, 0.16666666666666666)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(((1.0 / (180.0 / (angle_m * math.pow(math.pi, 0.8333333333333334)))) * math.pow(math.pi, 0.16666666666666666)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(1.0 / Float64(180.0 / Float64(angle_m * (pi ^ 0.8333333333333334)))) * (pi ^ 0.16666666666666666)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + ((b * cos(((1.0 / (180.0 / (angle_m * (pi ^ 0.8333333333333334)))) * (pi ^ 0.16666666666666666)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(1.0 / N[(180.0 / N[(angle$95$m * N[Power[Pi, 0.8333333333333334], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[Pi, 0.16666666666666666], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{1}{\frac{180}{angle\_m \cdot {\pi}^{0.8333333333333334}}} \cdot {\pi}^{0.16666666666666666}\right)\right)}^{2}
\end{array}
Initial program 82.3%
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6482.3
Applied egg-rr82.3%
associate-*l/N/A
add-sqr-sqrtN/A
associate-*r*N/A
clear-numN/A
associate-*l/N/A
*-lft-identityN/A
un-div-invN/A
clear-numN/A
*-lowering-*.f64N/A
clear-numN/A
un-div-invN/A
*-lft-identityN/A
associate-*l/N/A
clear-numN/A
*-lowering-*.f64N/A
div-invN/A
metadata-evalN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6482.2
Applied egg-rr82.2%
metadata-evalN/A
div-invN/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
associate-*l/N/A
remove-double-negN/A
neg-mul-1N/A
times-fracN/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.f64N/A
distribute-neg-fracN/A
/-lowering-/.f64N/A
metadata-eval82.3
Applied egg-rr82.3%
associate-/r/N/A
associate-*l/N/A
frac-timesN/A
associate-*l*N/A
add-sqr-sqrtN/A
add-cbrt-cubeN/A
add-sqr-sqrtN/A
associate-*r*N/A
cbrt-unprodN/A
unpow1/3N/A
*-commutativeN/A
metadata-evalN/A
clear-numN/A
Applied egg-rr82.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* PI (/ 1.0 (/ 180.0 angle_m))))) 2.0) (pow (* b (cos (/ (* angle_m PI) 180.0))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin((((double) M_PI) * (1.0 / (180.0 / angle_m))))), 2.0) + pow((b * cos(((angle_m * ((double) M_PI)) / 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((Math.PI * (1.0 / (180.0 / angle_m))))), 2.0) + Math.pow((b * Math.cos(((angle_m * Math.PI) / 180.0))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin((math.pi * (1.0 / (180.0 / angle_m))))), 2.0) + math.pow((b * math.cos(((angle_m * math.pi) / 180.0))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(pi * Float64(1.0 / Float64(180.0 / angle_m))))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle_m * pi) / 180.0))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin((pi * (1.0 / (180.0 / angle_m))))) ^ 2.0) + ((b * cos(((angle_m * pi) / 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[(Pi * N[(1.0 / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\pi \cdot \frac{1}{\frac{180}{angle\_m}}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle\_m \cdot \pi}{180}\right)\right)}^{2}
\end{array}
Initial program 82.3%
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6482.3
Applied egg-rr82.3%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6482.3
Applied egg-rr82.3%
Final simplification82.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (cos (/ (* angle_m PI) 180.0))) 2.0) (pow (* a (sin (/ PI (/ 180.0 angle_m)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * cos(((angle_m * ((double) M_PI)) / 180.0))), 2.0) + pow((a * 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 Math.pow((b * Math.cos(((angle_m * Math.PI) / 180.0))), 2.0) + Math.pow((a * Math.sin((Math.PI / (180.0 / angle_m)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.cos(((angle_m * math.pi) / 180.0))), 2.0) + math.pow((a * math.sin((math.pi / (180.0 / angle_m)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * cos(Float64(Float64(angle_m * pi) / 180.0))) ^ 2.0) + (Float64(a * sin(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * cos(((angle_m * pi) / 180.0))) ^ 2.0) + ((a * sin((pi / (180.0 / angle_m)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Cos[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * 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|
\\
{\left(b \cdot \cos \left(\frac{angle\_m \cdot \pi}{180}\right)\right)}^{2} + {\left(a \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2}
\end{array}
Initial program 82.3%
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6482.3
Applied egg-rr82.3%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6482.3
Applied egg-rr82.3%
Final simplification82.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0) (pow (* b (cos (/ (* angle_m PI) 180.0))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((angle_m * ((double) M_PI)) / 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 / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((angle_m * Math.PI) / 180.0))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(((angle_m * math.pi) / 180.0))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(angle_m * pi) / 180.0))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + ((b * cos(((angle_m * pi) / 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[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle\_m \cdot \pi}{180}\right)\right)}^{2}
\end{array}
Initial program 82.3%
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6482.3
Applied egg-rr82.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (/ angle_m 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = (angle_m / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = (angle_m / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 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}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 82.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* PI (/ 1.0 (/ 180.0 angle_m))))) 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) * (1.0 / (180.0 / angle_m))))), 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 * (1.0 / (180.0 / angle_m))))), 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 * (1.0 / (180.0 / angle_m))))), 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(1.0 / Float64(180.0 / angle_m))))) ^ 2.0) + (b ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin((pi * (1.0 / (180.0 / angle_m))))) ^ 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[(1.0 / N[(180.0 / angle$95$m), $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(\pi \cdot \frac{1}{\frac{180}{angle\_m}}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 82.3%
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6482.3
Applied egg-rr82.3%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6482.3
Applied egg-rr82.3%
Taylor expanded in angle around 0
Simplified82.0%
Final simplification82.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (/ PI (/ 180.0 angle_m)))) 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) / (180.0 / angle_m)))), 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 / (180.0 / angle_m)))), 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 / (180.0 / angle_m)))), 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(180.0 / angle_m)))) ^ 2.0) + (b ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin((pi / (180.0 / angle_m)))) ^ 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[(180.0 / angle$95$m), $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(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 82.3%
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6482.2
Applied egg-rr82.2%
Taylor expanded in angle around 0
Simplified81.9%
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6482.0
Applied egg-rr82.0%
Final simplification82.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0) (* b b)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + (b * b);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + (b * b);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + (b * b)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + Float64(b * b)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + (b * b); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + b \cdot b
\end{array}
Initial program 82.3%
Taylor expanded in angle around 0
Simplified82.0%
unpow2N/A
*-lowering-*.f64N/A
*-rgt-identityN/A
*-rgt-identity82.0
Applied egg-rr82.0%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 2.95e+122)
(fma
(- 0.5 (* 0.5 (cos (* 2.0 (* PI (* angle_m 0.005555555555555556))))))
(* a a)
(* b b))
(* (* a angle_m) (* angle_m (* a (* PI (* PI 3.08641975308642e-5)))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 2.95e+122) {
tmp = fma((0.5 - (0.5 * cos((2.0 * (((double) M_PI) * (angle_m * 0.005555555555555556)))))), (a * a), (b * b));
} else {
tmp = (a * angle_m) * (angle_m * (a * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 2.95e+122) tmp = fma(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(angle_m * 0.005555555555555556)))))), Float64(a * a), Float64(b * b)); else tmp = Float64(Float64(a * angle_m) * Float64(angle_m * Float64(a * Float64(pi * Float64(pi * 3.08641975308642e-5))))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 2.95e+122], N[(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] * N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(a * angle$95$m), $MachinePrecision] * N[(angle$95$m * N[(a * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.95 \cdot 10^{+122}:\\
\;\;\;\;\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(angle\_m \cdot 0.005555555555555556\right)\right)\right), a \cdot a, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot angle\_m\right) \cdot \left(angle\_m \cdot \left(a \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.95000000000000016e122Initial program 79.9%
Taylor expanded in angle around 0
Simplified79.6%
*-commutativeN/A
unpow-prod-downN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr68.9%
if 2.95000000000000016e122 < a Initial program 96.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6496.9
Simplified96.9%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6456.2
Simplified56.2%
pow2N/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow2N/A
*-lowering-*.f6465.4
Applied egg-rr65.4%
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f6478.5
Applied egg-rr78.5%
Final simplification70.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 3.1e+122)
(fma
(- 0.5 (* 0.5 (cos (* 2.0 (* angle_m (* PI 0.005555555555555556))))))
(* a a)
(* b b))
(* (* a angle_m) (* angle_m (* a (* PI (* PI 3.08641975308642e-5)))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 3.1e+122) {
tmp = fma((0.5 - (0.5 * cos((2.0 * (angle_m * (((double) M_PI) * 0.005555555555555556)))))), (a * a), (b * b));
} else {
tmp = (a * angle_m) * (angle_m * (a * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5))));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 3.1e+122) tmp = fma(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(angle_m * Float64(pi * 0.005555555555555556)))))), Float64(a * a), Float64(b * b)); else tmp = Float64(Float64(a * angle_m) * Float64(angle_m * Float64(a * Float64(pi * Float64(pi * 3.08641975308642e-5))))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 3.1e+122], N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(a * angle$95$m), $MachinePrecision] * N[(angle$95$m * N[(a * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.1 \cdot 10^{+122}:\\
\;\;\;\;\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right), a \cdot a, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot angle\_m\right) \cdot \left(angle\_m \cdot \left(a \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.09999999999999999e122Initial program 79.9%
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6479.8
Applied egg-rr79.8%
Taylor expanded in angle around 0
Simplified79.5%
*-commutativeN/A
associate-/r*N/A
associate-/r/N/A
clear-numN/A
unpow-prod-downN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr68.9%
if 3.09999999999999999e122 < a Initial program 96.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6496.9
Simplified96.9%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6456.2
Simplified56.2%
pow2N/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow2N/A
*-lowering-*.f6465.4
Applied egg-rr65.4%
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f6478.5
Applied egg-rr78.5%
Final simplification70.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 3.1e+122) (* b b) (* (* a angle_m) (* angle_m (* a (* PI (* PI 3.08641975308642e-5)))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 3.1e+122) {
tmp = b * b;
} else {
tmp = (a * angle_m) * (angle_m * (a * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 3.1e+122) {
tmp = b * b;
} else {
tmp = (a * angle_m) * (angle_m * (a * (Math.PI * (Math.PI * 3.08641975308642e-5))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 3.1e+122: tmp = b * b else: tmp = (a * angle_m) * (angle_m * (a * (math.pi * (math.pi * 3.08641975308642e-5)))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 3.1e+122) tmp = Float64(b * b); else tmp = Float64(Float64(a * angle_m) * Float64(angle_m * Float64(a * Float64(pi * Float64(pi * 3.08641975308642e-5))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 3.1e+122) tmp = b * b; else tmp = (a * angle_m) * (angle_m * (a * (pi * (pi * 3.08641975308642e-5)))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 3.1e+122], N[(b * b), $MachinePrecision], N[(N[(a * angle$95$m), $MachinePrecision] * N[(angle$95$m * N[(a * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.1 \cdot 10^{+122}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot angle\_m\right) \cdot \left(angle\_m \cdot \left(a \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.09999999999999999e122Initial program 79.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6463.4
Simplified63.4%
if 3.09999999999999999e122 < a Initial program 96.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6496.9
Simplified96.9%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6456.2
Simplified56.2%
pow2N/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow2N/A
*-lowering-*.f6465.4
Applied egg-rr65.4%
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f6478.5
Applied egg-rr78.5%
Final simplification65.6%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 3e+122) (* b b) (* angle_m (* a (* angle_m (* a (* PI (* PI 3.08641975308642e-5))))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 3e+122) {
tmp = b * b;
} else {
tmp = angle_m * (a * (angle_m * (a * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 3e+122) {
tmp = b * b;
} else {
tmp = angle_m * (a * (angle_m * (a * (Math.PI * (Math.PI * 3.08641975308642e-5)))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 3e+122: tmp = b * b else: tmp = angle_m * (a * (angle_m * (a * (math.pi * (math.pi * 3.08641975308642e-5))))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 3e+122) tmp = Float64(b * b); else tmp = Float64(angle_m * Float64(a * Float64(angle_m * Float64(a * Float64(pi * Float64(pi * 3.08641975308642e-5)))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 3e+122) tmp = b * b; else tmp = angle_m * (a * (angle_m * (a * (pi * (pi * 3.08641975308642e-5))))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 3e+122], N[(b * b), $MachinePrecision], N[(angle$95$m * N[(a * N[(angle$95$m * N[(a * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3 \cdot 10^{+122}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;angle\_m \cdot \left(a \cdot \left(angle\_m \cdot \left(a \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.99999999999999986e122Initial program 79.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6463.4
Simplified63.4%
if 2.99999999999999986e122 < a Initial program 96.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6496.9
Simplified96.9%
Taylor expanded in angle around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6456.2
Simplified56.2%
pow2N/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow2N/A
*-lowering-*.f6465.4
Applied egg-rr65.4%
associate-*r*N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6470.9
Applied egg-rr70.9%
Final simplification64.5%
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 82.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6462.0
Simplified62.0%
herbie shell --seed 2024204
(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)))