
(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 15 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
(if (<= (pow b 2.0) 2e+285)
(*
2.0
(*
(- b a)
(*
(cos (* PI (* 0.005555555555555556 angle)))
(* (sin (* angle (/ PI 180.0))) (+ b a)))))
(* 0.011111111111111112 (* (* PI (+ b a)) (* (- b a) angle)))))
double code(double a, double b, double angle) {
double tmp;
if (pow(b, 2.0) <= 2e+285) {
tmp = 2.0 * ((b - a) * (cos((((double) M_PI) * (0.005555555555555556 * angle))) * (sin((angle * (((double) M_PI) / 180.0))) * (b + a))));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * ((b - a) * angle));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(b, 2.0) <= 2e+285) {
tmp = 2.0 * ((b - a) * (Math.cos((Math.PI * (0.005555555555555556 * angle))) * (Math.sin((angle * (Math.PI / 180.0))) * (b + a))));
} else {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * ((b - a) * angle));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if math.pow(b, 2.0) <= 2e+285: tmp = 2.0 * ((b - a) * (math.cos((math.pi * (0.005555555555555556 * angle))) * (math.sin((angle * (math.pi / 180.0))) * (b + a)))) else: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * ((b - a) * angle)) return tmp
function code(a, b, angle) tmp = 0.0 if ((b ^ 2.0) <= 2e+285) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(pi * Float64(0.005555555555555556 * angle))) * Float64(sin(Float64(angle * Float64(pi / 180.0))) * Float64(b + a))))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(Float64(b - a) * angle))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b ^ 2.0) <= 2e+285) tmp = 2.0 * ((b - a) * (cos((pi * (0.005555555555555556 * angle))) * (sin((angle * (pi / 180.0))) * (b + a)))); else tmp = 0.011111111111111112 * ((pi * (b + a)) * ((b - a) * angle)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e+285], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(angle * N[(Pi / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+285}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\sin \left(angle \cdot \frac{\pi}{180}\right) \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 2e285Initial program 58.3%
associate-*l*58.3%
unpow258.3%
unpow258.3%
difference-of-squares58.3%
Simplified58.3%
Taylor expanded in angle around inf 67.1%
*-un-lft-identity67.1%
associate-*r*67.1%
*-commutative67.1%
*-commutative67.1%
metadata-eval67.1%
div-inv66.5%
div-inv67.1%
metadata-eval67.1%
*-commutative67.1%
Applied egg-rr67.1%
associate-*r*67.4%
*-commutative67.4%
*-commutative67.4%
metadata-eval67.4%
div-inv68.0%
associate-*r/68.1%
Applied egg-rr68.1%
associate-*l/68.9%
Simplified68.9%
if 2e285 < (pow.f64 b 2) Initial program 47.1%
associate-*l*47.1%
unpow247.1%
unpow247.1%
difference-of-squares56.3%
Simplified56.3%
Taylor expanded in angle around 0 65.3%
associate-*r*82.1%
*-commutative82.1%
+-commutative82.1%
Simplified82.1%
Final simplification71.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* angle (* PI 0.005555555555555556))))
(if (<= (/ angle 180.0) 4e-70)
(* 0.011111111111111112 (* (* PI (+ b a)) (* (- b a) angle)))
(* 2.0 (* (cos t_0) (* (* (- b a) (+ b a)) (sin t_0)))))))
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) * 0.005555555555555556);
double tmp;
if ((angle / 180.0) <= 4e-70) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * ((b - a) * angle));
} else {
tmp = 2.0 * (cos(t_0) * (((b - a) * (b + a)) * sin(t_0)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = angle * (Math.PI * 0.005555555555555556);
double tmp;
if ((angle / 180.0) <= 4e-70) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * ((b - a) * angle));
} else {
tmp = 2.0 * (Math.cos(t_0) * (((b - a) * (b + a)) * Math.sin(t_0)));
}
return tmp;
}
def code(a, b, angle): t_0 = angle * (math.pi * 0.005555555555555556) tmp = 0 if (angle / 180.0) <= 4e-70: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * ((b - a) * angle)) else: tmp = 2.0 * (math.cos(t_0) * (((b - a) * (b + a)) * math.sin(t_0))) return tmp
function code(a, b, angle) t_0 = Float64(angle * Float64(pi * 0.005555555555555556)) tmp = 0.0 if (Float64(angle / 180.0) <= 4e-70) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(Float64(b - a) * angle))); else tmp = Float64(2.0 * Float64(cos(t_0) * Float64(Float64(Float64(b - a) * Float64(b + a)) * sin(t_0)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = angle * (pi * 0.005555555555555556); tmp = 0.0; if ((angle / 180.0) <= 4e-70) tmp = 0.011111111111111112 * ((pi * (b + a)) * ((b - a) * angle)); else tmp = 2.0 * (cos(t_0) * (((b - a) * (b + a)) * sin(t_0))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e-70], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{-70}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\cos t_0 \cdot \left(\left(\left(b - a\right) \cdot \left(b + a\right)\right) \cdot \sin t_0\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 3.99999999999999998e-70Initial program 58.7%
associate-*l*58.7%
unpow258.7%
unpow258.7%
difference-of-squares61.9%
Simplified61.9%
Taylor expanded in angle around 0 62.6%
associate-*r*78.8%
*-commutative78.8%
+-commutative78.8%
Simplified78.8%
if 3.99999999999999998e-70 < (/.f64 angle 180) Initial program 51.0%
*-commutative51.0%
associate-*l*51.0%
unpow251.0%
fma-neg51.0%
unpow251.0%
Simplified51.0%
add-cube-cbrt50.9%
pow350.9%
div-inv50.4%
metadata-eval50.4%
Applied egg-rr50.4%
Taylor expanded in angle around inf 52.3%
*-commutative52.3%
associate-*l*53.2%
*-commutative53.2%
associate-*r*49.4%
*-commutative49.4%
unpow249.4%
unpow249.4%
difference-of-squares49.4%
associate-*r*53.0%
*-commutative53.0%
*-commutative53.0%
Simplified53.0%
Final simplification69.4%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* PI angle)))) (* 2.0 (* (* (+ b a) (sin t_0)) (* (- b a) (cos t_0))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle);
return 2.0 * (((b + a) * sin(t_0)) * ((b - a) * cos(t_0)));
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (Math.PI * angle);
return 2.0 * (((b + a) * Math.sin(t_0)) * ((b - a) * Math.cos(t_0)));
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (math.pi * angle) return 2.0 * (((b + a) * math.sin(t_0)) * ((b - a) * math.cos(t_0)))
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(pi * angle)) return Float64(2.0 * Float64(Float64(Float64(b + a) * sin(t_0)) * Float64(Float64(b - a) * cos(t_0)))) end
function tmp = code(a, b, angle) t_0 = 0.005555555555555556 * (pi * angle); tmp = 2.0 * (((b + a) * sin(t_0)) * ((b - a) * cos(t_0))); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
2 \cdot \left(\left(\left(b + a\right) \cdot \sin t_0\right) \cdot \left(\left(b - a\right) \cdot \cos t_0\right)\right)
\end{array}
\end{array}
Initial program 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares57.9%
Simplified57.9%
Taylor expanded in angle around inf 68.9%
associate-*r*68.9%
+-commutative68.9%
Simplified68.9%
Final simplification68.9%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* PI angle)))) (* 2.0 (* (- b a) (* (* (+ b a) (sin t_0)) (cos t_0))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (((double) M_PI) * angle);
return 2.0 * ((b - a) * (((b + a) * sin(t_0)) * cos(t_0)));
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (Math.PI * angle);
return 2.0 * ((b - a) * (((b + a) * Math.sin(t_0)) * Math.cos(t_0)));
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (math.pi * angle) return 2.0 * ((b - a) * (((b + a) * math.sin(t_0)) * math.cos(t_0)))
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(pi * angle)) return Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(Float64(b + a) * sin(t_0)) * cos(t_0)))) end
function tmp = code(a, b, angle) t_0 = 0.005555555555555556 * (pi * angle); tmp = 2.0 * ((b - a) * (((b + a) * sin(t_0)) * cos(t_0))); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]}, N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[(N[(b + a), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(\pi \cdot angle\right)\\
2 \cdot \left(\left(b - a\right) \cdot \left(\left(\left(b + a\right) \cdot \sin t_0\right) \cdot \cos t_0\right)\right)
\end{array}
\end{array}
Initial program 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares57.9%
Simplified57.9%
Taylor expanded in angle around inf 68.9%
Final simplification68.9%
(FPCore (a b angle)
:precision binary64
(*
2.0
(*
(- b a)
(*
(cos (* PI (* 0.005555555555555556 angle)))
(* (+ b a) (sin (* 0.005555555555555556 (* PI angle))))))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (cos((((double) M_PI) * (0.005555555555555556 * angle))) * ((b + a) * sin((0.005555555555555556 * (((double) M_PI) * angle))))));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (Math.cos((Math.PI * (0.005555555555555556 * angle))) * ((b + a) * Math.sin((0.005555555555555556 * (Math.PI * angle))))));
}
def code(a, b, angle): return 2.0 * ((b - a) * (math.cos((math.pi * (0.005555555555555556 * angle))) * ((b + a) * math.sin((0.005555555555555556 * (math.pi * angle))))))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(cos(Float64(pi * Float64(0.005555555555555556 * angle))) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(pi * angle))))))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * (cos((pi * (0.005555555555555556 * angle))) * ((b + a) * sin((0.005555555555555556 * (pi * angle)))))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \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)
\end{array}
Initial program 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares57.9%
Simplified57.9%
Taylor expanded in angle around inf 68.9%
*-un-lft-identity68.9%
associate-*r*69.2%
*-commutative69.2%
*-commutative69.2%
metadata-eval69.2%
div-inv69.1%
div-inv69.2%
metadata-eval69.2%
*-commutative69.2%
Applied egg-rr69.2%
Final simplification69.2%
(FPCore (a b angle)
:precision binary64
(if (<= b -8.8e-70)
(* 0.011111111111111112 (* (* PI (+ b a)) (* (- b a) angle)))
(*
2.0
(* (- b a) (* (+ b a) (sin (* 0.005555555555555556 (* PI angle))))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= -8.8e-70) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * ((b - a) * angle));
} else {
tmp = 2.0 * ((b - a) * ((b + a) * sin((0.005555555555555556 * (((double) M_PI) * angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= -8.8e-70) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * ((b - a) * angle));
} else {
tmp = 2.0 * ((b - a) * ((b + a) * Math.sin((0.005555555555555556 * (Math.PI * angle)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= -8.8e-70: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * ((b - a) * angle)) else: tmp = 2.0 * ((b - a) * ((b + a) * math.sin((0.005555555555555556 * (math.pi * angle))))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= -8.8e-70) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(Float64(b - a) * angle))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(Float64(b + a) * sin(Float64(0.005555555555555556 * Float64(pi * angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= -8.8e-70) tmp = 0.011111111111111112 * ((pi * (b + a)) * ((b - a) * angle)); else tmp = 2.0 * ((b - a) * ((b + a) * sin((0.005555555555555556 * (pi * angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, -8.8e-70], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{-70}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;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}
\end{array}
if b < -8.7999999999999996e-70Initial program 48.9%
associate-*l*48.9%
unpow248.9%
unpow248.9%
difference-of-squares54.7%
Simplified54.7%
Taylor expanded in angle around 0 55.0%
associate-*r*67.7%
*-commutative67.7%
+-commutative67.7%
Simplified67.7%
if -8.7999999999999996e-70 < b Initial program 59.5%
associate-*l*59.5%
unpow259.5%
unpow259.5%
difference-of-squares59.6%
Simplified59.6%
Taylor expanded in angle around inf 70.1%
Taylor expanded in angle around 0 69.1%
Final simplification68.6%
(FPCore (a b angle) :precision binary64 (if (<= (/ angle 180.0) 5e+97) (* 0.011111111111111112 (* (* PI (+ b a)) (* (- b a) angle))) (* 0.011111111111111112 (* (* PI angle) (pow (+ b a) 2.0)))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+97) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * ((b - a) * angle));
} else {
tmp = 0.011111111111111112 * ((((double) M_PI) * angle) * pow((b + a), 2.0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5e+97) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * ((b - a) * angle));
} else {
tmp = 0.011111111111111112 * ((Math.PI * angle) * Math.pow((b + a), 2.0));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 5e+97: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * ((b - a) * angle)) else: tmp = 0.011111111111111112 * ((math.pi * angle) * math.pow((b + a), 2.0)) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+97) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(Float64(b - a) * angle))); else tmp = Float64(0.011111111111111112 * Float64(Float64(pi * angle) * (Float64(b + a) ^ 2.0))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 5e+97) tmp = 0.011111111111111112 * ((pi * (b + a)) * ((b - a) * angle)); else tmp = 0.011111111111111112 * ((pi * angle) * ((b + a) ^ 2.0)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+97], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(Pi * angle), $MachinePrecision] * N[Power[N[(b + a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+97}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\right) \cdot {\left(b + a\right)}^{2}\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 4.99999999999999999e97Initial program 58.5%
associate-*l*58.5%
unpow258.5%
unpow258.5%
difference-of-squares60.9%
Simplified60.9%
Taylor expanded in angle around 0 60.1%
associate-*r*72.6%
*-commutative72.6%
+-commutative72.6%
Simplified72.6%
if 4.99999999999999999e97 < (/.f64 angle 180) Initial program 43.5%
*-commutative43.5%
associate-*l*43.5%
unpow243.5%
fma-neg43.5%
unpow243.5%
Simplified43.5%
*-commutative43.5%
associate-*r*43.5%
fma-neg43.5%
difference-of-squares43.5%
*-commutative43.5%
add-log-exp41.6%
*-commutative41.6%
difference-of-squares41.6%
fma-neg41.6%
Applied egg-rr32.3%
log-pow33.5%
sin-033.5%
exp-sum33.5%
1-exp33.5%
*-commutative33.5%
associate-*r*35.5%
*-commutative35.5%
*-commutative35.5%
Simplified35.5%
Taylor expanded in angle around 0 34.3%
associate-*r*34.3%
+-commutative34.3%
Simplified34.3%
Final simplification65.8%
(FPCore (a b angle) :precision binary64 (if (or (<= a -2.7e-34) (not (<= a 2e-5))) (* 0.011111111111111112 (* angle (* (- b a) (* a PI)))) (* 0.011111111111111112 (* PI (* angle (* b b))))))
double code(double a, double b, double angle) {
double tmp;
if ((a <= -2.7e-34) || !(a <= 2e-5)) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * ((double) M_PI))));
} else {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((a <= -2.7e-34) || !(a <= 2e-5)) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (a * Math.PI)));
} else {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (a <= -2.7e-34) or not (a <= 2e-5): tmp = 0.011111111111111112 * (angle * ((b - a) * (a * math.pi))) else: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) return tmp
function code(a, b, angle) tmp = 0.0 if ((a <= -2.7e-34) || !(a <= 2e-5)) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(a * pi)))); else tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a <= -2.7e-34) || ~((a <= 2e-5))) tmp = 0.011111111111111112 * (angle * ((b - a) * (a * pi))); else tmp = 0.011111111111111112 * (pi * (angle * (b * b))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[a, -2.7e-34], N[Not[LessEqual[a, 2e-5]], $MachinePrecision]], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{-34} \lor \neg \left(a \leq 2 \cdot 10^{-5}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\end{array}
\end{array}
if a < -2.70000000000000017e-34 or 2.00000000000000016e-5 < a Initial program 55.3%
associate-*l*55.3%
unpow255.3%
unpow255.3%
difference-of-squares59.0%
Simplified59.0%
Taylor expanded in angle around 0 56.9%
Taylor expanded in a around inf 46.9%
*-commutative46.9%
Simplified46.9%
if -2.70000000000000017e-34 < a < 2.00000000000000016e-5Initial program 56.5%
associate-*l*56.5%
unpow256.5%
unpow256.5%
difference-of-squares56.5%
Simplified56.5%
Taylor expanded in angle around 0 52.5%
Taylor expanded in b around inf 51.7%
*-commutative51.7%
unpow251.7%
Simplified51.7%
Taylor expanded in angle around 0 51.7%
associate-*r*51.8%
*-commutative51.8%
unpow251.8%
Simplified51.8%
Final simplification49.2%
(FPCore (a b angle) :precision binary64 (if (or (<= b -1.7e-11) (not (<= b 1.15e+100))) (* 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 ((b <= -1.7e-11) || !(b <= 1.15e+100)) {
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 ((b <= -1.7e-11) || !(b <= 1.15e+100)) {
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 (b <= -1.7e-11) or not (b <= 1.15e+100): 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 ((b <= -1.7e-11) || !(b <= 1.15e+100)) 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 ((b <= -1.7e-11) || ~((b <= 1.15e+100))) 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[Or[LessEqual[b, -1.7e-11], N[Not[LessEqual[b, 1.15e+100]], $MachinePrecision]], 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}\;b \leq -1.7 \cdot 10^{-11} \lor \neg \left(b \leq 1.15 \cdot 10^{+100}\right):\\
\;\;\;\;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 b < -1.6999999999999999e-11 or 1.14999999999999995e100 < b Initial program 49.8%
associate-*l*49.8%
unpow249.8%
unpow249.8%
difference-of-squares54.6%
Simplified54.6%
Taylor expanded in angle around 0 54.8%
Taylor expanded in a around 0 49.8%
*-commutative49.8%
Simplified49.8%
if -1.6999999999999999e-11 < b < 1.14999999999999995e100Initial program 60.2%
associate-*l*60.2%
unpow260.2%
unpow260.2%
difference-of-squares60.2%
Simplified60.2%
Taylor expanded in angle around 0 54.9%
Taylor expanded in a around inf 51.2%
*-commutative51.2%
Simplified51.2%
Final simplification50.6%
(FPCore (a b angle) :precision binary64 (if (<= angle 5.2e+165) (* 0.011111111111111112 (* (* PI (+ b a)) (* (- b a) angle))) (* 0.011111111111111112 (* angle (* (- b a) (* b PI))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 5.2e+165) {
tmp = 0.011111111111111112 * ((((double) M_PI) * (b + a)) * ((b - a) * angle));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 5.2e+165) {
tmp = 0.011111111111111112 * ((Math.PI * (b + a)) * ((b - a) * angle));
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 5.2e+165: tmp = 0.011111111111111112 * ((math.pi * (b + a)) * ((b - a) * angle)) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (b * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 5.2e+165) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * Float64(b + a)) * Float64(Float64(b - a) * angle))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(b * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 5.2e+165) tmp = 0.011111111111111112 * ((pi * (b + a)) * ((b - a) * angle)); else tmp = 0.011111111111111112 * (angle * ((b - a) * (b * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 5.2e+165], N[(0.011111111111111112 * N[(N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 5.2 \cdot 10^{+165}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(\left(b - a\right) \cdot angle\right)\right)\\
\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 angle < 5.2000000000000002e165Initial program 58.4%
associate-*l*58.4%
unpow258.4%
unpow258.4%
difference-of-squares60.8%
Simplified60.8%
Taylor expanded in angle around 0 59.4%
associate-*r*70.9%
*-commutative70.9%
+-commutative70.9%
Simplified70.9%
if 5.2000000000000002e165 < angle Initial program 40.8%
associate-*l*40.8%
unpow240.8%
unpow240.8%
difference-of-squares40.8%
Simplified40.8%
Taylor expanded in angle around 0 28.2%
Taylor expanded in a around 0 34.1%
*-commutative34.1%
Simplified34.1%
Final simplification65.6%
(FPCore (a b angle) :precision binary64 (if (or (<= b -5e-19) (not (<= b 1.38e+100))) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* angle (* (* PI (* a a)) -0.011111111111111112))))
double code(double a, double b, double angle) {
double tmp;
if ((b <= -5e-19) || !(b <= 1.38e+100)) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = angle * ((((double) M_PI) * (a * a)) * -0.011111111111111112);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((b <= -5e-19) || !(b <= 1.38e+100)) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = angle * ((Math.PI * (a * a)) * -0.011111111111111112);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (b <= -5e-19) or not (b <= 1.38e+100): tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = angle * ((math.pi * (a * a)) * -0.011111111111111112) return tmp
function code(a, b, angle) tmp = 0.0 if ((b <= -5e-19) || !(b <= 1.38e+100)) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(angle * Float64(Float64(pi * Float64(a * a)) * -0.011111111111111112)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b <= -5e-19) || ~((b <= 1.38e+100))) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = angle * ((pi * (a * a)) * -0.011111111111111112); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[b, -5e-19], N[Not[LessEqual[b, 1.38e+100]], $MachinePrecision]], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(angle * N[(N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-19} \lor \neg \left(b \leq 1.38 \cdot 10^{+100}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\left(\pi \cdot \left(a \cdot a\right)\right) \cdot -0.011111111111111112\right)\\
\end{array}
\end{array}
if b < -5.0000000000000004e-19 or 1.38e100 < b Initial program 50.3%
associate-*l*50.3%
unpow250.3%
unpow250.3%
difference-of-squares55.0%
Simplified55.0%
Taylor expanded in angle around 0 55.1%
Taylor expanded in b around inf 44.9%
*-commutative44.9%
unpow244.9%
Simplified44.9%
Taylor expanded in angle around 0 44.9%
associate-*r*45.0%
*-commutative45.0%
unpow245.0%
Simplified45.0%
if -5.0000000000000004e-19 < b < 1.38e100Initial program 60.1%
associate-*l*60.1%
unpow260.1%
unpow260.1%
Simplified60.1%
Taylor expanded in angle around inf 59.6%
Taylor expanded in b around 0 56.4%
associate-*r*56.4%
*-commutative56.4%
associate-*r*57.1%
*-commutative57.1%
associate-*r*57.9%
*-commutative57.9%
*-commutative57.9%
associate-*r*56.8%
*-commutative56.8%
associate-*r*57.3%
*-commutative57.3%
*-commutative57.3%
*-commutative57.3%
unpow257.3%
Simplified57.3%
Taylor expanded in angle around 0 51.4%
*-commutative51.4%
associate-*l*51.4%
*-commutative51.4%
unpow251.4%
Simplified51.4%
Final simplification48.6%
(FPCore (a b angle) :precision binary64 (if (or (<= b -7.6e-17) (not (<= b 7.5e+100))) (* 0.011111111111111112 (* PI (* angle (* b b)))) (* (* angle (* PI (* a a))) -0.011111111111111112)))
double code(double a, double b, double angle) {
double tmp;
if ((b <= -7.6e-17) || !(b <= 7.5e+100)) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else {
tmp = (angle * (((double) M_PI) * (a * a))) * -0.011111111111111112;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((b <= -7.6e-17) || !(b <= 7.5e+100)) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else {
tmp = (angle * (Math.PI * (a * a))) * -0.011111111111111112;
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (b <= -7.6e-17) or not (b <= 7.5e+100): tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) else: tmp = (angle * (math.pi * (a * a))) * -0.011111111111111112 return tmp
function code(a, b, angle) tmp = 0.0 if ((b <= -7.6e-17) || !(b <= 7.5e+100)) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); else tmp = Float64(Float64(angle * Float64(pi * Float64(a * a))) * -0.011111111111111112); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b <= -7.6e-17) || ~((b <= 7.5e+100))) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); else tmp = (angle * (pi * (a * a))) * -0.011111111111111112; end tmp_2 = tmp; end
code[a_, b_, angle_] := If[Or[LessEqual[b, -7.6e-17], N[Not[LessEqual[b, 7.5e+100]], $MachinePrecision]], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.6 \cdot 10^{-17} \lor \neg \left(b \leq 7.5 \cdot 10^{+100}\right):\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\
\end{array}
\end{array}
if b < -7.6000000000000002e-17 or 7.49999999999999983e100 < b Initial program 50.3%
associate-*l*50.3%
unpow250.3%
unpow250.3%
difference-of-squares55.0%
Simplified55.0%
Taylor expanded in angle around 0 55.1%
Taylor expanded in b around inf 44.9%
*-commutative44.9%
unpow244.9%
Simplified44.9%
Taylor expanded in angle around 0 44.9%
associate-*r*45.0%
*-commutative45.0%
unpow245.0%
Simplified45.0%
if -7.6000000000000002e-17 < b < 7.49999999999999983e100Initial program 60.1%
associate-*l*60.1%
unpow260.1%
unpow260.1%
difference-of-squares60.1%
Simplified60.1%
Taylor expanded in angle around 0 54.7%
Taylor expanded in b around 0 51.4%
*-commutative51.4%
*-commutative51.4%
unpow251.4%
Simplified51.4%
Final simplification48.6%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* (- b a) (* PI (+ b a))))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (((double) M_PI) * (b + a))));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * ((b - a) * (Math.PI * (b + a))));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * ((b - a) * (math.pi * (b + a))))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(pi * Float64(b + a))))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * ((b - a) * (pi * (b + a)))); end
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}
\\
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 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares57.9%
Simplified57.9%
Taylor expanded in angle around 0 54.9%
Final simplification54.9%
(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 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares57.9%
Simplified57.9%
Taylor expanded in angle around 0 54.9%
Taylor expanded in b around inf 33.1%
*-commutative33.1%
unpow233.1%
Simplified33.1%
Final simplification33.1%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* PI (* angle (* b b)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (Math.PI * (angle * (b * b)));
}
def code(a, b, angle): return 0.011111111111111112 * (math.pi * (angle * (b * b)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 55.8%
associate-*l*55.8%
unpow255.8%
unpow255.8%
difference-of-squares57.9%
Simplified57.9%
Taylor expanded in angle around 0 54.9%
Taylor expanded in b around inf 33.1%
*-commutative33.1%
unpow233.1%
Simplified33.1%
Taylor expanded in angle around 0 33.1%
associate-*r*33.1%
*-commutative33.1%
unpow233.1%
Simplified33.1%
Final simplification33.1%
herbie shell --seed 2023187
(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)))))