
(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}
Herbie found 16 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 (sqrt (* 0.005555555555555556 angle_m))))
(+
(pow (* a (sin (* (* PI angle_m) 0.005555555555555556))) 2.0)
(pow (* b (sin (fma (* t_0 t_0) PI (/ PI 2.0)))) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = sqrt((0.005555555555555556 * angle_m));
return pow((a * sin(((((double) M_PI) * angle_m) * 0.005555555555555556))), 2.0) + pow((b * sin(fma((t_0 * t_0), ((double) M_PI), (((double) M_PI) / 2.0)))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = sqrt(Float64(0.005555555555555556 * angle_m)) return Float64((Float64(a * sin(Float64(Float64(pi * angle_m) * 0.005555555555555556))) ^ 2.0) + (Float64(b * sin(fma(Float64(t_0 * t_0), pi, Float64(pi / 2.0)))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[Sqrt[N[(0.005555555555555556 * angle$95$m), $MachinePrecision]], $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(t$95$0 * t$95$0), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \sqrt{0.005555555555555556 \cdot angle\_m}\\
{\left(a \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(t\_0 \cdot t\_0, \pi, \frac{\pi}{2}\right)\right)\right)}^{2}
\end{array}
\end{array}
Initial program 79.3%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
Applied rewrites79.2%
lift-*.f64N/A
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lift-*.f64N/A
lower-sqrt.f64N/A
lift-*.f6479.2
Applied rewrites79.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (* PI angle_m) 0.005555555555555556))) 2.0) (/ (* b b) (pow (/ 1.0 (cos (* (* PI 0.005555555555555556) 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) * 0.005555555555555556))), 2.0) + ((b * b) / pow((1.0 / cos(((((double) M_PI) * 0.005555555555555556) * 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) * 0.005555555555555556))), 2.0) + ((b * b) / Math.pow((1.0 / Math.cos(((Math.PI * 0.005555555555555556) * 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) * 0.005555555555555556))), 2.0) + ((b * b) / math.pow((1.0 / math.cos(((math.pi * 0.005555555555555556) * angle_m))), 2.0))
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(pi * angle_m) * 0.005555555555555556))) ^ 2.0) + Float64(Float64(b * b) / (Float64(1.0 / cos(Float64(Float64(pi * 0.005555555555555556) * angle_m))) ^ 2.0))) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((pi * angle_m) * 0.005555555555555556))) ^ 2.0) + ((b * b) / ((1.0 / cos(((pi * 0.005555555555555556) * 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[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(b * b), $MachinePrecision] / N[Power[N[(1.0 / N[Cos[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * angle$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right)}^{2} + \frac{b \cdot b}{{\left(\frac{1}{\cos \left(\left(\pi \cdot 0.005555555555555556\right) \cdot angle\_m\right)}\right)}^{2}}
\end{array}
Initial program 79.3%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
Applied rewrites79.2%
lift-*.f64N/A
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lift-*.f64N/A
lower-sqrt.f64N/A
lift-*.f6479.2
Applied rewrites79.2%
Applied rewrites79.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (* PI angle_m) 0.005555555555555556))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (sin (+ (- t_0) (* 0.5 PI)))) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (((double) M_PI) * angle_m) * 0.005555555555555556;
return pow((a * sin(t_0)), 2.0) + pow((b * sin((-t_0 + (0.5 * ((double) M_PI))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = (Math.PI * angle_m) * 0.005555555555555556;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.sin((-t_0 + (0.5 * Math.PI)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = (math.pi * angle_m) * 0.005555555555555556 return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.sin((-t_0 + (0.5 * math.pi)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(pi * angle_m) * 0.005555555555555556) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * sin(Float64(Float64(-t_0) + Float64(0.5 * pi)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = (pi * angle_m) * 0.005555555555555556; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * sin((-t_0 + (0.5 * pi)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[((-t$95$0) + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \sin \left(\left(-t\_0\right) + 0.5 \cdot \pi\right)\right)}^{2}
\end{array}
\end{array}
Initial program 79.3%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
Applied rewrites79.2%
lift-sin.f64N/A
lift-PI.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fabs.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
sin-+PI/2N/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
fabs-mulN/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
cos-fabs-revN/A
Applied rewrites79.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (* PI angle_m) 0.005555555555555556))) 2.0) (pow (* b (sin (fma (* PI angle_m) 0.005555555555555556 (* 0.5 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) * 0.005555555555555556))), 2.0) + pow((b * sin(fma((((double) M_PI) * angle_m), 0.005555555555555556, (0.5 * ((double) M_PI))))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(pi * angle_m) * 0.005555555555555556))) ^ 2.0) + (Float64(b * sin(fma(Float64(pi * angle_m), 0.005555555555555556, Float64(0.5 * pi)))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556 + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\pi \cdot angle\_m, 0.005555555555555556, 0.5 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 79.3%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
Applied rewrites79.2%
lift-*.f64N/A
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lift-*.f64N/A
lower-sqrt.f64N/A
lift-*.f6479.2
Applied rewrites79.2%
lift-PI.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6479.2
lift-PI.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (* PI angle_m) 0.005555555555555556))) 2.0) (pow (* b (sin (fma (* PI 0.005555555555555556) angle_m (* 0.5 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) * 0.005555555555555556))), 2.0) + pow((b * sin(fma((((double) M_PI) * 0.005555555555555556), angle_m, (0.5 * ((double) M_PI))))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(pi * angle_m) * 0.005555555555555556))) ^ 2.0) + (Float64(b * sin(fma(Float64(pi * 0.005555555555555556), angle_m, Float64(0.5 * pi)))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * angle$95$m + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot \sin \left(\mathsf{fma}\left(\pi \cdot 0.005555555555555556, angle\_m, 0.5 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 79.3%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-cos.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
Applied rewrites79.2%
lift-sin.f64N/A
lift-PI.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fabs.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
sin-+PI/2N/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
fabs-mulN/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
cos-fabs-revN/A
Applied rewrites79.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (* PI angle_m) 0.005555555555555556))) (+ (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 = (((double) M_PI) * angle_m) * 0.005555555555555556;
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 = (Math.PI * angle_m) * 0.005555555555555556;
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 = (math.pi * angle_m) * 0.005555555555555556 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(pi * angle_m) * 0.005555555555555556) 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 = (pi * angle_m) * 0.005555555555555556; 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[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $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 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 79.3%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (* PI angle_m) 0.005555555555555556))) 2.0) (pow (* b 1.0) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((((double) M_PI) * angle_m) * 0.005555555555555556))), 2.0) + pow((b * 1.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 * angle_m) * 0.005555555555555556))), 2.0) + Math.pow((b * 1.0), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((math.pi * angle_m) * 0.005555555555555556))), 2.0) + math.pow((b * 1.0), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(pi * angle_m) * 0.005555555555555556))) ^ 2.0) + (Float64(b * 1.0) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((pi * angle_m) * 0.005555555555555556))) ^ 2.0) + ((b * 1.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[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * 1.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\right)\right)}^{2} + {\left(b \cdot 1\right)}^{2}
\end{array}
Initial program 79.3%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
Taylor expanded in angle around 0
Applied rewrites79.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* (* PI angle_m) 0.005555555555555556)))
(if (<= a 6e-59)
(*
(+ 0.5 (* 0.5 (cos (* 2.0 (* PI (* 0.005555555555555556 angle_m))))))
(* b b))
(fma (+ 0.5 (* 0.5 (cos (* 2.0 t_0)))) (* b b) (* (* (* t_0 a) t_0) a)))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (((double) M_PI) * angle_m) * 0.005555555555555556;
double tmp;
if (a <= 6e-59) {
tmp = (0.5 + (0.5 * cos((2.0 * (((double) M_PI) * (0.005555555555555556 * angle_m)))))) * (b * b);
} else {
tmp = fma((0.5 + (0.5 * cos((2.0 * t_0)))), (b * b), (((t_0 * a) * t_0) * a));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(pi * angle_m) * 0.005555555555555556) tmp = 0.0 if (a <= 6e-59) tmp = Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(0.005555555555555556 * angle_m)))))) * Float64(b * b)); else tmp = fma(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * t_0)))), Float64(b * b), Float64(Float64(Float64(t_0 * a) * t_0) * a)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, If[LessEqual[a, 6e-59], N[(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] * N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision] + N[(N[(N[(t$95$0 * a), $MachinePrecision] * t$95$0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
\mathbf{if}\;a \leq 6 \cdot 10^{-59}:\\
\;\;\;\;\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right), b \cdot b, \left(\left(t\_0 \cdot a\right) \cdot t\_0\right) \cdot a\right)\\
\end{array}
\end{array}
if a < 6.0000000000000002e-59Initial program 79.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.9%
if 6.0000000000000002e-59 < a Initial program 79.3%
Taylor expanded in angle around 0
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6474.5
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
lift-pow.f64N/A
unpow2N/A
lower-*.f6474.5
Applied rewrites74.5%
Applied rewrites73.4%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* (* PI angle_m) 0.005555555555555556)) (t_1 (* t_0 a)))
(if (<= a 6e-59)
(*
(+ 0.5 (* 0.5 (cos (* 2.0 (* PI (* 0.005555555555555556 angle_m))))))
(* b b))
(fma t_1 t_1 (* (+ 0.5 (* 0.5 (cos (* 2.0 t_0)))) (* b b))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (((double) M_PI) * angle_m) * 0.005555555555555556;
double t_1 = t_0 * a;
double tmp;
if (a <= 6e-59) {
tmp = (0.5 + (0.5 * cos((2.0 * (((double) M_PI) * (0.005555555555555556 * angle_m)))))) * (b * b);
} else {
tmp = fma(t_1, t_1, ((0.5 + (0.5 * cos((2.0 * t_0)))) * (b * b)));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(pi * angle_m) * 0.005555555555555556) t_1 = Float64(t_0 * a) tmp = 0.0 if (a <= 6e-59) tmp = Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(0.005555555555555556 * angle_m)))))) * Float64(b * b)); else tmp = fma(t_1, t_1, Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * t_0)))) * Float64(b * b))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * angle$95$m), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * a), $MachinePrecision]}, If[LessEqual[a, 6e-59], N[(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] * N[(b * b), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$1 + N[(N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \left(\pi \cdot angle\_m\right) \cdot 0.005555555555555556\\
t_1 := t\_0 \cdot a\\
\mathbf{if}\;a \leq 6 \cdot 10^{-59}:\\
\;\;\;\;\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_1, \left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right) \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if a < 6.0000000000000002e-59Initial program 79.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.9%
if 6.0000000000000002e-59 < a Initial program 79.3%
Taylor expanded in angle around 0
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6474.5
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
lift-pow.f64N/A
unpow2N/A
lower-*.f6474.5
Applied rewrites74.5%
Applied rewrites74.4%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* (* PI 0.005555555555555556) angle_m)) (t_1 (* t_0 a)))
(if (<= a 6e-59)
(*
(+ 0.5 (* 0.5 (cos (* 2.0 (* PI (* 0.005555555555555556 angle_m))))))
(* b b))
(fma t_1 t_1 (* (+ 0.5 (* 0.5 (cos (* 2.0 t_0)))) (* b b))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (((double) M_PI) * 0.005555555555555556) * angle_m;
double t_1 = t_0 * a;
double tmp;
if (a <= 6e-59) {
tmp = (0.5 + (0.5 * cos((2.0 * (((double) M_PI) * (0.005555555555555556 * angle_m)))))) * (b * b);
} else {
tmp = fma(t_1, t_1, ((0.5 + (0.5 * cos((2.0 * t_0)))) * (b * b)));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(pi * 0.005555555555555556) * angle_m) t_1 = Float64(t_0 * a) tmp = 0.0 if (a <= 6e-59) tmp = Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(0.005555555555555556 * angle_m)))))) * Float64(b * b)); else tmp = fma(t_1, t_1, Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * t_0)))) * Float64(b * b))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * angle$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * a), $MachinePrecision]}, If[LessEqual[a, 6e-59], N[(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] * N[(b * b), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$1 + N[(N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \left(\pi \cdot 0.005555555555555556\right) \cdot angle\_m\\
t_1 := t\_0 \cdot a\\
\mathbf{if}\;a \leq 6 \cdot 10^{-59}:\\
\;\;\;\;\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_1, \left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right) \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if a < 6.0000000000000002e-59Initial program 79.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.9%
if 6.0000000000000002e-59 < a Initial program 79.3%
Taylor expanded in angle around 0
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6474.5
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
Applied rewrites74.5%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* (* (* PI 0.005555555555555556) angle_m) a)))
(if (<= a 6e-59)
(*
(+ 0.5 (* 0.5 (cos (* 2.0 (* PI (* 0.005555555555555556 angle_m))))))
(* b b))
(+ (* t_0 t_0) (pow (* b 1.0) 2.0)))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((((double) M_PI) * 0.005555555555555556) * angle_m) * a;
double tmp;
if (a <= 6e-59) {
tmp = (0.5 + (0.5 * cos((2.0 * (((double) M_PI) * (0.005555555555555556 * angle_m)))))) * (b * b);
} else {
tmp = (t_0 * t_0) + pow((b * 1.0), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = ((Math.PI * 0.005555555555555556) * angle_m) * a;
double tmp;
if (a <= 6e-59) {
tmp = (0.5 + (0.5 * Math.cos((2.0 * (Math.PI * (0.005555555555555556 * angle_m)))))) * (b * b);
} else {
tmp = (t_0 * t_0) + Math.pow((b * 1.0), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = ((math.pi * 0.005555555555555556) * angle_m) * a tmp = 0 if a <= 6e-59: tmp = (0.5 + (0.5 * math.cos((2.0 * (math.pi * (0.005555555555555556 * angle_m)))))) * (b * b) else: tmp = (t_0 * t_0) + math.pow((b * 1.0), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(Float64(pi * 0.005555555555555556) * angle_m) * a) tmp = 0.0 if (a <= 6e-59) tmp = Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(pi * Float64(0.005555555555555556 * angle_m)))))) * Float64(b * b)); else tmp = Float64(Float64(t_0 * t_0) + (Float64(b * 1.0) ^ 2.0)); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = ((pi * 0.005555555555555556) * angle_m) * a; tmp = 0.0; if (a <= 6e-59) tmp = (0.5 + (0.5 * cos((2.0 * (pi * (0.005555555555555556 * angle_m)))))) * (b * b); else tmp = (t_0 * t_0) + ((b * 1.0) ^ 2.0); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * angle$95$m), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, 6e-59], N[(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] * N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * t$95$0), $MachinePrecision] + N[Power[N[(b * 1.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \left(\left(\pi \cdot 0.005555555555555556\right) \cdot angle\_m\right) \cdot a\\
\mathbf{if}\;a \leq 6 \cdot 10^{-59}:\\
\;\;\;\;\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_0 + {\left(b \cdot 1\right)}^{2}\\
\end{array}
\end{array}
if a < 6.0000000000000002e-59Initial program 79.3%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.9%
if 6.0000000000000002e-59 < a Initial program 79.3%
Taylor expanded in angle around 0
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6474.5
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
lift-pow.f64N/A
unpow2N/A
lower-*.f6474.5
Applied rewrites74.5%
Taylor expanded in angle around 0
Applied rewrites74.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* (* PI 0.005555555555555556) angle_m)) (t_1 (* t_0 a)))
(if (<= a 6e-59)
(* (+ 0.5 (* 0.5 (cos (* 2.0 t_0)))) (* b b))
(+ (* t_1 t_1) (pow (* b 1.0) 2.0)))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (((double) M_PI) * 0.005555555555555556) * angle_m;
double t_1 = t_0 * a;
double tmp;
if (a <= 6e-59) {
tmp = (0.5 + (0.5 * cos((2.0 * t_0)))) * (b * b);
} else {
tmp = (t_1 * t_1) + pow((b * 1.0), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = (Math.PI * 0.005555555555555556) * angle_m;
double t_1 = t_0 * a;
double tmp;
if (a <= 6e-59) {
tmp = (0.5 + (0.5 * Math.cos((2.0 * t_0)))) * (b * b);
} else {
tmp = (t_1 * t_1) + Math.pow((b * 1.0), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = (math.pi * 0.005555555555555556) * angle_m t_1 = t_0 * a tmp = 0 if a <= 6e-59: tmp = (0.5 + (0.5 * math.cos((2.0 * t_0)))) * (b * b) else: tmp = (t_1 * t_1) + math.pow((b * 1.0), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(pi * 0.005555555555555556) * angle_m) t_1 = Float64(t_0 * a) tmp = 0.0 if (a <= 6e-59) tmp = Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * t_0)))) * Float64(b * b)); else tmp = Float64(Float64(t_1 * t_1) + (Float64(b * 1.0) ^ 2.0)); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = (pi * 0.005555555555555556) * angle_m; t_1 = t_0 * a; tmp = 0.0; if (a <= 6e-59) tmp = (0.5 + (0.5 * cos((2.0 * t_0)))) * (b * b); else tmp = (t_1 * t_1) + ((b * 1.0) ^ 2.0); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * angle$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * a), $MachinePrecision]}, If[LessEqual[a, 6e-59], N[(N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * t$95$1), $MachinePrecision] + N[Power[N[(b * 1.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \left(\pi \cdot 0.005555555555555556\right) \cdot angle\_m\\
t_1 := t\_0 \cdot a\\
\mathbf{if}\;a \leq 6 \cdot 10^{-59}:\\
\;\;\;\;\left(0.5 + 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right) \cdot \left(b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_1 + {\left(b \cdot 1\right)}^{2}\\
\end{array}
\end{array}
if a < 6.0000000000000002e-59Initial program 79.3%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.9%
if 6.0000000000000002e-59 < a Initial program 79.3%
Taylor expanded in angle around 0
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6474.5
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
lift-pow.f64N/A
unpow2N/A
lower-*.f6474.5
Applied rewrites74.5%
Taylor expanded in angle around 0
Applied rewrites74.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (* (* PI 0.005555555555555556) angle_m) a))) (if (<= a 6e-59) (* b b) (+ (* t_0 t_0) (pow (* b 1.0) 2.0)))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((((double) M_PI) * 0.005555555555555556) * angle_m) * a;
double tmp;
if (a <= 6e-59) {
tmp = b * b;
} else {
tmp = (t_0 * t_0) + pow((b * 1.0), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = ((Math.PI * 0.005555555555555556) * angle_m) * a;
double tmp;
if (a <= 6e-59) {
tmp = b * b;
} else {
tmp = (t_0 * t_0) + Math.pow((b * 1.0), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = ((math.pi * 0.005555555555555556) * angle_m) * a tmp = 0 if a <= 6e-59: tmp = b * b else: tmp = (t_0 * t_0) + math.pow((b * 1.0), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(Float64(pi * 0.005555555555555556) * angle_m) * a) tmp = 0.0 if (a <= 6e-59) tmp = Float64(b * b); else tmp = Float64(Float64(t_0 * t_0) + (Float64(b * 1.0) ^ 2.0)); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = ((pi * 0.005555555555555556) * angle_m) * a; tmp = 0.0; if (a <= 6e-59) tmp = b * b; else tmp = (t_0 * t_0) + ((b * 1.0) ^ 2.0); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * angle$95$m), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, 6e-59], N[(b * b), $MachinePrecision], N[(N[(t$95$0 * t$95$0), $MachinePrecision] + N[Power[N[(b * 1.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \left(\left(\pi \cdot 0.005555555555555556\right) \cdot angle\_m\right) \cdot a\\
\mathbf{if}\;a \leq 6 \cdot 10^{-59}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_0 + {\left(b \cdot 1\right)}^{2}\\
\end{array}
\end{array}
if a < 6.0000000000000002e-59Initial program 79.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
if 6.0000000000000002e-59 < a Initial program 79.3%
Taylor expanded in angle around 0
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6474.5
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6474.5
Applied rewrites74.5%
lift-pow.f64N/A
unpow2N/A
lower-*.f6474.5
Applied rewrites74.5%
Taylor expanded in angle around 0
Applied rewrites74.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 6e-59) (* b b) (fma b b (pow (* angle_m (* (* PI a) 0.005555555555555556)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 6e-59) {
tmp = b * b;
} else {
tmp = fma(b, b, pow((angle_m * ((((double) M_PI) * a) * 0.005555555555555556)), 2.0));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 6e-59) tmp = Float64(b * b); else tmp = fma(b, b, (Float64(angle_m * Float64(Float64(pi * a) * 0.005555555555555556)) ^ 2.0)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 6e-59], N[(b * b), $MachinePrecision], N[(b * b + N[Power[N[(angle$95$m * N[(N[(Pi * a), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 6 \cdot 10^{-59}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, b, {\left(angle\_m \cdot \left(\left(\pi \cdot a\right) \cdot 0.005555555555555556\right)\right)}^{2}\right)\\
\end{array}
\end{array}
if a < 6.0000000000000002e-59Initial program 79.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
if 6.0000000000000002e-59 < a Initial program 79.3%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6479.2
Applied rewrites79.2%
Applied rewrites45.1%
Taylor expanded in angle around 0
Applied rewrites74.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* (/ angle_m 180.0) PI)))
(if (<= (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0)) 5e+303)
(* b b)
(sqrt (* (* b b) (* b b))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
double tmp;
if ((pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0)) <= 5e+303) {
tmp = b * b;
} else {
tmp = sqrt(((b * b) * (b * b)));
}
return tmp;
}
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;
double tmp;
if ((Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0)) <= 5e+303) {
tmp = b * b;
} else {
tmp = Math.sqrt(((b * b) * (b * b)));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = (angle_m / 180.0) * math.pi tmp = 0 if (math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)) <= 5e+303: tmp = b * b else: tmp = math.sqrt(((b * b) * (b * b))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) tmp = 0.0 if (Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) <= 5e+303) tmp = Float64(b * b); else tmp = sqrt(Float64(Float64(b * b) * Float64(b * b))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = (angle_m / 180.0) * pi; tmp = 0.0; if ((((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0)) <= 5e+303) tmp = b * b; else tmp = sqrt(((b * b) * (b * b))); end tmp_2 = tmp; 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]}, If[LessEqual[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], 5e+303], N[(b * b), $MachinePrecision], N[Sqrt[N[(N[(b * b), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
\mathbf{if}\;{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2} \leq 5 \cdot 10^{+303}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right)}\\
\end{array}
\end{array}
if (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) < 4.9999999999999997e303Initial program 79.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
if 4.9999999999999997e303 < (+.f64 (pow.f64 (*.f64 a (sin.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64)) (pow.f64 (*.f64 b (cos.f64 (*.f64 (/.f64 angle #s(literal 180 binary64)) (PI.f64)))) #s(literal 2 binary64))) Initial program 79.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
lift-*.f64N/A
pow2N/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f6427.1
Applied rewrites27.1%
lift-exp.f64N/A
lift-*.f64N/A
lift-log.f64N/A
exp-fabsN/A
pow-to-expN/A
rem-sqrt-square-revN/A
lower-sqrt.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.5
Applied rewrites49.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 = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(a, b, angle_m)
use fmin_fmax_functions
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
lower-*.f6457.1
Applied rewrites57.1%
herbie shell --seed 2025140
(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)))