
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (/ angle 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0) (pow (* b (cos (pow (/ (exp (log (/ 180.0 angle_m))) PI) -1.0))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(pow((exp(log((180.0 / angle_m))) / ((double) M_PI)), -1.0))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(Math.pow((Math.exp(Math.log((180.0 / angle_m))) / Math.PI), -1.0))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos(math.pow((math.exp(math.log((180.0 / angle_m))) / math.pi), -1.0))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos((Float64(exp(log(Float64(180.0 / angle_m))) / pi) ^ -1.0))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + ((b * cos(((exp(log((180.0 / angle_m))) / pi) ^ -1.0))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[Power[N[(N[Exp[N[Log[N[(180.0 / angle$95$m), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left({\left(\frac{e^{\log \left(\frac{180}{angle\_m}\right)}}{\pi}\right)}^{-1}\right)\right)}^{2}
\end{array}
Initial program 83.7%
associate-*l/N/A
clear-numN/A
inv-powN/A
pow-to-expN/A
exp-prodN/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6441.9%
Applied egg-rr41.9%
associate-/r*N/A
log-divN/A
exp-diffN/A
add-exp-logN/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f6442.1%
Applied egg-rr42.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0) (pow (* b (cos (/ -0.005555555555555556 (/ -1.0 (* angle_m PI))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((-0.005555555555555556 / (-1.0 / (angle_m * ((double) M_PI)))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((-0.005555555555555556 / (-1.0 / (angle_m * Math.PI))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos((-0.005555555555555556 / (-1.0 / (angle_m * math.pi))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(-0.005555555555555556 / Float64(-1.0 / Float64(angle_m * pi))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + ((b * cos((-0.005555555555555556 / (-1.0 / (angle_m * pi))))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(-0.005555555555555556 / N[(-1.0 / N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{-0.005555555555555556}{\frac{-1}{angle\_m \cdot \pi}}\right)\right)}^{2}
\end{array}
Initial program 83.7%
associate-*l/N/A
clear-numN/A
div-invN/A
associate-/r*N/A
frac-2negN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-frac-neg2N/A
/-lowering-/.f64N/A
metadata-evalN/A
metadata-evalN/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6483.7%
Applied egg-rr83.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (/ (* angle_m PI) 180.0))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (angle_m * ((double) M_PI)) / 180.0;
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = (angle_m * Math.PI) / 180.0;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = (angle_m * math.pi) / 180.0 return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(angle_m * pi) / 180.0) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = (angle_m * pi) / 180.0; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m * 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}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \frac{angle\_m \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 83.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
Simplified83.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0) (pow (* b (cos (/ PI (/ 180.0 angle_m)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((((double) M_PI) / (180.0 / angle_m)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((Math.PI / (180.0 / angle_m)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos((math.pi / (180.0 / angle_m)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + ((b * cos((pi / (180.0 / angle_m)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2}
\end{array}
Initial program 83.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6483.7%
Applied egg-rr83.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* (/ angle_m 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = (angle_m / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = (angle_m / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(Float64(angle_m / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = (angle_m / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \frac{angle\_m}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 83.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (cos (* (/ angle_m 180.0) PI))) 2.0) (pow (* a (sin (* (* angle_m PI) 0.005555555555555556))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * cos(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow((a * sin(((angle_m * ((double) M_PI)) * 0.005555555555555556))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.cos(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow((a * Math.sin(((angle_m * Math.PI) * 0.005555555555555556))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.cos(((angle_m / 180.0) * math.pi))), 2.0) + math.pow((a * math.sin(((angle_m * math.pi) * 0.005555555555555556))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * cos(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (Float64(a * sin(Float64(Float64(angle_m * pi) * 0.005555555555555556))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * cos(((angle_m / 180.0) * pi))) ^ 2.0) + ((a * sin(((angle_m * pi) * 0.005555555555555556))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Cos[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \cos \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {\left(a \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}^{2}
\end{array}
Initial program 83.7%
associate-*l/N/A
div-invN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval83.7%
Applied egg-rr83.7%
Final simplification83.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (/ angle_m 180.0) PI))) 2.0) (pow b 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m / 180.0) * ((double) M_PI)))), 2.0) + pow(b, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((angle_m / 180.0) * Math.PI))), 2.0) + Math.pow(b, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m / 180.0) * math.pi))), 2.0) + math.pow(b, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m / 180.0) * pi))) ^ 2.0) + (b ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m / 180.0) * pi))) ^ 2.0) + (b ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m}{180} \cdot \pi\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 83.7%
Taylor expanded in angle around 0
Simplified83.6%
Final simplification83.6%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (* (* angle_m PI) 0.005555555555555556))) 2.0) (pow b 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m * ((double) M_PI)) * 0.005555555555555556))), 2.0) + pow(b, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((angle_m * Math.PI) * 0.005555555555555556))), 2.0) + Math.pow(b, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m * math.pi) * 0.005555555555555556))), 2.0) + math.pow(b, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m * pi) * 0.005555555555555556))) ^ 2.0) + (b ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m * pi) * 0.005555555555555556))) ^ 2.0) + (b ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 83.7%
*-commutativeN/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-/.f6483.6%
Applied egg-rr83.6%
Taylor expanded in angle around 0
Simplified83.5%
clear-numN/A
associate-/r*N/A
associate-/l*N/A
remove-double-divN/A
div-invN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval83.6%
Applied egg-rr83.6%
Final simplification83.6%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= angle_m 8e-6)
(+ (pow b 2.0) (pow (* 0.005555555555555556 (* angle_m (* a PI))) 2.0))
(+
(* b b)
(* (* a a) (- 0.5 (* 0.5 (cos (* 2.0 (/ angle_m (/ 180.0 PI))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (angle_m <= 8e-6) {
tmp = pow(b, 2.0) + pow((0.005555555555555556 * (angle_m * (a * ((double) M_PI)))), 2.0);
} else {
tmp = (b * b) + ((a * a) * (0.5 - (0.5 * cos((2.0 * (angle_m / (180.0 / ((double) M_PI))))))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (angle_m <= 8e-6) {
tmp = Math.pow(b, 2.0) + Math.pow((0.005555555555555556 * (angle_m * (a * Math.PI))), 2.0);
} else {
tmp = (b * b) + ((a * a) * (0.5 - (0.5 * Math.cos((2.0 * (angle_m / (180.0 / Math.PI)))))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if angle_m <= 8e-6: tmp = math.pow(b, 2.0) + math.pow((0.005555555555555556 * (angle_m * (a * math.pi))), 2.0) else: tmp = (b * b) + ((a * a) * (0.5 - (0.5 * math.cos((2.0 * (angle_m / (180.0 / math.pi))))))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (angle_m <= 8e-6) tmp = Float64((b ^ 2.0) + (Float64(0.005555555555555556 * Float64(angle_m * Float64(a * pi))) ^ 2.0)); else tmp = Float64(Float64(b * b) + Float64(Float64(a * a) * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(angle_m / Float64(180.0 / pi)))))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (angle_m <= 8e-6) tmp = (b ^ 2.0) + ((0.005555555555555556 * (angle_m * (a * pi))) ^ 2.0); else tmp = (b * b) + ((a * a) * (0.5 - (0.5 * cos((2.0 * (angle_m / (180.0 / pi))))))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[angle$95$m, 8e-6], N[(N[Power[b, 2.0], $MachinePrecision] + N[Power[N[(0.005555555555555556 * N[(angle$95$m * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(b * b), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;angle\_m \leq 8 \cdot 10^{-6}:\\
\;\;\;\;{b}^{2} + {\left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(a \cdot \pi\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;b \cdot b + \left(a \cdot a\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{angle\_m}{\frac{180}{\pi}}\right)\right)\\
\end{array}
\end{array}
if angle < 7.99999999999999964e-6Initial program 90.1%
*-commutativeN/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-/.f6490.0%
Applied egg-rr90.0%
Taylor expanded in angle around 0
Simplified90.1%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6487.8%
Simplified87.8%
if 7.99999999999999964e-6 < angle Initial program 66.7%
*-commutativeN/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-/.f6466.7%
Applied egg-rr66.7%
Taylor expanded in angle around 0
Simplified66.0%
Applied egg-rr66.1%
Final simplification81.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (/ (/ PI 180.0) (/ 1.0 angle_m)))) 2.0) (* b b)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((((double) M_PI) / 180.0) / (1.0 / angle_m)))), 2.0) + (b * b);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((Math.PI / 180.0) / (1.0 / angle_m)))), 2.0) + (b * b);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((math.pi / 180.0) / (1.0 / angle_m)))), 2.0) + (b * b)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(pi / 180.0) / Float64(1.0 / angle_m)))) ^ 2.0) + Float64(b * b)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((pi / 180.0) / (1.0 / angle_m)))) ^ 2.0) + (b * b); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(Pi / 180.0), $MachinePrecision] / N[(1.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{\frac{\pi}{180}}{\frac{1}{angle\_m}}\right)\right)}^{2} + b \cdot b
\end{array}
Initial program 83.7%
*-commutativeN/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-/.f6483.6%
Applied egg-rr83.6%
Taylor expanded in angle around 0
Simplified83.5%
*-rgt-identityN/A
pow2N/A
*-lowering-*.f6483.5%
Applied egg-rr83.5%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 7.5e-9)
(+
(* b b)
(* (* a a) (- 0.5 (* 0.5 (cos (* 2.0 (/ angle_m (/ 180.0 PI))))))))
(if (<= a 3.5e+153)
(+
(* b b)
(* (* angle_m angle_m) (* (* PI PI) (* (* a a) 3.08641975308642e-5))))
(* (* a angle_m) (* a (* (* PI PI) (* angle_m 3.08641975308642e-5)))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 7.5e-9) {
tmp = (b * b) + ((a * a) * (0.5 - (0.5 * cos((2.0 * (angle_m / (180.0 / ((double) M_PI))))))));
} else if (a <= 3.5e+153) {
tmp = (b * b) + ((angle_m * angle_m) * ((((double) M_PI) * ((double) M_PI)) * ((a * a) * 3.08641975308642e-5)));
} else {
tmp = (a * angle_m) * (a * ((((double) M_PI) * ((double) M_PI)) * (angle_m * 3.08641975308642e-5)));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 7.5e-9) {
tmp = (b * b) + ((a * a) * (0.5 - (0.5 * Math.cos((2.0 * (angle_m / (180.0 / Math.PI)))))));
} else if (a <= 3.5e+153) {
tmp = (b * b) + ((angle_m * angle_m) * ((Math.PI * Math.PI) * ((a * a) * 3.08641975308642e-5)));
} else {
tmp = (a * angle_m) * (a * ((Math.PI * Math.PI) * (angle_m * 3.08641975308642e-5)));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 7.5e-9: tmp = (b * b) + ((a * a) * (0.5 - (0.5 * math.cos((2.0 * (angle_m / (180.0 / math.pi))))))) elif a <= 3.5e+153: tmp = (b * b) + ((angle_m * angle_m) * ((math.pi * math.pi) * ((a * a) * 3.08641975308642e-5))) else: tmp = (a * angle_m) * (a * ((math.pi * math.pi) * (angle_m * 3.08641975308642e-5))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 7.5e-9) tmp = Float64(Float64(b * b) + Float64(Float64(a * a) * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(angle_m / Float64(180.0 / pi)))))))); elseif (a <= 3.5e+153) tmp = Float64(Float64(b * b) + Float64(Float64(angle_m * angle_m) * Float64(Float64(pi * pi) * Float64(Float64(a * a) * 3.08641975308642e-5)))); else tmp = Float64(Float64(a * angle_m) * Float64(a * Float64(Float64(pi * pi) * Float64(angle_m * 3.08641975308642e-5)))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 7.5e-9) tmp = (b * b) + ((a * a) * (0.5 - (0.5 * cos((2.0 * (angle_m / (180.0 / pi))))))); elseif (a <= 3.5e+153) tmp = (b * b) + ((angle_m * angle_m) * ((pi * pi) * ((a * a) * 3.08641975308642e-5))); else tmp = (a * angle_m) * (a * ((pi * pi) * (angle_m * 3.08641975308642e-5))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 7.5e-9], N[(N[(b * b), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(angle$95$m / N[(180.0 / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e+153], N[(N[(b * b), $MachinePrecision] + N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * angle$95$m), $MachinePrecision] * N[(a * N[(N[(Pi * Pi), $MachinePrecision] * N[(angle$95$m * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.5 \cdot 10^{-9}:\\
\;\;\;\;b \cdot b + \left(a \cdot a\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{angle\_m}{\frac{180}{\pi}}\right)\right)\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+153}:\\
\;\;\;\;b \cdot b + \left(angle\_m \cdot angle\_m\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}:\\
\;\;\;\;\left(a \cdot angle\_m\right) \cdot \left(a \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(angle\_m \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\end{array}
\end{array}
if a < 7.49999999999999933e-9Initial program 81.4%
*-commutativeN/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.4%
Applied egg-rr81.4%
Taylor expanded in angle around 0
Simplified81.3%
Applied egg-rr68.5%
if 7.49999999999999933e-9 < a < 3.4999999999999999e153Initial program 80.4%
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
+-commutativeN/A
+-lowering-+.f64N/A
Simplified43.2%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6470.9%
Simplified70.9%
if 3.4999999999999999e153 < a Initial program 99.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
+-commutativeN/A
+-lowering-+.f64N/A
Simplified40.7%
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-*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.f6465.0%
Simplified65.0%
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6485.3%
Applied egg-rr85.3%
Final simplification71.0%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 2.2e-124)
(* b b)
(if (<= a 1.35e+154)
(+
(* b b)
(* (* angle_m angle_m) (* (* PI PI) (* (* a a) 3.08641975308642e-5))))
(* (* a angle_m) (* a (* (* PI PI) (* angle_m 3.08641975308642e-5)))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 2.2e-124) {
tmp = b * b;
} else if (a <= 1.35e+154) {
tmp = (b * b) + ((angle_m * angle_m) * ((((double) M_PI) * ((double) M_PI)) * ((a * a) * 3.08641975308642e-5)));
} else {
tmp = (a * angle_m) * (a * ((((double) M_PI) * ((double) M_PI)) * (angle_m * 3.08641975308642e-5)));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 2.2e-124) {
tmp = b * b;
} else if (a <= 1.35e+154) {
tmp = (b * b) + ((angle_m * angle_m) * ((Math.PI * Math.PI) * ((a * a) * 3.08641975308642e-5)));
} else {
tmp = (a * angle_m) * (a * ((Math.PI * Math.PI) * (angle_m * 3.08641975308642e-5)));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 2.2e-124: tmp = b * b elif a <= 1.35e+154: tmp = (b * b) + ((angle_m * angle_m) * ((math.pi * math.pi) * ((a * a) * 3.08641975308642e-5))) else: tmp = (a * angle_m) * (a * ((math.pi * math.pi) * (angle_m * 3.08641975308642e-5))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 2.2e-124) tmp = Float64(b * b); elseif (a <= 1.35e+154) tmp = Float64(Float64(b * b) + Float64(Float64(angle_m * angle_m) * Float64(Float64(pi * pi) * Float64(Float64(a * a) * 3.08641975308642e-5)))); else tmp = Float64(Float64(a * angle_m) * Float64(a * Float64(Float64(pi * pi) * Float64(angle_m * 3.08641975308642e-5)))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 2.2e-124) tmp = b * b; elseif (a <= 1.35e+154) tmp = (b * b) + ((angle_m * angle_m) * ((pi * pi) * ((a * a) * 3.08641975308642e-5))); else tmp = (a * angle_m) * (a * ((pi * pi) * (angle_m * 3.08641975308642e-5))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 2.2e-124], N[(b * b), $MachinePrecision], If[LessEqual[a, 1.35e+154], N[(N[(b * b), $MachinePrecision] + N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * angle$95$m), $MachinePrecision] * N[(a * N[(N[(Pi * Pi), $MachinePrecision] * N[(angle$95$m * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.2 \cdot 10^{-124}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;b \cdot b + \left(angle\_m \cdot angle\_m\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}:\\
\;\;\;\;\left(a \cdot angle\_m\right) \cdot \left(a \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(angle\_m \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.1999999999999999e-124Initial program 81.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.7%
Simplified61.7%
if 2.1999999999999999e-124 < a < 1.35000000000000003e154Initial program 81.1%
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
+-commutativeN/A
+-lowering-+.f64N/A
Simplified45.4%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6473.6%
Simplified73.6%
if 1.35000000000000003e154 < a Initial program 99.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
+-commutativeN/A
+-lowering-+.f64N/A
Simplified40.7%
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-*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.f6465.0%
Simplified65.0%
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6485.3%
Applied egg-rr85.3%
Final simplification66.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 4.5e+118) (* b b) (* (* a angle_m) (* a (* (* PI PI) (* angle_m 3.08641975308642e-5))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 4.5e+118) {
tmp = b * b;
} else {
tmp = (a * angle_m) * (a * ((((double) M_PI) * ((double) M_PI)) * (angle_m * 3.08641975308642e-5)));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 4.5e+118) {
tmp = b * b;
} else {
tmp = (a * angle_m) * (a * ((Math.PI * Math.PI) * (angle_m * 3.08641975308642e-5)));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 4.5e+118: tmp = b * b else: tmp = (a * angle_m) * (a * ((math.pi * math.pi) * (angle_m * 3.08641975308642e-5))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 4.5e+118) tmp = Float64(b * b); else tmp = Float64(Float64(a * angle_m) * Float64(a * Float64(Float64(pi * pi) * Float64(angle_m * 3.08641975308642e-5)))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 4.5e+118) tmp = b * b; else tmp = (a * angle_m) * (a * ((pi * pi) * (angle_m * 3.08641975308642e-5))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 4.5e+118], N[(b * b), $MachinePrecision], N[(N[(a * angle$95$m), $MachinePrecision] * N[(a * N[(N[(Pi * Pi), $MachinePrecision] * N[(angle$95$m * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.5 \cdot 10^{+118}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot angle\_m\right) \cdot \left(a \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(angle\_m \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\end{array}
\end{array}
if a < 4.50000000000000002e118Initial program 81.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.5%
Simplified61.5%
if 4.50000000000000002e118 < a Initial program 93.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
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
+-commutativeN/A
+-lowering-+.f64N/A
Simplified38.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-*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.f6458.0%
Simplified58.0%
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6474.4%
Applied egg-rr74.4%
Final simplification63.6%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 1e+137) (* b b) (* a (* a (* 3.08641975308642e-5 (* angle_m (* angle_m (* PI PI))))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1e+137) {
tmp = b * b;
} else {
tmp = a * (a * (3.08641975308642e-5 * (angle_m * (angle_m * (((double) M_PI) * ((double) M_PI))))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1e+137) {
tmp = b * b;
} else {
tmp = a * (a * (3.08641975308642e-5 * (angle_m * (angle_m * (Math.PI * Math.PI)))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 1e+137: tmp = b * b else: tmp = a * (a * (3.08641975308642e-5 * (angle_m * (angle_m * (math.pi * math.pi))))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 1e+137) tmp = Float64(b * b); else tmp = Float64(a * Float64(a * Float64(3.08641975308642e-5 * Float64(angle_m * Float64(angle_m * Float64(pi * pi)))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 1e+137) tmp = b * b; else tmp = a * (a * (3.08641975308642e-5 * (angle_m * (angle_m * (pi * pi))))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 1e+137], N[(b * b), $MachinePrecision], N[(a * N[(a * N[(3.08641975308642e-5 * N[(angle$95$m * N[(angle$95$m * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 10^{+137}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(a \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle\_m \cdot \left(angle\_m \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 1e137Initial program 81.6%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.6%
Simplified61.6%
if 1e137 < a Initial program 95.5%
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
+-commutativeN/A
+-lowering-+.f64N/A
Simplified41.1%
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-*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.f6462.1%
Simplified62.1%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6474.6%
Applied egg-rr74.6%
Final simplification63.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 8.8e+136) (* b b) (* (* a a) (* (* angle_m angle_m) (* (* PI PI) 3.08641975308642e-5)))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 8.8e+136) {
tmp = b * b;
} else {
tmp = (a * a) * ((angle_m * angle_m) * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 8.8e+136) {
tmp = b * b;
} else {
tmp = (a * a) * ((angle_m * angle_m) * ((Math.PI * Math.PI) * 3.08641975308642e-5));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 8.8e+136: tmp = b * b else: tmp = (a * a) * ((angle_m * angle_m) * ((math.pi * math.pi) * 3.08641975308642e-5)) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 8.8e+136) tmp = Float64(b * b); else tmp = Float64(Float64(a * a) * Float64(Float64(angle_m * angle_m) * Float64(Float64(pi * pi) * 3.08641975308642e-5))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 8.8e+136) tmp = b * b; else tmp = (a * a) * ((angle_m * angle_m) * ((pi * pi) * 3.08641975308642e-5)); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 8.8e+136], N[(b * b), $MachinePrecision], N[(N[(a * a), $MachinePrecision] * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.8 \cdot 10^{+136}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(\left(angle\_m \cdot angle\_m\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\\
\end{array}
\end{array}
if a < 8.7999999999999998e136Initial program 81.6%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6461.6%
Simplified61.6%
if 8.7999999999999998e136 < a Initial program 95.5%
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
+-commutativeN/A
+-lowering-+.f64N/A
Simplified41.1%
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-*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.f6462.1%
Simplified62.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (* b b))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return b * b;
}
angle_m = abs(angle)
real(8) function code(a, b, angle_m)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle_m
code = b * b
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return b * b;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return b * b
angle_m = abs(angle) function code(a, b, angle_m) return Float64(b * b) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = b * b; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
b \cdot b
\end{array}
Initial program 83.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6457.8%
Simplified57.8%
herbie shell --seed 2024164
(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)))