
(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 17 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 (cbrt (* angle 0.005555555555555556))))
(+
(pow (* a (cos (* t_0 (* PI (pow t_0 2.0))))) 2.0)
(pow (* b (sin (* PI (/ angle 180.0)))) 2.0))))
double code(double a, double b, double angle) {
double t_0 = cbrt((angle * 0.005555555555555556));
return pow((a * cos((t_0 * (((double) M_PI) * pow(t_0, 2.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.cbrt((angle * 0.005555555555555556));
return Math.pow((a * Math.cos((t_0 * (Math.PI * Math.pow(t_0, 2.0))))), 2.0) + Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0);
}
function code(a, b, angle) t_0 = cbrt(Float64(angle * 0.005555555555555556)) return Float64((Float64(a * cos(Float64(t_0 * Float64(pi * (t_0 ^ 2.0))))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0)) end
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[(angle * 0.005555555555555556), $MachinePrecision], 1/3], $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[N[(t$95$0 * N[(Pi * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{angle \cdot 0.005555555555555556}\\
{\left(a \cdot \cos \left(t_0 \cdot \left(\pi \cdot {t_0}^{2}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
\end{array}
Initial program 79.6%
add-sqr-sqrt34.2%
sqrt-unprod66.7%
associate-*r/66.7%
associate-*r/66.7%
frac-times65.9%
metadata-eval65.9%
metadata-eval65.9%
frac-times66.7%
associate-*l/66.7%
associate-*l/66.7%
sqrt-unprod45.4%
add-sqr-sqrt79.6%
add-exp-log45.5%
add-sqr-sqrt45.5%
sqrt-unprod66.7%
associate-*l/66.7%
associate-*l/66.7%
frac-times65.8%
Applied egg-rr34.1%
rem-exp-log79.5%
metadata-eval79.5%
div-inv79.6%
add-cube-cbrt79.7%
associate-*r*79.7%
pow279.7%
div-inv79.7%
metadata-eval79.7%
div-inv79.7%
metadata-eval79.7%
Applied egg-rr79.7%
Final simplification79.7%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* b (sin t_0)) 2.0) (pow (* a (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((b * sin(t_0)), 2.0) + pow((a * cos(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((b * Math.sin(t_0)), 2.0) + Math.pow((a * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((b * math.sin(t_0)), 2.0) + math.pow((a * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(b * sin(t_0)) ^ 2.0) + (Float64(a * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((b * sin(t_0)) ^ 2.0) + ((a * cos(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[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(b \cdot \sin t_0\right)}^{2} + {\left(a \cdot \cos t_0\right)}^{2}
\end{array}
\end{array}
Initial program 79.6%
Final simplification79.6%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (/ PI (/ 180.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 / 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 / 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 / angle)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(pi / Float64(180.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 / angle)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}
\end{array}
Initial program 79.6%
clear-num79.4%
un-div-inv79.4%
Applied egg-rr79.6%
Final simplification79.6%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* angle (/ PI -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 = angle * (((double) M_PI) / -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 = angle * (Math.PI / -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 = angle * (math.pi / -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(angle * Float64(pi / -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 = angle * (pi / -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[(angle * N[(Pi / -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 := angle \cdot \frac{\pi}{-180}\\
{\left(a \cdot \cos t_0\right)}^{2} + {\left(b \cdot \sin t_0\right)}^{2}
\end{array}
\end{array}
Initial program 79.6%
Simplified79.6%
Final simplification79.6%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (pow (* b (expm1 (log1p (sin (* angle (* PI 0.005555555555555556)))))) 2.0)))
double code(double a, double b, double angle) {
return pow(a, 2.0) + pow((b * expm1(log1p(sin((angle * (((double) M_PI) * 0.005555555555555556)))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + Math.pow((b * Math.expm1(Math.log1p(Math.sin((angle * (Math.PI * 0.005555555555555556)))))), 2.0);
}
def code(a, b, angle): return math.pow(a, 2.0) + math.pow((b * math.expm1(math.log1p(math.sin((angle * (math.pi * 0.005555555555555556)))))), 2.0)
function code(a, b, angle) return Float64((a ^ 2.0) + (Float64(b * expm1(log1p(sin(Float64(angle * Float64(pi * 0.005555555555555556)))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(Exp[N[Log[1 + N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + {\left(b \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)}^{2}
\end{array}
Initial program 79.6%
Taylor expanded in angle around 0 79.4%
add-sqr-sqrt33.8%
sqrt-unprod61.2%
associate-*r/61.2%
associate-*r/61.3%
frac-times60.4%
metadata-eval60.4%
metadata-eval60.4%
frac-times61.3%
associate-*l/61.3%
associate-*l/61.3%
sqrt-unprod45.2%
add-sqr-sqrt79.5%
add-cbrt-cube78.8%
add-cbrt-cube54.7%
cbrt-unprod54.8%
Applied egg-rr54.7%
expm1-log1p-u54.7%
cbrt-prod54.7%
rem-cbrt-cube54.8%
rem-cbrt-cube79.5%
associate-*l*79.4%
Applied egg-rr79.4%
*-un-lft-identity79.4%
*-commutative79.4%
*-commutative79.4%
add-sqr-sqrt45.5%
sqrt-unprod61.2%
*-commutative61.2%
*-commutative61.2%
swap-sqr60.8%
metadata-eval60.8%
metadata-eval60.8%
swap-sqr61.2%
sqrt-unprod33.8%
add-sqr-sqrt79.4%
associate-*l*79.5%
Applied egg-rr79.5%
Final simplification79.5%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (pow (* b (sin (* 0.005555555555555556 (* PI angle)))) 2.0)))
double code(double a, double b, double angle) {
return pow(a, 2.0) + pow((b * sin((0.005555555555555556 * (((double) M_PI) * angle)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + Math.pow((b * Math.sin((0.005555555555555556 * (Math.PI * angle)))), 2.0);
}
def code(a, b, angle): return math.pow(a, 2.0) + math.pow((b * math.sin((0.005555555555555556 * (math.pi * angle)))), 2.0)
function code(a, b, angle) return Float64((a ^ 2.0) + (Float64(b * sin(Float64(0.005555555555555556 * Float64(pi * angle)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + ((b * sin((0.005555555555555556 * (pi * angle)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}
\end{array}
Initial program 79.6%
Taylor expanded in angle around 0 79.4%
Taylor expanded in angle around inf 78.8%
Final simplification78.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (/ angle 180.0)))) 2.0) (pow a 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0) + pow(a, 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, 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi * (angle / 180.0)))), 2.0) + math.pow(a, 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (a ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi * (angle / 180.0)))) ^ 2.0) + (a ^ 2.0); 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[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {a}^{2}
\end{array}
Initial program 79.6%
Taylor expanded in angle around 0 79.4%
Final simplification79.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (/ PI (/ 180.0 angle)))) 2.0) (pow a 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) / (180.0 / angle)))), 2.0) + pow(a, 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI / (180.0 / angle)))), 2.0) + Math.pow(a, 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi / (180.0 / angle)))), 2.0) + math.pow(a, 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi / Float64(180.0 / angle)))) ^ 2.0) + (a ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi / (180.0 / angle)))) ^ 2.0) + (a ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2} + {a}^{2}
\end{array}
Initial program 79.6%
Taylor expanded in angle around 0 79.4%
clear-num79.4%
un-div-inv79.4%
Applied egg-rr79.4%
Final simplification79.4%
(FPCore (a b angle)
:precision binary64
(if (<= angle 6.5e-99)
(+ (pow a 2.0) (pow (* b (* 0.005555555555555556 (* PI angle))) 2.0))
(+
(pow a 2.0)
(*
(* angle 0.005555555555555556)
(* (* PI b) (* angle (* 0.005555555555555556 (* PI b))))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 6.5e-99) {
tmp = pow(a, 2.0) + pow((b * (0.005555555555555556 * (((double) M_PI) * angle))), 2.0);
} else {
tmp = pow(a, 2.0) + ((angle * 0.005555555555555556) * ((((double) M_PI) * b) * (angle * (0.005555555555555556 * (((double) M_PI) * b)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 6.5e-99) {
tmp = Math.pow(a, 2.0) + Math.pow((b * (0.005555555555555556 * (Math.PI * angle))), 2.0);
} else {
tmp = Math.pow(a, 2.0) + ((angle * 0.005555555555555556) * ((Math.PI * b) * (angle * (0.005555555555555556 * (Math.PI * b)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 6.5e-99: tmp = math.pow(a, 2.0) + math.pow((b * (0.005555555555555556 * (math.pi * angle))), 2.0) else: tmp = math.pow(a, 2.0) + ((angle * 0.005555555555555556) * ((math.pi * b) * (angle * (0.005555555555555556 * (math.pi * b))))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 6.5e-99) tmp = Float64((a ^ 2.0) + (Float64(b * Float64(0.005555555555555556 * Float64(pi * angle))) ^ 2.0)); else tmp = Float64((a ^ 2.0) + Float64(Float64(angle * 0.005555555555555556) * Float64(Float64(pi * b) * Float64(angle * Float64(0.005555555555555556 * Float64(pi * b)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 6.5e-99) tmp = (a ^ 2.0) + ((b * (0.005555555555555556 * (pi * angle))) ^ 2.0); else tmp = (a ^ 2.0) + ((angle * 0.005555555555555556) * ((pi * b) * (angle * (0.005555555555555556 * (pi * b))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 6.5e-99], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(N[(Pi * b), $MachinePrecision] * N[(angle * N[(0.005555555555555556 * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 6.5 \cdot 10^{-99}:\\
\;\;\;\;{a}^{2} + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + \left(angle \cdot 0.005555555555555556\right) \cdot \left(\left(\pi \cdot b\right) \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 6.50000000000000033e-99Initial program 85.2%
Taylor expanded in angle around 0 85.3%
Taylor expanded in angle around 0 81.8%
if 6.50000000000000033e-99 < angle Initial program 66.0%
Taylor expanded in angle around 0 65.0%
Taylor expanded in angle around 0 55.1%
*-commutative55.1%
Simplified55.1%
unpow255.1%
associate-*r*55.1%
*-commutative55.1%
associate-*l*60.1%
associate-*r*60.1%
*-commutative60.1%
associate-*l*60.1%
Applied egg-rr60.1%
Final simplification75.4%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* angle (* 0.005555555555555556 (* PI b)))))
(if (<= angle 4e-98)
(+ (pow a 2.0) (* (* b (* PI angle)) (* 0.005555555555555556 t_0)))
(+ (pow a 2.0) (* (* angle 0.005555555555555556) (* (* PI b) t_0))))))
double code(double a, double b, double angle) {
double t_0 = angle * (0.005555555555555556 * (((double) M_PI) * b));
double tmp;
if (angle <= 4e-98) {
tmp = pow(a, 2.0) + ((b * (((double) M_PI) * angle)) * (0.005555555555555556 * t_0));
} else {
tmp = pow(a, 2.0) + ((angle * 0.005555555555555556) * ((((double) M_PI) * b) * t_0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = angle * (0.005555555555555556 * (Math.PI * b));
double tmp;
if (angle <= 4e-98) {
tmp = Math.pow(a, 2.0) + ((b * (Math.PI * angle)) * (0.005555555555555556 * t_0));
} else {
tmp = Math.pow(a, 2.0) + ((angle * 0.005555555555555556) * ((Math.PI * b) * t_0));
}
return tmp;
}
def code(a, b, angle): t_0 = angle * (0.005555555555555556 * (math.pi * b)) tmp = 0 if angle <= 4e-98: tmp = math.pow(a, 2.0) + ((b * (math.pi * angle)) * (0.005555555555555556 * t_0)) else: tmp = math.pow(a, 2.0) + ((angle * 0.005555555555555556) * ((math.pi * b) * t_0)) return tmp
function code(a, b, angle) t_0 = Float64(angle * Float64(0.005555555555555556 * Float64(pi * b))) tmp = 0.0 if (angle <= 4e-98) tmp = Float64((a ^ 2.0) + Float64(Float64(b * Float64(pi * angle)) * Float64(0.005555555555555556 * t_0))); else tmp = Float64((a ^ 2.0) + Float64(Float64(angle * 0.005555555555555556) * Float64(Float64(pi * b) * t_0))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = angle * (0.005555555555555556 * (pi * b)); tmp = 0.0; if (angle <= 4e-98) tmp = (a ^ 2.0) + ((b * (pi * angle)) * (0.005555555555555556 * t_0)); else tmp = (a ^ 2.0) + ((angle * 0.005555555555555556) * ((pi * b) * t_0)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(0.005555555555555556 * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, 4e-98], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(b * N[(Pi * angle), $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(N[(Pi * b), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\\
\mathbf{if}\;angle \leq 4 \cdot 10^{-98}:\\
\;\;\;\;{a}^{2} + \left(b \cdot \left(\pi \cdot angle\right)\right) \cdot \left(0.005555555555555556 \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + \left(angle \cdot 0.005555555555555556\right) \cdot \left(\left(\pi \cdot b\right) \cdot t_0\right)\\
\end{array}
\end{array}
if angle < 3.99999999999999976e-98Initial program 85.2%
Taylor expanded in angle around 0 85.3%
Taylor expanded in angle around 0 81.7%
*-commutative81.7%
Simplified81.7%
unpow281.7%
associate-*r*81.7%
associate-*r*81.7%
*-commutative81.7%
associate-*l*81.7%
*-commutative81.7%
*-commutative81.7%
associate-*l*81.8%
Applied egg-rr81.8%
if 3.99999999999999976e-98 < angle Initial program 66.0%
Taylor expanded in angle around 0 65.0%
Taylor expanded in angle around 0 55.1%
*-commutative55.1%
Simplified55.1%
unpow255.1%
associate-*r*55.1%
*-commutative55.1%
associate-*l*60.1%
associate-*r*60.1%
*-commutative60.1%
associate-*l*60.1%
Applied egg-rr60.1%
Final simplification75.4%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* angle (* 0.005555555555555556 (* PI b)))))
(if (<= angle 1.6e-22)
(+ (pow a 2.0) (* 0.005555555555555556 (* t_0 (* b (* PI angle)))))
(+ (pow a 2.0) (* (* angle 0.005555555555555556) (* (* PI b) t_0))))))
double code(double a, double b, double angle) {
double t_0 = angle * (0.005555555555555556 * (((double) M_PI) * b));
double tmp;
if (angle <= 1.6e-22) {
tmp = pow(a, 2.0) + (0.005555555555555556 * (t_0 * (b * (((double) M_PI) * angle))));
} else {
tmp = pow(a, 2.0) + ((angle * 0.005555555555555556) * ((((double) M_PI) * b) * t_0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = angle * (0.005555555555555556 * (Math.PI * b));
double tmp;
if (angle <= 1.6e-22) {
tmp = Math.pow(a, 2.0) + (0.005555555555555556 * (t_0 * (b * (Math.PI * angle))));
} else {
tmp = Math.pow(a, 2.0) + ((angle * 0.005555555555555556) * ((Math.PI * b) * t_0));
}
return tmp;
}
def code(a, b, angle): t_0 = angle * (0.005555555555555556 * (math.pi * b)) tmp = 0 if angle <= 1.6e-22: tmp = math.pow(a, 2.0) + (0.005555555555555556 * (t_0 * (b * (math.pi * angle)))) else: tmp = math.pow(a, 2.0) + ((angle * 0.005555555555555556) * ((math.pi * b) * t_0)) return tmp
function code(a, b, angle) t_0 = Float64(angle * Float64(0.005555555555555556 * Float64(pi * b))) tmp = 0.0 if (angle <= 1.6e-22) tmp = Float64((a ^ 2.0) + Float64(0.005555555555555556 * Float64(t_0 * Float64(b * Float64(pi * angle))))); else tmp = Float64((a ^ 2.0) + Float64(Float64(angle * 0.005555555555555556) * Float64(Float64(pi * b) * t_0))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = angle * (0.005555555555555556 * (pi * b)); tmp = 0.0; if (angle <= 1.6e-22) tmp = (a ^ 2.0) + (0.005555555555555556 * (t_0 * (b * (pi * angle)))); else tmp = (a ^ 2.0) + ((angle * 0.005555555555555556) * ((pi * b) * t_0)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(0.005555555555555556 * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, 1.6e-22], N[(N[Power[a, 2.0], $MachinePrecision] + N[(0.005555555555555556 * N[(t$95$0 * N[(b * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[(N[(Pi * b), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot b\right)\right)\\
\mathbf{if}\;angle \leq 1.6 \cdot 10^{-22}:\\
\;\;\;\;{a}^{2} + 0.005555555555555556 \cdot \left(t_0 \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + \left(angle \cdot 0.005555555555555556\right) \cdot \left(\left(\pi \cdot b\right) \cdot t_0\right)\\
\end{array}
\end{array}
if angle < 1.59999999999999994e-22Initial program 86.2%
Taylor expanded in angle around 0 86.3%
Taylor expanded in angle around 0 83.0%
*-commutative83.0%
Simplified83.0%
unpow283.0%
*-commutative83.0%
associate-*r*83.0%
associate-*r*83.0%
*-commutative83.0%
associate-*l*83.0%
*-commutative83.0%
*-commutative83.0%
associate-*l*83.1%
Applied egg-rr83.1%
if 1.59999999999999994e-22 < angle Initial program 58.2%
Taylor expanded in angle around 0 57.1%
Taylor expanded in angle around 0 44.8%
*-commutative44.8%
Simplified44.8%
unpow244.8%
associate-*r*44.8%
*-commutative44.8%
associate-*l*50.9%
associate-*r*50.9%
*-commutative50.9%
associate-*l*50.9%
Applied egg-rr50.9%
Final simplification75.4%
(FPCore (a b angle)
:precision binary64
(if (<= angle 9.8e-98)
(+ (pow a 2.0) (pow (* b (* 0.005555555555555556 (* PI angle))) 2.0))
(+
(pow a 2.0)
(* (* (* PI angle) (* b (* b (* PI angle)))) 3.08641975308642e-5))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 9.8e-98) {
tmp = pow(a, 2.0) + pow((b * (0.005555555555555556 * (((double) M_PI) * angle))), 2.0);
} else {
tmp = pow(a, 2.0) + (((((double) M_PI) * angle) * (b * (b * (((double) M_PI) * angle)))) * 3.08641975308642e-5);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 9.8e-98) {
tmp = Math.pow(a, 2.0) + Math.pow((b * (0.005555555555555556 * (Math.PI * angle))), 2.0);
} else {
tmp = Math.pow(a, 2.0) + (((Math.PI * angle) * (b * (b * (Math.PI * angle)))) * 3.08641975308642e-5);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 9.8e-98: tmp = math.pow(a, 2.0) + math.pow((b * (0.005555555555555556 * (math.pi * angle))), 2.0) else: tmp = math.pow(a, 2.0) + (((math.pi * angle) * (b * (b * (math.pi * angle)))) * 3.08641975308642e-5) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 9.8e-98) tmp = Float64((a ^ 2.0) + (Float64(b * Float64(0.005555555555555556 * Float64(pi * angle))) ^ 2.0)); else tmp = Float64((a ^ 2.0) + Float64(Float64(Float64(pi * angle) * Float64(b * Float64(b * Float64(pi * angle)))) * 3.08641975308642e-5)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 9.8e-98) tmp = (a ^ 2.0) + ((b * (0.005555555555555556 * (pi * angle))) ^ 2.0); else tmp = (a ^ 2.0) + (((pi * angle) * (b * (b * (pi * angle)))) * 3.08641975308642e-5); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 9.8e-98], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(N[(Pi * angle), $MachinePrecision] * N[(b * N[(b * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 9.8 \cdot 10^{-98}:\\
\;\;\;\;{a}^{2} + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right)\right) \cdot 3.08641975308642 \cdot 10^{-5}\\
\end{array}
\end{array}
if angle < 9.80000000000000028e-98Initial program 85.2%
Taylor expanded in angle around 0 85.3%
Taylor expanded in angle around 0 81.8%
if 9.80000000000000028e-98 < angle Initial program 66.0%
Taylor expanded in angle around 0 65.0%
Taylor expanded in angle around 0 55.1%
*-commutative55.1%
Simplified55.1%
*-commutative55.1%
unpow-prod-down55.1%
*-commutative55.1%
*-commutative55.1%
associate-*l*55.1%
metadata-eval55.1%
Applied egg-rr55.1%
unpow255.1%
*-commutative55.1%
associate-*r*60.1%
*-commutative60.1%
Applied egg-rr60.1%
Final simplification75.4%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (* 3.08641975308642e-5 (pow (* angle (* PI b)) 2.0))))
double code(double a, double b, double angle) {
return pow(a, 2.0) + (3.08641975308642e-5 * pow((angle * (((double) M_PI) * b)), 2.0));
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + (3.08641975308642e-5 * Math.pow((angle * (Math.PI * b)), 2.0));
}
def code(a, b, angle): return math.pow(a, 2.0) + (3.08641975308642e-5 * math.pow((angle * (math.pi * b)), 2.0))
function code(a, b, angle) return Float64((a ^ 2.0) + Float64(3.08641975308642e-5 * (Float64(angle * Float64(pi * b)) ^ 2.0))) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + (3.08641975308642e-5 * ((angle * (pi * b)) ^ 2.0)); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[(3.08641975308642e-5 * N[Power[N[(angle * N[(Pi * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle \cdot \left(\pi \cdot b\right)\right)}^{2}
\end{array}
Initial program 79.6%
Taylor expanded in angle around 0 79.4%
Taylor expanded in angle around 0 73.9%
*-commutative73.9%
Simplified73.9%
*-commutative73.9%
unpow-prod-down73.9%
*-commutative73.9%
*-commutative73.9%
associate-*l*73.9%
metadata-eval73.9%
Applied egg-rr73.9%
Taylor expanded in b around 0 73.9%
Final simplification73.9%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (* 3.08641975308642e-5 (pow (* PI (* angle b)) 2.0))))
double code(double a, double b, double angle) {
return pow(a, 2.0) + (3.08641975308642e-5 * pow((((double) M_PI) * (angle * b)), 2.0));
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + (3.08641975308642e-5 * Math.pow((Math.PI * (angle * b)), 2.0));
}
def code(a, b, angle): return math.pow(a, 2.0) + (3.08641975308642e-5 * math.pow((math.pi * (angle * b)), 2.0))
function code(a, b, angle) return Float64((a ^ 2.0) + Float64(3.08641975308642e-5 * (Float64(pi * Float64(angle * b)) ^ 2.0))) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + (3.08641975308642e-5 * ((pi * (angle * b)) ^ 2.0)); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[(3.08641975308642e-5 * N[Power[N[(Pi * N[(angle * b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(\pi \cdot \left(angle \cdot b\right)\right)}^{2}
\end{array}
Initial program 79.6%
Taylor expanded in angle around 0 79.4%
Taylor expanded in angle around 0 73.9%
*-commutative73.9%
Simplified73.9%
*-commutative73.9%
unpow-prod-down73.9%
*-commutative73.9%
*-commutative73.9%
associate-*l*73.9%
metadata-eval73.9%
Applied egg-rr73.9%
Taylor expanded in b around 0 73.9%
associate-*r*73.9%
Simplified73.9%
Final simplification73.9%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (pow (* 0.005555555555555556 (* angle (* PI b))) 2.0)))
double code(double a, double b, double angle) {
return pow(a, 2.0) + pow((0.005555555555555556 * (angle * (((double) M_PI) * b))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + Math.pow((0.005555555555555556 * (angle * (Math.PI * b))), 2.0);
}
def code(a, b, angle): return math.pow(a, 2.0) + math.pow((0.005555555555555556 * (angle * (math.pi * b))), 2.0)
function code(a, b, angle) return Float64((a ^ 2.0) + (Float64(0.005555555555555556 * Float64(angle * Float64(pi * b))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + ((0.005555555555555556 * (angle * (pi * b))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(0.005555555555555556 * N[(angle * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + {\left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot b\right)\right)\right)}^{2}
\end{array}
Initial program 79.6%
Taylor expanded in angle around 0 79.4%
Taylor expanded in angle around 0 73.9%
*-commutative73.9%
Simplified73.9%
Final simplification73.9%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (pow (* angle (* b (* PI 0.005555555555555556))) 2.0)))
double code(double a, double b, double angle) {
return pow(a, 2.0) + pow((angle * (b * (((double) M_PI) * 0.005555555555555556))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + Math.pow((angle * (b * (Math.PI * 0.005555555555555556))), 2.0);
}
def code(a, b, angle): return math.pow(a, 2.0) + math.pow((angle * (b * (math.pi * 0.005555555555555556))), 2.0)
function code(a, b, angle) return Float64((a ^ 2.0) + (Float64(angle * Float64(b * Float64(pi * 0.005555555555555556))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + ((angle * (b * (pi * 0.005555555555555556))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(angle * N[(b * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + {\left(angle \cdot \left(b \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}
\end{array}
Initial program 79.6%
Taylor expanded in angle around 0 79.4%
Taylor expanded in angle around 0 73.9%
*-commutative73.9%
Simplified73.9%
Taylor expanded in angle around 0 73.9%
associate-*r*73.9%
*-commutative73.9%
*-commutative73.9%
associate-*r*73.9%
associate-*r*73.9%
Simplified73.9%
Final simplification73.9%
(FPCore (a b angle) :precision binary64 (+ (pow a 2.0) (pow (* b (* 0.005555555555555556 (* PI angle))) 2.0)))
double code(double a, double b, double angle) {
return pow(a, 2.0) + pow((b * (0.005555555555555556 * (((double) M_PI) * angle))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(a, 2.0) + Math.pow((b * (0.005555555555555556 * (Math.PI * angle))), 2.0);
}
def code(a, b, angle): return math.pow(a, 2.0) + math.pow((b * (0.005555555555555556 * (math.pi * angle))), 2.0)
function code(a, b, angle) return Float64((a ^ 2.0) + (Float64(b * Float64(0.005555555555555556 * Float64(pi * angle))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a ^ 2.0) + ((b * (0.005555555555555556 * (pi * angle))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{2} + {\left(b \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}
\end{array}
Initial program 79.6%
Taylor expanded in angle around 0 79.4%
Taylor expanded in angle around 0 73.9%
Final simplification73.9%
herbie shell --seed 2023338
(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)))