
(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
(*
(cbrt angle)
(*
(pow (cbrt (* PI (* angle 0.005555555555555556))) 2.0)
(cbrt (* PI 0.005555555555555556))))))
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((cbrt(angle) * (pow(cbrt((((double) M_PI) * (angle * 0.005555555555555556))), 2.0) * cbrt((((double) M_PI) * 0.005555555555555556)))))), 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.cbrt(angle) * (Math.pow(Math.cbrt((Math.PI * (angle * 0.005555555555555556))), 2.0) * Math.cbrt((Math.PI * 0.005555555555555556)))))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(cbrt(angle) * Float64((cbrt(Float64(pi * Float64(angle * 0.005555555555555556))) ^ 2.0) * cbrt(Float64(pi * 0.005555555555555556)))))) ^ 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[Power[angle, 1/3], $MachinePrecision] * N[(N[Power[N[Power[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[N[(Pi * 0.005555555555555556), $MachinePrecision], 1/3], $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(\sqrt[3]{angle} \cdot \left({\left(\sqrt[3]{\pi \cdot \left(angle \cdot 0.005555555555555556\right)}\right)}^{2} \cdot \sqrt[3]{\pi \cdot 0.005555555555555556}\right)\right)\right)}^{2}
\end{array}
Initial program 81.2%
add-cube-cbrt81.2%
pow381.2%
associate-*l/81.1%
associate-*r/81.2%
div-inv81.2%
metadata-eval81.2%
Applied egg-rr81.2%
rem-cube-cbrt81.2%
associate-*r*81.2%
metadata-eval81.2%
div-inv81.1%
associate-*l/81.2%
rem-3cbrt-rft81.2%
associate-*l/81.1%
associate-*r/81.2%
div-inv81.2%
metadata-eval81.2%
cbrt-prod81.3%
associate-*l*81.3%
Applied egg-rr81.3%
*-commutative81.3%
associate-*r*81.1%
*-commutative81.1%
associate-*r*81.3%
Simplified81.3%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (sqrt (* PI 0.005555555555555556))))
(+
(pow (* a (sin (* (/ angle 180.0) PI))) 2.0)
(pow (* b (cos (* t_0 (* angle t_0)))) 2.0))))
double code(double a, double b, double angle) {
double t_0 = sqrt((((double) M_PI) * 0.005555555555555556));
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((t_0 * (angle * t_0)))), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.sqrt((Math.PI * 0.005555555555555556));
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((t_0 * (angle * t_0)))), 2.0);
}
def code(a, b, angle): t_0 = math.sqrt((math.pi * 0.005555555555555556)) return math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos((t_0 * (angle * t_0)))), 2.0)
function code(a, b, angle) t_0 = sqrt(Float64(pi * 0.005555555555555556)) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(t_0 * Float64(angle * t_0)))) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = sqrt((pi * 0.005555555555555556)); tmp = ((a * sin(((angle / 180.0) * pi))) ^ 2.0) + ((b * cos((t_0 * (angle * t_0)))) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[Sqrt[N[(Pi * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]}, 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[(t$95$0 * N[(angle * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\pi \cdot 0.005555555555555556}\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(t\_0 \cdot \left(angle \cdot t\_0\right)\right)\right)}^{2}
\end{array}
\end{array}
Initial program 81.2%
add-cube-cbrt81.2%
pow381.2%
associate-*l/81.1%
associate-*r/81.2%
div-inv81.2%
metadata-eval81.2%
Applied egg-rr81.2%
rem-cube-cbrt81.2%
metadata-eval81.2%
div-inv81.2%
add-sqr-sqrt81.1%
associate-*r*81.2%
div-inv81.2%
metadata-eval81.2%
div-inv81.2%
metadata-eval81.2%
Applied egg-rr81.2%
Final simplification81.2%
(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}
Initial program 81.2%
(FPCore (a b angle) :precision binary64 (pow (hypot (* b (cos (* angle (* PI 0.005555555555555556)))) (* a (sin (* PI (* angle 0.005555555555555556))))) 2.0))
double code(double a, double b, double angle) {
return pow(hypot((b * cos((angle * (((double) M_PI) * 0.005555555555555556)))), (a * sin((((double) M_PI) * (angle * 0.005555555555555556))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow(Math.hypot((b * Math.cos((angle * (Math.PI * 0.005555555555555556)))), (a * Math.sin((Math.PI * (angle * 0.005555555555555556))))), 2.0);
}
def code(a, b, angle): return math.pow(math.hypot((b * math.cos((angle * (math.pi * 0.005555555555555556)))), (a * math.sin((math.pi * (angle * 0.005555555555555556))))), 2.0)
function code(a, b, angle) return hypot(Float64(b * cos(Float64(angle * Float64(pi * 0.005555555555555556)))), Float64(a * sin(Float64(pi * Float64(angle * 0.005555555555555556))))) ^ 2.0 end
function tmp = code(a, b, angle) tmp = hypot((b * cos((angle * (pi * 0.005555555555555556)))), (a * sin((pi * (angle * 0.005555555555555556))))) ^ 2.0; end
code[a_, b_, angle_] := N[Power[N[Sqrt[N[(b * N[Cos[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2 + N[(a * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision], 2.0], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(b \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right), a \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}
\end{array}
Initial program 81.2%
add-sqr-sqrt37.8%
pow237.8%
associate-*l/37.8%
associate-*r/37.8%
div-inv37.8%
metadata-eval37.8%
Applied egg-rr37.8%
Applied egg-rr81.2%
Final simplification81.2%
(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 81.2%
associate-*l/81.2%
associate-/l*81.2%
cos-neg81.2%
distribute-lft-neg-out81.2%
distribute-frac-neg81.2%
distribute-frac-neg81.2%
distribute-lft-neg-out81.2%
cos-neg81.2%
associate-*l/81.0%
associate-/l*81.1%
Simplified81.1%
Applied egg-rr81.1%
(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 81.2%
add-cube-cbrt81.2%
pow381.2%
associate-*l/81.1%
associate-*r/81.2%
div-inv81.2%
metadata-eval81.2%
Applied egg-rr81.2%
Taylor expanded in angle around 0 80.8%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* angle PI)))) (if (<= a 1.85e+163) (pow (* b (cos t_0)) 2.0) (pow (* a (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double tmp;
if (a <= 1.85e+163) {
tmp = pow((b * cos(t_0)), 2.0);
} else {
tmp = pow((a * sin(t_0)), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double tmp;
if (a <= 1.85e+163) {
tmp = Math.pow((b * Math.cos(t_0)), 2.0);
} else {
tmp = Math.pow((a * Math.sin(t_0)), 2.0);
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) tmp = 0 if a <= 1.85e+163: tmp = math.pow((b * math.cos(t_0)), 2.0) else: tmp = math.pow((a * math.sin(t_0)), 2.0) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) tmp = 0.0 if (a <= 1.85e+163) tmp = Float64(b * cos(t_0)) ^ 2.0; else tmp = Float64(a * sin(t_0)) ^ 2.0; end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); tmp = 0.0; if (a <= 1.85e+163) tmp = (b * cos(t_0)) ^ 2.0; else tmp = (a * sin(t_0)) ^ 2.0; end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 1.85e+163], N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\mathbf{if}\;a \leq 1.85 \cdot 10^{+163}:\\
\;\;\;\;{\left(b \cdot \cos t\_0\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin t\_0\right)}^{2}\\
\end{array}
\end{array}
if a < 1.84999999999999996e163Initial program 78.9%
associate-*l/78.9%
associate-/l*78.9%
cos-neg78.9%
distribute-lft-neg-out78.9%
distribute-frac-neg78.9%
distribute-frac-neg78.9%
distribute-lft-neg-out78.9%
cos-neg78.9%
associate-*l/78.7%
associate-/l*78.8%
Simplified78.8%
Taylor expanded in a around 0 59.9%
*-commutative59.9%
associate-*r*59.9%
unpow259.9%
unpow259.9%
swap-sqr59.9%
unpow259.9%
associate-*r*59.9%
*-commutative59.9%
Simplified59.9%
if 1.84999999999999996e163 < a Initial program 99.8%
associate-*l/99.8%
associate-/l*99.8%
cos-neg99.8%
distribute-lft-neg-out99.8%
distribute-frac-neg99.8%
distribute-frac-neg99.8%
distribute-lft-neg-out99.8%
cos-neg99.8%
associate-*l/99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 61.1%
unpow261.1%
*-commutative61.1%
associate-*r*61.1%
unpow261.1%
swap-sqr82.8%
unpow282.8%
associate-*r*82.8%
*-commutative82.8%
Simplified82.8%
(FPCore (a b angle) :precision binary64 (if (<= a 1.85e+163) (* b b) (pow (* a (sin (* 0.005555555555555556 (* angle PI)))) 2.0)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.85e+163) {
tmp = b * b;
} else {
tmp = pow((a * sin((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 1.85e+163) {
tmp = b * b;
} else {
tmp = Math.pow((a * Math.sin((0.005555555555555556 * (angle * Math.PI)))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 1.85e+163: tmp = b * b else: tmp = math.pow((a * math.sin((0.005555555555555556 * (angle * math.pi)))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 1.85e+163) tmp = Float64(b * b); else tmp = Float64(a * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0; end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1.85e+163) tmp = b * b; else tmp = (a * sin((0.005555555555555556 * (angle * pi)))) ^ 2.0; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 1.85e+163], N[(b * b), $MachinePrecision], N[Power[N[(a * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.85 \cdot 10^{+163}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if a < 1.84999999999999996e163Initial program 78.9%
associate-*l/78.9%
associate-/l*78.9%
cos-neg78.9%
distribute-lft-neg-out78.9%
distribute-frac-neg78.9%
distribute-frac-neg78.9%
distribute-lft-neg-out78.9%
cos-neg78.9%
associate-*l/78.7%
associate-/l*78.8%
Simplified78.8%
Taylor expanded in angle around 0 59.5%
unpow259.5%
Applied egg-rr59.5%
if 1.84999999999999996e163 < a Initial program 99.8%
associate-*l/99.8%
associate-/l*99.8%
cos-neg99.8%
distribute-lft-neg-out99.8%
distribute-frac-neg99.8%
distribute-frac-neg99.8%
distribute-lft-neg-out99.8%
cos-neg99.8%
associate-*l/99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 61.1%
unpow261.1%
*-commutative61.1%
associate-*r*61.1%
unpow261.1%
swap-sqr82.8%
unpow282.8%
associate-*r*82.8%
*-commutative82.8%
Simplified82.8%
(FPCore (a b angle) :precision binary64 (if (<= a 2.6e+216) (* b b) (cbrt (pow b 6.0))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.6e+216) {
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 (a <= 2.6e+216) {
tmp = b * b;
} else {
tmp = Math.cbrt(Math.pow(b, 6.0));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 2.6e+216) tmp = Float64(b * b); else tmp = cbrt((b ^ 6.0)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 2.6e+216], N[(b * b), $MachinePrecision], N[Power[N[Power[b, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.6 \cdot 10^{+216}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{b}^{6}}\\
\end{array}
\end{array}
if a < 2.5999999999999999e216Initial program 79.8%
associate-*l/79.8%
associate-/l*79.8%
cos-neg79.8%
distribute-lft-neg-out79.8%
distribute-frac-neg79.8%
distribute-frac-neg79.8%
distribute-lft-neg-out79.8%
cos-neg79.8%
associate-*l/79.6%
associate-/l*79.7%
Simplified79.7%
Taylor expanded in angle around 0 58.3%
unpow258.3%
Applied egg-rr58.3%
if 2.5999999999999999e216 < a Initial program 99.7%
associate-*l/99.7%
associate-/l*99.7%
cos-neg99.7%
distribute-lft-neg-out99.7%
distribute-frac-neg99.7%
distribute-frac-neg99.7%
distribute-lft-neg-out99.7%
cos-neg99.7%
associate-*l/99.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in angle around 0 14.5%
add-sqr-sqrt14.5%
sqrt-unprod35.1%
pow-prod-up35.1%
metadata-eval35.1%
Applied egg-rr35.1%
add-cbrt-cube35.1%
pow1/334.7%
add-sqr-sqrt34.7%
sqrt-pow134.7%
metadata-eval34.7%
pow-prod-up34.7%
metadata-eval34.7%
Applied egg-rr34.7%
unpow1/335.1%
Simplified35.1%
(FPCore (a b angle) :precision binary64 (* b b))
double code(double a, double b, double angle) {
return b * b;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = b * b
end function
public static double code(double a, double b, double angle) {
return b * b;
}
def code(a, b, angle): return b * b
function code(a, b, angle) return Float64(b * b) end
function tmp = code(a, b, angle) tmp = b * b; end
code[a_, b_, angle_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
\\
b \cdot b
\end{array}
Initial program 81.2%
associate-*l/81.2%
associate-/l*81.2%
cos-neg81.2%
distribute-lft-neg-out81.2%
distribute-frac-neg81.2%
distribute-frac-neg81.2%
distribute-lft-neg-out81.2%
cos-neg81.2%
associate-*l/81.0%
associate-/l*81.1%
Simplified81.1%
Taylor expanded in angle around 0 55.3%
unpow255.3%
Applied egg-rr55.3%
herbie shell --seed 2024141
(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)))