
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (pow (cbrt (sqrt PI)) 3.0)))
(if (<= (pow b 2.0) 4e+218)
(*
(cos (/ PI (/ -180.0 angle)))
(* (+ b a) (* (- b a) (* 2.0 (sin (/ PI (/ 180.0 angle)))))))
(*
(*
(+ b a)
(* (- b a) (* 2.0 (sin (* PI (* angle 0.005555555555555556))))))
(cos (* angle (* 0.005555555555555556 (* t_0 t_0))))))))
double code(double a, double b, double angle) {
double t_0 = pow(cbrt(sqrt(((double) M_PI))), 3.0);
double tmp;
if (pow(b, 2.0) <= 4e+218) {
tmp = cos((((double) M_PI) / (-180.0 / angle))) * ((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) / (180.0 / angle))))));
} else {
tmp = ((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) * (angle * 0.005555555555555556)))))) * cos((angle * (0.005555555555555556 * (t_0 * t_0))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.pow(Math.cbrt(Math.sqrt(Math.PI)), 3.0);
double tmp;
if (Math.pow(b, 2.0) <= 4e+218) {
tmp = Math.cos((Math.PI / (-180.0 / angle))) * ((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI / (180.0 / angle))))));
} else {
tmp = ((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI * (angle * 0.005555555555555556)))))) * Math.cos((angle * (0.005555555555555556 * (t_0 * t_0))));
}
return tmp;
}
function code(a, b, angle) t_0 = cbrt(sqrt(pi)) ^ 3.0 tmp = 0.0 if ((b ^ 2.0) <= 4e+218) tmp = Float64(cos(Float64(pi / Float64(-180.0 / angle))) * Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi / Float64(180.0 / angle))))))); else tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))) * cos(Float64(angle * Float64(0.005555555555555556 * Float64(t_0 * t_0))))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 4e+218], N[(N[Cos[N[(Pi / N[(-180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle * N[(0.005555555555555556 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\\
\mathbf{if}\;{b}^{2} \leq 4 \cdot 10^{+218}:\\
\;\;\;\;\cos \left(\frac{\pi}{\frac{-180}{angle}}\right) \cdot \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \left(t\_0 \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 4.00000000000000033e218Initial program 58.2%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr62.3%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.4
Applied egg-rr64.4%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6463.8
Applied egg-rr63.8%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
associate-/r/N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
cos-negN/A
lower-cos.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval66.6
Applied egg-rr66.6%
if 4.00000000000000033e218 < (pow.f64 b #s(literal 2 binary64)) Initial program 41.4%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr76.6%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6472.5
Applied egg-rr72.5%
add-cube-cbrtN/A
pow3N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
cbrt-prodN/A
unpow-prod-downN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cbrt.f64N/A
lower-pow.f64N/A
lower-cbrt.f6484.2
Applied egg-rr84.2%
Final simplification71.7%
(FPCore (a b angle)
:precision binary64
(if (<= (pow b 2.0) 1e+213)
(*
(cos (/ PI (/ -180.0 angle)))
(* (+ b a) (* (- b a) (* 2.0 (sin (/ PI (/ 180.0 angle)))))))
(*
(* (+ b a) (* (- b a) (* 2.0 (sin (* PI (* angle 0.005555555555555556))))))
(cos
(*
angle
(*
0.005555555555555556
(* (sqrt (* PI (sqrt PI))) (sqrt (sqrt PI)))))))))
double code(double a, double b, double angle) {
double tmp;
if (pow(b, 2.0) <= 1e+213) {
tmp = cos((((double) M_PI) / (-180.0 / angle))) * ((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) / (180.0 / angle))))));
} else {
tmp = ((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) * (angle * 0.005555555555555556)))))) * cos((angle * (0.005555555555555556 * (sqrt((((double) M_PI) * sqrt(((double) M_PI)))) * sqrt(sqrt(((double) M_PI)))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(b, 2.0) <= 1e+213) {
tmp = Math.cos((Math.PI / (-180.0 / angle))) * ((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI / (180.0 / angle))))));
} else {
tmp = ((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI * (angle * 0.005555555555555556)))))) * Math.cos((angle * (0.005555555555555556 * (Math.sqrt((Math.PI * Math.sqrt(Math.PI))) * Math.sqrt(Math.sqrt(Math.PI))))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if math.pow(b, 2.0) <= 1e+213: tmp = math.cos((math.pi / (-180.0 / angle))) * ((b + a) * ((b - a) * (2.0 * math.sin((math.pi / (180.0 / angle)))))) else: tmp = ((b + a) * ((b - a) * (2.0 * math.sin((math.pi * (angle * 0.005555555555555556)))))) * math.cos((angle * (0.005555555555555556 * (math.sqrt((math.pi * math.sqrt(math.pi))) * math.sqrt(math.sqrt(math.pi)))))) return tmp
function code(a, b, angle) tmp = 0.0 if ((b ^ 2.0) <= 1e+213) tmp = Float64(cos(Float64(pi / Float64(-180.0 / angle))) * Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi / Float64(180.0 / angle))))))); else tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))) * cos(Float64(angle * Float64(0.005555555555555556 * Float64(sqrt(Float64(pi * sqrt(pi))) * sqrt(sqrt(pi))))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b ^ 2.0) <= 1e+213) tmp = cos((pi / (-180.0 / angle))) * ((b + a) * ((b - a) * (2.0 * sin((pi / (180.0 / angle)))))); else tmp = ((b + a) * ((b - a) * (2.0 * sin((pi * (angle * 0.005555555555555556)))))) * cos((angle * (0.005555555555555556 * (sqrt((pi * sqrt(pi))) * sqrt(sqrt(pi)))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 1e+213], N[(N[Cos[N[(Pi / N[(-180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle * N[(0.005555555555555556 * N[(N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 10^{+213}:\\
\;\;\;\;\cos \left(\frac{\pi}{\frac{-180}{angle}}\right) \cdot \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \cos \left(angle \cdot \left(0.005555555555555556 \cdot \left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 9.99999999999999984e212Initial program 58.5%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr62.7%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.9
Applied egg-rr64.9%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6464.3
Applied egg-rr64.3%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
associate-/r/N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
cos-negN/A
lower-cos.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval67.1
Applied egg-rr67.1%
if 9.99999999999999984e212 < (pow.f64 b #s(literal 2 binary64)) Initial program 41.4%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr75.1%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6471.0
Applied egg-rr71.0%
lift-PI.f6471.0
rem-square-sqrtN/A
sqrt-unprodN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-*r*N/A
sqrt-prodN/A
pow1/2N/A
lift-sqrt.f64N/A
sqrt-pow2N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
sqrt-pow1N/A
pow1/2N/A
lift-sqrt.f64N/A
lower-sqrt.f6480.2
Applied egg-rr80.2%
Final simplification71.0%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 2e+82)
(*
(* (+ b a) (* (- b a) (* 2.0 (sin (* PI (* angle 0.005555555555555556))))))
(cos (* 0.005555555555555556 (* PI angle))))
(*
(*
(+ b a)
(*
(- b a)
(* 2.0 (sin (* (/ (sqrt PI) 180.0) (/ (sqrt PI) (/ 1.0 angle)))))))
(cos (* angle (* PI 0.005555555555555556))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2e+82) {
tmp = ((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) * (angle * 0.005555555555555556)))))) * cos((0.005555555555555556 * (((double) M_PI) * angle)));
} else {
tmp = ((b + a) * ((b - a) * (2.0 * sin(((sqrt(((double) M_PI)) / 180.0) * (sqrt(((double) M_PI)) / (1.0 / angle))))))) * cos((angle * (((double) M_PI) * 0.005555555555555556)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2e+82) {
tmp = ((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI * (angle * 0.005555555555555556)))))) * Math.cos((0.005555555555555556 * (Math.PI * angle)));
} else {
tmp = ((b + a) * ((b - a) * (2.0 * Math.sin(((Math.sqrt(Math.PI) / 180.0) * (Math.sqrt(Math.PI) / (1.0 / angle))))))) * Math.cos((angle * (Math.PI * 0.005555555555555556)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 2e+82: tmp = ((b + a) * ((b - a) * (2.0 * math.sin((math.pi * (angle * 0.005555555555555556)))))) * math.cos((0.005555555555555556 * (math.pi * angle))) else: tmp = ((b + a) * ((b - a) * (2.0 * math.sin(((math.sqrt(math.pi) / 180.0) * (math.sqrt(math.pi) / (1.0 / angle))))))) * math.cos((angle * (math.pi * 0.005555555555555556))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 2e+82) tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))) * cos(Float64(0.005555555555555556 * Float64(pi * angle)))); else tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(Float64(sqrt(pi) / 180.0) * Float64(sqrt(pi) / Float64(1.0 / angle))))))) * cos(Float64(angle * Float64(pi * 0.005555555555555556)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 2e+82) tmp = ((b + a) * ((b - a) * (2.0 * sin((pi * (angle * 0.005555555555555556)))))) * cos((0.005555555555555556 * (pi * angle))); else tmp = ((b + a) * ((b - a) * (2.0 * sin(((sqrt(pi) / 180.0) * (sqrt(pi) / (1.0 / angle))))))) * cos((angle * (pi * 0.005555555555555556))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+82], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+82}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\frac{\sqrt{\pi}}{180} \cdot \frac{\sqrt{\pi}}{\frac{1}{angle}}\right)\right)\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.9999999999999999e82Initial program 60.2%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr75.5%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6475.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6475.5
Applied egg-rr75.5%
if 1.9999999999999999e82 < (/.f64 angle #s(literal 180 binary64)) Initial program 23.9%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr27.2%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6428.0
Applied egg-rr28.0%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6425.9
Applied egg-rr25.9%
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6435.9
Applied egg-rr35.9%
Final simplification68.1%
(FPCore (a b angle)
:precision binary64
(if (<= b 2e+185)
(*
(cos (/ PI (/ -180.0 angle)))
(* (+ b a) (* (- b a) (* 2.0 (sin (/ PI (/ 180.0 angle)))))))
(*
(cos (* PI (/ angle 180.0)))
(* (- b a) (* (* PI angle) (* (+ b a) 0.011111111111111112))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 2e+185) {
tmp = cos((((double) M_PI) / (-180.0 / angle))) * ((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) / (180.0 / angle))))));
} else {
tmp = cos((((double) M_PI) * (angle / 180.0))) * ((b - a) * ((((double) M_PI) * angle) * ((b + a) * 0.011111111111111112)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 2e+185) {
tmp = Math.cos((Math.PI / (-180.0 / angle))) * ((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI / (180.0 / angle))))));
} else {
tmp = Math.cos((Math.PI * (angle / 180.0))) * ((b - a) * ((Math.PI * angle) * ((b + a) * 0.011111111111111112)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 2e+185: tmp = math.cos((math.pi / (-180.0 / angle))) * ((b + a) * ((b - a) * (2.0 * math.sin((math.pi / (180.0 / angle)))))) else: tmp = math.cos((math.pi * (angle / 180.0))) * ((b - a) * ((math.pi * angle) * ((b + a) * 0.011111111111111112))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 2e+185) tmp = Float64(cos(Float64(pi / Float64(-180.0 / angle))) * Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi / Float64(180.0 / angle))))))); else tmp = Float64(cos(Float64(pi * Float64(angle / 180.0))) * Float64(Float64(b - a) * Float64(Float64(pi * angle) * Float64(Float64(b + a) * 0.011111111111111112)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 2e+185) tmp = cos((pi / (-180.0 / angle))) * ((b + a) * ((b - a) * (2.0 * sin((pi / (180.0 / angle)))))); else tmp = cos((pi * (angle / 180.0))) * ((b - a) * ((pi * angle) * ((b + a) * 0.011111111111111112))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 2e+185], N[(N[Cos[N[(Pi / N[(-180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * angle), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2 \cdot 10^{+185}:\\
\;\;\;\;\cos \left(\frac{\pi}{\frac{-180}{angle}}\right) \cdot \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(b - a\right) \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if b < 2e185Initial program 55.0%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr64.8%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6465.2
Applied egg-rr65.2%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6465.1
Applied egg-rr65.1%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
associate-/r/N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
cos-negN/A
lower-cos.f64N/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
metadata-eval66.9
Applied egg-rr66.9%
if 2e185 < b Initial program 36.5%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6467.5
Simplified67.5%
lift-PI.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f6491.3
lift-+.f64N/A
+-commutativeN/A
lift-+.f6491.3
Applied egg-rr91.3%
Final simplification69.1%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 5e+128)
(*
(* (+ b a) (* (- b a) (* 2.0 (sin (* PI (* angle 0.005555555555555556))))))
(cos (* 0.005555555555555556 (* PI angle))))
(* (+ b a) (* (- b a) (* 2.0 (sin (/ PI (/ 180.0 angle))))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+128) {
tmp = ((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) * (angle * 0.005555555555555556)))))) * cos((0.005555555555555556 * (((double) M_PI) * angle)));
} else {
tmp = (b + a) * ((b - a) * (2.0 * sin((((double) M_PI) / (180.0 / angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+128) {
tmp = ((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI * (angle * 0.005555555555555556)))))) * Math.cos((0.005555555555555556 * (Math.PI * angle)));
} else {
tmp = (b + a) * ((b - a) * (2.0 * Math.sin((Math.PI / (180.0 / angle)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 5e+128: tmp = ((b + a) * ((b - a) * (2.0 * math.sin((math.pi * (angle * 0.005555555555555556)))))) * math.cos((0.005555555555555556 * (math.pi * angle))) else: tmp = (b + a) * ((b - a) * (2.0 * math.sin((math.pi / (180.0 / angle))))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+128) tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))) * cos(Float64(0.005555555555555556 * Float64(pi * angle)))); else tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi / Float64(180.0 / angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 5e+128) tmp = ((b + a) * ((b - a) * (2.0 * sin((pi * (angle * 0.005555555555555556)))))) * cos((0.005555555555555556 * (pi * angle))); else tmp = (b + a) * ((b - a) * (2.0 * sin((pi / (180.0 / angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+128], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+128}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5e128Initial program 58.9%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr73.7%
lift-PI.f64N/A
associate-*r/N/A
*-commutativeN/A
lift-*.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6473.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.8
Applied egg-rr73.8%
if 5e128 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.4%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr28.3%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6428.8
Applied egg-rr28.8%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6426.4
Applied egg-rr26.4%
Taylor expanded in angle around 0
Simplified37.6%
Final simplification68.0%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 5e+128)
(*
(* (+ b a) (* (- b a) (* 2.0 (sin (* PI (* angle 0.005555555555555556))))))
(cos (* angle (* PI 0.005555555555555556))))
(* (+ b a) (* (- b a) (* 2.0 (sin (/ PI (/ 180.0 angle))))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+128) {
tmp = ((b + a) * ((b - a) * (2.0 * sin((((double) M_PI) * (angle * 0.005555555555555556)))))) * cos((angle * (((double) M_PI) * 0.005555555555555556)));
} else {
tmp = (b + a) * ((b - a) * (2.0 * sin((((double) M_PI) / (180.0 / angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+128) {
tmp = ((b + a) * ((b - a) * (2.0 * Math.sin((Math.PI * (angle * 0.005555555555555556)))))) * Math.cos((angle * (Math.PI * 0.005555555555555556)));
} else {
tmp = (b + a) * ((b - a) * (2.0 * Math.sin((Math.PI / (180.0 / angle)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 5e+128: tmp = ((b + a) * ((b - a) * (2.0 * math.sin((math.pi * (angle * 0.005555555555555556)))))) * math.cos((angle * (math.pi * 0.005555555555555556))) else: tmp = (b + a) * ((b - a) * (2.0 * math.sin((math.pi / (180.0 / angle))))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+128) tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))) * cos(Float64(angle * Float64(pi * 0.005555555555555556)))); else tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi / Float64(180.0 / angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 5e+128) tmp = ((b + a) * ((b - a) * (2.0 * sin((pi * (angle * 0.005555555555555556)))))) * cos((angle * (pi * 0.005555555555555556))); else tmp = (b + a) * ((b - a) * (2.0 * sin((pi / (180.0 / angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+128], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+128}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5e128Initial program 58.9%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr73.7%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6473.9
Applied egg-rr73.9%
if 5e128 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.4%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr28.3%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6428.8
Applied egg-rr28.8%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6426.4
Applied egg-rr26.4%
Taylor expanded in angle around 0
Simplified37.6%
Final simplification68.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556))))
(if (<= (/ angle 180.0) 5e+128)
(* (* (+ b a) (* (- b a) (* 2.0 (sin t_0)))) (cos t_0))
(* (+ b a) (* (- b a) (* 2.0 (sin (/ PI (/ 180.0 angle)))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double tmp;
if ((angle / 180.0) <= 5e+128) {
tmp = ((b + a) * ((b - a) * (2.0 * sin(t_0)))) * cos(t_0);
} else {
tmp = (b + a) * ((b - a) * (2.0 * sin((((double) M_PI) / (180.0 / angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double tmp;
if ((angle / 180.0) <= 5e+128) {
tmp = ((b + a) * ((b - a) * (2.0 * Math.sin(t_0)))) * Math.cos(t_0);
} else {
tmp = (b + a) * ((b - a) * (2.0 * Math.sin((Math.PI / (180.0 / angle)))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle * 0.005555555555555556) tmp = 0 if (angle / 180.0) <= 5e+128: tmp = ((b + a) * ((b - a) * (2.0 * math.sin(t_0)))) * math.cos(t_0) else: tmp = (b + a) * ((b - a) * (2.0 * math.sin((math.pi / (180.0 / angle))))) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+128) tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(t_0)))) * cos(t_0)); else tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(Float64(pi / Float64(180.0 / angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle * 0.005555555555555556); tmp = 0.0; if ((angle / 180.0) <= 5e+128) tmp = ((b + a) * ((b - a) * (2.0 * sin(t_0)))) * cos(t_0); else tmp = (b + a) * ((b - a) * (2.0 * sin((pi / (180.0 / angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+128], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+128}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin t\_0\right)\right)\right) \cdot \cos t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5e128Initial program 58.9%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr73.7%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6473.7
lift-/.f64N/A
div-invN/A
metadata-evalN/A
lift-*.f6473.3
Applied egg-rr73.3%
if 5e128 < (/.f64 angle #s(literal 180 binary64)) Initial program 24.4%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr28.3%
lift-PI.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6428.8
Applied egg-rr28.8%
lift-PI.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6426.4
Applied egg-rr26.4%
Taylor expanded in angle around 0
Simplified37.6%
Final simplification67.6%
(FPCore (a b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a 2.0)) -2e-78) (* a (* (* PI angle) (* a -0.011111111111111112))) (* (* (+ b a) (* (- b a) PI)) (* angle 0.011111111111111112))))
double code(double a, double b, double angle) {
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -2e-78) {
tmp = a * ((((double) M_PI) * angle) * (a * -0.011111111111111112));
} else {
tmp = ((b + a) * ((b - a) * ((double) M_PI))) * (angle * 0.011111111111111112);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -2e-78) {
tmp = a * ((Math.PI * angle) * (a * -0.011111111111111112));
} else {
tmp = ((b + a) * ((b - a) * Math.PI)) * (angle * 0.011111111111111112);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -2e-78: tmp = a * ((math.pi * angle) * (a * -0.011111111111111112)) else: tmp = ((b + a) * ((b - a) * math.pi)) * (angle * 0.011111111111111112) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -2e-78) tmp = Float64(a * Float64(Float64(pi * angle) * Float64(a * -0.011111111111111112))); else tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * pi)) * Float64(angle * 0.011111111111111112)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= -2e-78) tmp = a * ((pi * angle) * (a * -0.011111111111111112)); else tmp = ((b + a) * ((b - a) * pi)) * (angle * 0.011111111111111112); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -2e-78], N[(a * N[(N[(Pi * angle), $MachinePrecision] * N[(a * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-78}:\\
\;\;\;\;a \cdot \left(\left(\pi \cdot angle\right) \cdot \left(a \cdot -0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \pi\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -2e-78Initial program 51.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6445.7
Simplified45.7%
Taylor expanded in angle around 0
Simplified48.6%
Taylor expanded in a around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6448.7
Simplified48.7%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6460.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6460.4
Applied egg-rr60.4%
if -2e-78 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.8%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr71.0%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6462.0
Simplified62.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f64N/A
lower-*.f6459.2
Simplified59.2%
Final simplification59.7%
(FPCore (a b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a 2.0)) -5e-273) (* a (* (* PI angle) (* a -0.011111111111111112))) (* (* PI angle) (* b (* b 0.011111111111111112)))))
double code(double a, double b, double angle) {
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -5e-273) {
tmp = a * ((((double) M_PI) * angle) * (a * -0.011111111111111112));
} else {
tmp = (((double) M_PI) * angle) * (b * (b * 0.011111111111111112));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -5e-273) {
tmp = a * ((Math.PI * angle) * (a * -0.011111111111111112));
} else {
tmp = (Math.PI * angle) * (b * (b * 0.011111111111111112));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -5e-273: tmp = a * ((math.pi * angle) * (a * -0.011111111111111112)) else: tmp = (math.pi * angle) * (b * (b * 0.011111111111111112)) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -5e-273) tmp = Float64(a * Float64(Float64(pi * angle) * Float64(a * -0.011111111111111112))); else tmp = Float64(Float64(pi * angle) * Float64(b * Float64(b * 0.011111111111111112))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= -5e-273) tmp = a * ((pi * angle) * (a * -0.011111111111111112)); else tmp = (pi * angle) * (b * (b * 0.011111111111111112)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -5e-273], N[(a * N[(N[(Pi * angle), $MachinePrecision] * N[(a * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * angle), $MachinePrecision] * N[(b * N[(b * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -5 \cdot 10^{-273}:\\
\;\;\;\;a \cdot \left(\left(\pi \cdot angle\right) \cdot \left(a \cdot -0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot angle\right) \cdot \left(b \cdot \left(b \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999965e-273Initial program 53.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6447.6
Simplified47.6%
Taylor expanded in angle around 0
Simplified50.2%
Taylor expanded in a around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.0
Simplified50.0%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6460.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6460.6
Applied egg-rr60.6%
if -4.99999999999999965e-273 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.5%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6460.7
Simplified60.7%
Taylor expanded in angle around 0
Simplified58.8%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6455.1
Simplified55.1%
Final simplification57.6%
(FPCore (a b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a 2.0)) -5e-273) (* -0.011111111111111112 (* PI (* a (* a angle)))) (* (* PI angle) (* b (* b 0.011111111111111112)))))
double code(double a, double b, double angle) {
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= -5e-273) {
tmp = -0.011111111111111112 * (((double) M_PI) * (a * (a * angle)));
} else {
tmp = (((double) M_PI) * angle) * (b * (b * 0.011111111111111112));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= -5e-273) {
tmp = -0.011111111111111112 * (Math.PI * (a * (a * angle)));
} else {
tmp = (Math.PI * angle) * (b * (b * 0.011111111111111112));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= -5e-273: tmp = -0.011111111111111112 * (math.pi * (a * (a * angle))) else: tmp = (math.pi * angle) * (b * (b * 0.011111111111111112)) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= -5e-273) tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(a * Float64(a * angle)))); else tmp = Float64(Float64(pi * angle) * Float64(b * Float64(b * 0.011111111111111112))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= -5e-273) tmp = -0.011111111111111112 * (pi * (a * (a * angle))); else tmp = (pi * angle) * (b * (b * 0.011111111111111112)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -5e-273], N[(-0.011111111111111112 * N[(Pi * N[(a * N[(a * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * angle), $MachinePrecision] * N[(b * N[(b * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq -5 \cdot 10^{-273}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot \left(a \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot angle\right) \cdot \left(b \cdot \left(b \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999965e-273Initial program 53.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6447.6
Simplified47.6%
Taylor expanded in angle around 0
Simplified50.2%
Taylor expanded in a around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.0
Simplified50.0%
Taylor expanded in angle around 0
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6460.5
Simplified60.5%
if -4.99999999999999965e-273 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 53.5%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6460.7
Simplified60.7%
Taylor expanded in angle around 0
Simplified58.8%
Taylor expanded in a around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6455.1
Simplified55.1%
Final simplification57.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556))))
(if (<= a 7.7e+118)
(* (+ b a) (* (- b a) (* 2.0 (sin t_0))))
(if (<= a 2.5e+228)
(* (- b a) (* (* PI angle) (* (+ b a) 0.011111111111111112)))
(*
(* (+ b a) (* (- b a) (* 2.0 t_0)))
(fma (* angle angle) (* -1.54320987654321e-5 (* PI PI)) 1.0))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double tmp;
if (a <= 7.7e+118) {
tmp = (b + a) * ((b - a) * (2.0 * sin(t_0)));
} else if (a <= 2.5e+228) {
tmp = (b - a) * ((((double) M_PI) * angle) * ((b + a) * 0.011111111111111112));
} else {
tmp = ((b + a) * ((b - a) * (2.0 * t_0))) * fma((angle * angle), (-1.54320987654321e-5 * (((double) M_PI) * ((double) M_PI))), 1.0);
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) tmp = 0.0 if (a <= 7.7e+118) tmp = Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * sin(t_0)))); elseif (a <= 2.5e+228) tmp = Float64(Float64(b - a) * Float64(Float64(pi * angle) * Float64(Float64(b + a) * 0.011111111111111112))); else tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * t_0))) * fma(Float64(angle * angle), Float64(-1.54320987654321e-5 * Float64(pi * pi)), 1.0)); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 7.7e+118], N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.5e+228], N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * angle), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(angle * angle), $MachinePrecision] * N[(-1.54320987654321e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
\mathbf{if}\;a \leq 7.7 \cdot 10^{+118}:\\
\;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \sin t\_0\right)\right)\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{+228}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot t\_0\right)\right)\right) \cdot \mathsf{fma}\left(angle \cdot angle, -1.54320987654321 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right), 1\right)\\
\end{array}
\end{array}
if a < 7.6999999999999997e118Initial program 54.2%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr65.8%
Taylor expanded in angle around 0
Simplified65.0%
if 7.6999999999999997e118 < a < 2.5e228Initial program 42.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6448.0
Simplified48.0%
Taylor expanded in angle around 0
Simplified63.1%
lift-PI.f64N/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
lower-*.f64N/A
lower-*.f6483.0
lift-+.f64N/A
+-commutativeN/A
lift-+.f6483.0
Applied egg-rr83.0%
if 2.5e228 < a Initial program 60.3%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr74.9%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6484.9
Simplified84.9%
Taylor expanded in angle around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f6489.9
Simplified89.9%
Final simplification68.9%
(FPCore (a b angle)
:precision binary64
(if (<= a 1.7e+228)
(* (- b a) (* (* PI angle) (* (+ b a) 0.011111111111111112)))
(*
(* (+ b a) (* (- b a) (* 2.0 (* PI (* angle 0.005555555555555556)))))
(fma (* angle angle) (* -1.54320987654321e-5 (* PI PI)) 1.0))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.7e+228) {
tmp = (b - a) * ((((double) M_PI) * angle) * ((b + a) * 0.011111111111111112));
} else {
tmp = ((b + a) * ((b - a) * (2.0 * (((double) M_PI) * (angle * 0.005555555555555556))))) * fma((angle * angle), (-1.54320987654321e-5 * (((double) M_PI) * ((double) M_PI))), 1.0);
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 1.7e+228) tmp = Float64(Float64(b - a) * Float64(Float64(pi * angle) * Float64(Float64(b + a) * 0.011111111111111112))); else tmp = Float64(Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(2.0 * Float64(pi * Float64(angle * 0.005555555555555556))))) * fma(Float64(angle * angle), Float64(-1.54320987654321e-5 * Float64(pi * pi)), 1.0)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 1.7e+228], N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * angle), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(2.0 * N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(angle * angle), $MachinePrecision] * N[(-1.54320987654321e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.7 \cdot 10^{+228}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot \mathsf{fma}\left(angle \cdot angle, -1.54320987654321 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right), 1\right)\\
\end{array}
\end{array}
if a < 1.6999999999999999e228Initial program 53.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6454.1
Simplified54.1%
Taylor expanded in angle around 0
Simplified54.7%
lift-PI.f64N/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
lower-*.f64N/A
lower-*.f6464.2
lift-+.f64N/A
+-commutativeN/A
lift-+.f6464.2
Applied egg-rr64.2%
if 1.6999999999999999e228 < a Initial program 57.4%
lift-pow.f64N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
lower-+.f64N/A
*-commutativeN/A
Applied egg-rr71.4%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6481.0
Simplified81.0%
Taylor expanded in angle around 0
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f6485.7
Simplified85.7%
Final simplification66.0%
(FPCore (a b angle)
:precision binary64
(if (<= a 3.8e+235)
(* (- b a) (* (* PI angle) (* (+ b a) 0.011111111111111112)))
(*
(fma (* angle angle) (* -1.54320987654321e-5 (* PI PI)) 1.0)
(* (* PI angle) (* 0.011111111111111112 (* (+ b a) (- b a)))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 3.8e+235) {
tmp = (b - a) * ((((double) M_PI) * angle) * ((b + a) * 0.011111111111111112));
} else {
tmp = fma((angle * angle), (-1.54320987654321e-5 * (((double) M_PI) * ((double) M_PI))), 1.0) * ((((double) M_PI) * angle) * (0.011111111111111112 * ((b + a) * (b - a))));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 3.8e+235) tmp = Float64(Float64(b - a) * Float64(Float64(pi * angle) * Float64(Float64(b + a) * 0.011111111111111112))); else tmp = Float64(fma(Float64(angle * angle), Float64(-1.54320987654321e-5 * Float64(pi * pi)), 1.0) * Float64(Float64(pi * angle) * Float64(0.011111111111111112 * Float64(Float64(b + a) * Float64(b - a))))); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 3.8e+235], N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * angle), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle * angle), $MachinePrecision] * N[(-1.54320987654321e-5 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(Pi * angle), $MachinePrecision] * N[(0.011111111111111112 * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.8 \cdot 10^{+235}:\\
\;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot angle, -1.54320987654321 \cdot 10^{-5} \cdot \left(\pi \cdot \pi\right), 1\right) \cdot \left(\left(\pi \cdot angle\right) \cdot \left(0.011111111111111112 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.79999999999999975e235Initial program 52.1%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6453.7
Simplified53.7%
Taylor expanded in angle around 0
Simplified54.3%
lift-PI.f64N/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
lower-*.f64N/A
lower-*.f6464.0
lift-+.f64N/A
+-commutativeN/A
lift-+.f6464.0
Applied egg-rr64.0%
if 3.79999999999999975e235 < a Initial program 70.6%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6470.6
Simplified70.6%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6488.2
Simplified88.2%
Final simplification65.6%
(FPCore (a b angle) :precision binary64 (* (- b a) (* (* PI angle) (* (+ b a) 0.011111111111111112))))
double code(double a, double b, double angle) {
return (b - a) * ((((double) M_PI) * angle) * ((b + a) * 0.011111111111111112));
}
public static double code(double a, double b, double angle) {
return (b - a) * ((Math.PI * angle) * ((b + a) * 0.011111111111111112));
}
def code(a, b, angle): return (b - a) * ((math.pi * angle) * ((b + a) * 0.011111111111111112))
function code(a, b, angle) return Float64(Float64(b - a) * Float64(Float64(pi * angle) * Float64(Float64(b + a) * 0.011111111111111112))) end
function tmp = code(a, b, angle) tmp = (b - a) * ((pi * angle) * ((b + a) * 0.011111111111111112)); end
code[a_, b_, angle_] := N[(N[(b - a), $MachinePrecision] * N[(N[(Pi * angle), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(b - a\right) \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\left(b + a\right) \cdot 0.011111111111111112\right)\right)
\end{array}
Initial program 53.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6454.8
Simplified54.8%
Taylor expanded in angle around 0
Simplified54.9%
lift-PI.f64N/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
lower-*.f64N/A
lower-*.f6464.0
lift-+.f64N/A
+-commutativeN/A
lift-+.f6464.0
Applied egg-rr64.0%
Final simplification64.0%
(FPCore (a b angle) :precision binary64 (* (* (+ b a) 0.011111111111111112) (* (- b a) (* PI angle))))
double code(double a, double b, double angle) {
return ((b + a) * 0.011111111111111112) * ((b - a) * (((double) M_PI) * angle));
}
public static double code(double a, double b, double angle) {
return ((b + a) * 0.011111111111111112) * ((b - a) * (Math.PI * angle));
}
def code(a, b, angle): return ((b + a) * 0.011111111111111112) * ((b - a) * (math.pi * angle))
function code(a, b, angle) return Float64(Float64(Float64(b + a) * 0.011111111111111112) * Float64(Float64(b - a) * Float64(pi * angle))) end
function tmp = code(a, b, angle) tmp = ((b + a) * 0.011111111111111112) * ((b - a) * (pi * angle)); end
code[a_, b_, angle_] := N[(N[(N[(b + a), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(b + a\right) \cdot 0.011111111111111112\right) \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot angle\right)\right)
\end{array}
Initial program 53.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6454.8
Simplified54.8%
Taylor expanded in angle around 0
Simplified54.9%
lift-PI.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f6464.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6464.0
Applied egg-rr64.0%
Final simplification64.0%
(FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* PI (* a (* a angle)))))
double code(double a, double b, double angle) {
return -0.011111111111111112 * (((double) M_PI) * (a * (a * angle)));
}
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (Math.PI * (a * (a * angle)));
}
def code(a, b, angle): return -0.011111111111111112 * (math.pi * (a * (a * angle)))
function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(pi * Float64(a * Float64(a * angle)))) end
function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (pi * (a * (a * angle))); end
code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(Pi * N[(a * N[(a * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot \left(a \cdot angle\right)\right)\right)
\end{array}
Initial program 53.4%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f6454.8
Simplified54.8%
Taylor expanded in angle around 0
Simplified54.9%
Taylor expanded in a around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6435.7
Simplified35.7%
Taylor expanded in angle around 0
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6440.1
Simplified40.1%
Final simplification40.1%
herbie shell --seed 2024215
(FPCore (a b angle)
:name "ab-angle->ABCF B"
:precision binary64
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))