
(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 15 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
(*
(sqrt PI)
(*
(* angle 0.005555555555555556)
(sqrt
(*
(pow (* (* PI PI) (sqrt PI)) 0.3333333333333333)
(cbrt (sqrt PI))))))))
2.0)
(pow (* b (sin (* 0.005555555555555556 (* angle PI)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((sqrt(((double) M_PI)) * ((angle * 0.005555555555555556) * sqrt((pow(((((double) M_PI) * ((double) M_PI)) * sqrt(((double) M_PI))), 0.3333333333333333) * cbrt(sqrt(((double) M_PI))))))))), 2.0) + pow((b * sin((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((Math.sqrt(Math.PI) * ((angle * 0.005555555555555556) * Math.sqrt((Math.pow(((Math.PI * Math.PI) * Math.sqrt(Math.PI)), 0.3333333333333333) * Math.cbrt(Math.sqrt(Math.PI)))))))), 2.0) + Math.pow((b * Math.sin((0.005555555555555556 * (angle * Math.PI)))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * cos(Float64(sqrt(pi) * Float64(Float64(angle * 0.005555555555555556) * sqrt(Float64((Float64(Float64(pi * pi) * sqrt(pi)) ^ 0.3333333333333333) * cbrt(sqrt(pi)))))))) ^ 2.0) + (Float64(b * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[Sqrt[N[(N[Power[N[(N[(Pi * Pi), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\sqrt{\pi} \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt{{\left(\left(\pi \cdot \pi\right) \cdot \sqrt{\pi}\right)}^{0.3333333333333333} \cdot \sqrt[3]{\sqrt{\pi}}}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 77.4%
add-cube-cbrtN/A
lift-/.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6477.4
Applied egg-rr77.4%
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied egg-rr77.4%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f6477.4
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6477.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied egg-rr77.5%
add-cbrt-cubeN/A
pow1/3N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lower-cbrt.f6477.5
Applied egg-rr77.5%
Final simplification77.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* 0.005555555555555556 (* angle PI)))) 2.0) (pow (* a (cos (* (sqrt PI) (* (* angle 0.005555555555555556) (sqrt PI))))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0) + pow((a * cos((sqrt(((double) M_PI)) * ((angle * 0.005555555555555556) * sqrt(((double) M_PI)))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((0.005555555555555556 * (angle * Math.PI)))), 2.0) + Math.pow((a * Math.cos((Math.sqrt(Math.PI) * ((angle * 0.005555555555555556) * Math.sqrt(Math.PI))))), 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin((0.005555555555555556 * (angle * math.pi)))), 2.0) + math.pow((a * math.cos((math.sqrt(math.pi) * ((angle * 0.005555555555555556) * math.sqrt(math.pi))))), 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0) + (Float64(a * cos(Float64(sqrt(pi) * Float64(Float64(angle * 0.005555555555555556) * sqrt(pi))))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin((0.005555555555555556 * (angle * pi)))) ^ 2.0) + ((a * cos((sqrt(pi) * ((angle * 0.005555555555555556) * sqrt(pi))))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(\sqrt{\pi} \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt{\pi}\right)\right)\right)}^{2}
\end{array}
Initial program 77.4%
add-cube-cbrtN/A
lift-/.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6477.4
Applied egg-rr77.4%
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied egg-rr77.4%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f6477.4
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6477.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied egg-rr77.5%
Final simplification77.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (/ (* angle PI) 180.0))) 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(((angle * ((double) M_PI)) / 180.0))), 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(((angle * Math.PI) / 180.0))), 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(((angle * math.pi) / 180.0))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle * pi) / 180.0))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos((pi * (angle / 180.0)))) ^ 2.0) + ((b * sin(((angle * pi) / 180.0))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2}
\end{array}
Initial program 77.4%
lift-PI.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6477.4
Applied egg-rr77.4%
Final simplification77.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* 0.005555555555555556 (* angle PI)))) 2.0) (pow (* a (cos (* PI (/ angle 180.0)))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0) + pow((a * cos((((double) M_PI) * (angle / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((0.005555555555555556 * (angle * Math.PI)))), 2.0) + Math.pow((a * Math.cos((Math.PI * (angle / 180.0)))), 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin((0.005555555555555556 * (angle * math.pi)))), 2.0) + math.pow((a * math.cos((math.pi * (angle / 180.0)))), 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0) + (Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin((0.005555555555555556 * (angle * pi)))) ^ 2.0) + ((a * cos((pi * (angle / 180.0)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} + {\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Initial program 77.4%
lift-PI.f64N/A
div-invN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-eval77.4
Applied egg-rr77.4%
Final simplification77.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* angle (* 0.005555555555555556 PI)))) 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((angle * (0.005555555555555556 * ((double) M_PI))))), 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((angle * (0.005555555555555556 * Math.PI)))), 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((angle * (0.005555555555555556 * math.pi)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(angle * Float64(0.005555555555555556 * pi)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos((pi * (angle / 180.0)))) ^ 2.0) + ((b * sin((angle * (0.005555555555555556 * pi)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 77.4%
lift-PI.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval77.4
Applied egg-rr77.4%
Final simplification77.4%
(FPCore (a b angle) :precision binary64 (+ (* (+ 0.5 (* 0.5 (cos (* 2.0 (* (* angle 0.005555555555555556) PI))))) (* a a)) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
double code(double a, double b, double angle) {
return ((0.5 + (0.5 * cos((2.0 * ((angle * 0.005555555555555556) * ((double) M_PI)))))) * (a * a)) + pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return ((0.5 + (0.5 * Math.cos((2.0 * ((angle * 0.005555555555555556) * Math.PI))))) * (a * a)) + Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0);
}
def code(a, b, angle): return ((0.5 + (0.5 * math.cos((2.0 * ((angle * 0.005555555555555556) * math.pi))))) * (a * a)) + math.pow((b * math.sin((math.pi * (angle / 180.0)))), 2.0)
function code(a, b, angle) return Float64(Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(angle * 0.005555555555555556) * pi))))) * Float64(a * a)) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((0.5 + (0.5 * cos((2.0 * ((angle * 0.005555555555555556) * pi))))) * (a * a)) + ((b * sin((pi * (angle / 180.0)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[(N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(angle * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right) \cdot \left(a \cdot a\right) + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Initial program 77.4%
rem-exp-logN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
pow-prod-downN/A
rem-exp-logN/A
*-commutativeN/A
lower-*.f64N/A
Applied egg-rr77.4%
Final simplification77.4%
(FPCore (a b angle)
:precision binary64
(if (<= a 3.7e-135)
(* (* b b) (pow (sin (* 0.005555555555555556 (* angle PI))) 2.0))
(if (<= a 2.1e+82)
(fma
(* a a)
(cos (* (* angle 0.005555555555555556) PI))
(* b (* b (* angle (* angle (* PI (* PI 3.08641975308642e-5)))))))
(* (* a a) (fma 0.5 (cos (* angle (* PI 0.011111111111111112))) 0.5)))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 3.7e-135) {
tmp = (b * b) * pow(sin((0.005555555555555556 * (angle * ((double) M_PI)))), 2.0);
} else if (a <= 2.1e+82) {
tmp = fma((a * a), cos(((angle * 0.005555555555555556) * ((double) M_PI))), (b * (b * (angle * (angle * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)))))));
} else {
tmp = (a * a) * fma(0.5, cos((angle * (((double) M_PI) * 0.011111111111111112))), 0.5);
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 3.7e-135) tmp = Float64(Float64(b * b) * (sin(Float64(0.005555555555555556 * Float64(angle * pi))) ^ 2.0)); elseif (a <= 2.1e+82) tmp = fma(Float64(a * a), cos(Float64(Float64(angle * 0.005555555555555556) * pi)), Float64(b * Float64(b * Float64(angle * Float64(angle * Float64(pi * Float64(pi * 3.08641975308642e-5))))))); else tmp = Float64(Float64(a * a) * fma(0.5, cos(Float64(angle * Float64(pi * 0.011111111111111112))), 0.5)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 3.7e-135], N[(N[(b * b), $MachinePrecision] * N[Power[N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.1e+82], N[(N[(a * a), $MachinePrecision] * N[Cos[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] + N[(b * N[(b * N[(angle * N[(angle * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.7 \cdot 10^{-135}:\\
\;\;\;\;\left(b \cdot b\right) \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{2}\\
\mathbf{elif}\;a \leq 2.1 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot a, \cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), b \cdot \left(b \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), 0.5\right)\\
\end{array}
\end{array}
if a < 3.6999999999999997e-135Initial program 75.4%
Taylor expanded in a around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-pow.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-sin.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6442.5
Simplified42.5%
if 3.6999999999999997e-135 < a < 2.1e82Initial program 75.3%
Applied egg-rr64.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
cos-2N/A
sqr-cos-aN/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-+.f64N/A
sqr-sin-aN/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
Applied egg-rr64.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6461.8
Simplified61.8%
Taylor expanded in angle around 0
distribute-rgt-out--N/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f6467.8
Simplified67.8%
if 2.1e82 < a Initial program 85.3%
Applied egg-rr61.4%
Taylor expanded in b around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6485.4
Simplified85.4%
Final simplification56.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* 0.005555555555555556 (* angle PI)))) 2.0) (* a a)))
double code(double a, double b, double angle) {
return pow((b * sin((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0) + (a * a);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((0.005555555555555556 * (angle * Math.PI)))), 2.0) + (a * a);
}
def code(a, b, angle): return math.pow((b * math.sin((0.005555555555555556 * (angle * math.pi)))), 2.0) + (a * a)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0) + Float64(a * a)) end
function tmp = code(a, b, angle) tmp = ((b * sin((0.005555555555555556 * (angle * pi)))) ^ 2.0) + (a * a); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2} + a \cdot a
\end{array}
Initial program 77.4%
add-cube-cbrtN/A
lift-/.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6477.4
Applied egg-rr77.4%
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied egg-rr77.4%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f6477.4
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f6477.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied egg-rr77.5%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6476.5
Simplified76.5%
Final simplification76.5%
(FPCore (a b angle)
:precision binary64
(if (<= a 7.2e-158)
(* angle (* 3.08641975308642e-5 (* (* angle PI) (* PI (* b b)))))
(if (<= a 3.8e+83)
(fma
(* a a)
(cos (* (* angle 0.005555555555555556) PI))
(* b (* b (* angle (* angle (* PI (* PI 3.08641975308642e-5)))))))
(* (* a a) (fma 0.5 (cos (* angle (* PI 0.011111111111111112))) 0.5)))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 7.2e-158) {
tmp = angle * (3.08641975308642e-5 * ((angle * ((double) M_PI)) * (((double) M_PI) * (b * b))));
} else if (a <= 3.8e+83) {
tmp = fma((a * a), cos(((angle * 0.005555555555555556) * ((double) M_PI))), (b * (b * (angle * (angle * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5)))))));
} else {
tmp = (a * a) * fma(0.5, cos((angle * (((double) M_PI) * 0.011111111111111112))), 0.5);
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 7.2e-158) tmp = Float64(angle * Float64(3.08641975308642e-5 * Float64(Float64(angle * pi) * Float64(pi * Float64(b * b))))); elseif (a <= 3.8e+83) tmp = fma(Float64(a * a), cos(Float64(Float64(angle * 0.005555555555555556) * pi)), Float64(b * Float64(b * Float64(angle * Float64(angle * Float64(pi * Float64(pi * 3.08641975308642e-5))))))); else tmp = Float64(Float64(a * a) * fma(0.5, cos(Float64(angle * Float64(pi * 0.011111111111111112))), 0.5)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 7.2e-158], N[(angle * N[(3.08641975308642e-5 * N[(N[(angle * Pi), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.8e+83], N[(N[(a * a), $MachinePrecision] * N[Cos[N[(N[(angle * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] + N[(b * N[(b * N[(angle * N[(angle * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.2 \cdot 10^{-158}:\\
\;\;\;\;angle \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\right)\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{+83}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot a, \cos \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right), b \cdot \left(b \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), 0.5\right)\\
\end{array}
\end{array}
if a < 7.19999999999999982e-158Initial program 77.3%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified37.7%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6444.9
Simplified44.9%
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6445.0
Applied egg-rr45.0%
if 7.19999999999999982e-158 < a < 3.8000000000000002e83Initial program 70.7%
Applied egg-rr60.8%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
cos-2N/A
sqr-cos-aN/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-+.f64N/A
sqr-sin-aN/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
Applied egg-rr60.9%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.5
Simplified58.5%
Taylor expanded in angle around 0
distribute-rgt-out--N/A
metadata-evalN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f6462.9
Simplified62.9%
if 3.8000000000000002e83 < a Initial program 85.3%
Applied egg-rr61.4%
Taylor expanded in b around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6485.4
Simplified85.4%
Final simplification57.3%
(FPCore (a b angle)
:precision binary64
(if (<= a 7.5e+71)
(fma
(*
(* angle PI)
(* PI (fma b (* b 3.08641975308642e-5) (* a (* a -3.08641975308642e-5)))))
angle
(* a a))
(* (* a a) (fma 0.5 (cos (* angle (* PI 0.011111111111111112))) 0.5))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 7.5e+71) {
tmp = fma(((angle * ((double) M_PI)) * (((double) M_PI) * fma(b, (b * 3.08641975308642e-5), (a * (a * -3.08641975308642e-5))))), angle, (a * a));
} else {
tmp = (a * a) * fma(0.5, cos((angle * (((double) M_PI) * 0.011111111111111112))), 0.5);
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 7.5e+71) tmp = fma(Float64(Float64(angle * pi) * Float64(pi * fma(b, Float64(b * 3.08641975308642e-5), Float64(a * Float64(a * -3.08641975308642e-5))))), angle, Float64(a * a)); else tmp = Float64(Float64(a * a) * fma(0.5, cos(Float64(angle * Float64(pi * 0.011111111111111112))), 0.5)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 7.5e+71], N[(N[(N[(angle * Pi), $MachinePrecision] * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision] + N[(a * N[(a * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.5 \cdot 10^{+71}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(b, b \cdot 3.08641975308642 \cdot 10^{-5}, a \cdot \left(a \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)\right), angle, a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), 0.5\right)\\
\end{array}
\end{array}
if a < 7.50000000000000007e71Initial program 75.6%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified43.9%
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied egg-rr47.9%
if 7.50000000000000007e71 < a Initial program 84.3%
Applied egg-rr61.3%
Taylor expanded in b around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6484.2
Simplified84.2%
(FPCore (a b angle)
:precision binary64
(if (<= a 5e+72)
(fma
(*
(* angle PI)
(* PI (fma b (* b 3.08641975308642e-5) (* a (* a -3.08641975308642e-5)))))
angle
(* a a))
(* a a)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 5e+72) {
tmp = fma(((angle * ((double) M_PI)) * (((double) M_PI) * fma(b, (b * 3.08641975308642e-5), (a * (a * -3.08641975308642e-5))))), angle, (a * a));
} else {
tmp = a * a;
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 5e+72) tmp = fma(Float64(Float64(angle * pi) * Float64(pi * fma(b, Float64(b * 3.08641975308642e-5), Float64(a * Float64(a * -3.08641975308642e-5))))), angle, Float64(a * a)); else tmp = Float64(a * a); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 5e+72], N[(N[(N[(angle * Pi), $MachinePrecision] * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision] + N[(a * N[(a * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5 \cdot 10^{+72}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(b, b \cdot 3.08641975308642 \cdot 10^{-5}, a \cdot \left(a \cdot -3.08641975308642 \cdot 10^{-5}\right)\right)\right), angle, a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a\\
\end{array}
\end{array}
if a < 4.99999999999999992e72Initial program 75.6%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified43.9%
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
Applied egg-rr47.9%
if 4.99999999999999992e72 < a Initial program 84.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6481.8
Simplified81.8%
(FPCore (a b angle)
:precision binary64
(if (<= a 9.5e-160)
(* angle (* 3.08641975308642e-5 (* (* angle PI) (* PI (* b b)))))
(if (<= a 1.4e+72)
(fma
(* angle angle)
(* PI (* PI (* (* b b) 3.08641975308642e-5)))
(* a a))
(* a a))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 9.5e-160) {
tmp = angle * (3.08641975308642e-5 * ((angle * ((double) M_PI)) * (((double) M_PI) * (b * b))));
} else if (a <= 1.4e+72) {
tmp = fma((angle * angle), (((double) M_PI) * (((double) M_PI) * ((b * b) * 3.08641975308642e-5))), (a * a));
} else {
tmp = a * a;
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 9.5e-160) tmp = Float64(angle * Float64(3.08641975308642e-5 * Float64(Float64(angle * pi) * Float64(pi * Float64(b * b))))); elseif (a <= 1.4e+72) tmp = fma(Float64(angle * angle), Float64(pi * Float64(pi * Float64(Float64(b * b) * 3.08641975308642e-5))), Float64(a * a)); else tmp = Float64(a * a); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 9.5e-160], N[(angle * N[(3.08641975308642e-5 * N[(N[(angle * Pi), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.4e+72], N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 9.5 \cdot 10^{-160}:\\
\;\;\;\;angle \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\right)\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{+72}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a\\
\end{array}
\end{array}
if a < 9.5000000000000002e-160Initial program 77.3%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified37.7%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6444.9
Simplified44.9%
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6445.0
Applied egg-rr45.0%
if 9.5000000000000002e-160 < a < 1.4e72Initial program 71.2%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified59.7%
Taylor expanded in b around inf
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6460.2
Simplified60.2%
if 1.4e72 < a Initial program 84.3%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6481.8
Simplified81.8%
Final simplification56.1%
(FPCore (a b angle) :precision binary64 (if (<= b 9.5e+83) (* a a) (* angle (* (* (* b b) 3.08641975308642e-5) (* PI (* angle PI))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 9.5e+83) {
tmp = a * a;
} else {
tmp = angle * (((b * b) * 3.08641975308642e-5) * (((double) M_PI) * (angle * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 9.5e+83) {
tmp = a * a;
} else {
tmp = angle * (((b * b) * 3.08641975308642e-5) * (Math.PI * (angle * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 9.5e+83: tmp = a * a else: tmp = angle * (((b * b) * 3.08641975308642e-5) * (math.pi * (angle * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 9.5e+83) tmp = Float64(a * a); else tmp = Float64(angle * Float64(Float64(Float64(b * b) * 3.08641975308642e-5) * Float64(pi * Float64(angle * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 9.5e+83) tmp = a * a; else tmp = angle * (((b * b) * 3.08641975308642e-5) * (pi * (angle * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 9.5e+83], N[(a * a), $MachinePrecision], N[(angle * N[(N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision] * N[(Pi * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9.5 \cdot 10^{+83}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 9.5000000000000002e83Initial program 75.6%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.2
Simplified60.2%
if 9.5000000000000002e83 < b Initial program 87.0%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified51.5%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.1
Simplified64.1%
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.2
lift-*.f64N/A
*-commutativeN/A
lift-*.f6464.2
Applied egg-rr64.2%
Final simplification60.8%
(FPCore (a b angle) :precision binary64 (if (<= b 1.05e+84) (* a a) (* angle (* angle (* PI (* PI (* (* b b) 3.08641975308642e-5)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.05e+84) {
tmp = a * a;
} else {
tmp = angle * (angle * (((double) M_PI) * (((double) M_PI) * ((b * b) * 3.08641975308642e-5))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.05e+84) {
tmp = a * a;
} else {
tmp = angle * (angle * (Math.PI * (Math.PI * ((b * b) * 3.08641975308642e-5))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.05e+84: tmp = a * a else: tmp = angle * (angle * (math.pi * (math.pi * ((b * b) * 3.08641975308642e-5)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.05e+84) tmp = Float64(a * a); else tmp = Float64(angle * Float64(angle * Float64(pi * Float64(pi * Float64(Float64(b * b) * 3.08641975308642e-5))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.05e+84) tmp = a * a; else tmp = angle * (angle * (pi * (pi * ((b * b) * 3.08641975308642e-5)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.05e+84], N[(a * a), $MachinePrecision], N[(angle * N[(angle * N[(Pi * N[(Pi * N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.05 \cdot 10^{+84}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(angle \cdot \left(\pi \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.05000000000000009e84Initial program 75.6%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.2
Simplified60.2%
if 1.05000000000000009e84 < b Initial program 87.0%
Taylor expanded in angle around 0
lower-fma.f64N/A
Simplified51.5%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6464.1
Simplified64.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 77.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6456.6
Simplified56.6%
herbie shell --seed 2024207
(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)))