
(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 14 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}
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(let* ((t_0 (/ PI (/ 180.0 angle_m)))
(t_1 (* 0.5 (cos (* 2.0 t_0))))
(t_2 (* a t_0)))
(if (<= angle_m 15500.0)
(+ (* t_2 t_2) (* b (* b (+ 0.5 t_1))))
(+ (* b b) (* (* a a) (- 0.5 t_1))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double t_0 = ((double) M_PI) / (180.0 / angle_m);
double t_1 = 0.5 * cos((2.0 * t_0));
double t_2 = a * t_0;
double tmp;
if (angle_m <= 15500.0) {
tmp = (t_2 * t_2) + (b * (b * (0.5 + t_1)));
} else {
tmp = (b * b) + ((a * a) * (0.5 - t_1));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double t_0 = Math.PI / (180.0 / angle_m);
double t_1 = 0.5 * Math.cos((2.0 * t_0));
double t_2 = a * t_0;
double tmp;
if (angle_m <= 15500.0) {
tmp = (t_2 * t_2) + (b * (b * (0.5 + t_1)));
} else {
tmp = (b * b) + ((a * a) * (0.5 - t_1));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): t_0 = math.pi / (180.0 / angle_m) t_1 = 0.5 * math.cos((2.0 * t_0)) t_2 = a * t_0 tmp = 0 if angle_m <= 15500.0: tmp = (t_2 * t_2) + (b * (b * (0.5 + t_1))) else: tmp = (b * b) + ((a * a) * (0.5 - t_1)) return tmp
angle_m = abs(angle) function code(a, b, angle_m) t_0 = Float64(pi / Float64(180.0 / angle_m)) t_1 = Float64(0.5 * cos(Float64(2.0 * t_0))) t_2 = Float64(a * t_0) tmp = 0.0 if (angle_m <= 15500.0) tmp = Float64(Float64(t_2 * t_2) + Float64(b * Float64(b * Float64(0.5 + t_1)))); else tmp = Float64(Float64(b * b) + Float64(Float64(a * a) * Float64(0.5 - t_1))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) t_0 = pi / (180.0 / angle_m); t_1 = 0.5 * cos((2.0 * t_0)); t_2 = a * t_0; tmp = 0.0; if (angle_m <= 15500.0) tmp = (t_2 * t_2) + (b * (b * (0.5 + t_1))); else tmp = (b * b) + ((a * a) * (0.5 - t_1)); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision]
code[a_, b_, angle$95$m_] := Block[{t$95$0 = N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[Cos[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * t$95$0), $MachinePrecision]}, If[LessEqual[angle$95$m, 15500.0], N[(N[(t$95$2 * t$95$2), $MachinePrecision] + N[(b * N[(b * N[(0.5 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * b), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * N[(0.5 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
t_0 := \frac{\pi}{\frac{180}{angle\_m}}\\
t_1 := 0.5 \cdot \cos \left(2 \cdot t\_0\right)\\
t_2 := a \cdot t\_0\\
\mathbf{if}\;angle\_m \leq 15500:\\
\;\;\;\;t\_2 \cdot t\_2 + b \cdot \left(b \cdot \left(0.5 + t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b + \left(a \cdot a\right) \cdot \left(0.5 - t\_1\right)\\
\end{array}
\end{array}
if angle < 15500Initial program 86.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified86.6%
clear-numN/A
inv-powN/A
sqr-powN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
metadata-eval35.8%
Applied egg-rr35.8%
Taylor expanded in angle around 0
*-commutativeN/A
unpow2N/A
rem-square-sqrtN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6483.9%
Simplified83.9%
Applied egg-rr83.9%
if 15500 < angle Initial program 59.8%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified60.0%
Taylor expanded in angle around 0
Simplified62.5%
+-lowering-+.f64N/A
Applied egg-rr62.2%
Final simplification79.9%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow (* a (sin (/ (* angle_m PI) 180.0))) 2.0)
(pow
(*
b
(+
(*
(cos (* 0.005555555555555556 (* angle_m (+ PI 1.0))))
(cos (/ angle_m 180.0)))
(* (sin (/ (+ PI 1.0) (/ 180.0 angle_m))) (sin (/ angle_m 180.0)))))
2.0)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m * ((double) M_PI)) / 180.0))), 2.0) + pow((b * ((cos((0.005555555555555556 * (angle_m * (((double) M_PI) + 1.0)))) * cos((angle_m / 180.0))) + (sin(((((double) M_PI) + 1.0) / (180.0 / angle_m))) * sin((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.sin(((angle_m * Math.PI) / 180.0))), 2.0) + Math.pow((b * ((Math.cos((0.005555555555555556 * (angle_m * (Math.PI + 1.0)))) * Math.cos((angle_m / 180.0))) + (Math.sin(((Math.PI + 1.0) / (180.0 / angle_m))) * Math.sin((angle_m / 180.0))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m * math.pi) / 180.0))), 2.0) + math.pow((b * ((math.cos((0.005555555555555556 * (angle_m * (math.pi + 1.0)))) * math.cos((angle_m / 180.0))) + (math.sin(((math.pi + 1.0) / (180.0 / angle_m))) * math.sin((angle_m / 180.0))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m * pi) / 180.0))) ^ 2.0) + (Float64(b * Float64(Float64(cos(Float64(0.005555555555555556 * Float64(angle_m * Float64(pi + 1.0)))) * cos(Float64(angle_m / 180.0))) + Float64(sin(Float64(Float64(pi + 1.0) / Float64(180.0 / angle_m))) * sin(Float64(angle_m / 180.0))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m * pi) / 180.0))) ^ 2.0) + ((b * ((cos((0.005555555555555556 * (angle_m * (pi + 1.0)))) * cos((angle_m / 180.0))) + (sin(((pi + 1.0) / (180.0 / angle_m))) * sin((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[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[(N[(N[Cos[N[(0.005555555555555556 * N[(angle$95$m * N[(Pi + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(angle$95$m / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(N[(Pi + 1.0), $MachinePrecision] / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(angle$95$m / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)}^{2} + {\left(b \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle\_m \cdot \left(\pi + 1\right)\right)\right) \cdot \cos \left(\frac{angle\_m}{180}\right) + \sin \left(\frac{\pi + 1}{\frac{180}{angle\_m}}\right) \cdot \sin \left(\frac{angle\_m}{180}\right)\right)\right)}^{2}
\end{array}
Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
clear-numN/A
associate-/r*N/A
clear-numN/A
expm1-log1p-uN/A
expm1-undefineN/A
div-subN/A
clear-numN/A
cos-diffN/A
+-lowering-+.f64N/A
Applied egg-rr82.0%
Taylor expanded in angle around inf
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
PI-lowering-PI.f6482.0%
Simplified82.0%
Final simplification82.0%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (/ (* angle_m PI) 180.0))) 2.0) (pow (* b (cos (/ PI (exp (log (/ 180.0 angle_m)))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m * ((double) M_PI)) / 180.0))), 2.0) + pow((b * cos((((double) M_PI) / exp(log((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.sin(((angle_m * Math.PI) / 180.0))), 2.0) + Math.pow((b * Math.cos((Math.PI / Math.exp(Math.log((180.0 / angle_m)))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m * math.pi) / 180.0))), 2.0) + math.pow((b * math.cos((math.pi / math.exp(math.log((180.0 / angle_m)))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m * pi) / 180.0))) ^ 2.0) + (Float64(b * cos(Float64(pi / exp(log(Float64(180.0 / angle_m)))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m * pi) / 180.0))) ^ 2.0) + ((b * cos((pi / exp(log((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[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(Pi / N[Exp[N[Log[N[(180.0 / angle$95$m), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{\pi}{e^{\log \left(\frac{180}{angle\_m}\right)}}\right)\right)}^{2}
\end{array}
Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
clear-numN/A
associate-/r*N/A
clear-numN/A
expm1-log1p-uN/A
expm1-undefineN/A
div-subN/A
clear-numN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
log1p-undefineN/A
rem-exp-logN/A
+-commutativeN/A
+-lowering-+.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6481.6%
Applied egg-rr81.6%
clear-numN/A
sub-divN/A
rem-exp-logN/A
+-commutativeN/A
log1p-undefineN/A
expm1-undefineN/A
expm1-log1p-uN/A
clear-numN/A
inv-powN/A
metadata-evalN/A
pow-to-expN/A
exp-lowering-exp.f64N/A
rem-log-expN/A
pow-to-expN/A
metadata-evalN/A
inv-powN/A
clear-numN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6440.8%
Applied egg-rr40.8%
log-divN/A
exp-diffN/A
add-exp-logN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
exp-lowering-exp.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f6440.8%
Applied egg-rr40.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (/ (* angle_m PI) 180.0))) 2.0) (pow (* b (cos (exp (log (/ PI (/ 180.0 angle_m)))))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m * ((double) M_PI)) / 180.0))), 2.0) + pow((b * cos(exp(log((((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.sin(((angle_m * Math.PI) / 180.0))), 2.0) + Math.pow((b * Math.cos(Math.exp(Math.log((Math.PI / (180.0 / angle_m)))))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m * math.pi) / 180.0))), 2.0) + math.pow((b * math.cos(math.exp(math.log((math.pi / (180.0 / angle_m)))))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m * pi) / 180.0))) ^ 2.0) + (Float64(b * cos(exp(log(Float64(pi / Float64(180.0 / angle_m)))))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m * pi) / 180.0))) ^ 2.0) + ((b * cos(exp(log((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[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[Exp[N[Log[N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)}^{2} + {\left(b \cdot \cos \left(e^{\log \left(\frac{\pi}{\frac{180}{angle\_m}}\right)}\right)\right)}^{2}
\end{array}
Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
clear-numN/A
associate-/r*N/A
clear-numN/A
expm1-log1p-uN/A
expm1-undefineN/A
div-subN/A
clear-numN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
log1p-undefineN/A
rem-exp-logN/A
+-commutativeN/A
+-lowering-+.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6481.6%
Applied egg-rr81.6%
clear-numN/A
sub-divN/A
rem-exp-logN/A
+-commutativeN/A
log1p-undefineN/A
expm1-undefineN/A
expm1-log1p-uN/A
clear-numN/A
inv-powN/A
metadata-evalN/A
pow-to-expN/A
exp-lowering-exp.f64N/A
rem-log-expN/A
pow-to-expN/A
metadata-evalN/A
inv-powN/A
clear-numN/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6440.8%
Applied egg-rr40.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(+
(pow
(*
a
(sin
(/
(+ (* (+ PI 1.0) -180.0) (* angle_m (/ 180.0 angle_m)))
(* (/ 180.0 angle_m) -180.0))))
2.0)
(pow b 2.0)))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((((((double) M_PI) + 1.0) * -180.0) + (angle_m * (180.0 / angle_m))) / ((180.0 / angle_m) * -180.0)))), 2.0) + pow(b, 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((((Math.PI + 1.0) * -180.0) + (angle_m * (180.0 / angle_m))) / ((180.0 / angle_m) * -180.0)))), 2.0) + Math.pow(b, 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((((math.pi + 1.0) * -180.0) + (angle_m * (180.0 / angle_m))) / ((180.0 / angle_m) * -180.0)))), 2.0) + math.pow(b, 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(Float64(Float64(pi + 1.0) * -180.0) + Float64(angle_m * Float64(180.0 / angle_m))) / Float64(Float64(180.0 / angle_m) * -180.0)))) ^ 2.0) + (b ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((((pi + 1.0) * -180.0) + (angle_m * (180.0 / angle_m))) / ((180.0 / angle_m) * -180.0)))) ^ 2.0) + (b ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(N[(N[(Pi + 1.0), $MachinePrecision] * -180.0), $MachinePrecision] + N[(angle$95$m * N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(180.0 / angle$95$m), $MachinePrecision] * -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{\left(\pi + 1\right) \cdot -180 + angle\_m \cdot \frac{180}{angle\_m}}{\frac{180}{angle\_m} \cdot -180}\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
Taylor expanded in angle around 0
Simplified81.8%
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
expm1-log1p-uN/A
expm1-undefineN/A
log1p-undefineN/A
+-commutativeN/A
rem-exp-logN/A
sub-divN/A
clear-numN/A
frac-2negN/A
frac-subN/A
/-lowering-/.f64N/A
Applied egg-rr81.9%
Final simplification81.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow b 2.0) (pow (* a (sin (* (* angle_m PI) 0.005555555555555556))) 2.0)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow(b, 2.0) + pow((a * sin(((angle_m * ((double) M_PI)) * 0.005555555555555556))), 2.0);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow(b, 2.0) + Math.pow((a * Math.sin(((angle_m * Math.PI) * 0.005555555555555556))), 2.0);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow(b, 2.0) + math.pow((a * math.sin(((angle_m * math.pi) * 0.005555555555555556))), 2.0)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((b ^ 2.0) + (Float64(a * sin(Float64(Float64(angle_m * pi) * 0.005555555555555556))) ^ 2.0)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = (b ^ 2.0) + ((a * sin(((angle_m * pi) * 0.005555555555555556))) ^ 2.0); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[b, 2.0], $MachinePrecision] + N[Power[N[(a * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{b}^{2} + {\left(a \cdot \sin \left(\left(angle\_m \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}^{2}
\end{array}
Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
Taylor expanded in angle around 0
Simplified81.8%
div-invN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval81.9%
Applied egg-rr81.9%
Final simplification81.9%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (+ (pow (* a (sin (/ (* angle_m PI) 180.0))) 2.0) (* b b)))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return pow((a * sin(((angle_m * ((double) M_PI)) / 180.0))), 2.0) + (b * b);
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return Math.pow((a * Math.sin(((angle_m * Math.PI) / 180.0))), 2.0) + (b * b);
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return math.pow((a * math.sin(((angle_m * math.pi) / 180.0))), 2.0) + (b * b)
angle_m = abs(angle) function code(a, b, angle_m) return Float64((Float64(a * sin(Float64(Float64(angle_m * pi) / 180.0))) ^ 2.0) + Float64(b * b)) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = ((a * sin(((angle_m * pi) / 180.0))) ^ 2.0) + (b * b); end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle$95$m * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
{\left(a \cdot \sin \left(\frac{angle\_m \cdot \pi}{180}\right)\right)}^{2} + b \cdot b
\end{array}
Initial program 81.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.6%
Taylor expanded in angle around 0
Simplified81.8%
*-rgt-identityN/A
pow2N/A
*-lowering-*.f6481.8%
Applied egg-rr81.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= angle_m 2.45e-11)
(+
(* b b)
(* angle_m (* (* a angle_m) (* a (* PI (* PI 3.08641975308642e-5))))))
(+
(* b b)
(* (* a a) (- 0.5 (* 0.5 (cos (* 2.0 (/ PI (/ 180.0 angle_m))))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (angle_m <= 2.45e-11) {
tmp = (b * b) + (angle_m * ((a * angle_m) * (a * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)))));
} else {
tmp = (b * b) + ((a * a) * (0.5 - (0.5 * cos((2.0 * (((double) M_PI) / (180.0 / angle_m)))))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (angle_m <= 2.45e-11) {
tmp = (b * b) + (angle_m * ((a * angle_m) * (a * (Math.PI * (Math.PI * 3.08641975308642e-5)))));
} else {
tmp = (b * b) + ((a * a) * (0.5 - (0.5 * Math.cos((2.0 * (Math.PI / (180.0 / angle_m)))))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if angle_m <= 2.45e-11: tmp = (b * b) + (angle_m * ((a * angle_m) * (a * (math.pi * (math.pi * 3.08641975308642e-5))))) else: tmp = (b * b) + ((a * a) * (0.5 - (0.5 * math.cos((2.0 * (math.pi / (180.0 / angle_m))))))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (angle_m <= 2.45e-11) tmp = Float64(Float64(b * b) + Float64(angle_m * Float64(Float64(a * angle_m) * Float64(a * Float64(pi * Float64(pi * 3.08641975308642e-5)))))); else tmp = Float64(Float64(b * b) + Float64(Float64(a * a) * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(pi / Float64(180.0 / angle_m)))))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (angle_m <= 2.45e-11) tmp = (b * b) + (angle_m * ((a * angle_m) * (a * (pi * (pi * 3.08641975308642e-5))))); else tmp = (b * b) + ((a * a) * (0.5 - (0.5 * cos((2.0 * (pi / (180.0 / angle_m))))))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[angle$95$m, 2.45e-11], N[(N[(b * b), $MachinePrecision] + N[(angle$95$m * N[(N[(a * angle$95$m), $MachinePrecision] * N[(a * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * b), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(Pi / N[(180.0 / angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.45 \cdot 10^{-11}:\\
\;\;\;\;b \cdot b + angle\_m \cdot \left(\left(a \cdot angle\_m\right) \cdot \left(a \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot b + \left(a \cdot a\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \frac{\pi}{\frac{180}{angle\_m}}\right)\right)\\
\end{array}
\end{array}
if angle < 2.4499999999999999e-11Initial program 86.3%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified86.3%
Taylor expanded in angle around 0
Simplified86.3%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
Simplified73.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6479.9%
Applied egg-rr79.9%
if 2.4499999999999999e-11 < angle Initial program 64.1%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified64.3%
Taylor expanded in angle around 0
Simplified65.1%
+-lowering-+.f64N/A
Applied egg-rr64.9%
Final simplification76.7%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 8.8e-17)
(* b b)
(+
(* b b)
(* angle_m (* (* a angle_m) (* a (* PI (* PI 3.08641975308642e-5))))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 8.8e-17) {
tmp = b * b;
} else {
tmp = (b * b) + (angle_m * ((a * angle_m) * (a * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 8.8e-17) {
tmp = b * b;
} else {
tmp = (b * b) + (angle_m * ((a * angle_m) * (a * (Math.PI * (Math.PI * 3.08641975308642e-5)))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 8.8e-17: tmp = b * b else: tmp = (b * b) + (angle_m * ((a * angle_m) * (a * (math.pi * (math.pi * 3.08641975308642e-5))))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 8.8e-17) tmp = Float64(b * b); else tmp = Float64(Float64(b * b) + Float64(angle_m * Float64(Float64(a * angle_m) * Float64(a * Float64(pi * Float64(pi * 3.08641975308642e-5)))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 8.8e-17) tmp = b * b; else tmp = (b * b) + (angle_m * ((a * angle_m) * (a * (pi * (pi * 3.08641975308642e-5))))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 8.8e-17], N[(b * b), $MachinePrecision], N[(N[(b * b), $MachinePrecision] + N[(angle$95$m * N[(N[(a * angle$95$m), $MachinePrecision] * N[(a * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.8 \cdot 10^{-17}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;b \cdot b + angle\_m \cdot \left(\left(a \cdot angle\_m\right) \cdot \left(a \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 8.8e-17Initial program 79.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6466.9%
Simplified66.9%
if 8.8e-17 < a Initial program 87.9%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified87.8%
Taylor expanded in angle around 0
Simplified88.1%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
Simplified67.8%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6479.6%
Applied egg-rr79.6%
Final simplification69.8%
angle_m = (fabs.f64 angle)
(FPCore (a b angle_m)
:precision binary64
(if (<= a 8.8e-17)
(* b b)
(+
(* b b)
(* a (* (* a (* PI (* PI 3.08641975308642e-5))) (* angle_m angle_m))))))angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 8.8e-17) {
tmp = b * b;
} else {
tmp = (b * b) + (a * ((a * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5))) * (angle_m * angle_m)));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 8.8e-17) {
tmp = b * b;
} else {
tmp = (b * b) + (a * ((a * (Math.PI * (Math.PI * 3.08641975308642e-5))) * (angle_m * angle_m)));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 8.8e-17: tmp = b * b else: tmp = (b * b) + (a * ((a * (math.pi * (math.pi * 3.08641975308642e-5))) * (angle_m * angle_m))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 8.8e-17) tmp = Float64(b * b); else tmp = Float64(Float64(b * b) + Float64(a * Float64(Float64(a * Float64(pi * Float64(pi * 3.08641975308642e-5))) * Float64(angle_m * angle_m)))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 8.8e-17) tmp = b * b; else tmp = (b * b) + (a * ((a * (pi * (pi * 3.08641975308642e-5))) * (angle_m * angle_m))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 8.8e-17], N[(b * b), $MachinePrecision], N[(N[(b * b), $MachinePrecision] + N[(a * N[(N[(a * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.8 \cdot 10^{-17}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;b \cdot b + a \cdot \left(\left(a \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right) \cdot \left(angle\_m \cdot angle\_m\right)\right)\\
\end{array}
\end{array}
if a < 8.8e-17Initial program 79.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6466.9%
Simplified66.9%
if 8.8e-17 < a Initial program 87.9%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified87.8%
Taylor expanded in angle around 0
Simplified88.1%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
Simplified67.8%
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6474.6%
Applied egg-rr74.6%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 1.2e+93) (* b b) (* 3.08641975308642e-5 (* (* angle_m (* angle_m (* a a))) (* PI PI)))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.2e+93) {
tmp = b * b;
} else {
tmp = 3.08641975308642e-5 * ((angle_m * (angle_m * (a * a))) * (((double) M_PI) * ((double) M_PI)));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.2e+93) {
tmp = b * b;
} else {
tmp = 3.08641975308642e-5 * ((angle_m * (angle_m * (a * a))) * (Math.PI * Math.PI));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 1.2e+93: tmp = b * b else: tmp = 3.08641975308642e-5 * ((angle_m * (angle_m * (a * a))) * (math.pi * math.pi)) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 1.2e+93) tmp = Float64(b * b); else tmp = Float64(3.08641975308642e-5 * Float64(Float64(angle_m * Float64(angle_m * Float64(a * a))) * Float64(pi * pi))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 1.2e+93) tmp = b * b; else tmp = 3.08641975308642e-5 * ((angle_m * (angle_m * (a * a))) * (pi * pi)); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 1.2e+93], N[(b * b), $MachinePrecision], N[(3.08641975308642e-5 * N[(N[(angle$95$m * N[(angle$95$m * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.2 \cdot 10^{+93}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle\_m \cdot \left(angle\_m \cdot \left(a \cdot a\right)\right)\right) \cdot \left(\pi \cdot \pi\right)\right)\\
\end{array}
\end{array}
if a < 1.20000000000000005e93Initial program 78.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6464.8%
Simplified64.8%
if 1.20000000000000005e93 < a Initial program 97.3%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified97.3%
Taylor expanded in angle around 0
Simplified97.3%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
Simplified71.0%
Taylor expanded in b around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6468.5%
Simplified68.5%
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6477.0%
Applied egg-rr77.0%
Final simplification66.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 1.65e+93) (* b b) (* angle_m (* angle_m (* a (* a (* 3.08641975308642e-5 (* PI PI))))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.65e+93) {
tmp = b * b;
} else {
tmp = angle_m * (angle_m * (a * (a * (3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI))))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 1.65e+93) {
tmp = b * b;
} else {
tmp = angle_m * (angle_m * (a * (a * (3.08641975308642e-5 * (Math.PI * Math.PI)))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 1.65e+93: tmp = b * b else: tmp = angle_m * (angle_m * (a * (a * (3.08641975308642e-5 * (math.pi * math.pi))))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 1.65e+93) tmp = Float64(b * b); else tmp = Float64(angle_m * Float64(angle_m * Float64(a * Float64(a * Float64(3.08641975308642e-5 * Float64(pi * pi)))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 1.65e+93) tmp = b * b; else tmp = angle_m * (angle_m * (a * (a * (3.08641975308642e-5 * (pi * pi))))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 1.65e+93], N[(b * b), $MachinePrecision], N[(angle$95$m * N[(angle$95$m * N[(a * N[(a * N[(3.08641975308642e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.65 \cdot 10^{+93}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;angle\_m \cdot \left(angle\_m \cdot \left(a \cdot \left(a \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.65000000000000004e93Initial program 78.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6464.8%
Simplified64.8%
if 1.65000000000000004e93 < a Initial program 97.3%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified97.3%
Taylor expanded in angle around 0
Simplified97.3%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
Simplified71.0%
Taylor expanded in b around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6468.5%
Simplified68.5%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr76.9%
Final simplification66.5%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (if (<= a 5.5e+164) (* b b) (* a (* (* angle_m angle_m) (* a (* 3.08641975308642e-5 (* PI PI)))))))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
double tmp;
if (a <= 5.5e+164) {
tmp = b * b;
} else {
tmp = a * ((angle_m * angle_m) * (a * (3.08641975308642e-5 * (((double) M_PI) * ((double) M_PI)))));
}
return tmp;
}
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
double tmp;
if (a <= 5.5e+164) {
tmp = b * b;
} else {
tmp = a * ((angle_m * angle_m) * (a * (3.08641975308642e-5 * (Math.PI * Math.PI))));
}
return tmp;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): tmp = 0 if a <= 5.5e+164: tmp = b * b else: tmp = a * ((angle_m * angle_m) * (a * (3.08641975308642e-5 * (math.pi * math.pi)))) return tmp
angle_m = abs(angle) function code(a, b, angle_m) tmp = 0.0 if (a <= 5.5e+164) tmp = Float64(b * b); else tmp = Float64(a * Float64(Float64(angle_m * angle_m) * Float64(a * Float64(3.08641975308642e-5 * Float64(pi * pi))))); end return tmp end
angle_m = abs(angle); function tmp_2 = code(a, b, angle_m) tmp = 0.0; if (a <= 5.5e+164) tmp = b * b; else tmp = a * ((angle_m * angle_m) * (a * (3.08641975308642e-5 * (pi * pi)))); end tmp_2 = tmp; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := If[LessEqual[a, 5.5e+164], N[(b * b), $MachinePrecision], N[(a * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(a * N[(3.08641975308642e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
angle_m = \left|angle\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.5 \cdot 10^{+164}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(angle\_m \cdot angle\_m\right) \cdot \left(a \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 5.4999999999999998e164Initial program 79.4%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6464.1%
Simplified64.1%
if 5.4999999999999998e164 < a Initial program 99.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
sin-lowering-sin.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified99.7%
Taylor expanded in angle around 0
Simplified99.7%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
Simplified72.0%
Taylor expanded in b around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f6472.0%
Simplified72.0%
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
metadata-evalN/A
swap-sqrN/A
*-lowering-*.f64N/A
swap-sqrN/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f6479.2%
Applied egg-rr79.2%
Final simplification65.8%
angle_m = (fabs.f64 angle) (FPCore (a b angle_m) :precision binary64 (* b b))
angle_m = fabs(angle);
double code(double a, double b, double angle_m) {
return b * b;
}
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 = b * b
end function
angle_m = Math.abs(angle);
public static double code(double a, double b, double angle_m) {
return b * b;
}
angle_m = math.fabs(angle) def code(a, b, angle_m): return b * b
angle_m = abs(angle) function code(a, b, angle_m) return Float64(b * b) end
angle_m = abs(angle); function tmp = code(a, b, angle_m) tmp = b * b; end
angle_m = N[Abs[angle], $MachinePrecision] code[a_, b_, angle$95$m_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
angle_m = \left|angle\right|
\\
b \cdot b
\end{array}
Initial program 81.6%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6459.0%
Simplified59.0%
herbie shell --seed 2024152
(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)))