
(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 14 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}
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (/ (* PI angle) 180.0))) 2.0) (pow (* b (sin (* (/ 1.0 (/ -1.0 (* PI angle))) -0.005555555555555556))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos(((((double) M_PI) * angle) / 180.0))), 2.0) + pow((b * sin(((1.0 / (-1.0 / (((double) M_PI) * angle))) * -0.005555555555555556))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos(((Math.PI * angle) / 180.0))), 2.0) + Math.pow((b * Math.sin(((1.0 / (-1.0 / (Math.PI * angle))) * -0.005555555555555556))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos(((math.pi * angle) / 180.0))), 2.0) + math.pow((b * math.sin(((1.0 / (-1.0 / (math.pi * angle))) * -0.005555555555555556))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + (Float64(b * sin(Float64(Float64(1.0 / Float64(-1.0 / Float64(pi * angle))) * -0.005555555555555556))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos(((pi * angle) / 180.0))) ^ 2.0) + ((b * sin(((1.0 / (-1.0 / (pi * angle))) * -0.005555555555555556))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(1.0 / N[(-1.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{1}{\frac{-1}{\pi \cdot angle}} \cdot -0.005555555555555556\right)\right)}^{2}
\end{array}
Initial program 83.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified83.6%
clear-numN/A
clear-numN/A
frac-2negN/A
div-invN/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
metadata-eval83.7%
Applied egg-rr83.7%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (/ (* PI angle) 180.0))) 2.0) (pow (* b (sin (/ PI (/ 180.0 angle)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos(((((double) M_PI) * angle) / 180.0))), 2.0) + pow((b * sin((((double) M_PI) / (180.0 / angle)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos(((Math.PI * angle) / 180.0))), 2.0) + Math.pow((b * Math.sin((Math.PI / (180.0 / angle)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos(((math.pi * angle) / 180.0))), 2.0) + math.pow((b * math.sin((math.pi / (180.0 / angle)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(Float64(pi * angle) / 180.0))) ^ 2.0) + (Float64(b * sin(Float64(pi / Float64(180.0 / angle)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos(((pi * angle) / 180.0))) ^ 2.0) + ((b * sin((pi / (180.0 / angle)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)}^{2}
\end{array}
Initial program 83.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified83.6%
associate-*r/N/A
sin-lowering-sin.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
PI-lowering-PI.f64N/A
/-lowering-/.f6483.7%
Applied egg-rr83.7%
(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}
Initial program 83.7%
(FPCore (a b angle) :precision binary64 (+ (* a (* a (+ 0.5 (* 0.5 (cos (* (* PI angle) 0.011111111111111112)))))) (pow (* b (sin (/ (* PI angle) 180.0))) 2.0)))
double code(double a, double b, double angle) {
return (a * (a * (0.5 + (0.5 * cos(((((double) M_PI) * angle) * 0.011111111111111112)))))) + pow((b * sin(((((double) M_PI) * angle) / 180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return (a * (a * (0.5 + (0.5 * Math.cos(((Math.PI * angle) * 0.011111111111111112)))))) + Math.pow((b * Math.sin(((Math.PI * angle) / 180.0))), 2.0);
}
def code(a, b, angle): return (a * (a * (0.5 + (0.5 * math.cos(((math.pi * angle) * 0.011111111111111112)))))) + math.pow((b * math.sin(((math.pi * angle) / 180.0))), 2.0)
function code(a, b, angle) return Float64(Float64(a * Float64(a * Float64(0.5 + Float64(0.5 * cos(Float64(Float64(pi * angle) * 0.011111111111111112)))))) + (Float64(b * sin(Float64(Float64(pi * angle) / 180.0))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a * (a * (0.5 + (0.5 * cos(((pi * angle) * 0.011111111111111112)))))) + ((b * sin(((pi * angle) / 180.0))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[(a * N[(a * N[(0.5 + N[(0.5 * N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right)\right) + {\left(b \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\right)}^{2}
\end{array}
Initial program 83.7%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified83.6%
associate-*r/N/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr83.6%
Final simplification83.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0
(+
0.005555555555555556
(* angle (* angle (* (* PI PI) -2.8577960676726107e-8))))))
(if (<= b 1.46e-102)
(* (* a a) (pow (cos (* (* PI angle) 0.005555555555555556)) 2.0))
(+
(*
a
(*
a
(+ 0.5 (* 0.5 (cos (/ 0.011111111111111112 (/ 1.0 (* PI angle))))))))
(* (* (* angle (* t_0 (* PI b))) (* angle b)) (* PI t_0))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 + (angle * (angle * ((((double) M_PI) * ((double) M_PI)) * -2.8577960676726107e-8)));
double tmp;
if (b <= 1.46e-102) {
tmp = (a * a) * pow(cos(((((double) M_PI) * angle) * 0.005555555555555556)), 2.0);
} else {
tmp = (a * (a * (0.5 + (0.5 * cos((0.011111111111111112 / (1.0 / (((double) M_PI) * angle)))))))) + (((angle * (t_0 * (((double) M_PI) * b))) * (angle * b)) * (((double) M_PI) * t_0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 + (angle * (angle * ((Math.PI * Math.PI) * -2.8577960676726107e-8)));
double tmp;
if (b <= 1.46e-102) {
tmp = (a * a) * Math.pow(Math.cos(((Math.PI * angle) * 0.005555555555555556)), 2.0);
} else {
tmp = (a * (a * (0.5 + (0.5 * Math.cos((0.011111111111111112 / (1.0 / (Math.PI * angle)))))))) + (((angle * (t_0 * (Math.PI * b))) * (angle * b)) * (Math.PI * t_0));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 + (angle * (angle * ((math.pi * math.pi) * -2.8577960676726107e-8))) tmp = 0 if b <= 1.46e-102: tmp = (a * a) * math.pow(math.cos(((math.pi * angle) * 0.005555555555555556)), 2.0) else: tmp = (a * (a * (0.5 + (0.5 * math.cos((0.011111111111111112 / (1.0 / (math.pi * angle)))))))) + (((angle * (t_0 * (math.pi * b))) * (angle * b)) * (math.pi * t_0)) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 + Float64(angle * Float64(angle * Float64(Float64(pi * pi) * -2.8577960676726107e-8)))) tmp = 0.0 if (b <= 1.46e-102) tmp = Float64(Float64(a * a) * (cos(Float64(Float64(pi * angle) * 0.005555555555555556)) ^ 2.0)); else tmp = Float64(Float64(a * Float64(a * Float64(0.5 + Float64(0.5 * cos(Float64(0.011111111111111112 / Float64(1.0 / Float64(pi * angle)))))))) + Float64(Float64(Float64(angle * Float64(t_0 * Float64(pi * b))) * Float64(angle * b)) * Float64(pi * t_0))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 + (angle * (angle * ((pi * pi) * -2.8577960676726107e-8))); tmp = 0.0; if (b <= 1.46e-102) tmp = (a * a) * (cos(((pi * angle) * 0.005555555555555556)) ^ 2.0); else tmp = (a * (a * (0.5 + (0.5 * cos((0.011111111111111112 / (1.0 / (pi * angle)))))))) + (((angle * (t_0 * (pi * b))) * (angle * b)) * (pi * t_0)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 + N[(angle * N[(angle * N[(N[(Pi * Pi), $MachinePrecision] * -2.8577960676726107e-8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 1.46e-102], N[(N[(a * a), $MachinePrecision] * N[Power[N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(a * N[(0.5 + N[(0.5 * N[Cos[N[(0.011111111111111112 / N[(1.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(angle * N[(t$95$0 * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * b), $MachinePrecision]), $MachinePrecision] * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 + angle \cdot \left(angle \cdot \left(\left(\pi \cdot \pi\right) \cdot -2.8577960676726107 \cdot 10^{-8}\right)\right)\\
\mathbf{if}\;b \leq 1.46 \cdot 10^{-102}:\\
\;\;\;\;\left(a \cdot a\right) \cdot {\cos \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(\frac{0.011111111111111112}{\frac{1}{\pi \cdot angle}}\right)\right)\right) + \left(\left(angle \cdot \left(t\_0 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \left(\pi \cdot t\_0\right)\\
\end{array}
\end{array}
if b < 1.4599999999999999e-102Initial program 86.0%
Taylor expanded in a around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
*-commutativeN/A
associate-*r*N/A
cos-lowering-cos.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6467.2%
Simplified67.2%
if 1.4599999999999999e-102 < b Initial program 79.1%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified74.5%
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr74.5%
associate-/r/N/A
associate-*r*N/A
clear-numN/A
un-div-invN/A
associate-/r/N/A
associate-/r*N/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
clear-numN/A
/-lowering-/.f64N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6474.5%
Applied egg-rr74.5%
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr74.4%
Final simplification69.7%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (/ angle 180.0)))) 2.0) (* a a)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0) + (a * a);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0) + (a * a);
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi * (angle / 180.0)))), 2.0) + (a * a)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + Float64(a * a)) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi * (angle / 180.0)))) ^ 2.0) + (a * a); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + a \cdot a
\end{array}
Initial program 83.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6483.5%
Simplified83.5%
Final simplification83.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0
(+
0.005555555555555556
(* angle (* angle (* (* PI PI) -2.8577960676726107e-8))))))
(if (<= b 3e-103)
(* (* a a) (+ 0.5 (* 0.5 (cos (* angle (* PI 0.011111111111111112))))))
(+
(*
a
(*
a
(+ 0.5 (* 0.5 (cos (/ 0.011111111111111112 (/ 1.0 (* PI angle))))))))
(* (* (* angle (* t_0 (* PI b))) (* angle b)) (* PI t_0))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 + (angle * (angle * ((((double) M_PI) * ((double) M_PI)) * -2.8577960676726107e-8)));
double tmp;
if (b <= 3e-103) {
tmp = (a * a) * (0.5 + (0.5 * cos((angle * (((double) M_PI) * 0.011111111111111112)))));
} else {
tmp = (a * (a * (0.5 + (0.5 * cos((0.011111111111111112 / (1.0 / (((double) M_PI) * angle)))))))) + (((angle * (t_0 * (((double) M_PI) * b))) * (angle * b)) * (((double) M_PI) * t_0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 + (angle * (angle * ((Math.PI * Math.PI) * -2.8577960676726107e-8)));
double tmp;
if (b <= 3e-103) {
tmp = (a * a) * (0.5 + (0.5 * Math.cos((angle * (Math.PI * 0.011111111111111112)))));
} else {
tmp = (a * (a * (0.5 + (0.5 * Math.cos((0.011111111111111112 / (1.0 / (Math.PI * angle)))))))) + (((angle * (t_0 * (Math.PI * b))) * (angle * b)) * (Math.PI * t_0));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 + (angle * (angle * ((math.pi * math.pi) * -2.8577960676726107e-8))) tmp = 0 if b <= 3e-103: tmp = (a * a) * (0.5 + (0.5 * math.cos((angle * (math.pi * 0.011111111111111112))))) else: tmp = (a * (a * (0.5 + (0.5 * math.cos((0.011111111111111112 / (1.0 / (math.pi * angle)))))))) + (((angle * (t_0 * (math.pi * b))) * (angle * b)) * (math.pi * t_0)) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 + Float64(angle * Float64(angle * Float64(Float64(pi * pi) * -2.8577960676726107e-8)))) tmp = 0.0 if (b <= 3e-103) tmp = Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(angle * Float64(pi * 0.011111111111111112)))))); else tmp = Float64(Float64(a * Float64(a * Float64(0.5 + Float64(0.5 * cos(Float64(0.011111111111111112 / Float64(1.0 / Float64(pi * angle)))))))) + Float64(Float64(Float64(angle * Float64(t_0 * Float64(pi * b))) * Float64(angle * b)) * Float64(pi * t_0))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 + (angle * (angle * ((pi * pi) * -2.8577960676726107e-8))); tmp = 0.0; if (b <= 3e-103) tmp = (a * a) * (0.5 + (0.5 * cos((angle * (pi * 0.011111111111111112))))); else tmp = (a * (a * (0.5 + (0.5 * cos((0.011111111111111112 / (1.0 / (pi * angle)))))))) + (((angle * (t_0 * (pi * b))) * (angle * b)) * (pi * t_0)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 + N[(angle * N[(angle * N[(N[(Pi * Pi), $MachinePrecision] * -2.8577960676726107e-8), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 3e-103], N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(a * N[(0.5 + N[(0.5 * N[Cos[N[(0.011111111111111112 / N[(1.0 / N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(angle * N[(t$95$0 * N[(Pi * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * b), $MachinePrecision]), $MachinePrecision] * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 + angle \cdot \left(angle \cdot \left(\left(\pi \cdot \pi\right) \cdot -2.8577960676726107 \cdot 10^{-8}\right)\right)\\
\mathbf{if}\;b \leq 3 \cdot 10^{-103}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(a \cdot \left(0.5 + 0.5 \cdot \cos \left(\frac{0.011111111111111112}{\frac{1}{\pi \cdot angle}}\right)\right)\right) + \left(\left(angle \cdot \left(t\_0 \cdot \left(\pi \cdot b\right)\right)\right) \cdot \left(angle \cdot b\right)\right) \cdot \left(\pi \cdot t\_0\right)\\
\end{array}
\end{array}
if b < 3e-103Initial program 86.0%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified80.3%
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr80.3%
Taylor expanded in a around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6467.2%
Simplified67.2%
if 3e-103 < b Initial program 79.1%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified74.5%
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr74.5%
associate-/r/N/A
associate-*r*N/A
clear-numN/A
un-div-invN/A
associate-/r/N/A
associate-/r*N/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
metadata-evalN/A
clear-numN/A
/-lowering-/.f64N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6474.5%
Applied egg-rr74.5%
unpow2N/A
associate-*r*N/A
associate-*r*N/A
*-lowering-*.f64N/A
Applied egg-rr74.4%
Final simplification69.7%
(FPCore (a b angle)
:precision binary64
(if (<= b 1.55e-102)
(* (* a a) (+ 0.5 (* 0.5 (cos (* angle (* PI 0.011111111111111112))))))
(+
(* a a)
(pow
(*
angle
(*
b
(*
PI
(+
0.005555555555555556
(* (* PI PI) (* -2.8577960676726107e-8 (* angle angle)))))))
2.0))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.55e-102) {
tmp = (a * a) * (0.5 + (0.5 * cos((angle * (((double) M_PI) * 0.011111111111111112)))));
} else {
tmp = (a * a) + pow((angle * (b * (((double) M_PI) * (0.005555555555555556 + ((((double) M_PI) * ((double) M_PI)) * (-2.8577960676726107e-8 * (angle * angle))))))), 2.0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.55e-102) {
tmp = (a * a) * (0.5 + (0.5 * Math.cos((angle * (Math.PI * 0.011111111111111112)))));
} else {
tmp = (a * a) + Math.pow((angle * (b * (Math.PI * (0.005555555555555556 + ((Math.PI * Math.PI) * (-2.8577960676726107e-8 * (angle * angle))))))), 2.0);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.55e-102: tmp = (a * a) * (0.5 + (0.5 * math.cos((angle * (math.pi * 0.011111111111111112))))) else: tmp = (a * a) + math.pow((angle * (b * (math.pi * (0.005555555555555556 + ((math.pi * math.pi) * (-2.8577960676726107e-8 * (angle * angle))))))), 2.0) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.55e-102) tmp = Float64(Float64(a * a) * Float64(0.5 + Float64(0.5 * cos(Float64(angle * Float64(pi * 0.011111111111111112)))))); else tmp = Float64(Float64(a * a) + (Float64(angle * Float64(b * Float64(pi * Float64(0.005555555555555556 + Float64(Float64(pi * pi) * Float64(-2.8577960676726107e-8 * Float64(angle * angle))))))) ^ 2.0)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.55e-102) tmp = (a * a) * (0.5 + (0.5 * cos((angle * (pi * 0.011111111111111112))))); else tmp = (a * a) + ((angle * (b * (pi * (0.005555555555555556 + ((pi * pi) * (-2.8577960676726107e-8 * (angle * angle))))))) ^ 2.0); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.55e-102], N[(N[(a * a), $MachinePrecision] * N[(0.5 + N[(0.5 * N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] + N[Power[N[(angle * N[(b * N[(Pi * N[(0.005555555555555556 + N[(N[(Pi * Pi), $MachinePrecision] * N[(-2.8577960676726107e-8 * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.55 \cdot 10^{-102}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(0.5 + 0.5 \cdot \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a + {\left(angle \cdot \left(b \cdot \left(\pi \cdot \left(0.005555555555555556 + \left(\pi \cdot \pi\right) \cdot \left(-2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right)\right)\right)\right)\right)\right)}^{2}\\
\end{array}
\end{array}
if b < 1.55000000000000006e-102Initial program 86.0%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified80.3%
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr80.3%
Taylor expanded in a around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6467.2%
Simplified67.2%
if 1.55000000000000006e-102 < b Initial program 79.1%
Taylor expanded in angle around 0
distribute-lft-inN/A
fma-defineN/A
*-commutativeN/A
associate-*r*N/A
fma-undefineN/A
distribute-lft-inN/A
+-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
Simplified74.5%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6474.5%
Simplified74.5%
Final simplification69.7%
(FPCore (a b angle)
:precision binary64
(if (<= a 1.1e+135)
(+
(* a a)
(*
angle
(*
(+ (* a (* a -3.08641975308642e-5)) (* 3.08641975308642e-5 (* b b)))
(* angle (* PI PI)))))
(* a a)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.1e+135) {
tmp = (a * a) + (angle * (((a * (a * -3.08641975308642e-5)) + (3.08641975308642e-5 * (b * b))) * (angle * (((double) M_PI) * ((double) M_PI)))));
} else {
tmp = a * a;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 1.1e+135) {
tmp = (a * a) + (angle * (((a * (a * -3.08641975308642e-5)) + (3.08641975308642e-5 * (b * b))) * (angle * (Math.PI * Math.PI))));
} else {
tmp = a * a;
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 1.1e+135: tmp = (a * a) + (angle * (((a * (a * -3.08641975308642e-5)) + (3.08641975308642e-5 * (b * b))) * (angle * (math.pi * math.pi)))) else: tmp = a * a return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 1.1e+135) tmp = Float64(Float64(a * a) + Float64(angle * Float64(Float64(Float64(a * Float64(a * -3.08641975308642e-5)) + Float64(3.08641975308642e-5 * Float64(b * b))) * Float64(angle * Float64(pi * pi))))); else tmp = Float64(a * a); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1.1e+135) tmp = (a * a) + (angle * (((a * (a * -3.08641975308642e-5)) + (3.08641975308642e-5 * (b * b))) * (angle * (pi * pi)))); else tmp = a * a; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 1.1e+135], N[(N[(a * a), $MachinePrecision] + N[(angle * N[(N[(N[(a * N[(a * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision] + N[(3.08641975308642e-5 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.1 \cdot 10^{+135}:\\
\;\;\;\;a \cdot a + angle \cdot \left(\left(a \cdot \left(a \cdot -3.08641975308642 \cdot 10^{-5}\right) + 3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right) \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a\\
\end{array}
\end{array}
if a < 1.1e135Initial program 81.5%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified81.4%
clear-numN/A
clear-numN/A
frac-2negN/A
div-invN/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
metadata-eval81.5%
Applied egg-rr81.5%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified53.7%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Applied egg-rr56.3%
if 1.1e135 < a Initial program 95.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6495.9%
Simplified95.9%
Final simplification62.3%
(FPCore (a b angle)
:precision binary64
(if (<= a 4.1e-161)
(* angle (* (* b b) (* angle (* PI (* PI 3.08641975308642e-5)))))
(if (<= a 1.42e+135)
(+
(* a a)
(* (* angle angle) (* (* PI PI) (* 3.08641975308642e-5 (* b b)))))
(* a a))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 4.1e-161) {
tmp = angle * ((b * b) * (angle * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5))));
} else if (a <= 1.42e+135) {
tmp = (a * a) + ((angle * angle) * ((((double) M_PI) * ((double) M_PI)) * (3.08641975308642e-5 * (b * b))));
} else {
tmp = a * a;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 4.1e-161) {
tmp = angle * ((b * b) * (angle * (Math.PI * (Math.PI * 3.08641975308642e-5))));
} else if (a <= 1.42e+135) {
tmp = (a * a) + ((angle * angle) * ((Math.PI * Math.PI) * (3.08641975308642e-5 * (b * b))));
} else {
tmp = a * a;
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 4.1e-161: tmp = angle * ((b * b) * (angle * (math.pi * (math.pi * 3.08641975308642e-5)))) elif a <= 1.42e+135: tmp = (a * a) + ((angle * angle) * ((math.pi * math.pi) * (3.08641975308642e-5 * (b * b)))) else: tmp = a * a return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 4.1e-161) tmp = Float64(angle * Float64(Float64(b * b) * Float64(angle * Float64(pi * Float64(pi * 3.08641975308642e-5))))); elseif (a <= 1.42e+135) tmp = Float64(Float64(a * a) + Float64(Float64(angle * angle) * Float64(Float64(pi * pi) * Float64(3.08641975308642e-5 * Float64(b * b))))); else tmp = Float64(a * a); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 4.1e-161) tmp = angle * ((b * b) * (angle * (pi * (pi * 3.08641975308642e-5)))); elseif (a <= 1.42e+135) tmp = (a * a) + ((angle * angle) * ((pi * pi) * (3.08641975308642e-5 * (b * b)))); else tmp = a * a; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 4.1e-161], N[(angle * N[(N[(b * b), $MachinePrecision] * N[(angle * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.42e+135], N[(N[(a * a), $MachinePrecision] + N[(N[(angle * angle), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(3.08641975308642e-5 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.1 \cdot 10^{-161}:\\
\;\;\;\;angle \cdot \left(\left(b \cdot b\right) \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\mathbf{elif}\;a \leq 1.42 \cdot 10^{+135}:\\
\;\;\;\;a \cdot a + \left(angle \cdot angle\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a\\
\end{array}
\end{array}
if a < 4.0999999999999997e-161Initial program 82.6%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified82.5%
clear-numN/A
clear-numN/A
frac-2negN/A
div-invN/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
metadata-eval82.6%
Applied egg-rr82.6%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified51.2%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/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.f6439.5%
Simplified39.5%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
pow2N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
pow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6442.7%
Applied egg-rr42.7%
if 4.0999999999999997e-161 < a < 1.41999999999999998e135Initial program 77.4%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified77.4%
clear-numN/A
clear-numN/A
frac-2negN/A
div-invN/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
metadata-eval77.4%
Applied egg-rr77.4%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified62.7%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.7%
Simplified64.7%
if 1.41999999999999998e135 < a Initial program 95.9%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6495.9%
Simplified95.9%
Final simplification54.9%
(FPCore (a b angle) :precision binary64 (if (<= b 3e+191) (* a a) (* 3.08641975308642e-5 (* (* PI PI) (* b (* b (* angle angle)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 3e+191) {
tmp = a * a;
} else {
tmp = 3.08641975308642e-5 * ((((double) M_PI) * ((double) M_PI)) * (b * (b * (angle * angle))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3e+191) {
tmp = a * a;
} else {
tmp = 3.08641975308642e-5 * ((Math.PI * Math.PI) * (b * (b * (angle * angle))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 3e+191: tmp = a * a else: tmp = 3.08641975308642e-5 * ((math.pi * math.pi) * (b * (b * (angle * angle)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 3e+191) tmp = Float64(a * a); else tmp = Float64(3.08641975308642e-5 * Float64(Float64(pi * pi) * Float64(b * Float64(b * Float64(angle * angle))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3e+191) tmp = a * a; else tmp = 3.08641975308642e-5 * ((pi * pi) * (b * (b * (angle * angle)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 3e+191], N[(a * a), $MachinePrecision], N[(3.08641975308642e-5 * N[(N[(Pi * Pi), $MachinePrecision] * N[(b * N[(b * N[(angle * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{+191}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;3.08641975308642 \cdot 10^{-5} \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(b \cdot \left(b \cdot \left(angle \cdot angle\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 2.9999999999999997e191Initial program 82.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6463.8%
Simplified63.8%
if 2.9999999999999997e191 < b Initial program 99.9%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified99.9%
clear-numN/A
clear-numN/A
frac-2negN/A
div-invN/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified65.9%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/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.f6480.9%
Simplified80.9%
pow2N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6497.2%
Applied egg-rr97.2%
Final simplification66.4%
(FPCore (a b angle) :precision binary64 (if (<= b 1e+157) (* a a) (* angle (* (* b b) (* angle (* PI (* PI 3.08641975308642e-5)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1e+157) {
tmp = a * a;
} else {
tmp = angle * ((b * b) * (angle * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1e+157) {
tmp = a * a;
} else {
tmp = angle * ((b * b) * (angle * (Math.PI * (Math.PI * 3.08641975308642e-5))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1e+157: tmp = a * a else: tmp = angle * ((b * b) * (angle * (math.pi * (math.pi * 3.08641975308642e-5)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1e+157) tmp = Float64(a * a); else tmp = Float64(angle * Float64(Float64(b * b) * Float64(angle * Float64(pi * Float64(pi * 3.08641975308642e-5))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1e+157) tmp = a * a; else tmp = angle * ((b * b) * (angle * (pi * (pi * 3.08641975308642e-5)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1e+157], N[(a * a), $MachinePrecision], N[(angle * N[(N[(b * b), $MachinePrecision] * N[(angle * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 10^{+157}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\left(b \cdot b\right) \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 9.99999999999999983e156Initial program 81.8%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6463.2%
Simplified63.2%
if 9.99999999999999983e156 < b Initial program 99.9%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified99.9%
clear-numN/A
clear-numN/A
frac-2negN/A
div-invN/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified50.7%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/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.f6469.9%
Simplified69.9%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
pow2N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
pow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f6477.9%
Applied egg-rr77.9%
Final simplification64.7%
(FPCore (a b angle) :precision binary64 (if (<= b 3.8e+191) (* a a) (* (* angle angle) (* (* b b) (* (* PI PI) 3.08641975308642e-5)))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 3.8e+191) {
tmp = a * a;
} else {
tmp = (angle * angle) * ((b * b) * ((((double) M_PI) * ((double) M_PI)) * 3.08641975308642e-5));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3.8e+191) {
tmp = a * a;
} else {
tmp = (angle * angle) * ((b * b) * ((Math.PI * Math.PI) * 3.08641975308642e-5));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 3.8e+191: tmp = a * a else: tmp = (angle * angle) * ((b * b) * ((math.pi * math.pi) * 3.08641975308642e-5)) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 3.8e+191) tmp = Float64(a * a); else tmp = Float64(Float64(angle * angle) * Float64(Float64(b * b) * Float64(Float64(pi * pi) * 3.08641975308642e-5))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3.8e+191) tmp = a * a; else tmp = (angle * angle) * ((b * b) * ((pi * pi) * 3.08641975308642e-5)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 3.8e+191], N[(a * a), $MachinePrecision], N[(N[(angle * angle), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.8 \cdot 10^{+191}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\\
\end{array}
\end{array}
if b < 3.7999999999999998e191Initial program 82.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6463.8%
Simplified63.8%
if 3.7999999999999998e191 < b Initial program 99.9%
+-lowering-+.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
cos-lowering-cos.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
pow-lowering-pow.f64N/A
Simplified99.9%
clear-numN/A
clear-numN/A
frac-2negN/A
div-invN/A
associate-/r*N/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
frac-2negN/A
metadata-evalN/A
remove-double-negN/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-evalN/A
metadata-eval99.8%
Applied egg-rr99.8%
Taylor expanded in angle around 0
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
associate-*r*N/A
distribute-rgt-outN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
+-lowering-+.f64N/A
Simplified65.9%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/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.f6480.9%
Simplified80.9%
Final simplification65.1%
(FPCore (a b angle) :precision binary64 (* a a))
double code(double a, double b, double angle) {
return a * a;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = a * a
end function
public static double code(double a, double b, double angle) {
return a * a;
}
def code(a, b, angle): return a * a
function code(a, b, angle) return Float64(a * a) end
function tmp = code(a, b, angle) tmp = a * a; end
code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a
\end{array}
Initial program 83.7%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6460.1%
Simplified60.1%
herbie shell --seed 2024164
(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)))