
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (/ angle 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (/ angle 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
(FPCore (a b angle)
:precision binary64
(+
(pow (* a (sin (/ (* angle PI) 180.0))) 2.0)
(pow
(*
b
(cos
(*
(pow (/ 180.0 (sqrt PI)) -1.0)
(pow (/ (/ 1.0 angle) (sqrt PI)) -1.0))))
2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle * ((double) M_PI)) / 180.0))), 2.0) + pow((b * cos((pow((180.0 / sqrt(((double) M_PI))), -1.0) * pow(((1.0 / angle) / sqrt(((double) M_PI))), -1.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle * Math.PI) / 180.0))), 2.0) + Math.pow((b * Math.cos((Math.pow((180.0 / Math.sqrt(Math.PI)), -1.0) * Math.pow(((1.0 / angle) / Math.sqrt(Math.PI)), -1.0)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin(((angle * math.pi) / 180.0))), 2.0) + math.pow((b * math.cos((math.pow((180.0 / math.sqrt(math.pi)), -1.0) * math.pow(((1.0 / angle) / math.sqrt(math.pi)), -1.0)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle * pi) / 180.0))) ^ 2.0) + (Float64(b * cos(Float64((Float64(180.0 / sqrt(pi)) ^ -1.0) * (Float64(Float64(1.0 / angle) / sqrt(pi)) ^ -1.0)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin(((angle * pi) / 180.0))) ^ 2.0) + ((b * cos((((180.0 / sqrt(pi)) ^ -1.0) * (((1.0 / angle) / sqrt(pi)) ^ -1.0)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Power[N[(180.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * N[Power[N[(N[(1.0 / angle), $MachinePrecision] / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\frac{180}{\sqrt{\pi}}\right)}^{-1} \cdot {\left(\frac{\frac{1}{angle}}{\sqrt{\pi}}\right)}^{-1}\right)\right)}^{2}
\end{array}
Initial program 81.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.3%
associate-*l/N/A
*-commutativeN/A
add-cube-cbrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow2N/A
pow1/3N/A
pow-powN/A
pow-lowering-pow.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6481.3%
Applied egg-rr81.3%
associate-*r/N/A
clear-numN/A
*-commutativeN/A
associate-*r*N/A
pow1/3N/A
pow-prod-upN/A
metadata-evalN/A
pow1N/A
associate-/l/N/A
inv-powN/A
div-invN/A
add-sqr-sqrtN/A
times-fracN/A
metadata-evalN/A
unpow-prod-downN/A
*-lowering-*.f64N/A
Applied egg-rr81.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ (* angle PI) 180.0))) 2.0) (pow (* b (cos (* (pow PI 0.6666666666666666) (/ (* angle (cbrt PI)) 180.0)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle * ((double) M_PI)) / 180.0))), 2.0) + pow((b * cos((pow(((double) M_PI), 0.6666666666666666) * ((angle * cbrt(((double) M_PI))) / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle * Math.PI) / 180.0))), 2.0) + Math.pow((b * Math.cos((Math.pow(Math.PI, 0.6666666666666666) * ((angle * Math.cbrt(Math.PI)) / 180.0)))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle * pi) / 180.0))) ^ 2.0) + (Float64(b * cos(Float64((pi ^ 0.6666666666666666) * Float64(Float64(angle * cbrt(pi)) / 180.0)))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Power[Pi, 0.6666666666666666], $MachinePrecision] * N[(N[(angle * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision] / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left({\pi}^{0.6666666666666666} \cdot \frac{angle \cdot \sqrt[3]{\pi}}{180}\right)\right)}^{2}
\end{array}
Initial program 81.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.3%
associate-*l/N/A
*-commutativeN/A
add-cube-cbrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow2N/A
pow1/3N/A
pow-powN/A
pow-lowering-pow.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6481.3%
Applied egg-rr81.3%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ (* angle PI) 180.0))) 2.0) (pow (* b (cos (* (* (sqrt PI) 0.005555555555555556) (* angle (sqrt PI))))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle * ((double) M_PI)) / 180.0))), 2.0) + pow((b * cos(((sqrt(((double) M_PI)) * 0.005555555555555556) * (angle * sqrt(((double) M_PI)))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle * Math.PI) / 180.0))), 2.0) + Math.pow((b * Math.cos(((Math.sqrt(Math.PI) * 0.005555555555555556) * (angle * Math.sqrt(Math.PI))))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin(((angle * math.pi) / 180.0))), 2.0) + math.pow((b * math.cos(((math.sqrt(math.pi) * 0.005555555555555556) * (angle * math.sqrt(math.pi))))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle * pi) / 180.0))) ^ 2.0) + (Float64(b * cos(Float64(Float64(sqrt(pi) * 0.005555555555555556) * Float64(angle * sqrt(pi))))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin(((angle * pi) / 180.0))) ^ 2.0) + ((b * cos(((sqrt(pi) * 0.005555555555555556) * (angle * sqrt(pi))))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(N[Sqrt[Pi], $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[(angle * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\left(\sqrt{\pi} \cdot 0.005555555555555556\right) \cdot \left(angle \cdot \sqrt{\pi}\right)\right)\right)}^{2}
\end{array}
Initial program 81.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.3%
clear-numN/A
associate-/r/N/A
*-commutativeN/A
add-sqr-sqrtN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6481.3%
Applied egg-rr81.3%
Final simplification81.3%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (/ (* angle PI) 180.0))) (+ (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 * ((double) M_PI)) / 180.0;
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 * Math.PI) / 180.0;
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 * math.pi) / 180.0 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 * pi) / 180.0) 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 * pi) / 180.0; 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 * Pi), $MachinePrecision] / 180.0), $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 \cdot \pi}{180}\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 81.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.3%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ (* angle PI) 180.0))) 2.0) (pow (* b (cos (/ PI (/ 180.0 angle)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle * ((double) M_PI)) / 180.0))), 2.0) + pow((b * cos((((double) M_PI) / (180.0 / angle)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle * Math.PI) / 180.0))), 2.0) + Math.pow((b * Math.cos((Math.PI / (180.0 / angle)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin(((angle * math.pi) / 180.0))), 2.0) + math.pow((b * math.cos((math.pi / (180.0 / angle)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle * pi) / 180.0))) ^ 2.0) + (Float64(b * cos(Float64(pi / Float64(180.0 / angle)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin(((angle * pi) / 180.0))) ^ 2.0) + ((b * cos((pi / (180.0 / angle)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}
\end{array}
Initial program 81.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.3%
clear-numN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6481.2%
Applied egg-rr81.2%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (cos (/ (* angle PI) 180.0))) 2.0) (pow (* a (sin (* (* angle PI) 0.005555555555555556))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * cos(((angle * ((double) M_PI)) / 180.0))), 2.0) + pow((a * sin(((angle * ((double) M_PI)) * 0.005555555555555556))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.cos(((angle * Math.PI) / 180.0))), 2.0) + Math.pow((a * Math.sin(((angle * Math.PI) * 0.005555555555555556))), 2.0);
}
def code(a, b, angle): return math.pow((b * math.cos(((angle * math.pi) / 180.0))), 2.0) + math.pow((a * math.sin(((angle * math.pi) * 0.005555555555555556))), 2.0)
function code(a, b, angle) return Float64((Float64(b * cos(Float64(Float64(angle * pi) / 180.0))) ^ 2.0) + (Float64(a * sin(Float64(Float64(angle * pi) * 0.005555555555555556))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * cos(((angle * pi) / 180.0))) ^ 2.0) + ((a * sin(((angle * pi) * 0.005555555555555556))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Cos[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \cos \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2} + {\left(a \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}^{2}
\end{array}
Initial program 81.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.3%
div-invN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval81.2%
Applied egg-rr81.2%
Final simplification81.2%
(FPCore (a b angle)
:precision binary64
(if (<= a 3.6e-7)
(* (* b b) (pow (cos (* angle (* PI 0.005555555555555556))) 2.0))
(if (<= a 1.34e+154)
(+
(* b b)
(* (* angle angle) (* (* PI PI) (* (* a a) 3.08641975308642e-5))))
(* a (* (* a angle) (* angle (* PI (* PI 3.08641975308642e-5))))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 3.6e-7) {
tmp = (b * b) * pow(cos((angle * (((double) M_PI) * 0.005555555555555556))), 2.0);
} else if (a <= 1.34e+154) {
tmp = (b * b) + ((angle * angle) * ((((double) M_PI) * ((double) M_PI)) * ((a * a) * 3.08641975308642e-5)));
} else {
tmp = a * ((a * angle) * (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 (a <= 3.6e-7) {
tmp = (b * b) * Math.pow(Math.cos((angle * (Math.PI * 0.005555555555555556))), 2.0);
} else if (a <= 1.34e+154) {
tmp = (b * b) + ((angle * angle) * ((Math.PI * Math.PI) * ((a * a) * 3.08641975308642e-5)));
} else {
tmp = a * ((a * angle) * (angle * (Math.PI * (Math.PI * 3.08641975308642e-5))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 3.6e-7: tmp = (b * b) * math.pow(math.cos((angle * (math.pi * 0.005555555555555556))), 2.0) elif a <= 1.34e+154: tmp = (b * b) + ((angle * angle) * ((math.pi * math.pi) * ((a * a) * 3.08641975308642e-5))) else: tmp = a * ((a * angle) * (angle * (math.pi * (math.pi * 3.08641975308642e-5)))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 3.6e-7) tmp = Float64(Float64(b * b) * (cos(Float64(angle * Float64(pi * 0.005555555555555556))) ^ 2.0)); elseif (a <= 1.34e+154) tmp = Float64(Float64(b * b) + Float64(Float64(angle * angle) * Float64(Float64(pi * pi) * Float64(Float64(a * a) * 3.08641975308642e-5)))); else tmp = Float64(a * Float64(Float64(a * angle) * Float64(angle * Float64(pi * Float64(pi * 3.08641975308642e-5))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 3.6e-7) tmp = (b * b) * (cos((angle * (pi * 0.005555555555555556))) ^ 2.0); elseif (a <= 1.34e+154) tmp = (b * b) + ((angle * angle) * ((pi * pi) * ((a * a) * 3.08641975308642e-5))); else tmp = a * ((a * angle) * (angle * (pi * (pi * 3.08641975308642e-5)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 3.6e-7], N[(N[(b * b), $MachinePrecision] * N[Power[N[Cos[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.34e+154], N[(N[(b * b), $MachinePrecision] + N[(N[(angle * angle), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(a * angle), $MachinePrecision] * N[(angle * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.6 \cdot 10^{-7}:\\
\;\;\;\;\left(b \cdot b\right) \cdot {\cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)}^{2}\\
\mathbf{elif}\;a \leq 1.34 \cdot 10^{+154}:\\
\;\;\;\;b \cdot b + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(a \cdot angle\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 a < 3.59999999999999994e-7Initial program 77.7%
Taylor expanded in a around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
*-commutativeN/A
associate-*r*N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6463.2%
Simplified63.2%
if 3.59999999999999994e-7 < a < 1.34000000000000001e154Initial program 74.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified74.6%
associate-*l/N/A
*-commutativeN/A
add-cube-cbrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow2N/A
pow1/3N/A
pow-powN/A
pow-lowering-pow.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6474.7%
Applied egg-rr74.7%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/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.0%
Taylor expanded in b around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.3%
Simplified64.3%
if 1.34000000000000001e154 < a Initial program 99.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified99.6%
associate-*l/N/A
*-commutativeN/A
add-cube-cbrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow2N/A
pow1/3N/A
pow-powN/A
pow-lowering-pow.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6499.6%
Applied egg-rr99.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
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.3%
Taylor expanded in b around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6470.8%
Simplified70.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*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.f6486.3%
Applied egg-rr86.3%
Final simplification67.3%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (/ (* angle PI) 180.0))) 2.0) (* b b)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle * ((double) M_PI)) / 180.0))), 2.0) + (b * b);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle * Math.PI) / 180.0))), 2.0) + (b * b);
}
def code(a, b, angle): return math.pow((a * math.sin(((angle * math.pi) / 180.0))), 2.0) + (b * b)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle * pi) / 180.0))) ^ 2.0) + Float64(b * b)) end
function tmp = code(a, b, angle) tmp = ((a * sin(((angle * pi) / 180.0))) ^ 2.0) + (b * b); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2} + b \cdot b
\end{array}
Initial program 81.2%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.3%
clear-numN/A
inv-powN/A
sqr-powN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
metadata-eval39.4%
Applied egg-rr39.4%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6481.1%
Simplified81.1%
(FPCore (a b angle)
:precision binary64
(if (<= a 1.2e-7)
(* b b)
(if (<= a 1.34e+154)
(+
(* b b)
(* (* angle angle) (* (* PI PI) (* (* a a) 3.08641975308642e-5))))
(* a (* (* a angle) (* angle (* PI (* PI 3.08641975308642e-5))))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.2e-7) {
tmp = b * b;
} else if (a <= 1.34e+154) {
tmp = (b * b) + ((angle * angle) * ((((double) M_PI) * ((double) M_PI)) * ((a * a) * 3.08641975308642e-5)));
} else {
tmp = a * ((a * angle) * (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 (a <= 1.2e-7) {
tmp = b * b;
} else if (a <= 1.34e+154) {
tmp = (b * b) + ((angle * angle) * ((Math.PI * Math.PI) * ((a * a) * 3.08641975308642e-5)));
} else {
tmp = a * ((a * angle) * (angle * (Math.PI * (Math.PI * 3.08641975308642e-5))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 1.2e-7: tmp = b * b elif a <= 1.34e+154: tmp = (b * b) + ((angle * angle) * ((math.pi * math.pi) * ((a * a) * 3.08641975308642e-5))) else: tmp = a * ((a * angle) * (angle * (math.pi * (math.pi * 3.08641975308642e-5)))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 1.2e-7) tmp = Float64(b * b); elseif (a <= 1.34e+154) tmp = Float64(Float64(b * b) + Float64(Float64(angle * angle) * Float64(Float64(pi * pi) * Float64(Float64(a * a) * 3.08641975308642e-5)))); else tmp = Float64(a * Float64(Float64(a * angle) * Float64(angle * Float64(pi * Float64(pi * 3.08641975308642e-5))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1.2e-7) tmp = b * b; elseif (a <= 1.34e+154) tmp = (b * b) + ((angle * angle) * ((pi * pi) * ((a * a) * 3.08641975308642e-5))); else tmp = a * ((a * angle) * (angle * (pi * (pi * 3.08641975308642e-5)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 1.2e-7], N[(b * b), $MachinePrecision], If[LessEqual[a, 1.34e+154], N[(N[(b * b), $MachinePrecision] + N[(N[(angle * angle), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(a * angle), $MachinePrecision] * N[(angle * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.2 \cdot 10^{-7}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 1.34 \cdot 10^{+154}:\\
\;\;\;\;b \cdot b + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(\left(a \cdot a\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(a \cdot angle\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 a < 1.19999999999999989e-7Initial program 77.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6463.1%
Simplified63.1%
if 1.19999999999999989e-7 < a < 1.34000000000000001e154Initial program 74.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified74.6%
associate-*l/N/A
*-commutativeN/A
add-cube-cbrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow2N/A
pow1/3N/A
pow-powN/A
pow-lowering-pow.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6474.7%
Applied egg-rr74.7%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/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.0%
Taylor expanded in b around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.3%
Simplified64.3%
if 1.34000000000000001e154 < a Initial program 99.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified99.6%
associate-*l/N/A
*-commutativeN/A
add-cube-cbrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow2N/A
pow1/3N/A
pow-powN/A
pow-lowering-pow.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6499.6%
Applied egg-rr99.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
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.3%
Taylor expanded in b around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6470.8%
Simplified70.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*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.f6486.3%
Applied egg-rr86.3%
Final simplification67.2%
(FPCore (a b angle) :precision binary64 (if (<= a 2.3e+151) (* b b) (* a (* (* a angle) (* angle (* PI (* PI 3.08641975308642e-5)))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.3e+151) {
tmp = b * b;
} else {
tmp = a * ((a * angle) * (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 (a <= 2.3e+151) {
tmp = b * b;
} else {
tmp = a * ((a * angle) * (angle * (Math.PI * (Math.PI * 3.08641975308642e-5))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.3e+151: tmp = b * b else: tmp = a * ((a * angle) * (angle * (math.pi * (math.pi * 3.08641975308642e-5)))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.3e+151) tmp = Float64(b * b); else tmp = Float64(a * Float64(Float64(a * angle) * Float64(angle * Float64(pi * Float64(pi * 3.08641975308642e-5))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.3e+151) tmp = b * b; else tmp = a * ((a * angle) * (angle * (pi * (pi * 3.08641975308642e-5)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.3e+151], N[(b * b), $MachinePrecision], N[(a * N[(N[(a * angle), $MachinePrecision] * N[(angle * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.3 \cdot 10^{+151}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(a \cdot angle\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 a < 2.3000000000000001e151Initial program 77.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.9%
Simplified61.9%
if 2.3000000000000001e151 < a Initial program 99.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified99.6%
associate-*l/N/A
*-commutativeN/A
add-cube-cbrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow2N/A
pow1/3N/A
pow-powN/A
pow-lowering-pow.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6499.6%
Applied egg-rr99.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
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.3%
Taylor expanded in b around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6470.8%
Simplified70.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*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.f6486.3%
Applied egg-rr86.3%
Final simplification66.1%
(FPCore (a b angle) :precision binary64 (if (<= a 1.15e+165) (* b b) (* (* angle (* PI (* PI 3.08641975308642e-5))) (* angle (* a a)))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.15e+165) {
tmp = b * b;
} else {
tmp = (angle * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5))) * (angle * (a * a));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 1.15e+165) {
tmp = b * b;
} else {
tmp = (angle * (Math.PI * (Math.PI * 3.08641975308642e-5))) * (angle * (a * a));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 1.15e+165: tmp = b * b else: tmp = (angle * (math.pi * (math.pi * 3.08641975308642e-5))) * (angle * (a * a)) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 1.15e+165) tmp = Float64(b * b); else tmp = Float64(Float64(angle * Float64(pi * Float64(pi * 3.08641975308642e-5))) * Float64(angle * Float64(a * a))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1.15e+165) tmp = b * b; else tmp = (angle * (pi * (pi * 3.08641975308642e-5))) * (angle * (a * a)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 1.15e+165], N[(b * b), $MachinePrecision], N[(N[(angle * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.15 \cdot 10^{+165}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right) \cdot \left(angle \cdot \left(a \cdot a\right)\right)\\
\end{array}
\end{array}
if a < 1.15000000000000008e165Initial program 77.6%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.5%
Simplified61.5%
if 1.15000000000000008e165 < a Initial program 99.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified99.7%
associate-*l/N/A
*-commutativeN/A
add-cube-cbrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow2N/A
pow1/3N/A
pow-powN/A
pow-lowering-pow.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6499.7%
Applied egg-rr99.7%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/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
Simplified53.8%
Taylor expanded in b around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6475.8%
Simplified75.8%
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/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.f6476.7%
Applied egg-rr76.7%
Final simplification63.9%
(FPCore (a b angle) :precision binary64 (if (<= a 1e+166) (* b b) (* (* a a) (* (* angle angle) (* (* PI PI) 3.08641975308642e-5)))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1e+166) {
tmp = b * b;
} else {
tmp = (a * a) * ((angle * 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 (a <= 1e+166) {
tmp = b * b;
} else {
tmp = (a * a) * ((angle * angle) * ((Math.PI * Math.PI) * 3.08641975308642e-5));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 1e+166: tmp = b * b else: tmp = (a * a) * ((angle * angle) * ((math.pi * math.pi) * 3.08641975308642e-5)) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 1e+166) tmp = Float64(b * b); else tmp = Float64(Float64(a * a) * Float64(Float64(angle * angle) * Float64(Float64(pi * pi) * 3.08641975308642e-5))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1e+166) tmp = b * b; else tmp = (a * a) * ((angle * angle) * ((pi * pi) * 3.08641975308642e-5)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 1e+166], N[(b * b), $MachinePrecision], N[(N[(a * a), $MachinePrecision] * N[(N[(angle * angle), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 10^{+166}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(\left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\\
\end{array}
\end{array}
if a < 9.9999999999999994e165Initial program 77.6%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.5%
Simplified61.5%
if 9.9999999999999994e165 < a Initial program 99.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified99.7%
associate-*l/N/A
*-commutativeN/A
add-cube-cbrtN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow2N/A
pow1/3N/A
pow-powN/A
pow-lowering-pow.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6499.7%
Applied egg-rr99.7%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/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
Simplified53.8%
Taylor expanded in b around 0
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6475.8%
Simplified75.8%
(FPCore (a b angle) :precision binary64 (* b b))
double code(double a, double b, double angle) {
return b * b;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = b * b
end function
public static double code(double a, double b, double angle) {
return b * b;
}
def code(a, b, angle): return b * b
function code(a, b, angle) return Float64(b * b) end
function tmp = code(a, b, angle) tmp = b * b; end
code[a_, b_, angle_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
\\
b \cdot b
\end{array}
Initial program 81.2%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6457.1%
Simplified57.1%
herbie shell --seed 2024158
(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)))