
(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 (+ 1.0 (* 0.005555555555555556 (* angle PI))))
(t_1 (* (sin (/ PI (/ 180.0 angle))) (+ a b))))
(if (<= (pow a 2.0) 5e+154)
(*
2.0
(* (- b a) (* (+ (* (cos t_0) (cos 1.0)) (* (sin t_0) (sin 1.0))) t_1)))
(*
2.0
(*
(- b a)
(*
t_1
(cos (* 0.005555555555555556 (* angle (cbrt (* PI (* PI PI))))))))))))
double code(double a, double b, double angle) {
double t_0 = 1.0 + (0.005555555555555556 * (angle * ((double) M_PI)));
double t_1 = sin((((double) M_PI) / (180.0 / angle))) * (a + b);
double tmp;
if (pow(a, 2.0) <= 5e+154) {
tmp = 2.0 * ((b - a) * (((cos(t_0) * cos(1.0)) + (sin(t_0) * sin(1.0))) * t_1));
} else {
tmp = 2.0 * ((b - a) * (t_1 * cos((0.005555555555555556 * (angle * cbrt((((double) M_PI) * (((double) M_PI) * ((double) M_PI)))))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 1.0 + (0.005555555555555556 * (angle * Math.PI));
double t_1 = Math.sin((Math.PI / (180.0 / angle))) * (a + b);
double tmp;
if (Math.pow(a, 2.0) <= 5e+154) {
tmp = 2.0 * ((b - a) * (((Math.cos(t_0) * Math.cos(1.0)) + (Math.sin(t_0) * Math.sin(1.0))) * t_1));
} else {
tmp = 2.0 * ((b - a) * (t_1 * Math.cos((0.005555555555555556 * (angle * Math.cbrt((Math.PI * (Math.PI * Math.PI))))))));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(1.0 + Float64(0.005555555555555556 * Float64(angle * pi))) t_1 = Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(a + b)) tmp = 0.0 if ((a ^ 2.0) <= 5e+154) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(Float64(cos(t_0) * cos(1.0)) + Float64(sin(t_0) * sin(1.0))) * t_1))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(t_1 * cos(Float64(0.005555555555555556 * Float64(angle * cbrt(Float64(pi * Float64(pi * pi))))))))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(1.0 + N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+154], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[(N[Cos[t$95$0], $MachinePrecision] * N[Cos[1.0], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[t$95$0], $MachinePrecision] * N[Sin[1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(t$95$1 * N[Cos[N[(0.005555555555555556 * N[(angle * N[Power[N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(a + b\right)\\
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+154}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(\cos t_0 \cdot \cos 1 + \sin t_0 \cdot \sin 1\right) \cdot t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(t_1 \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt[3]{\pi \cdot \left(\pi \cdot \pi\right)}\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 5.00000000000000004e154Initial program 60.9%
associate-*l*60.9%
unpow260.9%
unpow260.9%
difference-of-squares60.9%
Simplified60.9%
Taylor expanded in angle around inf 66.5%
*-commutative66.5%
*-commutative66.5%
associate-*r*67.6%
add-cube-cbrt66.3%
unpow367.1%
expm1-log1p-u67.1%
expm1-udef27.9%
Applied egg-rr28.4%
expm1-def68.2%
expm1-log1p68.2%
associate-*r/65.9%
associate-/l*67.4%
Simplified67.4%
add-cbrt-cube67.2%
Applied egg-rr67.2%
*-commutative67.2%
add-cbrt-cube67.4%
*-commutative67.4%
associate-*r*67.7%
expm1-log1p-u60.9%
expm1-udef60.1%
cos-diff59.7%
Applied egg-rr70.8%
if 5.00000000000000004e154 < (pow.f64 a 2) Initial program 40.8%
associate-*l*40.8%
unpow240.8%
unpow240.8%
difference-of-squares50.6%
Simplified50.6%
Taylor expanded in angle around inf 71.1%
*-commutative71.1%
*-commutative71.1%
associate-*r*74.3%
add-cube-cbrt69.6%
unpow374.0%
expm1-log1p-u74.0%
expm1-udef29.3%
Applied egg-rr30.3%
expm1-def75.5%
expm1-log1p75.5%
associate-*r/76.6%
associate-/l*76.2%
Simplified76.2%
add-cbrt-cube77.3%
Applied egg-rr77.3%
Final simplification73.2%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 1e+56)
(*
2.0
(*
(- b a)
(*
(* (sin (/ PI (/ 180.0 angle))) (+ a b))
(log (exp (cos (* 0.005555555555555556 (* angle PI))))))))
(*
(* 2.0 (* (- b a) (+ a b)))
(*
(sin (pow (cbrt (* PI (* 0.005555555555555556 angle))) 3.0))
(cos (* angle (/ PI 180.0)))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+56) {
tmp = 2.0 * ((b - a) * ((sin((((double) M_PI) / (180.0 / angle))) * (a + b)) * log(exp(cos((0.005555555555555556 * (angle * ((double) M_PI))))))));
} else {
tmp = (2.0 * ((b - a) * (a + b))) * (sin(pow(cbrt((((double) M_PI) * (0.005555555555555556 * angle))), 3.0)) * cos((angle * (((double) M_PI) / 180.0))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+56) {
tmp = 2.0 * ((b - a) * ((Math.sin((Math.PI / (180.0 / angle))) * (a + b)) * Math.log(Math.exp(Math.cos((0.005555555555555556 * (angle * Math.PI)))))));
} else {
tmp = (2.0 * ((b - a) * (a + b))) * (Math.sin(Math.pow(Math.cbrt((Math.PI * (0.005555555555555556 * angle))), 3.0)) * Math.cos((angle * (Math.PI / 180.0))));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 1e+56) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(a + b)) * log(exp(cos(Float64(0.005555555555555556 * Float64(angle * pi)))))))); else tmp = Float64(Float64(2.0 * Float64(Float64(b - a) * Float64(a + b))) * Float64(sin((cbrt(Float64(pi * Float64(0.005555555555555556 * angle))) ^ 3.0)) * cos(Float64(angle * Float64(pi / 180.0))))); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+56], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[Power[N[Power[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * N[Cos[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 10^{+56}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(a + b\right)\right) \cdot \log \left(e^{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\left(b - a\right) \cdot \left(a + b\right)\right)\right) \cdot \left(\sin \left({\left(\sqrt[3]{\pi \cdot \left(0.005555555555555556 \cdot angle\right)}\right)}^{3}\right) \cdot \cos \left(angle \cdot \frac{\pi}{180}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 1.00000000000000009e56Initial program 61.4%
associate-*l*61.4%
unpow261.4%
unpow261.4%
difference-of-squares66.1%
Simplified66.1%
Taylor expanded in angle around inf 81.2%
*-commutative81.2%
*-commutative81.2%
associate-*r*81.6%
add-cube-cbrt80.4%
unpow381.2%
expm1-log1p-u81.2%
expm1-udef27.6%
Applied egg-rr28.4%
expm1-def82.7%
expm1-log1p82.7%
associate-*r/81.2%
associate-/l*82.3%
Simplified82.3%
add-cbrt-cube81.7%
Applied egg-rr81.7%
add-cbrt-cube82.3%
associate-*r*80.1%
*-commutative80.1%
add-log-exp80.1%
*-commutative80.1%
associate-*r*82.3%
Applied egg-rr82.3%
if 1.00000000000000009e56 < (/.f64 angle 180) Initial program 26.7%
associate-*l*26.7%
unpow226.7%
unpow226.7%
difference-of-squares26.7%
Simplified26.7%
add-cube-cbrt32.5%
pow334.2%
div-inv36.6%
metadata-eval36.6%
Applied egg-rr36.6%
clear-num33.2%
un-div-inv36.4%
Applied egg-rr36.4%
associate-/r/40.1%
*-commutative40.1%
Simplified40.1%
Final simplification72.6%
(FPCore (a b angle)
:precision binary64
(*
2.0
(*
(- b a)
(*
(* (sin (/ PI (/ 180.0 angle))) (+ a b))
(log (exp (cos (* 0.005555555555555556 (* angle PI)))))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((sin((((double) M_PI) / (180.0 / angle))) * (a + b)) * log(exp(cos((0.005555555555555556 * (angle * ((double) M_PI))))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((Math.sin((Math.PI / (180.0 / angle))) * (a + b)) * Math.log(Math.exp(Math.cos((0.005555555555555556 * (angle * Math.PI)))))));
}
def code(a, b, angle): return 2.0 * ((b - a) * ((math.sin((math.pi / (180.0 / angle))) * (a + b)) * math.log(math.exp(math.cos((0.005555555555555556 * (angle * math.pi)))))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(a + b)) * log(exp(cos(Float64(0.005555555555555556 * Float64(angle * pi)))))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * ((sin((pi / (180.0 / angle))) * (a + b)) * log(exp(cos((0.005555555555555556 * (angle * pi))))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Log[N[Exp[N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(a + b\right)\right) \cdot \log \left(e^{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}\right)\right)\right)
\end{array}
Initial program 53.4%
associate-*l*53.4%
unpow253.4%
unpow253.4%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 68.2%
*-commutative68.2%
*-commutative68.2%
associate-*r*70.1%
add-cube-cbrt67.5%
unpow369.7%
expm1-log1p-u69.7%
expm1-udef28.4%
Applied egg-rr29.1%
expm1-def70.9%
expm1-log1p70.9%
associate-*r/69.8%
associate-/l*70.7%
Simplified70.7%
add-cbrt-cube70.9%
Applied egg-rr70.9%
add-cbrt-cube70.7%
associate-*r*67.9%
*-commutative67.9%
add-log-exp67.9%
*-commutative67.9%
associate-*r*70.7%
Applied egg-rr70.7%
Final simplification70.7%
(FPCore (a b angle)
:precision binary64
(*
2.0
(*
(- b a)
(*
(cos (* 0.005555555555555556 (* angle PI)))
(* (+ a b) (sin (* PI (* 0.005555555555555556 angle))))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * ((double) M_PI)))) * ((a + b) * sin((((double) M_PI) * (0.005555555555555556 * angle))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (Math.cos((0.005555555555555556 * (angle * Math.PI))) * ((a + b) * Math.sin((Math.PI * (0.005555555555555556 * angle))))));
}
def code(a, b, angle): return 2.0 * ((b - a) * (math.cos((0.005555555555555556 * (angle * math.pi))) * ((a + b) * math.sin((math.pi * (0.005555555555555556 * angle))))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(Float64(a + b) * sin(Float64(pi * Float64(0.005555555555555556 * angle))))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * (cos((0.005555555555555556 * (angle * pi))) * ((a + b) * sin((pi * (0.005555555555555556 * angle)))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(a + b\right) \cdot \sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)\right)\right)\right)
\end{array}
Initial program 53.4%
associate-*l*53.4%
unpow253.4%
unpow253.4%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 68.2%
*-commutative68.2%
*-commutative68.2%
associate-*r*70.1%
add-cube-cbrt67.5%
unpow369.7%
expm1-log1p-u69.7%
expm1-udef28.4%
Applied egg-rr29.1%
expm1-def70.9%
expm1-log1p70.9%
associate-*r/69.8%
associate-/l*70.7%
Simplified70.7%
div-inv69.8%
clear-num70.9%
*-commutative70.9%
div-inv70.1%
metadata-eval70.1%
Applied egg-rr70.1%
Final simplification70.1%
(FPCore (a b angle)
:precision binary64
(*
2.0
(*
(- b a)
(*
(* (sin (/ PI (/ 180.0 angle))) (+ a b))
(cos (* 0.005555555555555556 (* angle PI)))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((sin((((double) M_PI) / (180.0 / angle))) * (a + b)) * cos((0.005555555555555556 * (angle * ((double) M_PI))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((Math.sin((Math.PI / (180.0 / angle))) * (a + b)) * Math.cos((0.005555555555555556 * (angle * Math.PI)))));
}
def code(a, b, angle): return 2.0 * ((b - a) * ((math.sin((math.pi / (180.0 / angle))) * (a + b)) * math.cos((0.005555555555555556 * (angle * math.pi)))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(a + b)) * cos(Float64(0.005555555555555556 * Float64(angle * pi)))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * ((sin((pi / (180.0 / angle))) * (a + b)) * cos((0.005555555555555556 * (angle * pi))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(a + b\right)\right) \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 53.4%
associate-*l*53.4%
unpow253.4%
unpow253.4%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 68.2%
*-commutative68.2%
*-commutative68.2%
associate-*r*70.1%
add-cube-cbrt67.5%
unpow369.7%
expm1-log1p-u69.7%
expm1-udef28.4%
Applied egg-rr29.1%
expm1-def70.9%
expm1-log1p70.9%
associate-*r/69.8%
associate-/l*70.7%
Simplified70.7%
Final simplification70.7%
(FPCore (a b angle) :precision binary64 (* 2.0 (* (- b a) (* (+ a b) (sin (* 0.005555555555555556 (* angle PI)))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((a + b) * sin((0.005555555555555556 * (angle * ((double) M_PI))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * ((a + b) * Math.sin((0.005555555555555556 * (angle * Math.PI)))));
}
def code(a, b, angle): return 2.0 * ((b - a) * ((a + b) * math.sin((0.005555555555555556 * (angle * math.pi)))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(a + b) * sin(Float64(0.005555555555555556 * Float64(angle * pi)))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * ((a + b) * sin((0.005555555555555556 * (angle * pi))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(a + b\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)
\end{array}
Initial program 53.4%
associate-*l*53.4%
unpow253.4%
unpow253.4%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 68.2%
Taylor expanded in angle around 0 66.6%
Final simplification66.6%
(FPCore (a b angle) :precision binary64 (* 2.0 (* (- b a) (* (sin (/ PI (/ 180.0 angle))) (+ a b)))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (sin((((double) M_PI) / (180.0 / angle))) * (a + b)));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (Math.sin((Math.PI / (180.0 / angle))) * (a + b)));
}
def code(a, b, angle): return 2.0 * ((b - a) * (math.sin((math.pi / (180.0 / angle))) * (a + b)))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(sin(Float64(pi / Float64(180.0 / angle))) * Float64(a + b)))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * (sin((pi / (180.0 / angle))) * (a + b))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\frac{\pi}{\frac{180}{angle}}\right) \cdot \left(a + b\right)\right)\right)
\end{array}
Initial program 53.4%
associate-*l*53.4%
unpow253.4%
unpow253.4%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around inf 68.2%
*-commutative68.2%
*-commutative68.2%
associate-*r*70.1%
add-cube-cbrt67.5%
unpow369.7%
expm1-log1p-u69.7%
expm1-udef28.4%
Applied egg-rr29.1%
expm1-def70.9%
expm1-log1p70.9%
associate-*r/69.8%
associate-/l*70.7%
Simplified70.7%
Taylor expanded in angle around 0 68.4%
Final simplification68.4%
(FPCore (a b angle) :precision binary64 (if (<= a 3.2e+17) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* 0.011111111111111112 (* angle (* (- b a) (* a PI))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 3.2e+17) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 3.2e+17) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 3.2e+17: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 3.2e+17) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 3.2e+17) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 3.2e+17], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.2 \cdot 10^{+17}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 3.2e17Initial program 54.4%
associate-*l*54.4%
unpow254.4%
unpow254.4%
difference-of-squares57.6%
Simplified57.6%
Taylor expanded in angle around 0 54.2%
Taylor expanded in b around inf 41.8%
*-commutative41.8%
associate-*r*41.8%
*-commutative41.8%
unpow241.8%
Simplified41.8%
if 3.2e17 < a Initial program 50.5%
associate-*l*50.5%
unpow250.5%
unpow250.5%
difference-of-squares55.4%
Simplified55.4%
Taylor expanded in angle around 0 54.9%
Taylor expanded in a around inf 47.7%
*-commutative47.7%
Simplified47.7%
Final simplification43.2%
(FPCore (a b angle) :precision binary64 (if (<= a 2.3e+19) (* 0.011111111111111112 (* angle (* (- b a) (* b PI)))) (* 0.011111111111111112 (* angle (* (- b a) (* a PI))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.3e+19) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.3e+19) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * Math.PI)));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.3e+19: tmp = 0.011111111111111112 * (angle * ((b - a) * (b * math.pi))) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.3e+19) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(b * pi)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.3e+19) tmp = 0.011111111111111112 * (angle * ((b - a) * (b * pi))); else tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.3e+19], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.3 \cdot 10^{+19}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 2.3e19Initial program 54.4%
associate-*l*54.4%
unpow254.4%
unpow254.4%
difference-of-squares57.6%
Simplified57.6%
Taylor expanded in angle around 0 54.2%
Taylor expanded in a around 0 43.6%
*-commutative43.6%
Simplified43.6%
if 2.3e19 < a Initial program 50.5%
associate-*l*50.5%
unpow250.5%
unpow250.5%
difference-of-squares55.4%
Simplified55.4%
Taylor expanded in angle around 0 54.9%
Taylor expanded in a around inf 47.7%
*-commutative47.7%
Simplified47.7%
Final simplification44.6%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* (- b a) (* PI (+ a b))))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (a + b))));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (a + b))));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * ((b - a) * (math.pi * (a + b))))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(a + b))))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (a + b)))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)\right)
\end{array}
Initial program 53.4%
associate-*l*53.4%
unpow253.4%
unpow253.4%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around 0 54.4%
Final simplification54.4%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* (* (- b a) angle) (* PI (+ a b)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (((b - a) * angle) * (((double) M_PI) * (a + b)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (((b - a) * angle) * (Math.PI * (a + b)));
}
def code(a, b, angle): return 0.011111111111111112 * (((b - a) * angle) * (math.pi * (a + b)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(Float64(b - a) * angle) * Float64(pi * Float64(a + b)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (((b - a) * angle) * (pi * (a + b))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision] * N[(Pi * N[(a + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\left(\left(b - a\right) \cdot angle\right) \cdot \left(\pi \cdot \left(a + b\right)\right)\right)
\end{array}
Initial program 53.4%
*-commutative53.4%
associate-*l*53.4%
unpow253.4%
fma-neg55.0%
unpow255.0%
Simplified55.0%
Taylor expanded in angle around 0 50.4%
associate-*r*50.4%
unpow250.4%
unpow250.4%
difference-of-squares54.4%
associate-*l*54.4%
*-commutative54.4%
associate-*l*54.4%
+-commutative54.4%
associate-*r*54.4%
associate-*r*64.1%
*-commutative64.1%
+-commutative64.1%
Simplified64.1%
Final simplification64.1%
(FPCore (a b angle) :precision binary64 (if (<= b 4.6e+40) (* angle (* PI (* (* a a) -0.011111111111111112))) (* 0.011111111111111112 (* angle (* PI (* b b))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 4.6e+40) {
tmp = angle * (((double) M_PI) * ((a * a) * -0.011111111111111112));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 4.6e+40) {
tmp = angle * (Math.PI * ((a * a) * -0.011111111111111112));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 4.6e+40: tmp = angle * (math.pi * ((a * a) * -0.011111111111111112)) else: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 4.6e+40) tmp = Float64(angle * Float64(pi * Float64(Float64(a * a) * -0.011111111111111112))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 4.6e+40) tmp = angle * (pi * ((a * a) * -0.011111111111111112)); else tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 4.6e+40], N[(angle * N[(Pi * N[(N[(a * a), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.6 \cdot 10^{+40}:\\
\;\;\;\;angle \cdot \left(\pi \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 4.59999999999999987e40Initial program 52.1%
associate-*l*52.1%
unpow252.1%
unpow252.1%
difference-of-squares53.2%
Simplified53.2%
Taylor expanded in angle around 0 53.2%
Taylor expanded in b around 0 37.8%
*-commutative37.8%
*-commutative37.8%
unpow237.8%
Simplified37.8%
Taylor expanded in angle around 0 37.8%
*-commutative37.8%
*-commutative37.8%
unpow237.8%
associate-*r*37.7%
unpow237.7%
associate-*l*37.7%
unpow237.7%
Simplified37.7%
if 4.59999999999999987e40 < b Initial program 57.7%
associate-*l*57.6%
unpow257.6%
unpow257.6%
difference-of-squares69.4%
Simplified69.4%
Taylor expanded in angle around 0 58.4%
Taylor expanded in b around inf 53.5%
*-commutative53.5%
unpow253.5%
Simplified53.5%
Final simplification41.5%
(FPCore (a b angle) :precision binary64 (if (<= b 3.8e+41) (* -0.011111111111111112 (* angle (* PI (* a a)))) (* 0.011111111111111112 (* angle (* PI (* b b))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 3.8e+41) {
tmp = -0.011111111111111112 * (angle * (((double) M_PI) * (a * a)));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3.8e+41) {
tmp = -0.011111111111111112 * (angle * (Math.PI * (a * a)));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 3.8e+41: tmp = -0.011111111111111112 * (angle * (math.pi * (a * a))) else: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 3.8e+41) tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(a * a)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3.8e+41) tmp = -0.011111111111111112 * (angle * (pi * (a * a))); else tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 3.8e+41], N[(-0.011111111111111112 * N[(angle * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.8 \cdot 10^{+41}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 3.8000000000000001e41Initial program 52.1%
associate-*l*52.1%
unpow252.1%
unpow252.1%
difference-of-squares53.2%
Simplified53.2%
Taylor expanded in angle around 0 53.2%
Taylor expanded in b around 0 37.8%
*-commutative37.8%
*-commutative37.8%
unpow237.8%
Simplified37.8%
if 3.8000000000000001e41 < b Initial program 57.7%
associate-*l*57.6%
unpow257.6%
unpow257.6%
difference-of-squares69.4%
Simplified69.4%
Taylor expanded in angle around 0 58.4%
Taylor expanded in b around inf 53.5%
*-commutative53.5%
unpow253.5%
Simplified53.5%
Final simplification41.5%
(FPCore (a b angle) :precision binary64 (if (<= b 1.52e+37) (* (* PI (* a a)) (* angle -0.011111111111111112)) (* 0.011111111111111112 (* angle (* PI (* b b))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.52e+37) {
tmp = (((double) M_PI) * (a * a)) * (angle * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.52e+37) {
tmp = (Math.PI * (a * a)) * (angle * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.52e+37: tmp = (math.pi * (a * a)) * (angle * -0.011111111111111112) else: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.52e+37) tmp = Float64(Float64(pi * Float64(a * a)) * Float64(angle * -0.011111111111111112)); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.52e+37) tmp = (pi * (a * a)) * (angle * -0.011111111111111112); else tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.52e+37], N[(N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(angle * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.52 \cdot 10^{+37}:\\
\;\;\;\;\left(\pi \cdot \left(a \cdot a\right)\right) \cdot \left(angle \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.5200000000000001e37Initial program 52.1%
associate-*l*52.1%
unpow252.1%
unpow252.1%
difference-of-squares53.2%
Simplified53.2%
Taylor expanded in angle around 0 53.2%
Taylor expanded in b around 0 37.8%
*-commutative37.8%
*-commutative37.8%
associate-*l*37.8%
*-commutative37.8%
unpow237.8%
Simplified37.8%
if 1.5200000000000001e37 < b Initial program 57.7%
associate-*l*57.6%
unpow257.6%
unpow257.6%
difference-of-squares69.4%
Simplified69.4%
Taylor expanded in angle around 0 58.4%
Taylor expanded in b around inf 53.5%
*-commutative53.5%
unpow253.5%
Simplified53.5%
Final simplification41.5%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* b b)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * (b * b)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 53.4%
associate-*l*53.4%
unpow253.4%
unpow253.4%
difference-of-squares57.0%
Simplified57.0%
Taylor expanded in angle around 0 54.4%
Taylor expanded in b around inf 36.6%
*-commutative36.6%
unpow236.6%
Simplified36.6%
Final simplification36.6%
(FPCore (a b angle) :precision binary64 0.0)
double code(double a, double b, double angle) {
return 0.0;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = 0.0d0
end function
public static double code(double a, double b, double angle) {
return 0.0;
}
def code(a, b, angle): return 0.0
function code(a, b, angle) return 0.0 end
function tmp = code(a, b, angle) tmp = 0.0; end
code[a_, b_, angle_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 53.4%
associate-*l*53.4%
unpow253.4%
unpow253.4%
difference-of-squares57.0%
Simplified57.0%
add-cube-cbrt59.8%
pow358.2%
div-inv58.7%
metadata-eval58.7%
Applied egg-rr58.7%
clear-num58.2%
un-div-inv58.9%
Applied egg-rr58.9%
associate-/r/59.8%
*-commutative59.8%
Simplified59.8%
Taylor expanded in angle around 0 12.3%
Final simplification12.3%
herbie shell --seed 2023207
(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)))))