
(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 10 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 180.0) PI))) 2.0) (pow (* b (cos (* (/ (pow (cbrt PI) 2.0) 180.0) (/ (cbrt PI) (/ 1.0 angle))))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((pow(cbrt(((double) M_PI)), 2.0) / 180.0) * (cbrt(((double) M_PI)) / (1.0 / angle))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((Math.pow(Math.cbrt(Math.PI), 2.0) / 180.0) * (Math.cbrt(Math.PI) / (1.0 / angle))))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64((cbrt(pi) ^ 2.0) / 180.0) * Float64(cbrt(pi) / Float64(1.0 / angle))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(N[Power[N[Power[Pi, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Power[Pi, 1/3], $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{{\left(\sqrt[3]{\pi}\right)}^{2}}{180} \cdot \frac{\sqrt[3]{\pi}}{\frac{1}{angle}}\right)\right)}^{2}
\end{array}
Initial program 77.5%
*-commutative77.5%
clear-num77.6%
un-div-inv77.7%
Applied egg-rr77.7%
add-cube-cbrt77.6%
div-inv77.6%
times-frac77.7%
pow277.7%
Applied egg-rr77.7%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (log1p (expm1 (cos (/ PI (/ 180.0 angle)))))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * log1p(expm1(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 / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.log1p(Math.expm1(Math.cos((Math.PI / (180.0 / angle)))))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.log1p(math.expm1(math.cos((math.pi / (180.0 / angle)))))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * log1p(expm1(cos(Float64(pi / Float64(180.0 / angle)))))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Log[1 + N[(Exp[N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\right)}^{2}
\end{array}
Initial program 77.5%
*-commutative77.5%
clear-num77.6%
un-div-inv77.7%
Applied egg-rr77.7%
associate-/r/77.6%
*-commutative77.6%
div-inv77.6%
metadata-eval77.6%
rem-cube-cbrt77.6%
log1p-expm1-u77.6%
rem-cube-cbrt77.6%
associate-*r*77.6%
*-commutative77.6%
associate-*r*77.5%
Applied egg-rr77.5%
Taylor expanded in angle around inf 77.6%
expm1-define77.6%
associate-*r*77.5%
metadata-eval77.5%
associate-/r/77.6%
associate-*l/77.7%
*-lft-identity77.7%
Simplified77.7%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (/ PI (/ 180.0 angle)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 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 / 180.0) * Math.PI))), 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 / 180.0) * math.pi))), 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 / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(pi / Float64(180.0 / angle)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin(((angle / 180.0) * pi))) ^ 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 / 180.0), $MachinePrecision] * Pi), $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}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}
\end{array}
Initial program 77.5%
*-commutative77.5%
clear-num77.6%
un-div-inv77.7%
Applied egg-rr77.7%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* angle (* PI 0.005555555555555556)))) (pow (hypot (* a (sin t_0)) (* b (cos t_0))) 2.0)))
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) * 0.005555555555555556);
return pow(hypot((a * sin(t_0)), (b * cos(t_0))), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = angle * (Math.PI * 0.005555555555555556);
return Math.pow(Math.hypot((a * Math.sin(t_0)), (b * Math.cos(t_0))), 2.0);
}
def code(a, b, angle): t_0 = angle * (math.pi * 0.005555555555555556) return math.pow(math.hypot((a * math.sin(t_0)), (b * math.cos(t_0))), 2.0)
function code(a, b, angle) t_0 = Float64(angle * Float64(pi * 0.005555555555555556)) return hypot(Float64(a * sin(t_0)), Float64(b * cos(t_0))) ^ 2.0 end
function tmp = code(a, b, angle) t_0 = angle * (pi * 0.005555555555555556); tmp = hypot((a * sin(t_0)), (b * cos(t_0))) ^ 2.0; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, N[Power[N[Sqrt[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
{\left(\mathsf{hypot}\left(a \cdot \sin t\_0, b \cdot \cos t\_0\right)\right)}^{2}
\end{array}
\end{array}
Initial program 77.5%
associate-*l/77.5%
associate-/l*77.6%
cos-neg77.6%
distribute-lft-neg-out77.6%
distribute-frac-neg77.6%
distribute-frac-neg77.6%
distribute-lft-neg-out77.6%
cos-neg77.6%
associate-*l/77.6%
associate-/l*77.6%
Simplified77.6%
associate-*r/77.6%
associate-*l/77.6%
unpow277.6%
associate-*r/77.6%
associate-*l/77.5%
unpow277.5%
add-sqr-sqrt77.5%
pow277.5%
Applied egg-rr77.6%
Final simplification77.6%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* angle PI)))) (pow (hypot (* a (sin t_0)) (* b (cos t_0))) 2.0)))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
return pow(hypot((a * sin(t_0)), (b * cos(t_0))), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
return Math.pow(Math.hypot((a * Math.sin(t_0)), (b * Math.cos(t_0))), 2.0);
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) return math.pow(math.hypot((a * math.sin(t_0)), (b * math.cos(t_0))), 2.0)
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) return hypot(Float64(a * sin(t_0)), Float64(b * cos(t_0))) ^ 2.0 end
function tmp = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); tmp = hypot((a * sin(t_0)), (b * cos(t_0))) ^ 2.0; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, N[Power[N[Sqrt[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
{\left(\mathsf{hypot}\left(a \cdot \sin t\_0, b \cdot \cos t\_0\right)\right)}^{2}
\end{array}
\end{array}
Initial program 77.5%
associate-*l/77.5%
associate-/l*77.6%
cos-neg77.6%
distribute-lft-neg-out77.6%
distribute-frac-neg77.6%
distribute-frac-neg77.6%
distribute-lft-neg-out77.6%
cos-neg77.6%
associate-*l/77.6%
associate-/l*77.6%
Simplified77.6%
Taylor expanded in a around 0 68.4%
*-commutative68.4%
associate-*r*68.5%
unpow268.5%
unpow268.5%
unpow268.5%
unpow268.5%
swap-sqr77.6%
*-commutative77.6%
Simplified77.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* angle (/ PI 180.0)))) 2.0) (pow b 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin((angle * (((double) M_PI) / 180.0)))), 2.0) + pow(b, 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, 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin((angle * (math.pi / 180.0)))), 2.0) + math.pow(b, 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(angle * Float64(pi / 180.0)))) ^ 2.0) + (b ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin((angle * (pi / 180.0)))) ^ 2.0) + (b ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(angle \cdot \frac{\pi}{180}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 77.5%
associate-*l/77.5%
associate-/l*77.6%
cos-neg77.6%
distribute-lft-neg-out77.6%
distribute-frac-neg77.6%
distribute-frac-neg77.6%
distribute-lft-neg-out77.6%
cos-neg77.6%
associate-*l/77.6%
associate-/l*77.6%
Simplified77.6%
Taylor expanded in angle around 0 77.4%
Final simplification77.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow b 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow(b, 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow(b, 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow(b, 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (b ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin(((angle / 180.0) * pi))) ^ 2.0) + (b ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 77.5%
*-commutative77.5%
clear-num77.6%
un-div-inv77.7%
Applied egg-rr77.7%
add-cube-cbrt77.6%
div-inv77.6%
times-frac77.7%
pow277.7%
Applied egg-rr77.7%
Taylor expanded in angle around 0 77.4%
(FPCore (a b angle) :precision binary64 (if (<= b 3.2e-68) (pow (* a (sin (* angle (* PI 0.005555555555555556)))) 2.0) (* b b)))
double code(double a, double b, double angle) {
double tmp;
if (b <= 3.2e-68) {
tmp = pow((a * sin((angle * (((double) M_PI) * 0.005555555555555556)))), 2.0);
} else {
tmp = b * b;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3.2e-68) {
tmp = Math.pow((a * Math.sin((angle * (Math.PI * 0.005555555555555556)))), 2.0);
} else {
tmp = b * b;
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 3.2e-68: tmp = math.pow((a * math.sin((angle * (math.pi * 0.005555555555555556)))), 2.0) else: tmp = b * b return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 3.2e-68) tmp = Float64(a * sin(Float64(angle * Float64(pi * 0.005555555555555556)))) ^ 2.0; else tmp = Float64(b * b); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3.2e-68) tmp = (a * sin((angle * (pi * 0.005555555555555556)))) ^ 2.0; else tmp = b * b; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 3.2e-68], N[Power[N[(a * N[Sin[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(b * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.2 \cdot 10^{-68}:\\
\;\;\;\;{\left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;b \cdot b\\
\end{array}
\end{array}
if b < 3.1999999999999999e-68Initial program 76.3%
*-commutative76.3%
clear-num76.3%
un-div-inv76.5%
Applied egg-rr76.5%
add-cube-cbrt76.3%
div-inv76.3%
times-frac76.4%
pow276.4%
Applied egg-rr76.4%
Taylor expanded in a around inf 38.6%
*-commutative38.6%
*-commutative38.6%
*-commutative38.6%
associate-*r*38.7%
unpow238.7%
unpow238.7%
swap-sqr43.0%
unpow243.0%
*-commutative43.0%
associate-*r*43.0%
*-commutative43.0%
*-commutative43.0%
*-commutative43.0%
associate-*r*43.1%
Simplified43.1%
if 3.1999999999999999e-68 < b Initial program 80.4%
associate-*l/80.4%
associate-/l*80.4%
cos-neg80.4%
distribute-lft-neg-out80.4%
distribute-frac-neg80.4%
distribute-frac-neg80.4%
distribute-lft-neg-out80.4%
cos-neg80.4%
associate-*l/80.5%
associate-/l*80.4%
Simplified80.4%
Taylor expanded in angle around 0 71.5%
unpow271.5%
Applied egg-rr71.5%
(FPCore (a b angle) :precision binary64 (if (<= angle 3.3e+168) (* b b) (cbrt (pow b 6.0))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 3.3e+168) {
tmp = b * b;
} else {
tmp = cbrt(pow(b, 6.0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 3.3e+168) {
tmp = b * b;
} else {
tmp = Math.cbrt(Math.pow(b, 6.0));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (angle <= 3.3e+168) tmp = Float64(b * b); else tmp = cbrt((b ^ 6.0)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[angle, 3.3e+168], N[(b * b), $MachinePrecision], N[Power[N[Power[b, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 3.3 \cdot 10^{+168}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{b}^{6}}\\
\end{array}
\end{array}
if angle < 3.2999999999999999e168Initial program 79.7%
associate-*l/79.6%
associate-/l*79.7%
cos-neg79.7%
distribute-lft-neg-out79.7%
distribute-frac-neg79.7%
distribute-frac-neg79.7%
distribute-lft-neg-out79.7%
cos-neg79.7%
associate-*l/79.8%
associate-/l*79.8%
Simplified79.8%
Taylor expanded in angle around 0 58.8%
unpow258.8%
Applied egg-rr58.8%
if 3.2999999999999999e168 < angle Initial program 61.4%
associate-*l/61.2%
associate-/l*61.4%
cos-neg61.4%
distribute-lft-neg-out61.4%
distribute-frac-neg61.4%
distribute-frac-neg61.4%
distribute-lft-neg-out61.4%
cos-neg61.4%
associate-*l/61.5%
associate-/l*61.2%
Simplified61.2%
Taylor expanded in angle around 0 32.2%
add-sqr-sqrt32.2%
sqrt-unprod37.4%
pow-prod-up37.4%
metadata-eval37.4%
Applied egg-rr37.4%
add-cbrt-cube35.4%
pow1/335.4%
add-sqr-sqrt35.4%
sqrt-pow135.4%
metadata-eval35.4%
pow-prod-up35.4%
metadata-eval35.4%
Applied egg-rr35.4%
unpow1/335.4%
Simplified35.4%
(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 77.5%
associate-*l/77.5%
associate-/l*77.6%
cos-neg77.6%
distribute-lft-neg-out77.6%
distribute-frac-neg77.6%
distribute-frac-neg77.6%
distribute-lft-neg-out77.6%
cos-neg77.6%
associate-*l/77.6%
associate-/l*77.6%
Simplified77.6%
Taylor expanded in angle around 0 55.7%
unpow255.7%
Applied egg-rr55.7%
herbie shell --seed 2024137
(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)))