
(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 19 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}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (/ (+ PI 1.0) (/ 180.0 angle))))
(+
(pow
(*
a
(+
(* (cos t_0) (cos (* angle 0.005555555555555556)))
(* (sin t_0) (sin (/ angle 180.0)))))
2.0)
(pow (* b (sin (/ (* PI angle) 180.0))) 2.0))))
double code(double a, double b, double angle) {
double t_0 = (((double) M_PI) + 1.0) / (180.0 / angle);
return pow((a * ((cos(t_0) * cos((angle * 0.005555555555555556))) + (sin(t_0) * sin((angle / 180.0))))), 2.0) + pow((b * sin(((((double) M_PI) * angle) / 180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (Math.PI + 1.0) / (180.0 / angle);
return Math.pow((a * ((Math.cos(t_0) * Math.cos((angle * 0.005555555555555556))) + (Math.sin(t_0) * Math.sin((angle / 180.0))))), 2.0) + Math.pow((b * Math.sin(((Math.PI * angle) / 180.0))), 2.0);
}
def code(a, b, angle): t_0 = (math.pi + 1.0) / (180.0 / angle) return math.pow((a * ((math.cos(t_0) * math.cos((angle * 0.005555555555555556))) + (math.sin(t_0) * math.sin((angle / 180.0))))), 2.0) + math.pow((b * math.sin(((math.pi * angle) / 180.0))), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(pi + 1.0) / Float64(180.0 / angle)) return Float64((Float64(a * Float64(Float64(cos(t_0) * cos(Float64(angle * 0.005555555555555556))) + Float64(sin(t_0) * sin(Float64(angle / 180.0))))) ^ 2.0) + (Float64(b * sin(Float64(Float64(pi * angle) / 180.0))) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (pi + 1.0) / (180.0 / angle); tmp = ((a * ((cos(t_0) * cos((angle * 0.005555555555555556))) + (sin(t_0) * sin((angle / 180.0))))) ^ 2.0) + ((b * sin(((pi * angle) / 180.0))) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(Pi + 1.0), $MachinePrecision] / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[(N[(N[Cos[t$95$0], $MachinePrecision] * N[Cos[N[(angle * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[t$95$0], $MachinePrecision] * N[Sin[N[(angle / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\pi + 1}{\frac{180}{angle}}\\
{\left(a \cdot \left(\cos t\_0 \cdot \cos \left(angle \cdot 0.005555555555555556\right) + \sin t\_0 \cdot \sin \left(\frac{angle}{180}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2}
\end{array}
\end{array}
Initial program 81.1%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.2%
associate-*r/N/A
clear-numN/A
un-div-invN/A
expm1-log1p-uN/A
expm1-undefineN/A
div-subN/A
clear-numN/A
cos-diffN/A
+-lowering-+.f64N/A
Applied egg-rr81.3%
Taylor expanded in angle around inf
cos-lowering-cos.f64N/A
*-lowering-*.f6481.3%
Simplified81.3%
Final simplification81.3%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (/ (* PI angle) 180.0))) 2.0) (pow (* b (sin (* (* angle (sqrt PI)) (* 0.005555555555555556 (sqrt PI))))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos(((((double) M_PI) * angle) / 180.0))), 2.0) + pow((b * sin(((angle * sqrt(((double) M_PI))) * (0.005555555555555556 * sqrt(((double) M_PI)))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos(((Math.PI * angle) / 180.0))), 2.0) + Math.pow((b * Math.sin(((angle * Math.sqrt(Math.PI)) * (0.005555555555555556 * Math.sqrt(Math.PI))))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos(((math.pi * angle) / 180.0))), 2.0) + math.pow((b * math.sin(((angle * math.sqrt(math.pi)) * (0.005555555555555556 * math.sqrt(math.pi))))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle * sqrt(pi)) * Float64(0.005555555555555556 * sqrt(pi))))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos(((pi * angle) / 180.0))) ^ 2.0) + ((b * sin(((angle * sqrt(pi)) * (0.005555555555555556 * sqrt(pi))))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(0.005555555555555556 \cdot \sqrt{\pi}\right)\right)\right)}^{2}
\end{array}
Initial program 81.1%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.2%
div-invN/A
*-commutativeN/A
add-sqr-sqrtN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
metadata-eval81.3%
Applied egg-rr81.3%
Final simplification81.3%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (/ (* PI angle) 180.0))) 2.0) (pow (* b (sin (/ (/ PI 180.0) (/ 1.0 angle)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos(((((double) M_PI) * angle) / 180.0))), 2.0) + pow((b * sin(((((double) M_PI) / 180.0) / (1.0 / angle)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos(((Math.PI * angle) / 180.0))), 2.0) + Math.pow((b * Math.sin(((Math.PI / 180.0) / (1.0 / angle)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos(((math.pi * angle) / 180.0))), 2.0) + math.pow((b * math.sin(((math.pi / 180.0) / (1.0 / angle)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + (Float64(b * sin(Float64(Float64(pi / 180.0) / Float64(1.0 / angle)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos(((pi * angle) / 180.0))) ^ 2.0) + ((b * sin(((pi / 180.0) / (1.0 / angle)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi / 180.0), $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\frac{\pi}{180}}{\frac{1}{angle}}\right)\right)}^{2}
\end{array}
Initial program 81.1%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.2%
associate-*r/N/A
clear-numN/A
un-div-invN/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6481.3%
Applied egg-rr81.3%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (/ (* PI angle) 180.0))) 2.0) (pow (* a (cos (* 0.005555555555555556 (/ PI (/ 1.0 angle))))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin(((((double) M_PI) * angle) / 180.0))), 2.0) + pow((a * cos((0.005555555555555556 * (((double) M_PI) / (1.0 / angle))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin(((Math.PI * angle) / 180.0))), 2.0) + Math.pow((a * Math.cos((0.005555555555555556 * (Math.PI / (1.0 / angle))))), 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin(((math.pi * angle) / 180.0))), 2.0) + math.pow((a * math.cos((0.005555555555555556 * (math.pi / (1.0 / angle))))), 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + (Float64(a * cos(Float64(0.005555555555555556 * Float64(pi / Float64(1.0 / angle))))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin(((pi * angle) / 180.0))) ^ 2.0) + ((a * cos((0.005555555555555556 * (pi / (1.0 / angle))))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(0.005555555555555556 * N[(Pi / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(0.005555555555555556 \cdot \frac{\pi}{\frac{1}{angle}}\right)\right)}^{2}
\end{array}
Initial program 81.1%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.2%
associate-*r/N/A
clear-numN/A
un-div-invN/A
*-un-lft-identityN/A
div-invN/A
times-fracN/A
*-lowering-*.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6481.2%
Applied egg-rr81.2%
Final simplification81.2%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (/ (* PI angle) 180.0))) 2.0) (pow (* a (cos (* angle (/ PI 180.0)))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin(((((double) M_PI) * angle) / 180.0))), 2.0) + pow((a * cos((angle * (((double) M_PI) / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin(((Math.PI * angle) / 180.0))), 2.0) + Math.pow((a * Math.cos((angle * (Math.PI / 180.0)))), 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin(((math.pi * angle) / 180.0))), 2.0) + math.pow((a * math.cos((angle * (math.pi / 180.0)))), 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + (Float64(a * cos(Float64(angle * Float64(pi / 180.0)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin(((pi * angle) / 180.0))) ^ 2.0) + ((a * cos((angle * (pi / 180.0)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2}
\end{array}
Initial program 81.1%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6481.2%
Applied egg-rr81.2%
Final simplification81.2%
(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}
Initial program 81.1%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* (* angle (sqrt PI)) (* 0.005555555555555556 (sqrt PI))))) 2.0) (* a a)))
double code(double a, double b, double angle) {
return pow((b * sin(((angle * sqrt(((double) M_PI))) * (0.005555555555555556 * sqrt(((double) M_PI)))))), 2.0) + (a * a);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin(((angle * Math.sqrt(Math.PI)) * (0.005555555555555556 * Math.sqrt(Math.PI))))), 2.0) + (a * a);
}
def code(a, b, angle): return math.pow((b * math.sin(((angle * math.sqrt(math.pi)) * (0.005555555555555556 * math.sqrt(math.pi))))), 2.0) + (a * a)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(Float64(angle * sqrt(pi)) * Float64(0.005555555555555556 * sqrt(pi))))) ^ 2.0) + Float64(a * a)) end
function tmp = code(a, b, angle) tmp = ((b * sin(((angle * sqrt(pi)) * (0.005555555555555556 * sqrt(pi))))) ^ 2.0) + (a * a); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(N[(angle * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\left(angle \cdot \sqrt{\pi}\right) \cdot \left(0.005555555555555556 \cdot \sqrt{\pi}\right)\right)\right)}^{2} + a \cdot a
\end{array}
Initial program 81.1%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.2%
div-invN/A
*-commutativeN/A
add-sqr-sqrtN/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
metadata-eval81.3%
Applied egg-rr81.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6480.6%
Simplified80.6%
Final simplification80.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0
(*
angle
(*
(+
0.005555555555555556
(* (* angle (* angle -2.8577960676726107e-8)) (* PI PI)))
(* PI b)))))
(if (<= b 4.3e-71)
(* (* a a) (pow (cos (* angle (* PI 0.005555555555555556))) 2.0))
(+
(* (* a a) (+ 0.5 (* 0.5 (cos (/ 2.0 (/ 180.0 (* PI angle)))))))
(* t_0 t_0)))))
double code(double a, double b, double angle) {
double t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (((double) M_PI) * ((double) M_PI)))) * (((double) M_PI) * b));
double tmp;
if (b <= 4.3e-71) {
tmp = (a * a) * pow(cos((angle * (((double) M_PI) * 0.005555555555555556))), 2.0);
} else {
tmp = ((a * a) * (0.5 + (0.5 * cos((2.0 / (180.0 / (((double) M_PI) * angle))))))) + (t_0 * t_0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (Math.PI * Math.PI))) * (Math.PI * b));
double tmp;
if (b <= 4.3e-71) {
tmp = (a * a) * Math.pow(Math.cos((angle * (Math.PI * 0.005555555555555556))), 2.0);
} else {
tmp = ((a * a) * (0.5 + (0.5 * Math.cos((2.0 / (180.0 / (Math.PI * angle))))))) + (t_0 * t_0);
}
return tmp;
}
def code(a, b, angle): t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (math.pi * math.pi))) * (math.pi * b)) tmp = 0 if b <= 4.3e-71: tmp = (a * a) * math.pow(math.cos((angle * (math.pi * 0.005555555555555556))), 2.0) else: tmp = ((a * a) * (0.5 + (0.5 * math.cos((2.0 / (180.0 / (math.pi * angle))))))) + (t_0 * t_0) return tmp
function code(a, b, angle) t_0 = Float64(angle * Float64(Float64(0.005555555555555556 + Float64(Float64(angle * Float64(angle * -2.8577960676726107e-8)) * Float64(pi * pi))) * Float64(pi * b))) tmp = 0.0 if (b <= 4.3e-71) tmp = Float64(Float64(a * a) * (cos(Float64(angle * Float64(pi * 0.005555555555555556))) ^ 2.0)); else tmp = Float64(Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 / Float64(180.0 / Float64(pi * angle))))))) + Float64(t_0 * t_0)); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (pi * pi))) * (pi * b)); tmp = 0.0; if (b <= 4.3e-71) tmp = (a * a) * (cos((angle * (pi * 0.005555555555555556))) ^ 2.0); else tmp = ((a * a) * (0.5 + (0.5 * cos((2.0 / (180.0 / (pi * angle))))))) + (t_0 * t_0); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(N[(0.005555555555555556 + N[(N[(angle * N[(angle * -2.8577960676726107e-8), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 4.3e-71], N[(N[(a * a), $MachinePrecision] * N[Power[N[Cos[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 / N[(180.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\left(0.005555555555555556 + \left(angle \cdot \left(angle \cdot -2.8577960676726107 \cdot 10^{-8}\right)\right) \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\pi \cdot b\right)\right)\\
\mathbf{if}\;b \leq 4.3 \cdot 10^{-71}:\\
\;\;\;\;\left(a \cdot a\right) \cdot {\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(\frac{2}{\frac{180}{\pi \cdot angle}}\right)\right) + t\_0 \cdot t\_0\\
\end{array}
\end{array}
if b < 4.2999999999999997e-71Initial program 80.9%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.0%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified74.3%
unpow2N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
Applied egg-rr73.8%
*-commutativeN/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6473.8%
Applied egg-rr73.8%
Taylor expanded in a around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.2%
Simplified62.2%
if 4.2999999999999997e-71 < b Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified77.9%
+-lowering-+.f64N/A
Applied egg-rr77.9%
Final simplification67.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0
(*
angle
(*
(+
0.005555555555555556
(* (* angle (* angle -2.8577960676726107e-8)) (* PI PI)))
(* PI b)))))
(if (<= b 7.5e-71)
(* (* a a) (pow (cos (* 0.005555555555555556 (* PI angle))) 2.0))
(+
(* (* a a) (+ 0.5 (* 0.5 (cos (/ 2.0 (/ 180.0 (* PI angle)))))))
(* t_0 t_0)))))
double code(double a, double b, double angle) {
double t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (((double) M_PI) * ((double) M_PI)))) * (((double) M_PI) * b));
double tmp;
if (b <= 7.5e-71) {
tmp = (a * a) * pow(cos((0.005555555555555556 * (((double) M_PI) * angle))), 2.0);
} else {
tmp = ((a * a) * (0.5 + (0.5 * cos((2.0 / (180.0 / (((double) M_PI) * angle))))))) + (t_0 * t_0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (Math.PI * Math.PI))) * (Math.PI * b));
double tmp;
if (b <= 7.5e-71) {
tmp = (a * a) * Math.pow(Math.cos((0.005555555555555556 * (Math.PI * angle))), 2.0);
} else {
tmp = ((a * a) * (0.5 + (0.5 * Math.cos((2.0 / (180.0 / (Math.PI * angle))))))) + (t_0 * t_0);
}
return tmp;
}
def code(a, b, angle): t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (math.pi * math.pi))) * (math.pi * b)) tmp = 0 if b <= 7.5e-71: tmp = (a * a) * math.pow(math.cos((0.005555555555555556 * (math.pi * angle))), 2.0) else: tmp = ((a * a) * (0.5 + (0.5 * math.cos((2.0 / (180.0 / (math.pi * angle))))))) + (t_0 * t_0) return tmp
function code(a, b, angle) t_0 = Float64(angle * Float64(Float64(0.005555555555555556 + Float64(Float64(angle * Float64(angle * -2.8577960676726107e-8)) * Float64(pi * pi))) * Float64(pi * b))) tmp = 0.0 if (b <= 7.5e-71) tmp = Float64(Float64(a * a) * (cos(Float64(0.005555555555555556 * Float64(pi * angle))) ^ 2.0)); else tmp = Float64(Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 / Float64(180.0 / Float64(pi * angle))))))) + Float64(t_0 * t_0)); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (pi * pi))) * (pi * b)); tmp = 0.0; if (b <= 7.5e-71) tmp = (a * a) * (cos((0.005555555555555556 * (pi * angle))) ^ 2.0); else tmp = ((a * a) * (0.5 + (0.5 * cos((2.0 / (180.0 / (pi * angle))))))) + (t_0 * t_0); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(N[(0.005555555555555556 + N[(N[(angle * N[(angle * -2.8577960676726107e-8), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 7.5e-71], N[(N[(a * a), $MachinePrecision] * N[Power[N[Cos[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 / N[(180.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\left(0.005555555555555556 + \left(angle \cdot \left(angle \cdot -2.8577960676726107 \cdot 10^{-8}\right)\right) \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\pi \cdot b\right)\right)\\
\mathbf{if}\;b \leq 7.5 \cdot 10^{-71}:\\
\;\;\;\;\left(a \cdot a\right) \cdot {\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(\frac{2}{\frac{180}{\pi \cdot angle}}\right)\right) + t\_0 \cdot t\_0\\
\end{array}
\end{array}
if b < 7.5000000000000004e-71Initial program 80.9%
Taylor expanded in a around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
*-commutativeN/A
associate-*r*N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.1%
Simplified62.1%
if 7.5000000000000004e-71 < b Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified77.9%
+-lowering-+.f64N/A
Applied egg-rr77.9%
Final simplification67.2%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (/ (* PI angle) 180.0))) 2.0) (* a a)))
double code(double a, double b, double angle) {
return pow((b * sin(((((double) M_PI) * angle) / 180.0))), 2.0) + (a * a);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin(((Math.PI * angle) / 180.0))), 2.0) + (a * a);
}
def code(a, b, angle): return math.pow((b * math.sin(((math.pi * angle) / 180.0))), 2.0) + (a * a)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + Float64(a * a)) end
function tmp = code(a, b, angle) tmp = ((b * sin(((pi * angle) / 180.0))) ^ 2.0) + (a * a); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + a \cdot a
\end{array}
Initial program 81.1%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.2%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6480.5%
Simplified80.5%
Final simplification80.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (/ angle 180.0)))) 2.0) (* a a)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0) + (a * a);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0) + (a * a);
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi * (angle / 180.0)))), 2.0) + (a * a)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + Float64(a * a)) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi * (angle / 180.0)))) ^ 2.0) + (a * a); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + a \cdot a
\end{array}
Initial program 81.1%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6480.4%
Simplified80.4%
Final simplification80.4%
(FPCore (a b angle)
:precision binary64
(let* ((t_0
(*
angle
(*
(+
0.005555555555555556
(* (* angle (* angle -2.8577960676726107e-8)) (* PI PI)))
(* PI b)))))
(if (<= b 6.7e-71)
(* (* a a) (+ 0.5 (* 0.5 (cos (* (* PI angle) 0.011111111111111112)))))
(+
(* (* a a) (+ 0.5 (* 0.5 (cos (/ 2.0 (/ 180.0 (* PI angle)))))))
(* t_0 t_0)))))
double code(double a, double b, double angle) {
double t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (((double) M_PI) * ((double) M_PI)))) * (((double) M_PI) * b));
double tmp;
if (b <= 6.7e-71) {
tmp = (a * a) * (0.5 + (0.5 * cos(((((double) M_PI) * angle) * 0.011111111111111112))));
} else {
tmp = ((a * a) * (0.5 + (0.5 * cos((2.0 / (180.0 / (((double) M_PI) * angle))))))) + (t_0 * t_0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (Math.PI * Math.PI))) * (Math.PI * b));
double tmp;
if (b <= 6.7e-71) {
tmp = (a * a) * (0.5 + (0.5 * Math.cos(((Math.PI * angle) * 0.011111111111111112))));
} else {
tmp = ((a * a) * (0.5 + (0.5 * Math.cos((2.0 / (180.0 / (Math.PI * angle))))))) + (t_0 * t_0);
}
return tmp;
}
def code(a, b, angle): t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (math.pi * math.pi))) * (math.pi * b)) tmp = 0 if b <= 6.7e-71: tmp = (a * a) * (0.5 + (0.5 * math.cos(((math.pi * angle) * 0.011111111111111112)))) else: tmp = ((a * a) * (0.5 + (0.5 * math.cos((2.0 / (180.0 / (math.pi * angle))))))) + (t_0 * t_0) return tmp
function code(a, b, angle) t_0 = Float64(angle * Float64(Float64(0.005555555555555556 + Float64(Float64(angle * Float64(angle * -2.8577960676726107e-8)) * Float64(pi * pi))) * Float64(pi * b))) tmp = 0.0 if (b <= 6.7e-71) tmp = Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(Float64(pi * angle) * 0.011111111111111112))))); else tmp = Float64(Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(2.0 / Float64(180.0 / Float64(pi * angle))))))) + Float64(t_0 * t_0)); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = angle * ((0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (pi * pi))) * (pi * b)); tmp = 0.0; if (b <= 6.7e-71) tmp = (a * a) * (0.5 + (0.5 * cos(((pi * angle) * 0.011111111111111112)))); else tmp = ((a * a) * (0.5 + (0.5 * cos((2.0 / (180.0 / (pi * angle))))))) + (t_0 * t_0); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(N[(0.005555555555555556 + N[(N[(angle * N[(angle * -2.8577960676726107e-8), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 6.7e-71], N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(2.0 / N[(180.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\left(0.005555555555555556 + \left(angle \cdot \left(angle \cdot -2.8577960676726107 \cdot 10^{-8}\right)\right) \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\pi \cdot b\right)\right)\\
\mathbf{if}\;b \leq 6.7 \cdot 10^{-71}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(\frac{2}{\frac{180}{\pi \cdot angle}}\right)\right) + t\_0 \cdot t\_0\\
\end{array}
\end{array}
if b < 6.6999999999999998e-71Initial program 80.9%
+-commutativeN/A
unpow2N/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
Applied egg-rr76.8%
Taylor expanded in b around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.1%
Simplified62.1%
if 6.6999999999999998e-71 < b Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified77.9%
+-lowering-+.f64N/A
Applied egg-rr77.9%
Final simplification67.2%
(FPCore (a b angle)
:precision binary64
(if (<= b 6.5e-71)
(* (* a a) (+ 0.5 (* 0.5 (cos (* (* PI angle) 0.011111111111111112)))))
(+
(* a a)
(pow
(*
angle
(*
b
(*
PI
(+
0.005555555555555556
(* (* PI PI) (* -2.8577960676726107e-8 (* angle angle)))))))
2.0))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 6.5e-71) {
tmp = (a * a) * (0.5 + (0.5 * cos(((((double) M_PI) * angle) * 0.011111111111111112))));
} else {
tmp = (a * a) + pow((angle * (b * (((double) M_PI) * (0.005555555555555556 + ((((double) M_PI) * ((double) M_PI)) * (-2.8577960676726107e-8 * (angle * angle))))))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 6.5e-71) {
tmp = (a * a) * (0.5 + (0.5 * Math.cos(((Math.PI * angle) * 0.011111111111111112))));
} else {
tmp = (a * a) + Math.pow((angle * (b * (Math.PI * (0.005555555555555556 + ((Math.PI * Math.PI) * (-2.8577960676726107e-8 * (angle * angle))))))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 6.5e-71: tmp = (a * a) * (0.5 + (0.5 * math.cos(((math.pi * angle) * 0.011111111111111112)))) else: tmp = (a * a) + math.pow((angle * (b * (math.pi * (0.005555555555555556 + ((math.pi * math.pi) * (-2.8577960676726107e-8 * (angle * angle))))))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 6.5e-71) tmp = Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(Float64(pi * angle) * 0.011111111111111112))))); else tmp = Float64(Float64(a * a) + (Float64(angle * Float64(b * Float64(pi * Float64(0.005555555555555556 + Float64(Float64(pi * pi) * Float64(-2.8577960676726107e-8 * Float64(angle * angle))))))) ^ 2.0)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 6.5e-71) tmp = (a * a) * (0.5 + (0.5 * cos(((pi * angle) * 0.011111111111111112)))); else tmp = (a * a) + ((angle * (b * (pi * (0.005555555555555556 + ((pi * pi) * (-2.8577960676726107e-8 * (angle * angle))))))) ^ 2.0); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 6.5e-71], N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[Power[N[(angle * N[(b * N[(Pi * N[(0.005555555555555556 + N[(N[(Pi * Pi), $MachinePrecision] * N[(-2.8577960676726107e-8 * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5 \cdot 10^{-71}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 + \left(\pi \cdot \pi\right) \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right)\right)\right)\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if b < 6.50000000000000005e-71Initial program 80.9%
+-commutativeN/A
unpow2N/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
Applied egg-rr76.8%
Taylor expanded in b around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.1%
Simplified62.1%
if 6.50000000000000005e-71 < b Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified77.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6477.9%
Simplified77.9%
Final simplification67.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0
(*
(+
0.005555555555555556
(* (* angle (* angle -2.8577960676726107e-8)) (* PI PI)))
(* PI b))))
(if (<= b 4.4e-71)
(* (* a a) (+ 0.5 (* 0.5 (cos (* (* PI angle) 0.011111111111111112)))))
(+ (* a a) (* t_0 (* angle (* angle t_0)))))))
double code(double a, double b, double angle) {
double t_0 = (0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (((double) M_PI) * ((double) M_PI)))) * (((double) M_PI) * b);
double tmp;
if (b <= 4.4e-71) {
tmp = (a * a) * (0.5 + (0.5 * cos(((((double) M_PI) * angle) * 0.011111111111111112))));
} else {
tmp = (a * a) + (t_0 * (angle * (angle * t_0)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = (0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (Math.PI * Math.PI))) * (Math.PI * b);
double tmp;
if (b <= 4.4e-71) {
tmp = (a * a) * (0.5 + (0.5 * Math.cos(((Math.PI * angle) * 0.011111111111111112))));
} else {
tmp = (a * a) + (t_0 * (angle * (angle * t_0)));
}
return tmp;
}
def code(a, b, angle): t_0 = (0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (math.pi * math.pi))) * (math.pi * b) tmp = 0 if b <= 4.4e-71: tmp = (a * a) * (0.5 + (0.5 * math.cos(((math.pi * angle) * 0.011111111111111112)))) else: tmp = (a * a) + (t_0 * (angle * (angle * t_0))) return tmp
function code(a, b, angle) t_0 = Float64(Float64(0.005555555555555556 + Float64(Float64(angle * Float64(angle * -2.8577960676726107e-8)) * Float64(pi * pi))) * Float64(pi * b)) tmp = 0.0 if (b <= 4.4e-71) tmp = Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(Float64(pi * angle) * 0.011111111111111112))))); else tmp = Float64(Float64(a * a) + Float64(t_0 * Float64(angle * Float64(angle * t_0)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = (0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (pi * pi))) * (pi * b); tmp = 0.0; if (b <= 4.4e-71) tmp = (a * a) * (0.5 + (0.5 * cos(((pi * angle) * 0.011111111111111112)))); else tmp = (a * a) + (t_0 * (angle * (angle * t_0))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(0.005555555555555556 + N[(N[(angle * N[(angle * -2.8577960676726107e-8), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 4.4e-71], N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[(t$95$0 * N[(angle * N[(angle * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 + \left(angle \cdot \left(angle \cdot -2.8577960676726107 \cdot 10^{-8}\right)\right) \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\pi \cdot b\right)\\
\mathbf{if}\;b \leq 4.4 \cdot 10^{-71}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + t\_0 \cdot \left(angle \cdot \left(angle \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if b < 4.39999999999999995e-71Initial program 80.9%
+-commutativeN/A
unpow2N/A
associate-*r*N/A
fma-defineN/A
fma-lowering-fma.f64N/A
Applied egg-rr76.8%
Taylor expanded in b around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6462.1%
Simplified62.1%
if 4.39999999999999995e-71 < b Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified77.9%
unpow2N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
Applied egg-rr76.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6476.9%
Simplified76.9%
Final simplification66.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0
(*
(+
0.005555555555555556
(* (* angle (* angle -2.8577960676726107e-8)) (* PI PI)))
(* PI b))))
(if (<= b 6.1e-71) (* a a) (+ (* a a) (* t_0 (* angle (* angle t_0)))))))
double code(double a, double b, double angle) {
double t_0 = (0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (((double) M_PI) * ((double) M_PI)))) * (((double) M_PI) * b);
double tmp;
if (b <= 6.1e-71) {
tmp = a * a;
} else {
tmp = (a * a) + (t_0 * (angle * (angle * t_0)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = (0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (Math.PI * Math.PI))) * (Math.PI * b);
double tmp;
if (b <= 6.1e-71) {
tmp = a * a;
} else {
tmp = (a * a) + (t_0 * (angle * (angle * t_0)));
}
return tmp;
}
def code(a, b, angle): t_0 = (0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (math.pi * math.pi))) * (math.pi * b) tmp = 0 if b <= 6.1e-71: tmp = a * a else: tmp = (a * a) + (t_0 * (angle * (angle * t_0))) return tmp
function code(a, b, angle) t_0 = Float64(Float64(0.005555555555555556 + Float64(Float64(angle * Float64(angle * -2.8577960676726107e-8)) * Float64(pi * pi))) * Float64(pi * b)) tmp = 0.0 if (b <= 6.1e-71) tmp = Float64(a * a); else tmp = Float64(Float64(a * a) + Float64(t_0 * Float64(angle * Float64(angle * t_0)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = (0.005555555555555556 + ((angle * (angle * -2.8577960676726107e-8)) * (pi * pi))) * (pi * b); tmp = 0.0; if (b <= 6.1e-71) tmp = a * a; else tmp = (a * a) + (t_0 * (angle * (angle * t_0))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(0.005555555555555556 + N[(N[(angle * N[(angle * -2.8577960676726107e-8), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 6.1e-71], N[(a * a), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[(t$95$0 * N[(angle * N[(angle * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(0.005555555555555556 + \left(angle \cdot \left(angle \cdot -2.8577960676726107 \cdot 10^{-8}\right)\right) \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\pi \cdot b\right)\\
\mathbf{if}\;b \leq 6.1 \cdot 10^{-71}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + t\_0 \cdot \left(angle \cdot \left(angle \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if b < 6.0999999999999998e-71Initial program 80.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.1%
Simplified61.1%
if 6.0999999999999998e-71 < b Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified77.9%
unpow2N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
Applied egg-rr76.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6476.9%
Simplified76.9%
(FPCore (a b angle)
:precision binary64
(if (<= a 2.6e+41)
(+
(* a a)
(*
angle
(*
angle
(*
PI
(*
PI
(+
(* (* b b) 3.08641975308642e-5)
(* a (* a -3.08641975308642e-5))))))))
(* a a)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.6e+41) {
tmp = (a * a) + (angle * (angle * (((double) M_PI) * (((double) M_PI) * (((b * b) * 3.08641975308642e-5) + (a * (a * -3.08641975308642e-5)))))));
} else {
tmp = a * a;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.6e+41) {
tmp = (a * a) + (angle * (angle * (Math.PI * (Math.PI * (((b * b) * 3.08641975308642e-5) + (a * (a * -3.08641975308642e-5)))))));
} else {
tmp = a * a;
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.6e+41: tmp = (a * a) + (angle * (angle * (math.pi * (math.pi * (((b * b) * 3.08641975308642e-5) + (a * (a * -3.08641975308642e-5))))))) else: tmp = a * a return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.6e+41) tmp = Float64(Float64(a * a) + Float64(angle * Float64(angle * Float64(pi * Float64(pi * Float64(Float64(Float64(b * b) * 3.08641975308642e-5) + Float64(a * Float64(a * -3.08641975308642e-5)))))))); else tmp = Float64(a * a); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.6e+41) tmp = (a * a) + (angle * (angle * (pi * (pi * (((b * b) * 3.08641975308642e-5) + (a * (a * -3.08641975308642e-5))))))); else tmp = a * a; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.6e+41], N[(N[(a * a), $MachinePrecision] + N[(angle * N[(angle * N[(Pi * N[(Pi * N[(N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision] + N[(a * N[(a * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.6 \cdot 10^{+41}:\\
\;\;\;\;a \cdot a + angle \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5} + a \cdot \left(a \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a\\
\end{array}
\end{array}
if a < 2.6000000000000001e41Initial program 77.2%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified51.2%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr56.0%
if 2.6000000000000001e41 < a Initial program 92.5%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6487.1%
Simplified87.1%
Final simplification64.1%
(FPCore (a b angle)
:precision binary64
(if (<= b 7e-71)
(* a a)
(+
(* a a)
(* (* angle angle) (* (* PI PI) (* (* b b) 3.08641975308642e-5))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 7e-71) {
tmp = a * a;
} else {
tmp = (a * a) + ((angle * angle) * ((((double) M_PI) * ((double) M_PI)) * ((b * b) * 3.08641975308642e-5)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 7e-71) {
tmp = a * a;
} else {
tmp = (a * a) + ((angle * angle) * ((Math.PI * Math.PI) * ((b * b) * 3.08641975308642e-5)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 7e-71: tmp = a * a else: tmp = (a * a) + ((angle * angle) * ((math.pi * math.pi) * ((b * b) * 3.08641975308642e-5))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 7e-71) tmp = Float64(a * a); else tmp = Float64(Float64(a * a) + Float64(Float64(angle * angle) * Float64(Float64(pi * pi) * Float64(Float64(b * b) * 3.08641975308642e-5)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 7e-71) tmp = a * a; else tmp = (a * a) + ((angle * angle) * ((pi * pi) * ((b * b) * 3.08641975308642e-5))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 7e-71], N[(a * a), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[(N[(angle * angle), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7 \cdot 10^{-71}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\\
\end{array}
\end{array}
if b < 6.9999999999999998e-71Initial program 80.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.1%
Simplified61.1%
if 6.9999999999999998e-71 < b Initial program 81.6%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified40.4%
Taylor expanded in b around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.4%
Simplified67.4%
(FPCore (a b angle) :precision binary64 (if (<= b 2.9e+170) (* a a) (* angle (* (* b b) (* angle (* PI (* PI 3.08641975308642e-5)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 2.9e+170) {
tmp = a * a;
} else {
tmp = angle * ((b * b) * (angle * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 2.9e+170) {
tmp = a * a;
} else {
tmp = angle * ((b * b) * (angle * (Math.PI * (Math.PI * 3.08641975308642e-5))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 2.9e+170: tmp = a * a else: tmp = angle * ((b * b) * (angle * (math.pi * (math.pi * 3.08641975308642e-5)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 2.9e+170) tmp = Float64(a * a); else tmp = Float64(angle * Float64(Float64(b * b) * Float64(angle * Float64(pi * Float64(pi * 3.08641975308642e-5))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 2.9e+170) tmp = a * a; else tmp = angle * ((b * b) * (angle * (pi * (pi * 3.08641975308642e-5)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 2.9e+170], N[(a * a), $MachinePrecision], N[(angle * N[(N[(b * b), $MachinePrecision] * N[(angle * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.9 \cdot 10^{+170}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\left(b \cdot b\right) \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.9000000000000001e170Initial program 79.0%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6459.7%
Simplified59.7%
if 2.9000000000000001e170 < b Initial program 99.8%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified50.6%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*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.f6481.4%
Simplified81.4%
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6481.8%
Applied egg-rr81.8%
Final simplification61.9%
(FPCore (a b angle) :precision binary64 (* a a))
double code(double a, double b, double angle) {
return a * a;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = a * a
end function
public static double code(double a, double b, double angle) {
return a * a;
}
def code(a, b, angle): return a * a
function code(a, b, angle) return Float64(a * a) end
function tmp = code(a, b, angle) tmp = a * a; end
code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a
\end{array}
Initial program 81.1%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6457.3%
Simplified57.3%
herbie shell --seed 2024158
(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)))