
(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}
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle))) (t_1 (* 2.0 (- b a))))
(if (<= b 1.38e+209)
(*
(*
(sin (* (pow (sqrt PI) 2.0) (* 0.005555555555555556 angle)))
(* (cos t_0) (+ b a)))
t_1)
(*
t_1
(*
(sin t_0)
(*
(+ b a)
(+ 1.0 (* -1.54320987654321e-5 (* (* angle angle) (pow PI 2.0))))))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
double t_1 = 2.0 * (b - a);
double tmp;
if (b <= 1.38e+209) {
tmp = (sin((pow(sqrt(((double) M_PI)), 2.0) * (0.005555555555555556 * angle))) * (cos(t_0) * (b + a))) * t_1;
} else {
tmp = t_1 * (sin(t_0) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * pow(((double) M_PI), 2.0))))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (0.005555555555555556 * angle);
double t_1 = 2.0 * (b - a);
double tmp;
if (b <= 1.38e+209) {
tmp = (Math.sin((Math.pow(Math.sqrt(Math.PI), 2.0) * (0.005555555555555556 * angle))) * (Math.cos(t_0) * (b + a))) * t_1;
} else {
tmp = t_1 * (Math.sin(t_0) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * Math.pow(Math.PI, 2.0))))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): t_0 = math.pi * (0.005555555555555556 * angle) t_1 = 2.0 * (b - a) tmp = 0 if b <= 1.38e+209: tmp = (math.sin((math.pow(math.sqrt(math.pi), 2.0) * (0.005555555555555556 * angle))) * (math.cos(t_0) * (b + a))) * t_1 else: tmp = t_1 * (math.sin(t_0) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * math.pow(math.pi, 2.0)))))) return tmp
b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(0.005555555555555556 * angle)) t_1 = Float64(2.0 * Float64(b - a)) tmp = 0.0 if (b <= 1.38e+209) tmp = Float64(Float64(sin(Float64((sqrt(pi) ^ 2.0) * Float64(0.005555555555555556 * angle))) * Float64(cos(t_0) * Float64(b + a))) * t_1); else tmp = Float64(t_1 * Float64(sin(t_0) * Float64(Float64(b + a) * Float64(1.0 + Float64(-1.54320987654321e-5 * Float64(Float64(angle * angle) * (pi ^ 2.0))))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) t_0 = pi * (0.005555555555555556 * angle); t_1 = 2.0 * (b - a); tmp = 0.0; if (b <= 1.38e+209) tmp = (sin(((sqrt(pi) ^ 2.0) * (0.005555555555555556 * angle))) * (cos(t_0) * (b + a))) * t_1; else tmp = t_1 * (sin(t_0) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * (pi ^ 2.0)))))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 1.38e+209], N[(N[(N[Sin[N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(1.0 + N[(-1.54320987654321e-5 * N[(N[(angle * angle), $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := 2 \cdot \left(b - a\right)\\
\mathbf{if}\;b \leq 1.38 \cdot 10^{+209}:\\
\;\;\;\;\left(\sin \left({\left(\sqrt{\pi}\right)}^{2} \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\cos t_0 \cdot \left(b + a\right)\right)\right) \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(\sin t_0 \cdot \left(\left(b + a\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot {\pi}^{2}\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.3799999999999999e209Initial program 52.9%
associate-*l*52.9%
unpow252.9%
unpow252.9%
difference-of-squares55.0%
Simplified55.0%
Taylor expanded in angle around inf 65.1%
*-commutative65.1%
*-commutative65.1%
associate-*l*65.1%
Simplified65.2%
add-sqr-sqrt66.7%
pow266.7%
Applied egg-rr66.7%
if 1.3799999999999999e209 < b Initial program 42.4%
associate-*l*42.4%
unpow242.4%
unpow242.4%
difference-of-squares60.5%
Simplified60.5%
Taylor expanded in angle around inf 76.4%
*-commutative76.4%
*-commutative76.4%
associate-*l*76.4%
Simplified76.3%
Taylor expanded in angle around 0 93.9%
unpow293.9%
Simplified93.9%
Final simplification68.5%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= b 2e+213)
(*
2.0
(*
(- b a)
(*
(cos (* 0.005555555555555556 (* (pow (sqrt PI) 2.0) angle)))
(* (+ b a) (sin (* 0.005555555555555556 (* PI angle)))))))
(*
(* 2.0 (- b a))
(*
(sin (* PI (* 0.005555555555555556 angle)))
(*
(+ b a)
(+ 1.0 (* -1.54320987654321e-5 (* (* angle angle) (pow PI 2.0)))))))))b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 2e+213) {
tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (pow(sqrt(((double) M_PI)), 2.0) * angle))) * ((b + a) * sin((0.005555555555555556 * (((double) M_PI) * angle))))));
} else {
tmp = (2.0 * (b - a)) * (sin((((double) M_PI) * (0.005555555555555556 * angle))) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * pow(((double) M_PI), 2.0))))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 2e+213) {
tmp = 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (Math.pow(Math.sqrt(Math.PI), 2.0) * angle))) * ((b + a) * Math.sin((0.005555555555555556 * (Math.PI * angle))))));
} else {
tmp = (2.0 * (b - a)) * (Math.sin((Math.PI * (0.005555555555555556 * angle))) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * Math.pow(Math.PI, 2.0))))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if b <= 2e+213: tmp = 2.0 * ((b - a) * (math.cos((0.005555555555555556 * (math.pow(math.sqrt(math.pi), 2.0) * angle))) * ((b + a) * math.sin((0.005555555555555556 * (math.pi * angle)))))) else: tmp = (2.0 * (b - a)) * (math.sin((math.pi * (0.005555555555555556 * angle))) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * math.pow(math.pi, 2.0)))))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 2e+213) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64((sqrt(pi) ^ 2.0) * angle))) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(pi * angle))))))); else tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(sin(Float64(pi * Float64(0.005555555555555556 * angle))) * Float64(Float64(b + a) * Float64(1.0 + Float64(-1.54320987654321e-5 * Float64(Float64(angle * angle) * (pi ^ 2.0))))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 2e+213) tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * ((sqrt(pi) ^ 2.0) * angle))) * ((b + a) * sin((0.005555555555555556 * (pi * angle)))))); else tmp = (2.0 * (b - a)) * (sin((pi * (0.005555555555555556 * angle))) * ((b + a) * (1.0 + (-1.54320987654321e-5 * ((angle * angle) * (pi ^ 2.0)))))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 2e+213], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(1.0 + N[(-1.54320987654321e-5 * N[(N[(angle * angle), $MachinePrecision] * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2 \cdot 10^{+213}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left({\left(\sqrt{\pi}\right)}^{2} \cdot angle\right)\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\left(b + a\right) \cdot \left(1 + -1.54320987654321 \cdot 10^{-5} \cdot \left(\left(angle \cdot angle\right) \cdot {\pi}^{2}\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.99999999999999997e213Initial program 52.7%
associate-*l*52.7%
unpow252.7%
unpow252.7%
difference-of-squares54.8%
Simplified54.8%
Taylor expanded in angle around inf 65.2%
add-sqr-sqrt66.8%
pow266.8%
Applied egg-rr67.8%
if 1.99999999999999997e213 < b Initial program 44.8%
associate-*l*44.8%
unpow244.8%
unpow244.8%
difference-of-squares64.0%
Simplified64.0%
Taylor expanded in angle around inf 75.0%
*-commutative75.0%
*-commutative75.0%
associate-*l*75.0%
Simplified75.0%
Taylor expanded in angle around 0 93.8%
unpow293.8%
Simplified93.8%
Final simplification69.4%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle)))
(t_1 (* PI (/ angle 180.0))))
(if (<= (/ angle 180.0) 2e+53)
(* (* 2.0 (- b a)) (* (* (cos t_0) (+ b a)) (sin t_0)))
(* (sin t_1) (* (* 2.0 (+ (* b b) (* a a))) (cos t_1))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
double t_1 = ((double) M_PI) * (angle / 180.0);
double tmp;
if ((angle / 180.0) <= 2e+53) {
tmp = (2.0 * (b - a)) * ((cos(t_0) * (b + a)) * sin(t_0));
} else {
tmp = sin(t_1) * ((2.0 * ((b * b) + (a * a))) * cos(t_1));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (0.005555555555555556 * angle);
double t_1 = Math.PI * (angle / 180.0);
double tmp;
if ((angle / 180.0) <= 2e+53) {
tmp = (2.0 * (b - a)) * ((Math.cos(t_0) * (b + a)) * Math.sin(t_0));
} else {
tmp = Math.sin(t_1) * ((2.0 * ((b * b) + (a * a))) * Math.cos(t_1));
}
return tmp;
}
b = abs(b) def code(a, b, angle): t_0 = math.pi * (0.005555555555555556 * angle) t_1 = math.pi * (angle / 180.0) tmp = 0 if (angle / 180.0) <= 2e+53: tmp = (2.0 * (b - a)) * ((math.cos(t_0) * (b + a)) * math.sin(t_0)) else: tmp = math.sin(t_1) * ((2.0 * ((b * b) + (a * a))) * math.cos(t_1)) return tmp
b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(0.005555555555555556 * angle)) t_1 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if (Float64(angle / 180.0) <= 2e+53) tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(cos(t_0) * Float64(b + a)) * sin(t_0))); else tmp = Float64(sin(t_1) * Float64(Float64(2.0 * Float64(Float64(b * b) + Float64(a * a))) * cos(t_1))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) t_0 = pi * (0.005555555555555556 * angle); t_1 = pi * (angle / 180.0); tmp = 0.0; if ((angle / 180.0) <= 2e+53) tmp = (2.0 * (b - a)) * ((cos(t_0) * (b + a)) * sin(t_0)); else tmp = sin(t_1) * ((2.0 * ((b * b) + (a * a))) * cos(t_1)); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+53], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[(2.0 * N[(N[(b * b), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+53}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(\cos t_0 \cdot \left(b + a\right)\right) \cdot \sin t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\sin t_1 \cdot \left(\left(2 \cdot \left(b \cdot b + a \cdot a\right)\right) \cdot \cos t_1\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 2e53Initial program 60.1%
associate-*l*60.1%
unpow260.1%
unpow260.1%
difference-of-squares63.7%
Simplified63.7%
Taylor expanded in angle around inf 76.6%
*-commutative76.6%
*-commutative76.6%
associate-*l*76.6%
Simplified77.6%
if 2e53 < (/.f64 angle 180) Initial program 23.3%
*-commutative23.3%
associate-*l*23.3%
unpow223.3%
fma-neg25.2%
unpow225.2%
Simplified25.2%
fma-udef23.3%
add-sqr-sqrt9.9%
sqrt-unprod39.2%
sqr-neg39.2%
sqrt-unprod40.4%
add-sqr-sqrt40.4%
Applied egg-rr40.4%
Final simplification69.6%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle))) (t_1 (* 2.0 (- b a))))
(if (<= (pow b 2.0) 2e+240)
(* t_1 (* (+ b a) (sin t_0)))
(* t_1 (* (* (cos t_0) (+ b a)) (* 0.005555555555555556 (* PI angle)))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
double t_1 = 2.0 * (b - a);
double tmp;
if (pow(b, 2.0) <= 2e+240) {
tmp = t_1 * ((b + a) * sin(t_0));
} else {
tmp = t_1 * ((cos(t_0) * (b + a)) * (0.005555555555555556 * (((double) M_PI) * angle)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (0.005555555555555556 * angle);
double t_1 = 2.0 * (b - a);
double tmp;
if (Math.pow(b, 2.0) <= 2e+240) {
tmp = t_1 * ((b + a) * Math.sin(t_0));
} else {
tmp = t_1 * ((Math.cos(t_0) * (b + a)) * (0.005555555555555556 * (Math.PI * angle)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): t_0 = math.pi * (0.005555555555555556 * angle) t_1 = 2.0 * (b - a) tmp = 0 if math.pow(b, 2.0) <= 2e+240: tmp = t_1 * ((b + a) * math.sin(t_0)) else: tmp = t_1 * ((math.cos(t_0) * (b + a)) * (0.005555555555555556 * (math.pi * angle))) return tmp
b = abs(b) function code(a, b, angle) t_0 = Float64(pi * Float64(0.005555555555555556 * angle)) t_1 = Float64(2.0 * Float64(b - a)) tmp = 0.0 if ((b ^ 2.0) <= 2e+240) tmp = Float64(t_1 * Float64(Float64(b + a) * sin(t_0))); else tmp = Float64(t_1 * Float64(Float64(cos(t_0) * Float64(b + a)) * Float64(0.005555555555555556 * Float64(pi * angle)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) t_0 = pi * (0.005555555555555556 * angle); t_1 = 2.0 * (b - a); tmp = 0.0; if ((b ^ 2.0) <= 2e+240) tmp = t_1 * ((b + a) * sin(t_0)); else tmp = t_1 * ((cos(t_0) * (b + a)) * (0.005555555555555556 * (pi * angle))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e+240], N[(t$95$1 * N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(N[Cos[t$95$0], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := 2 \cdot \left(b - a\right)\\
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+240}:\\
\;\;\;\;t_1 \cdot \left(\left(b + a\right) \cdot \sin t_0\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(\left(\cos t_0 \cdot \left(b + a\right)\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 2.00000000000000003e240Initial program 57.0%
associate-*l*57.0%
unpow257.0%
unpow257.0%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 64.8%
*-commutative64.8%
*-commutative64.8%
associate-*l*64.8%
Simplified64.2%
Taylor expanded in angle around 0 65.5%
if 2.00000000000000003e240 < (pow.f64 b 2) Initial program 39.9%
associate-*l*39.9%
unpow239.9%
unpow239.9%
difference-of-squares51.2%
Simplified51.2%
Taylor expanded in angle around inf 68.4%
*-commutative68.4%
*-commutative68.4%
associate-*l*68.4%
Simplified70.3%
Taylor expanded in angle around 0 76.5%
Final simplification68.6%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 2.0 (- b a))) (t_1 (* PI (* 0.005555555555555556 angle))))
(if (<= b 2e+162)
(* t_0 (* (sin t_1) (* (+ b a) (cos (/ PI (/ 180.0 angle))))))
(* t_0 (* (* (cos t_1) (+ b a)) (* 0.005555555555555556 (* PI angle)))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = 2.0 * (b - a);
double t_1 = ((double) M_PI) * (0.005555555555555556 * angle);
double tmp;
if (b <= 2e+162) {
tmp = t_0 * (sin(t_1) * ((b + a) * cos((((double) M_PI) / (180.0 / angle)))));
} else {
tmp = t_0 * ((cos(t_1) * (b + a)) * (0.005555555555555556 * (((double) M_PI) * angle)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = 2.0 * (b - a);
double t_1 = Math.PI * (0.005555555555555556 * angle);
double tmp;
if (b <= 2e+162) {
tmp = t_0 * (Math.sin(t_1) * ((b + a) * Math.cos((Math.PI / (180.0 / angle)))));
} else {
tmp = t_0 * ((Math.cos(t_1) * (b + a)) * (0.005555555555555556 * (Math.PI * angle)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): t_0 = 2.0 * (b - a) t_1 = math.pi * (0.005555555555555556 * angle) tmp = 0 if b <= 2e+162: tmp = t_0 * (math.sin(t_1) * ((b + a) * math.cos((math.pi / (180.0 / angle))))) else: tmp = t_0 * ((math.cos(t_1) * (b + a)) * (0.005555555555555556 * (math.pi * angle))) return tmp
b = abs(b) function code(a, b, angle) t_0 = Float64(2.0 * Float64(b - a)) t_1 = Float64(pi * Float64(0.005555555555555556 * angle)) tmp = 0.0 if (b <= 2e+162) tmp = Float64(t_0 * Float64(sin(t_1) * Float64(Float64(b + a) * cos(Float64(pi / Float64(180.0 / angle)))))); else tmp = Float64(t_0 * Float64(Float64(cos(t_1) * Float64(b + a)) * Float64(0.005555555555555556 * Float64(pi * angle)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) t_0 = 2.0 * (b - a); t_1 = pi * (0.005555555555555556 * angle); tmp = 0.0; if (b <= 2e+162) tmp = t_0 * (sin(t_1) * ((b + a) * cos((pi / (180.0 / angle))))); else tmp = t_0 * ((cos(t_1) * (b + a)) * (0.005555555555555556 * (pi * angle))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 2e+162], N[(t$95$0 * N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(N[Cos[t$95$1], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := 2 \cdot \left(b - a\right)\\
t_1 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
\mathbf{if}\;b \leq 2 \cdot 10^{+162}:\\
\;\;\;\;t_0 \cdot \left(\sin t_1 \cdot \left(\left(b + a\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\left(\cos t_1 \cdot \left(b + a\right)\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.9999999999999999e162Initial program 52.6%
associate-*l*52.6%
unpow252.6%
unpow252.6%
difference-of-squares54.8%
Simplified54.8%
Taylor expanded in angle around inf 64.7%
*-commutative64.7%
*-commutative64.7%
associate-*l*64.7%
Simplified64.8%
*-commutative64.8%
metadata-eval64.8%
div-inv64.8%
associate-*r/65.6%
Applied egg-rr65.6%
associate-/l*66.9%
Simplified66.9%
if 1.9999999999999999e162 < b Initial program 48.8%
associate-*l*48.8%
unpow248.8%
unpow248.8%
difference-of-squares61.3%
Simplified61.3%
Taylor expanded in angle around inf 75.9%
*-commutative75.9%
*-commutative75.9%
associate-*l*75.9%
Simplified75.8%
Taylor expanded in angle around 0 79.9%
Final simplification68.2%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= (pow b 2.0) 0.0) (* -2.0 (* (sin (* 0.005555555555555556 (* PI angle))) (* a a))) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (pow(b, 2.0) <= 0.0) {
tmp = -2.0 * (sin((0.005555555555555556 * (((double) M_PI) * angle))) * (a * a));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(b, 2.0) <= 0.0) {
tmp = -2.0 * (Math.sin((0.005555555555555556 * (Math.PI * angle))) * (a * a));
} else {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if math.pow(b, 2.0) <= 0.0: tmp = -2.0 * (math.sin((0.005555555555555556 * (math.pi * angle))) * (a * a)) else: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if ((b ^ 2.0) <= 0.0) tmp = Float64(-2.0 * Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle))) * Float64(a * a))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b ^ 2.0) <= 0.0) tmp = -2.0 * (sin((0.005555555555555556 * (pi * angle))) * (a * a)); else tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 0.0], N[(-2.0 * N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 0:\\
\;\;\;\;-2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 0.0Initial program 61.2%
Taylor expanded in b around 0 61.0%
unpow261.0%
*-commutative61.0%
Simplified61.0%
Taylor expanded in angle around 0 65.9%
if 0.0 < (pow.f64 b 2) Initial program 48.9%
*-commutative48.9%
associate-*l*48.9%
unpow248.9%
fma-neg50.5%
unpow250.5%
Simplified50.5%
Taylor expanded in angle around 0 46.2%
associate-*r*46.1%
unpow246.1%
unpow246.1%
difference-of-squares50.5%
associate-*l*50.5%
*-commutative50.5%
associate-*l*50.5%
+-commutative50.5%
associate-*r*50.6%
associate-*r*63.1%
*-commutative63.1%
+-commutative63.1%
Simplified63.1%
Final simplification63.9%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 2.0 (* (- b a) (* (+ b a) (sin (* 0.005555555555555556 (* PI angle)))))))
b = abs(b);
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((b + a) * sin((0.005555555555555556 * (((double) M_PI) * angle)))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((b + a) * Math.sin((0.005555555555555556 * (Math.PI * angle)))));
}
b = abs(b) def code(a, b, angle): return 2.0 * ((b - a) * ((b + a) * math.sin((0.005555555555555556 * (math.pi * angle)))))
b = abs(b) function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(pi * angle)))))) end
b = abs(b) function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * ((b + a) * sin((0.005555555555555556 * (pi * angle))))); end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(b + a\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)
\end{array}
Initial program 52.2%
associate-*l*52.2%
unpow252.2%
unpow252.2%
difference-of-squares55.4%
Simplified55.4%
Taylor expanded in angle around inf 65.8%
add-cube-cbrt68.3%
pow268.3%
Applied egg-rr68.3%
Taylor expanded in angle around 0 65.9%
Final simplification65.9%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= (/ angle 180.0) 5e+15) (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a)))) (* angle (* 0.011111111111111112 (* PI (pow (+ b a) 2.0))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+15) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
} else {
tmp = angle * (0.011111111111111112 * (((double) M_PI) * pow((b + a), 2.0)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+15) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
} else {
tmp = angle * (0.011111111111111112 * (Math.PI * Math.pow((b + a), 2.0)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 5e+15: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a))) else: tmp = angle * (0.011111111111111112 * (math.pi * math.pow((b + a), 2.0))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+15) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))); else tmp = Float64(angle * Float64(0.011111111111111112 * Float64(pi * (Float64(b + a) ^ 2.0)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 5e+15) tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); else tmp = angle * (0.011111111111111112 * (pi * ((b + a) ^ 2.0))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+15], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(angle * N[(0.011111111111111112 * N[(Pi * N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+15}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot {\left(b + a\right)}^{2}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 5e15Initial program 60.5%
*-commutative60.5%
associate-*l*60.5%
unpow260.5%
fma-neg61.5%
unpow261.5%
Simplified61.5%
Taylor expanded in angle around 0 57.4%
associate-*r*57.4%
unpow257.4%
unpow257.4%
difference-of-squares61.0%
associate-*l*61.0%
*-commutative61.0%
associate-*l*61.0%
+-commutative61.0%
associate-*r*61.1%
associate-*r*74.3%
*-commutative74.3%
+-commutative74.3%
Simplified74.3%
if 5e15 < (/.f64 angle 180) Initial program 25.4%
*-commutative25.4%
associate-*l*25.4%
unpow225.4%
fma-neg27.0%
unpow227.0%
Simplified27.0%
Applied egg-rr32.1%
log-pow35.2%
sin-035.2%
+-lft-identity35.2%
associate-*l*35.2%
associate-*l*35.2%
metadata-eval35.2%
Simplified35.2%
Taylor expanded in angle around 0 28.2%
associate-*r*28.2%
*-commutative28.2%
associate-*l*28.2%
+-commutative28.2%
Simplified28.2%
Final simplification63.5%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 5.2) (* angle (* PI (* (* b b) 0.011111111111111112))) (* 0.011111111111111112 (* angle (* (- b a) (* PI a))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (a <= 5.2) {
tmp = angle * (((double) M_PI) * ((b * b) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * a)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 5.2) {
tmp = angle * (Math.PI * ((b * b) * 0.011111111111111112));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (Math.PI * a)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if a <= 5.2: tmp = angle * (math.pi * ((b * b) * 0.011111111111111112)) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (math.pi * a))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (a <= 5.2) tmp = Float64(angle * Float64(pi * Float64(Float64(b * b) * 0.011111111111111112))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * a)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 5.2) tmp = angle * (pi * ((b * b) * 0.011111111111111112)); else tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * a))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 5.2], N[(angle * N[(Pi * N[(N[(b * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.2:\\
\;\;\;\;angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot a\right)\right)\right)\\
\end{array}
\end{array}
if a < 5.20000000000000018Initial program 52.6%
associate-*l*52.6%
unpow252.6%
unpow252.6%
difference-of-squares55.3%
Simplified55.3%
Taylor expanded in angle around 0 52.7%
Taylor expanded in b around inf 37.4%
*-commutative37.4%
associate-*l*37.4%
*-commutative37.4%
unpow237.4%
Simplified37.4%
Taylor expanded in b around 0 37.4%
*-commutative37.4%
*-commutative37.4%
associate-*r*37.4%
*-commutative37.4%
unpow237.4%
Simplified37.4%
if 5.20000000000000018 < a Initial program 51.1%
associate-*l*51.1%
unpow251.1%
unpow251.1%
difference-of-squares55.7%
Simplified55.7%
Taylor expanded in angle around 0 52.2%
Taylor expanded in a around inf 42.5%
*-commutative42.5%
Simplified42.5%
Final simplification38.8%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 1.06e+41) (* (* PI (* angle (* a a))) -0.011111111111111112) (* 0.011111111111111112 (* angle (* (- b a) (* b PI))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.06e+41) {
tmp = (((double) M_PI) * (angle * (a * a))) * -0.011111111111111112;
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * ((double) M_PI))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.06e+41) {
tmp = (Math.PI * (angle * (a * a))) * -0.011111111111111112;
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * Math.PI)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if b <= 1.06e+41: tmp = (math.pi * (angle * (a * a))) * -0.011111111111111112 else: tmp = 0.011111111111111112 * (angle * ((b - a) * (b * math.pi))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 1.06e+41) tmp = Float64(Float64(pi * Float64(angle * Float64(a * a))) * -0.011111111111111112); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(b * pi)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.06e+41) tmp = (pi * (angle * (a * a))) * -0.011111111111111112; else tmp = 0.011111111111111112 * (angle * ((b - a) * (b * pi))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 1.06e+41], N[(N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.06 \cdot 10^{+41}:\\
\;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.06e41Initial program 52.3%
associate-*l*52.3%
unpow252.3%
unpow252.3%
difference-of-squares54.8%
Simplified54.8%
Taylor expanded in angle around 0 53.1%
Taylor expanded in b around 0 39.0%
*-commutative39.0%
associate-*r*39.5%
unpow239.5%
Simplified39.5%
if 1.06e41 < b Initial program 52.0%
associate-*l*52.0%
unpow252.0%
unpow252.0%
difference-of-squares57.7%
Simplified57.7%
Taylor expanded in angle around 0 50.5%
Taylor expanded in a around 0 48.7%
*-commutative48.7%
Simplified48.7%
Final simplification41.5%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* (- b a) (* PI (+ b a))))))
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (b + a))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (b + a))));
}
b = abs(b) def code(a, b, angle): return 0.011111111111111112 * (angle * ((b - a) * (math.pi * (b + a))))
b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(b + a))))) end
b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (b + a)))); end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Initial program 52.2%
associate-*l*52.2%
unpow252.2%
unpow252.2%
difference-of-squares55.4%
Simplified55.4%
Taylor expanded in angle around 0 52.5%
Final simplification52.5%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* (* PI (+ b a)) (* angle (- b a)))))
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * ((((double) M_PI) * (b + a)) * (angle * (b - a)));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * ((Math.PI * (b + a)) * (angle * (b - a)));
}
b = abs(b) def code(a, b, angle): return 0.011111111111111112 * ((math.pi * (b + a)) * (angle * (b - a)))
b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(angle * Float64(b - a)))) end
b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * ((pi * (b + a)) * (angle * (b - a))); end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right)
\end{array}
Initial program 52.2%
*-commutative52.2%
associate-*l*52.2%
unpow252.2%
fma-neg53.4%
unpow253.4%
Simplified53.4%
Taylor expanded in angle around 0 49.4%
associate-*r*49.3%
unpow249.3%
unpow249.3%
difference-of-squares52.5%
associate-*l*52.5%
*-commutative52.5%
associate-*l*52.5%
+-commutative52.5%
associate-*r*52.5%
associate-*r*61.6%
*-commutative61.6%
+-commutative61.6%
Simplified61.6%
Final simplification61.6%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 1.1e+41) (* (* PI (* a a)) (* angle -0.011111111111111112)) (* angle (* PI (* (* b b) 0.011111111111111112)))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.1e+41) {
tmp = (((double) M_PI) * (a * a)) * (angle * -0.011111111111111112);
} else {
tmp = angle * (((double) M_PI) * ((b * b) * 0.011111111111111112));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.1e+41) {
tmp = (Math.PI * (a * a)) * (angle * -0.011111111111111112);
} else {
tmp = angle * (Math.PI * ((b * b) * 0.011111111111111112));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if b <= 1.1e+41: tmp = (math.pi * (a * a)) * (angle * -0.011111111111111112) else: tmp = angle * (math.pi * ((b * b) * 0.011111111111111112)) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 1.1e+41) tmp = Float64(Float64(pi * Float64(a * a)) * Float64(angle * -0.011111111111111112)); else tmp = Float64(angle * Float64(pi * Float64(Float64(b * b) * 0.011111111111111112))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.1e+41) tmp = (pi * (a * a)) * (angle * -0.011111111111111112); else tmp = angle * (pi * ((b * b) * 0.011111111111111112)); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 1.1e+41], N[(N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(angle * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(angle * N[(Pi * N[(N[(b * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{+41}:\\
\;\;\;\;\left(\pi \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if b < 1.09999999999999995e41Initial program 52.3%
associate-*l*52.3%
unpow252.3%
unpow252.3%
difference-of-squares54.8%
Simplified54.8%
Taylor expanded in angle around 0 53.1%
Taylor expanded in b around 0 39.0%
*-commutative39.0%
*-commutative39.0%
associate-*l*39.0%
*-commutative39.0%
unpow239.0%
Simplified39.0%
if 1.09999999999999995e41 < b Initial program 52.0%
associate-*l*52.0%
unpow252.0%
unpow252.0%
difference-of-squares57.7%
Simplified57.7%
Taylor expanded in angle around 0 50.5%
Taylor expanded in b around inf 46.7%
*-commutative46.7%
associate-*l*46.7%
*-commutative46.7%
unpow246.7%
Simplified46.7%
Taylor expanded in b around 0 46.7%
*-commutative46.7%
*-commutative46.7%
associate-*r*46.7%
*-commutative46.7%
unpow246.7%
Simplified46.7%
Final simplification40.6%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= b 1.65e+41) (* (* PI (* angle (* a a))) -0.011111111111111112) (* angle (* PI (* (* b b) 0.011111111111111112)))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.65e+41) {
tmp = (((double) M_PI) * (angle * (a * a))) * -0.011111111111111112;
} else {
tmp = angle * (((double) M_PI) * ((b * b) * 0.011111111111111112));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.65e+41) {
tmp = (Math.PI * (angle * (a * a))) * -0.011111111111111112;
} else {
tmp = angle * (Math.PI * ((b * b) * 0.011111111111111112));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if b <= 1.65e+41: tmp = (math.pi * (angle * (a * a))) * -0.011111111111111112 else: tmp = angle * (math.pi * ((b * b) * 0.011111111111111112)) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (b <= 1.65e+41) tmp = Float64(Float64(pi * Float64(angle * Float64(a * a))) * -0.011111111111111112); else tmp = Float64(angle * Float64(pi * Float64(Float64(b * b) * 0.011111111111111112))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.65e+41) tmp = (pi * (angle * (a * a))) * -0.011111111111111112; else tmp = angle * (pi * ((b * b) * 0.011111111111111112)); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[b, 1.65e+41], N[(N[(Pi * N[(angle * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision], N[(angle * N[(Pi * N[(N[(b * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.65 \cdot 10^{+41}:\\
\;\;\;\;\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if b < 1.65e41Initial program 52.3%
associate-*l*52.3%
unpow252.3%
unpow252.3%
difference-of-squares54.8%
Simplified54.8%
Taylor expanded in angle around 0 53.1%
Taylor expanded in b around 0 39.0%
*-commutative39.0%
associate-*r*39.5%
unpow239.5%
Simplified39.5%
if 1.65e41 < b Initial program 52.0%
associate-*l*52.0%
unpow252.0%
unpow252.0%
difference-of-squares57.7%
Simplified57.7%
Taylor expanded in angle around 0 50.5%
Taylor expanded in b around inf 46.7%
*-commutative46.7%
associate-*l*46.7%
*-commutative46.7%
unpow246.7%
Simplified46.7%
Taylor expanded in b around 0 46.7%
*-commutative46.7%
*-commutative46.7%
associate-*r*46.7%
*-commutative46.7%
unpow246.7%
Simplified46.7%
Final simplification41.0%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* b b)))))
b = abs(b);
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
b = abs(b) def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * (b * b)))
b = abs(b) function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))) end
b = abs(b) function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 52.2%
associate-*l*52.2%
unpow252.2%
unpow252.2%
difference-of-squares55.4%
Simplified55.4%
Taylor expanded in angle around 0 52.5%
Taylor expanded in b around inf 31.6%
*-commutative31.6%
associate-*l*31.6%
*-commutative31.6%
unpow231.6%
Simplified31.6%
Taylor expanded in b around 0 31.6%
*-commutative31.6%
*-commutative31.6%
associate-*r*31.6%
*-commutative31.6%
unpow231.6%
Simplified31.6%
Taylor expanded in angle around 0 31.6%
unpow231.6%
Simplified31.6%
Final simplification31.6%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* angle (* PI (* (* b b) 0.011111111111111112))))
b = abs(b);
double code(double a, double b, double angle) {
return angle * (((double) M_PI) * ((b * b) * 0.011111111111111112));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return angle * (Math.PI * ((b * b) * 0.011111111111111112));
}
b = abs(b) def code(a, b, angle): return angle * (math.pi * ((b * b) * 0.011111111111111112))
b = abs(b) function code(a, b, angle) return Float64(angle * Float64(pi * Float64(Float64(b * b) * 0.011111111111111112))) end
b = abs(b) function tmp = code(a, b, angle) tmp = angle * (pi * ((b * b) * 0.011111111111111112)); end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(angle * N[(Pi * N[(N[(b * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
angle \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 0.011111111111111112\right)\right)
\end{array}
Initial program 52.2%
associate-*l*52.2%
unpow252.2%
unpow252.2%
difference-of-squares55.4%
Simplified55.4%
Taylor expanded in angle around 0 52.5%
Taylor expanded in b around inf 31.6%
*-commutative31.6%
associate-*l*31.6%
*-commutative31.6%
unpow231.6%
Simplified31.6%
Taylor expanded in b around 0 31.6%
*-commutative31.6%
*-commutative31.6%
associate-*r*31.6%
*-commutative31.6%
unpow231.6%
Simplified31.6%
Final simplification31.6%
herbie shell --seed 2023252
(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)))))