
(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 13 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}
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle_m))))
(+
(pow
(*
a
(fma
(sin (+ 1.0 t_0))
(sin 1.0)
(* (cos 1.0) (cos (+ 1.0 (* 0.005555555555555556 (* PI angle_m)))))))
2.0)
(pow (* b (sin t_0)) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle_m);
return pow((a * fma(sin((1.0 + t_0)), sin(1.0), (cos(1.0) * cos((1.0 + (0.005555555555555556 * (((double) M_PI) * angle_m))))))), 2.0) + pow((b * sin(t_0)), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(0.005555555555555556 * angle_m)) return Float64((Float64(a * fma(sin(Float64(1.0 + t_0)), sin(1.0), Float64(cos(1.0) * cos(Float64(1.0 + Float64(0.005555555555555556 * Float64(pi * angle_m))))))) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[(N[Sin[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[1.0], $MachinePrecision] + N[(N[Cos[1.0], $MachinePrecision] * N[Cos[N[(1.0 + N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\
{\left(a \cdot \mathsf{fma}\left(\sin \left(1 + t\_0\right), \sin 1, \cos 1 \cdot \cos \left(1 + 0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 80.2%
associate-*r/80.3%
metadata-eval80.3%
metadata-eval80.3%
distribute-neg-frac280.3%
distribute-frac-neg80.3%
distribute-rgt-neg-out80.3%
associate-/l*80.2%
neg-mul-180.2%
*-commutative80.2%
associate-/l*80.2%
metadata-eval80.2%
metadata-eval80.2%
Simplified80.2%
metadata-eval80.2%
div-inv80.2%
expm1-log1p-u66.0%
expm1-undefine66.0%
cos-diff66.0%
div-inv66.0%
metadata-eval66.0%
div-inv66.0%
metadata-eval66.0%
Applied egg-rr66.0%
+-commutative66.0%
fma-define66.0%
log1p-undefine66.0%
rem-exp-log66.0%
*-commutative66.0%
*-commutative66.0%
log1p-undefine66.0%
rem-exp-log80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in angle around inf 80.3%
Final simplification80.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.005555555555555556 (* PI angle_m)))))
(+
(pow (* b (sin (* PI (* 0.005555555555555556 angle_m)))) 2.0)
(pow (* a (+ (* (cos 1.0) (cos t_0)) (* (sin 1.0) (sin t_0)))) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = 1.0 + (0.005555555555555556 * (((double) M_PI) * angle_m));
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))), 2.0) + pow((a * ((cos(1.0) * cos(t_0)) + (sin(1.0) * sin(t_0)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = 1.0 + (0.005555555555555556 * (Math.PI * angle_m));
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle_m)))), 2.0) + Math.pow((a * ((Math.cos(1.0) * Math.cos(t_0)) + (Math.sin(1.0) * Math.sin(t_0)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = 1.0 + (0.005555555555555556 * (math.pi * angle_m)) return math.pow((b * math.sin((math.pi * (0.005555555555555556 * angle_m)))), 2.0) + math.pow((a * ((math.cos(1.0) * math.cos(t_0)) + (math.sin(1.0) * math.sin(t_0)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(1.0 + Float64(0.005555555555555556 * Float64(pi * angle_m))) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) ^ 2.0) + (Float64(a * Float64(Float64(cos(1.0) * cos(t_0)) + Float64(sin(1.0) * sin(t_0)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = 1.0 + (0.005555555555555556 * (pi * angle_m)); tmp = ((b * sin((pi * (0.005555555555555556 * angle_m)))) ^ 2.0) + ((a * ((cos(1.0) * cos(t_0)) + (sin(1.0) * sin(t_0)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(1.0 + N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[(N[(N[Cos[1.0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[1.0], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := 1 + 0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)}^{2} + {\left(a \cdot \left(\cos 1 \cdot \cos t\_0 + \sin 1 \cdot \sin t\_0\right)\right)}^{2}
\end{array}
\end{array}
Initial program 80.2%
associate-*r/80.3%
metadata-eval80.3%
metadata-eval80.3%
distribute-neg-frac280.3%
distribute-frac-neg80.3%
distribute-rgt-neg-out80.3%
associate-/l*80.2%
neg-mul-180.2%
*-commutative80.2%
associate-/l*80.2%
metadata-eval80.2%
metadata-eval80.2%
Simplified80.2%
metadata-eval80.2%
div-inv80.2%
expm1-log1p-u66.0%
expm1-undefine66.0%
cos-diff66.0%
div-inv66.0%
metadata-eval66.0%
div-inv66.0%
metadata-eval66.0%
Applied egg-rr66.0%
+-commutative66.0%
fma-define66.0%
log1p-undefine66.0%
rem-exp-log66.0%
*-commutative66.0%
*-commutative66.0%
log1p-undefine66.0%
rem-exp-log80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in angle around inf 80.3%
add-log-exp80.2%
Applied egg-rr80.2%
Taylor expanded in a around 0 80.2%
Final simplification80.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (cos (* PI (* 0.005555555555555556 angle_m)))) 2.0) (pow (* b (sin (/ (* PI angle_m) 180.0))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * cos((((double) M_PI) * (0.005555555555555556 * angle_m)))), 2.0) + pow((b * sin(((((double) M_PI) * angle_m) / 180.0))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.cos((Math.PI * (0.005555555555555556 * angle_m)))), 2.0) + Math.pow((b * Math.sin(((Math.PI * angle_m) / 180.0))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.cos((math.pi * (0.005555555555555556 * angle_m)))), 2.0) + math.pow((b * math.sin(((math.pi * angle_m) / 180.0))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * cos(Float64(pi * Float64(0.005555555555555556 * angle_m)))) ^ 2.0) + (Float64(b * sin(Float64(Float64(pi * angle_m) / 180.0))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * cos((pi * (0.005555555555555556 * angle_m)))) ^ 2.0) + ((b * sin(((pi * angle_m) / 180.0))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi * angle$95$m), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi \cdot angle\_m}{180}\right)\right)}^{2}
\end{array}
Initial program 80.2%
associate-*r/80.3%
metadata-eval80.3%
metadata-eval80.3%
distribute-neg-frac280.3%
distribute-frac-neg80.3%
distribute-rgt-neg-out80.3%
associate-/l*80.2%
neg-mul-180.2%
*-commutative80.2%
associate-/l*80.2%
metadata-eval80.2%
metadata-eval80.2%
Simplified80.2%
metadata-eval80.2%
div-inv80.2%
associate-*r/80.3%
Applied egg-rr80.3%
Final simplification80.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (cos (* PI (* 0.005555555555555556 angle_m)))) 2.0) (pow (* b (sin (/ PI (/ 180.0 angle_m)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * cos((((double) M_PI) * (0.005555555555555556 * angle_m)))), 2.0) + pow((b * sin((((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.cos((Math.PI * (0.005555555555555556 * angle_m)))), 2.0) + Math.pow((b * Math.sin((Math.PI / (180.0 / angle_m)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.cos((math.pi * (0.005555555555555556 * angle_m)))), 2.0) + math.pow((b * math.sin((math.pi / (180.0 / angle_m)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * cos(Float64(pi * Float64(0.005555555555555556 * angle_m)))) ^ 2.0) + (Float64(b * sin(Float64(pi / Float64(180.0 / angle_m)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * cos((pi * (0.005555555555555556 * angle_m)))) ^ 2.0) + ((b * sin((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[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[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 \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle\_m}}\right)\right)}^{2}
\end{array}
Initial program 80.2%
associate-*r/80.3%
metadata-eval80.3%
metadata-eval80.3%
distribute-neg-frac280.3%
distribute-frac-neg80.3%
distribute-rgt-neg-out80.3%
associate-/l*80.2%
neg-mul-180.2%
*-commutative80.2%
associate-/l*80.2%
metadata-eval80.2%
metadata-eval80.2%
Simplified80.2%
metadata-eval80.2%
div-inv80.2%
clear-num80.2%
un-div-inv80.2%
Applied egg-rr80.2%
Final simplification80.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* PI (* 0.005555555555555556 angle_m)))) (+ (pow (* b (sin t_0)) 2.0) (pow (* a (cos t_0)) 2.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle_m);
return pow((b * sin(t_0)), 2.0) + pow((a * cos(t_0)), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.PI * (0.005555555555555556 * angle_m);
return Math.pow((b * Math.sin(t_0)), 2.0) + Math.pow((a * Math.cos(t_0)), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pi * (0.005555555555555556 * angle_m) return math.pow((b * math.sin(t_0)), 2.0) + math.pow((a * math.cos(t_0)), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(0.005555555555555556 * angle_m)) return Float64((Float64(b * sin(t_0)) ^ 2.0) + (Float64(a * cos(t_0)) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = pi * (0.005555555555555556 * angle_m); tmp = ((b * sin(t_0)) ^ 2.0) + ((a * cos(t_0)) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $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}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\
{\left(b \cdot \sin t\_0\right)}^{2} + {\left(a \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 80.2%
associate-*r/80.3%
metadata-eval80.3%
metadata-eval80.3%
distribute-neg-frac280.3%
distribute-frac-neg80.3%
distribute-rgt-neg-out80.3%
associate-/l*80.2%
neg-mul-180.2%
*-commutative80.2%
associate-/l*80.2%
metadata-eval80.2%
metadata-eval80.2%
Simplified80.2%
Final simplification80.2%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle_m))) (t_1 (cos t_0)))
(if (<= angle_m 410000.0)
(+ (* a (* t_1 (* a t_1))) (pow (* t_0 b) 2.0))
(+
(pow a 2.0)
(cbrt (pow (* b (sin (* 0.005555555555555556 (* PI angle_m)))) 6.0))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle_m);
double t_1 = cos(t_0);
double tmp;
if (angle_m <= 410000.0) {
tmp = (a * (t_1 * (a * t_1))) + pow((t_0 * b), 2.0);
} else {
tmp = pow(a, 2.0) + cbrt(pow((b * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))), 6.0));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.PI * (0.005555555555555556 * angle_m);
double t_1 = Math.cos(t_0);
double tmp;
if (angle_m <= 410000.0) {
tmp = (a * (t_1 * (a * t_1))) + Math.pow((t_0 * b), 2.0);
} else {
tmp = Math.pow(a, 2.0) + Math.cbrt(Math.pow((b * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))), 6.0));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(0.005555555555555556 * angle_m)) t_1 = cos(t_0) tmp = 0.0 if (angle_m <= 410000.0) tmp = Float64(Float64(a * Float64(t_1 * Float64(a * t_1))) + (Float64(t_0 * b) ^ 2.0)); else tmp = Float64((a ^ 2.0) + cbrt((Float64(b * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))) ^ 6.0))); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[angle$95$m, 410000.0], N[(N[(a * N[(t$95$1 * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[(t$95$0 * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 6.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\
t_1 := \cos t\_0\\
\mathbf{if}\;angle\_m \leq 410000:\\
\;\;\;\;a \cdot \left(t\_1 \cdot \left(a \cdot t\_1\right)\right) + {\left(t\_0 \cdot b\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + \sqrt[3]{{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{6}}\\
\end{array}
\end{array}
if angle < 4.1e5Initial program 86.2%
associate-*r/86.2%
metadata-eval86.2%
metadata-eval86.2%
distribute-neg-frac286.2%
distribute-frac-neg86.2%
distribute-rgt-neg-out86.2%
associate-/l*86.2%
neg-mul-186.2%
*-commutative86.2%
associate-/l*86.2%
metadata-eval86.2%
metadata-eval86.2%
Simplified86.2%
unpow-prod-down86.2%
metadata-eval86.2%
div-inv86.2%
unpow-prod-down86.2%
unpow286.2%
*-commutative86.2%
associate-*r*86.2%
Applied egg-rr86.2%
Taylor expanded in angle around 0 82.2%
associate-*r*82.2%
*-commutative82.2%
*-commutative82.2%
*-commutative82.2%
Simplified82.2%
if 4.1e5 < angle Initial program 60.7%
add-sqr-sqrt60.5%
pow260.5%
Applied egg-rr60.5%
div-inv60.6%
metadata-eval60.6%
unpow260.6%
add-sqr-sqrt60.7%
add-cbrt-cube58.2%
pow358.2%
pow-pow58.2%
associate-*r*58.1%
*-commutative58.1%
*-commutative58.1%
metadata-eval58.1%
Applied egg-rr58.1%
*-commutative58.1%
Simplified58.1%
Taylor expanded in angle around 0 58.7%
Final simplification76.7%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle_m))) (t_1 (cos t_0)))
(if (<= a 7e-146)
(pow (* b (sin (* angle_m (* PI 0.005555555555555556)))) 2.0)
(+ (* a (* t_1 (* a t_1))) (pow (* t_0 b) 2.0)))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle_m);
double t_1 = cos(t_0);
double tmp;
if (a <= 7e-146) {
tmp = pow((b * sin((angle_m * (((double) M_PI) * 0.005555555555555556)))), 2.0);
} else {
tmp = (a * (t_1 * (a * t_1))) + pow((t_0 * b), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.PI * (0.005555555555555556 * angle_m);
double t_1 = Math.cos(t_0);
double tmp;
if (a <= 7e-146) {
tmp = Math.pow((b * Math.sin((angle_m * (Math.PI * 0.005555555555555556)))), 2.0);
} else {
tmp = (a * (t_1 * (a * t_1))) + Math.pow((t_0 * b), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pi * (0.005555555555555556 * angle_m) t_1 = math.cos(t_0) tmp = 0 if a <= 7e-146: tmp = math.pow((b * math.sin((angle_m * (math.pi * 0.005555555555555556)))), 2.0) else: tmp = (a * (t_1 * (a * t_1))) + math.pow((t_0 * b), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(0.005555555555555556 * angle_m)) t_1 = cos(t_0) tmp = 0.0 if (a <= 7e-146) tmp = Float64(b * sin(Float64(angle_m * Float64(pi * 0.005555555555555556)))) ^ 2.0; else tmp = Float64(Float64(a * Float64(t_1 * Float64(a * t_1))) + (Float64(t_0 * b) ^ 2.0)); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = pi * (0.005555555555555556 * angle_m); t_1 = cos(t_0); tmp = 0.0; if (a <= 7e-146) tmp = (b * sin((angle_m * (pi * 0.005555555555555556)))) ^ 2.0; else tmp = (a * (t_1 * (a * t_1))) + ((t_0 * b) ^ 2.0); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[t$95$0], $MachinePrecision]}, If[LessEqual[a, 7e-146], N[Power[N[(b * N[Sin[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(a * N[(t$95$1 * N[(a * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[(t$95$0 * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\\
t_1 := \cos t\_0\\
\mathbf{if}\;a \leq 7 \cdot 10^{-146}:\\
\;\;\;\;{\left(b \cdot \sin \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t\_1 \cdot \left(a \cdot t\_1\right)\right) + {\left(t\_0 \cdot b\right)}^{2}\\
\end{array}
\end{array}
if a < 7.0000000000000003e-146Initial program 77.9%
associate-*r/78.0%
metadata-eval78.0%
metadata-eval78.0%
distribute-neg-frac278.0%
distribute-frac-neg78.0%
distribute-rgt-neg-out78.0%
associate-/l*77.9%
neg-mul-177.9%
*-commutative77.9%
associate-/l*77.9%
metadata-eval77.9%
metadata-eval77.9%
Simplified77.9%
unpow-prod-down77.9%
metadata-eval77.9%
div-inv77.9%
unpow-prod-down77.9%
unpow277.9%
*-commutative77.9%
associate-*r*77.9%
Applied egg-rr77.9%
Taylor expanded in a around 0 41.2%
*-commutative41.2%
associate-*r*41.3%
*-commutative41.3%
unpow241.3%
unpow241.3%
swap-sqr46.2%
unpow246.2%
*-commutative46.2%
associate-*r*46.2%
*-commutative46.2%
*-commutative46.2%
*-commutative46.2%
Simplified46.2%
if 7.0000000000000003e-146 < a Initial program 84.3%
associate-*r/84.2%
metadata-eval84.2%
metadata-eval84.2%
distribute-neg-frac284.2%
distribute-frac-neg84.2%
distribute-rgt-neg-out84.2%
associate-/l*84.3%
neg-mul-184.3%
*-commutative84.3%
associate-/l*84.3%
metadata-eval84.3%
metadata-eval84.3%
Simplified84.3%
unpow-prod-down84.3%
metadata-eval84.3%
div-inv84.3%
unpow-prod-down84.3%
unpow284.3%
*-commutative84.3%
associate-*r*84.3%
Applied egg-rr84.3%
Taylor expanded in angle around 0 83.1%
associate-*r*83.1%
*-commutative83.1%
*-commutative83.1%
*-commutative83.1%
Simplified83.1%
Final simplification59.6%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 1.1e+144) (pow (* a (cos (* angle_m (* PI 0.005555555555555556)))) 2.0) (pow (* b (sin (* 0.005555555555555556 (* PI angle_m)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.1e+144) {
tmp = pow((a * cos((angle_m * (((double) M_PI) * 0.005555555555555556)))), 2.0);
} else {
tmp = pow((b * sin((0.005555555555555556 * (((double) M_PI) * angle_m)))), 2.0);
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.1e+144) {
tmp = Math.pow((a * Math.cos((angle_m * (Math.PI * 0.005555555555555556)))), 2.0);
} else {
tmp = Math.pow((b * Math.sin((0.005555555555555556 * (Math.PI * angle_m)))), 2.0);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 1.1e+144: tmp = math.pow((a * math.cos((angle_m * (math.pi * 0.005555555555555556)))), 2.0) else: tmp = math.pow((b * math.sin((0.005555555555555556 * (math.pi * angle_m)))), 2.0) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.1e+144) tmp = Float64(a * cos(Float64(angle_m * Float64(pi * 0.005555555555555556)))) ^ 2.0; else tmp = Float64(b * sin(Float64(0.005555555555555556 * Float64(pi * angle_m)))) ^ 2.0; end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 1.1e+144) tmp = (a * cos((angle_m * (pi * 0.005555555555555556)))) ^ 2.0; else tmp = (b * sin((0.005555555555555556 * (pi * angle_m)))) ^ 2.0; end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.1e+144], N[Power[N[(a * N[Cos[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{+144}:\\
\;\;\;\;{\left(a \cdot \cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if b < 1.09999999999999994e144Initial program 77.5%
associate-*r/77.6%
metadata-eval77.6%
metadata-eval77.6%
distribute-neg-frac277.6%
distribute-frac-neg77.6%
distribute-rgt-neg-out77.6%
associate-/l*77.5%
neg-mul-177.5%
*-commutative77.5%
associate-/l*77.5%
metadata-eval77.5%
metadata-eval77.5%
Simplified77.5%
unpow-prod-down77.5%
metadata-eval77.5%
div-inv77.5%
unpow-prod-down77.5%
unpow277.5%
*-commutative77.5%
associate-*r*77.5%
Applied egg-rr77.5%
Taylor expanded in a around inf 65.0%
unpow265.0%
associate-*r*65.0%
*-commutative65.0%
unpow265.0%
swap-sqr65.0%
unpow265.0%
associate-*r*65.1%
*-commutative65.1%
*-commutative65.1%
*-commutative65.1%
Simplified65.1%
if 1.09999999999999994e144 < b Initial program 99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-neg-frac299.8%
distribute-frac-neg99.8%
distribute-rgt-neg-out99.8%
associate-/l*99.8%
neg-mul-199.8%
*-commutative99.8%
associate-/l*99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around 0 71.4%
*-commutative71.4%
associate-*r*71.4%
*-commutative71.4%
*-commutative71.4%
unpow271.4%
unpow271.4%
swap-sqr78.3%
unpow278.3%
*-commutative78.3%
*-commutative78.3%
*-commutative78.3%
associate-*r*78.2%
Simplified78.2%
Final simplification66.7%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 9.2e+153) (pow (* a (cos (* angle_m (* PI 0.005555555555555556)))) 2.0) (cbrt (pow a 6.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 9.2e+153) {
tmp = pow((a * cos((angle_m * (((double) M_PI) * 0.005555555555555556)))), 2.0);
} else {
tmp = cbrt(pow(a, 6.0));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 9.2e+153) {
tmp = Math.pow((a * Math.cos((angle_m * (Math.PI * 0.005555555555555556)))), 2.0);
} else {
tmp = Math.cbrt(Math.pow(a, 6.0));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 9.2e+153) tmp = Float64(a * cos(Float64(angle_m * Float64(pi * 0.005555555555555556)))) ^ 2.0; else tmp = cbrt((a ^ 6.0)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 9.2e+153], N[Power[N[(a * N[Cos[N[(angle$95$m * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9.2 \cdot 10^{+153}:\\
\;\;\;\;{\left(a \cdot \cos \left(angle\_m \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{a}^{6}}\\
\end{array}
\end{array}
if b < 9.2000000000000005e153Initial program 77.7%
associate-*r/77.7%
metadata-eval77.7%
metadata-eval77.7%
distribute-neg-frac277.7%
distribute-frac-neg77.7%
distribute-rgt-neg-out77.7%
associate-/l*77.7%
neg-mul-177.7%
*-commutative77.7%
associate-/l*77.7%
metadata-eval77.7%
metadata-eval77.7%
Simplified77.7%
unpow-prod-down77.7%
metadata-eval77.7%
div-inv77.7%
unpow-prod-down77.7%
unpow277.7%
*-commutative77.7%
associate-*r*77.7%
Applied egg-rr77.7%
Taylor expanded in a around inf 64.9%
unpow264.9%
associate-*r*64.9%
*-commutative64.9%
unpow264.9%
swap-sqr64.9%
unpow264.9%
associate-*r*64.9%
*-commutative64.9%
*-commutative64.9%
*-commutative64.9%
Simplified64.9%
if 9.2000000000000005e153 < b Initial program 99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
distribute-rgt-neg-out99.9%
associate-/l*99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in angle around 0 43.1%
unpow243.1%
Applied egg-rr43.1%
add-cbrt-cube49.5%
pow1/349.5%
unswap-sqr49.5%
pow349.5%
metadata-eval49.5%
pow349.5%
metadata-eval49.5%
sqr-pow49.5%
Applied egg-rr49.5%
unpow1/349.5%
Simplified49.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 9.2e+153) (pow (* a (cos (* 0.005555555555555556 (* PI angle_m)))) 2.0) (cbrt (pow a 6.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 9.2e+153) {
tmp = pow((a * cos((0.005555555555555556 * (((double) M_PI) * angle_m)))), 2.0);
} else {
tmp = cbrt(pow(a, 6.0));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 9.2e+153) {
tmp = Math.pow((a * Math.cos((0.005555555555555556 * (Math.PI * angle_m)))), 2.0);
} else {
tmp = Math.cbrt(Math.pow(a, 6.0));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 9.2e+153) tmp = Float64(a * cos(Float64(0.005555555555555556 * Float64(pi * angle_m)))) ^ 2.0; else tmp = cbrt((a ^ 6.0)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 9.2e+153], N[Power[N[(a * N[Cos[N[(0.005555555555555556 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9.2 \cdot 10^{+153}:\\
\;\;\;\;{\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\_m\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{a}^{6}}\\
\end{array}
\end{array}
if b < 9.2000000000000005e153Initial program 77.7%
associate-*r/77.7%
metadata-eval77.7%
metadata-eval77.7%
distribute-neg-frac277.7%
distribute-frac-neg77.7%
distribute-rgt-neg-out77.7%
associate-/l*77.7%
neg-mul-177.7%
*-commutative77.7%
associate-/l*77.7%
metadata-eval77.7%
metadata-eval77.7%
Simplified77.7%
Taylor expanded in a around inf 64.9%
*-commutative64.9%
associate-*r*64.9%
*-commutative64.9%
*-commutative64.9%
unpow264.9%
unpow264.9%
swap-sqr64.9%
unpow264.9%
*-commutative64.9%
*-commutative64.9%
associate-*r*64.9%
*-commutative64.9%
Simplified64.9%
if 9.2000000000000005e153 < b Initial program 99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
distribute-rgt-neg-out99.9%
associate-/l*99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in angle around 0 43.1%
unpow243.1%
Applied egg-rr43.1%
add-cbrt-cube49.5%
pow1/349.5%
unswap-sqr49.5%
pow349.5%
metadata-eval49.5%
pow349.5%
metadata-eval49.5%
sqr-pow49.5%
Applied egg-rr49.5%
unpow1/349.5%
Simplified49.5%
Final simplification63.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 1.22e+157) (* a a) (pow (pow a 6.0) 0.3333333333333333)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.22e+157) {
tmp = a * a;
} else {
tmp = pow(pow(a, 6.0), 0.3333333333333333);
}
return tmp;
}
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
real(8) :: tmp
if (b <= 1.22d+157) then
tmp = a * a
else
tmp = (a ** 6.0d0) ** 0.3333333333333333d0
end if
code = tmp
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.22e+157) {
tmp = a * a;
} else {
tmp = Math.pow(Math.pow(a, 6.0), 0.3333333333333333);
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 1.22e+157: tmp = a * a else: tmp = math.pow(math.pow(a, 6.0), 0.3333333333333333) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.22e+157) tmp = Float64(a * a); else tmp = (a ^ 6.0) ^ 0.3333333333333333; end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 1.22e+157) tmp = a * a; else tmp = (a ^ 6.0) ^ 0.3333333333333333; end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.22e+157], N[(a * a), $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.22 \cdot 10^{+157}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;{\left({a}^{6}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if b < 1.22e157Initial program 77.7%
associate-*r/77.7%
metadata-eval77.7%
metadata-eval77.7%
distribute-neg-frac277.7%
distribute-frac-neg77.7%
distribute-rgt-neg-out77.7%
associate-/l*77.7%
neg-mul-177.7%
*-commutative77.7%
associate-/l*77.7%
metadata-eval77.7%
metadata-eval77.7%
Simplified77.7%
Taylor expanded in angle around 0 64.8%
unpow264.8%
Applied egg-rr64.8%
if 1.22e157 < b Initial program 99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
distribute-rgt-neg-out99.9%
associate-/l*99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in angle around 0 43.1%
unpow243.1%
Applied egg-rr43.1%
add-cbrt-cube49.5%
pow1/349.5%
unswap-sqr49.5%
pow349.5%
metadata-eval49.5%
pow349.5%
metadata-eval49.5%
sqr-pow49.5%
Applied egg-rr49.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 4.9e+153) (* a a) (cbrt (pow a 6.0))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 4.9e+153) {
tmp = a * a;
} else {
tmp = cbrt(pow(a, 6.0));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 4.9e+153) {
tmp = a * a;
} else {
tmp = Math.cbrt(Math.pow(a, 6.0));
}
return tmp;
}
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 4.9e+153) tmp = Float64(a * a); else tmp = cbrt((a ^ 6.0)); end return tmp end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 4.9e+153], N[(a * a), $MachinePrecision], N[Power[N[Power[a, 6.0], $MachinePrecision], 1/3], $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.9 \cdot 10^{+153}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{a}^{6}}\\
\end{array}
\end{array}
if b < 4.90000000000000002e153Initial program 77.7%
associate-*r/77.7%
metadata-eval77.7%
metadata-eval77.7%
distribute-neg-frac277.7%
distribute-frac-neg77.7%
distribute-rgt-neg-out77.7%
associate-/l*77.7%
neg-mul-177.7%
*-commutative77.7%
associate-/l*77.7%
metadata-eval77.7%
metadata-eval77.7%
Simplified77.7%
Taylor expanded in angle around 0 64.8%
unpow264.8%
Applied egg-rr64.8%
if 4.90000000000000002e153 < b Initial program 99.9%
associate-*r/99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-neg-frac299.9%
distribute-frac-neg99.9%
distribute-rgt-neg-out99.9%
associate-/l*99.9%
neg-mul-199.9%
*-commutative99.9%
associate-/l*99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in angle around 0 43.1%
unpow243.1%
Applied egg-rr43.1%
add-cbrt-cube49.5%
pow1/349.5%
unswap-sqr49.5%
pow349.5%
metadata-eval49.5%
pow349.5%
metadata-eval49.5%
sqr-pow49.5%
Applied egg-rr49.5%
unpow1/349.5%
Simplified49.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (* a a))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return a * a;
}
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 = a * a
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return a * a;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return a * a
angle_m = abs(angle) function code(a, b, angle_m) return Float64(a * a) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = a * a; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
a \cdot a
\end{array}
Initial program 80.2%
associate-*r/80.3%
metadata-eval80.3%
metadata-eval80.3%
distribute-neg-frac280.3%
distribute-frac-neg80.3%
distribute-rgt-neg-out80.3%
associate-/l*80.2%
neg-mul-180.2%
*-commutative80.2%
associate-/l*80.2%
metadata-eval80.2%
metadata-eval80.2%
Simplified80.2%
Taylor expanded in angle around 0 62.4%
unpow262.4%
Applied egg-rr62.4%
herbie shell --seed 2024139
(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)))