
(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 16 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 (+ 1.0 (* 0.005555555555555556 (* angle_m PI)))))
(+
(pow
(* a (fma (sqrt (pow (sin t_0) 2.0)) (sin 1.0) (* (cos 1.0) (cos t_0))))
2.0)
(pow (* b (sin (* PI (* 0.005555555555555556 angle_m)))) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = 1.0 + (0.005555555555555556 * (angle_m * ((double) M_PI)));
return pow((a * fma(sqrt(pow(sin(t_0), 2.0)), sin(1.0), (cos(1.0) * cos(t_0)))), 2.0) + pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(1.0 + Float64(0.005555555555555556 * Float64(angle_m * pi))) return Float64((Float64(a * fma(sqrt((sin(t_0) ^ 2.0)), sin(1.0), Float64(cos(1.0) * cos(t_0)))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) ^ 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[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[(N[Sqrt[N[Power[N[Sin[t$95$0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] * N[Sin[1.0], $MachinePrecision] + N[(N[Cos[1.0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $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(angle\_m \cdot \pi\right)\\
{\left(a \cdot \mathsf{fma}\left(\sqrt{{\sin t\_0}^{2}}, \sin 1, \cos 1 \cdot \cos t\_0\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)}^{2}
\end{array}
\end{array}
Initial program 75.2%
Simplified75.1%
metadata-eval75.1%
div-inv75.2%
expm1-log1p-u59.8%
expm1-undefine59.8%
cos-diff59.7%
*-commutative59.7%
div-inv59.7%
metadata-eval59.7%
associate-*l*59.7%
Applied egg-rr59.7%
+-commutative59.7%
fma-define59.7%
log1p-undefine59.7%
rem-exp-log59.8%
associate-*r*59.8%
*-commutative59.8%
associate-*r*59.8%
*-commutative59.8%
log1p-undefine59.8%
rem-exp-log75.3%
associate-*r*75.3%
*-commutative75.3%
associate-*r*75.3%
Simplified75.3%
add-sqr-sqrt57.6%
sqrt-unprod75.3%
pow275.3%
+-commutative75.3%
fma-define75.3%
Applied egg-rr75.3%
Taylor expanded in angle around inf 75.3%
Final simplification75.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (fma PI (* 0.005555555555555556 angle_m) 1.0)))
(+
(pow (* b (sin (* PI (* 0.005555555555555556 angle_m)))) 2.0)
(pow (* a (fma (sin t_0) (sin 1.0) (* (cos 1.0) (cos t_0)))) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = fma(((double) M_PI), (0.005555555555555556 * angle_m), 1.0);
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))), 2.0) + pow((a * fma(sin(t_0), sin(1.0), (cos(1.0) * cos(t_0)))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = fma(pi, Float64(0.005555555555555556 * angle_m), 1.0) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) ^ 2.0) + (Float64(a * fma(sin(t_0), sin(1.0), Float64(cos(1.0) * 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] + 1.0), $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[Sin[t$95$0], $MachinePrecision] * N[Sin[1.0], $MachinePrecision] + N[(N[Cos[1.0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\pi, 0.005555555555555556 \cdot angle\_m, 1\right)\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)}^{2} + {\left(a \cdot \mathsf{fma}\left(\sin t\_0, \sin 1, \cos 1 \cdot \cos t\_0\right)\right)}^{2}
\end{array}
\end{array}
Initial program 75.2%
Simplified75.1%
metadata-eval75.1%
div-inv75.2%
expm1-log1p-u59.8%
expm1-undefine59.8%
cos-diff59.7%
*-commutative59.7%
div-inv59.7%
metadata-eval59.7%
associate-*l*59.7%
Applied egg-rr59.7%
+-commutative59.7%
fma-define59.7%
log1p-undefine59.7%
rem-exp-log59.8%
associate-*r*59.8%
*-commutative59.8%
associate-*r*59.8%
*-commutative59.8%
log1p-undefine59.8%
rem-exp-log75.3%
associate-*r*75.3%
*-commutative75.3%
associate-*r*75.3%
Simplified75.3%
*-un-lft-identity75.3%
+-commutative75.3%
fma-define75.3%
Applied egg-rr75.3%
*-lft-identity75.3%
fma-undefine75.3%
associate-*r*75.3%
*-commutative75.3%
fma-define75.3%
*-commutative75.3%
Simplified75.3%
*-un-lft-identity75.3%
+-commutative75.3%
fma-define75.3%
Applied egg-rr75.3%
*-lft-identity75.3%
fma-undefine75.3%
associate-*r*75.4%
*-commutative75.4%
fma-define75.4%
*-commutative75.4%
Simplified75.4%
Final simplification75.4%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow (* b (sin (* PI (* 0.005555555555555556 angle_m)))) 2.0)
(pow
(*
a
(fma
(sin (fma PI (* 0.005555555555555556 angle_m) 1.0))
(sin 1.0)
(* (cos 1.0) (cos (+ 1.0 (* 0.005555555555555556 (* angle_m PI)))))))
2.0)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))), 2.0) + pow((a * fma(sin(fma(((double) M_PI), (0.005555555555555556 * angle_m), 1.0)), sin(1.0), (cos(1.0) * cos((1.0 + (0.005555555555555556 * (angle_m * ((double) M_PI)))))))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) ^ 2.0) + (Float64(a * fma(sin(fma(pi, Float64(0.005555555555555556 * angle_m), 1.0)), sin(1.0), Float64(cos(1.0) * cos(Float64(1.0 + Float64(0.005555555555555556 * Float64(angle_m * pi))))))) ^ 2.0)) end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := 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[Sin[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] * N[Sin[1.0], $MachinePrecision] + N[(N[Cos[1.0], $MachinePrecision] * N[Cos[N[(1.0 + N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)}^{2} + {\left(a \cdot \mathsf{fma}\left(\sin \left(\mathsf{fma}\left(\pi, 0.005555555555555556 \cdot angle\_m, 1\right)\right), \sin 1, \cos 1 \cdot \cos \left(1 + 0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)\right)}^{2}
\end{array}
Initial program 75.2%
Simplified75.1%
metadata-eval75.1%
div-inv75.2%
expm1-log1p-u59.8%
expm1-undefine59.8%
cos-diff59.7%
*-commutative59.7%
div-inv59.7%
metadata-eval59.7%
associate-*l*59.7%
Applied egg-rr59.7%
+-commutative59.7%
fma-define59.7%
log1p-undefine59.7%
rem-exp-log59.8%
associate-*r*59.8%
*-commutative59.8%
associate-*r*59.8%
*-commutative59.8%
log1p-undefine59.8%
rem-exp-log75.3%
associate-*r*75.3%
*-commutative75.3%
associate-*r*75.3%
Simplified75.3%
*-un-lft-identity75.3%
+-commutative75.3%
fma-define75.3%
Applied egg-rr75.3%
*-lft-identity75.3%
fma-undefine75.3%
associate-*r*75.3%
*-commutative75.3%
fma-define75.3%
*-commutative75.3%
Simplified75.3%
Final simplification75.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (+ 1.0 (* 0.005555555555555556 (* angle_m PI)))))
(+
(pow (* b (sin (* PI (* 0.005555555555555556 angle_m)))) 2.0)
(pow (* a (fma (sin t_0) (sin 1.0) (* (cos 1.0) (cos t_0)))) 2.0))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = 1.0 + (0.005555555555555556 * (angle_m * ((double) M_PI)));
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))), 2.0) + pow((a * fma(sin(t_0), sin(1.0), (cos(1.0) * cos(t_0)))), 2.0);
}
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(1.0 + Float64(0.005555555555555556 * Float64(angle_m * pi))) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) ^ 2.0) + (Float64(a * fma(sin(t_0), sin(1.0), Float64(cos(1.0) * cos(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[(angle$95$m * Pi), $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[Sin[t$95$0], $MachinePrecision] * N[Sin[1.0], $MachinePrecision] + N[(N[Cos[1.0], $MachinePrecision] * N[Cos[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(angle\_m \cdot \pi\right)\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)}^{2} + {\left(a \cdot \mathsf{fma}\left(\sin t\_0, \sin 1, \cos 1 \cdot \cos t\_0\right)\right)}^{2}
\end{array}
\end{array}
Initial program 75.2%
Simplified75.1%
metadata-eval75.1%
div-inv75.2%
expm1-log1p-u59.8%
expm1-undefine59.8%
cos-diff59.7%
*-commutative59.7%
div-inv59.7%
metadata-eval59.7%
associate-*l*59.7%
Applied egg-rr59.7%
+-commutative59.7%
fma-define59.7%
log1p-undefine59.7%
rem-exp-log59.8%
associate-*r*59.8%
*-commutative59.8%
associate-*r*59.8%
*-commutative59.8%
log1p-undefine59.8%
rem-exp-log75.3%
associate-*r*75.3%
*-commutative75.3%
associate-*r*75.3%
Simplified75.3%
Final simplification75.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (* PI (* 0.005555555555555556 angle_m)))) 2.0) (pow (* a (cos (* PI (pow (sqrt (* 0.005555555555555556 angle_m)) 2.0)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))), 2.0) + pow((a * cos((((double) M_PI) * pow(sqrt((0.005555555555555556 * angle_m)), 2.0)))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle_m)))), 2.0) + Math.pow((a * Math.cos((Math.PI * Math.pow(Math.sqrt((0.005555555555555556 * angle_m)), 2.0)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((math.pi * (0.005555555555555556 * angle_m)))), 2.0) + math.pow((a * math.cos((math.pi * math.pow(math.sqrt((0.005555555555555556 * angle_m)), 2.0)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) ^ 2.0) + (Float64(a * cos(Float64(pi * (sqrt(Float64(0.005555555555555556 * angle_m)) ^ 2.0)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin((pi * (0.005555555555555556 * angle_m)))) ^ 2.0) + ((a * cos((pi * (sqrt((0.005555555555555556 * angle_m)) ^ 2.0)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := 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[Cos[N[(Pi * N[Power[N[Sqrt[N[(0.005555555555555556 * angle$95$m), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(\pi \cdot {\left(\sqrt{0.005555555555555556 \cdot angle\_m}\right)}^{2}\right)\right)}^{2}
\end{array}
Initial program 75.2%
Simplified75.1%
metadata-eval75.1%
div-inv75.2%
add-sqr-sqrt36.0%
pow236.0%
div-inv36.0%
metadata-eval36.0%
Applied egg-rr36.0%
Final simplification36.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (* PI (* 0.005555555555555556 angle_m)))) 2.0) (pow (* a (cos (* PI (exp (log (* 0.005555555555555556 angle_m)))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))), 2.0) + pow((a * cos((((double) M_PI) * exp(log((0.005555555555555556 * angle_m)))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle_m)))), 2.0) + Math.pow((a * Math.cos((Math.PI * Math.exp(Math.log((0.005555555555555556 * angle_m)))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((math.pi * (0.005555555555555556 * angle_m)))), 2.0) + math.pow((a * math.cos((math.pi * math.exp(math.log((0.005555555555555556 * angle_m)))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) ^ 2.0) + (Float64(a * cos(Float64(pi * exp(log(Float64(0.005555555555555556 * angle_m)))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin((pi * (0.005555555555555556 * angle_m)))) ^ 2.0) + ((a * cos((pi * exp(log((0.005555555555555556 * angle_m)))))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := 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[Cos[N[(Pi * N[Exp[N[Log[N[(0.005555555555555556 * angle$95$m), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(\pi \cdot e^{\log \left(0.005555555555555556 \cdot angle\_m\right)}\right)\right)}^{2}
\end{array}
Initial program 75.2%
Simplified75.1%
add-exp-log36.0%
Applied egg-rr36.0%
Final simplification36.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (* PI (* 0.005555555555555556 angle_m)))) 2.0) (pow (* a (cos (* 0.005555555555555556 (* angle_m PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) * (0.005555555555555556 * angle_m)))), 2.0) + pow((a * cos((0.005555555555555556 * (angle_m * ((double) M_PI))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI * (0.005555555555555556 * angle_m)))), 2.0) + Math.pow((a * Math.cos((0.005555555555555556 * (angle_m * Math.PI)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((math.pi * (0.005555555555555556 * angle_m)))), 2.0) + math.pow((a * math.cos((0.005555555555555556 * (angle_m * math.pi)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi * Float64(0.005555555555555556 * angle_m)))) ^ 2.0) + (Float64(a * cos(Float64(0.005555555555555556 * Float64(angle_m * pi)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin((pi * (0.005555555555555556 * angle_m)))) ^ 2.0) + ((a * cos((0.005555555555555556 * (angle_m * pi)))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := 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[Cos[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 75.2%
Simplified75.1%
Taylor expanded in angle around inf 75.1%
Final simplification75.1%
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 75.2%
Simplified75.1%
Final simplification75.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (cos (* PI (/ angle_m 180.0)))) 2.0) (pow (* b (sin (* 0.005555555555555556 (* angle_m PI)))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * cos((((double) M_PI) * (angle_m / 180.0)))), 2.0) + pow((b * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.cos((Math.PI * (angle_m / 180.0)))), 2.0) + Math.pow((b * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.cos((math.pi * (angle_m / 180.0)))), 2.0) + math.pow((b * math.sin((0.005555555555555556 * (angle_m * math.pi)))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * cos(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * cos((pi * (angle_m / 180.0)))) ^ 2.0) + ((b * sin((0.005555555555555556 * (angle_m * pi)))) ^ 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[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 75.2%
Taylor expanded in b around 0 67.1%
*-commutative67.1%
associate-*r*67.1%
*-commutative67.1%
associate-*r*67.1%
unpow267.1%
unpow267.1%
swap-sqr75.2%
unpow275.2%
*-commutative75.2%
associate-*r*75.2%
*-commutative75.2%
associate-*r*75.2%
Simplified75.2%
Final simplification75.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (let* ((t_0 (* PI (/ angle_m 180.0)))) (+ (pow (* a (cos t_0)) 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) * (angle_m / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(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 * (angle_m / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pi * (angle_m / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) t_0 = pi * (angle_m / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((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[(angle$95$m / 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}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
Initial program 75.2%
Final simplification75.2%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (* 0.005555555555555556 (* angle_m PI)))) 2.0) (pow a 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((0.005555555555555556 * (angle_m * ((double) M_PI))))), 2.0) + pow(a, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((0.005555555555555556 * (angle_m * Math.PI)))), 2.0) + Math.pow(a, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((0.005555555555555556 * (angle_m * math.pi)))), 2.0) + math.pow(a, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(0.005555555555555556 * Float64(angle_m * pi)))) ^ 2.0) + (a ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin((0.005555555555555556 * (angle_m * pi)))) ^ 2.0) + (a ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle\_m \cdot \pi\right)\right)\right)}^{2} + {a}^{2}
\end{array}
Initial program 75.2%
Simplified75.1%
Taylor expanded in angle around 0 75.1%
Taylor expanded in angle around inf 75.1%
Final simplification75.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* b (sin (* PI (/ angle_m 180.0)))) 2.0) (pow a 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((b * sin((((double) M_PI) * (angle_m / 180.0)))), 2.0) + pow(a, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((b * Math.sin((Math.PI * (angle_m / 180.0)))), 2.0) + Math.pow(a, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((b * math.sin((math.pi * (angle_m / 180.0)))), 2.0) + math.pow(a, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(b * sin(Float64(pi * Float64(angle_m / 180.0)))) ^ 2.0) + (a ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((b * sin((pi * (angle_m / 180.0)))) ^ 2.0) + (a ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle\_m}{180}\right)\right)}^{2} + {a}^{2}
\end{array}
Initial program 75.2%
Simplified75.1%
Taylor expanded in angle around 0 75.1%
metadata-eval75.1%
div-inv75.1%
Applied egg-rr75.1%
Final simplification75.1%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= b 1.1e-62) (pow a 2.0) (+ (pow a 2.0) (* 3.08641975308642e-5 (pow (* (* angle_m PI) b) 2.0)))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 1.1e-62) {
tmp = pow(a, 2.0);
} else {
tmp = pow(a, 2.0) + (3.08641975308642e-5 * pow(((angle_m * ((double) M_PI)) * b), 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-62) {
tmp = Math.pow(a, 2.0);
} else {
tmp = Math.pow(a, 2.0) + (3.08641975308642e-5 * Math.pow(((angle_m * Math.PI) * b), 2.0));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 1.1e-62: tmp = math.pow(a, 2.0) else: tmp = math.pow(a, 2.0) + (3.08641975308642e-5 * math.pow(((angle_m * math.pi) * b), 2.0)) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 1.1e-62) tmp = a ^ 2.0; else tmp = Float64((a ^ 2.0) + Float64(3.08641975308642e-5 * (Float64(Float64(angle_m * pi) * b) ^ 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-62) tmp = a ^ 2.0; else tmp = (a ^ 2.0) + (3.08641975308642e-5 * (((angle_m * pi) * b) ^ 2.0)); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 1.1e-62], N[Power[a, 2.0], $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(3.08641975308642e-5 * N[Power[N[(N[(angle$95$m * Pi), $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{-62}:\\
\;\;\;\;{a}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(\left(angle\_m \cdot \pi\right) \cdot b\right)}^{2}\\
\end{array}
\end{array}
if b < 1.10000000000000009e-62Initial program 74.5%
Simplified74.4%
Taylor expanded in angle around 0 74.5%
Taylor expanded in angle around 0 60.9%
associate-*r*60.9%
unpow260.9%
unpow260.9%
swap-sqr68.6%
unpow268.6%
swap-sqr68.6%
*-commutative68.6%
*-commutative68.6%
unpow268.6%
Simplified68.6%
Taylor expanded in a around inf 60.2%
if 1.10000000000000009e-62 < b Initial program 76.8%
Simplified76.8%
Taylor expanded in angle around 0 76.4%
Taylor expanded in angle around 0 62.5%
associate-*r*63.6%
unpow263.6%
unpow263.6%
swap-sqr73.3%
unpow273.3%
swap-sqr73.3%
*-commutative73.3%
*-commutative73.3%
unpow273.3%
Simplified73.3%
Taylor expanded in angle around 0 73.3%
*-commutative73.3%
associate-*r*73.3%
Simplified73.3%
Final simplification64.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (* angle_m (* PI b))))
(if (<= b 1.22e-64)
(pow a 2.0)
(+ (pow a 2.0) (* 3.08641975308642e-5 (* t_0 t_0))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = angle_m * (((double) M_PI) * b);
double tmp;
if (b <= 1.22e-64) {
tmp = pow(a, 2.0);
} else {
tmp = pow(a, 2.0) + (3.08641975308642e-5 * (t_0 * t_0));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = angle_m * (Math.PI * b);
double tmp;
if (b <= 1.22e-64) {
tmp = Math.pow(a, 2.0);
} else {
tmp = Math.pow(a, 2.0) + (3.08641975308642e-5 * (t_0 * t_0));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = angle_m * (math.pi * b) tmp = 0 if b <= 1.22e-64: tmp = math.pow(a, 2.0) else: tmp = math.pow(a, 2.0) + (3.08641975308642e-5 * (t_0 * t_0)) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(angle_m * Float64(pi * b)) tmp = 0.0 if (b <= 1.22e-64) tmp = a ^ 2.0; else tmp = Float64((a ^ 2.0) + Float64(3.08641975308642e-5 * Float64(t_0 * t_0))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = angle_m * (pi * b); tmp = 0.0; if (b <= 1.22e-64) tmp = a ^ 2.0; else tmp = (a ^ 2.0) + (3.08641975308642e-5 * (t_0 * t_0)); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 1.22e-64], N[Power[a, 2.0], $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(3.08641975308642e-5 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := angle\_m \cdot \left(\pi \cdot b\right)\\
\mathbf{if}\;b \leq 1.22 \cdot 10^{-64}:\\
\;\;\;\;{a}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(t\_0 \cdot t\_0\right)\\
\end{array}
\end{array}
if b < 1.22000000000000003e-64Initial program 74.5%
Simplified74.4%
Taylor expanded in angle around 0 74.5%
Taylor expanded in angle around 0 60.9%
associate-*r*60.9%
unpow260.9%
unpow260.9%
swap-sqr68.6%
unpow268.6%
swap-sqr68.6%
*-commutative68.6%
*-commutative68.6%
unpow268.6%
Simplified68.6%
Taylor expanded in a around inf 60.2%
if 1.22000000000000003e-64 < b Initial program 76.8%
Simplified76.8%
Taylor expanded in angle around 0 76.4%
Taylor expanded in angle around 0 62.5%
associate-*r*63.6%
unpow263.6%
unpow263.6%
swap-sqr73.3%
unpow273.3%
swap-sqr73.3%
*-commutative73.3%
*-commutative73.3%
unpow273.3%
Simplified73.3%
unpow273.3%
associate-*r*73.3%
*-commutative73.3%
associate-*r*73.3%
*-commutative73.3%
associate-*l*73.3%
associate-*l*73.3%
Applied egg-rr73.3%
Final simplification64.3%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= b 8.8e-63)
(pow a 2.0)
(+
(pow a 2.0)
(* 3.08641975308642e-5 (* (* PI (* angle_m (* PI b))) (* angle_m b))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (b <= 8.8e-63) {
tmp = pow(a, 2.0);
} else {
tmp = pow(a, 2.0) + (3.08641975308642e-5 * ((((double) M_PI) * (angle_m * (((double) M_PI) * b))) * (angle_m * b)));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (b <= 8.8e-63) {
tmp = Math.pow(a, 2.0);
} else {
tmp = Math.pow(a, 2.0) + (3.08641975308642e-5 * ((Math.PI * (angle_m * (Math.PI * b))) * (angle_m * b)));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if b <= 8.8e-63: tmp = math.pow(a, 2.0) else: tmp = math.pow(a, 2.0) + (3.08641975308642e-5 * ((math.pi * (angle_m * (math.pi * b))) * (angle_m * b))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (b <= 8.8e-63) tmp = a ^ 2.0; else tmp = Float64((a ^ 2.0) + Float64(3.08641975308642e-5 * Float64(Float64(pi * Float64(angle_m * Float64(pi * b))) * Float64(angle_m * b)))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (b <= 8.8e-63) tmp = a ^ 2.0; else tmp = (a ^ 2.0) + (3.08641975308642e-5 * ((pi * (angle_m * (pi * b))) * (angle_m * b))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[b, 8.8e-63], N[Power[a, 2.0], $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(3.08641975308642e-5 * N[(N[(Pi * N[(angle$95$m * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8.8 \cdot 10^{-63}:\\
\;\;\;\;{a}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot \left(\left(\pi \cdot \left(angle\_m \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(angle\_m \cdot b\right)\right)\\
\end{array}
\end{array}
if b < 8.7999999999999998e-63Initial program 74.5%
Simplified74.4%
Taylor expanded in angle around 0 74.5%
Taylor expanded in angle around 0 60.9%
associate-*r*60.9%
unpow260.9%
unpow260.9%
swap-sqr68.6%
unpow268.6%
swap-sqr68.6%
*-commutative68.6%
*-commutative68.6%
unpow268.6%
Simplified68.6%
Taylor expanded in a around inf 60.2%
if 8.7999999999999998e-63 < b Initial program 76.8%
Simplified76.8%
Taylor expanded in angle around 0 76.4%
Taylor expanded in angle around 0 62.5%
associate-*r*63.6%
unpow263.6%
unpow263.6%
swap-sqr73.3%
unpow273.3%
swap-sqr73.3%
*-commutative73.3%
*-commutative73.3%
unpow273.3%
Simplified73.3%
unpow273.3%
associate-*r*73.3%
associate-*r*73.3%
*-commutative73.3%
associate-*l*73.4%
Applied egg-rr73.4%
Final simplification64.3%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (pow a 2.0))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(a, 2.0);
}
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 ** 2.0d0
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow(a, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(a, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return a ^ 2.0 end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = a ^ 2.0; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[Power[a, 2.0], $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{a}^{2}
\end{array}
Initial program 75.2%
Simplified75.1%
Taylor expanded in angle around 0 75.1%
Taylor expanded in angle around 0 61.4%
associate-*r*61.8%
unpow261.8%
unpow261.8%
swap-sqr70.1%
unpow270.1%
swap-sqr70.1%
*-commutative70.1%
*-commutative70.1%
unpow270.1%
Simplified70.1%
Taylor expanded in a around inf 54.1%
Final simplification54.1%
herbie shell --seed 2024071
(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)))