
(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 14 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 (* PI (/ angle 180.0))))
(if (<= (/ angle 180.0) -5e+282)
(* 0.011111111111111112 (* angle (cbrt (pow (* PI (* b b)) 3.0))))
(if (<= (/ angle 180.0) -4e-78)
(* 2.0 (* (* (sin t_0) (cos t_0)) (* (- b a) (+ b a))))
(*
2.0
(*
(- b a)
(* (sin (* 0.005555555555555556 (* PI angle))) (+ b a))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double tmp;
if ((angle / 180.0) <= -5e+282) {
tmp = 0.011111111111111112 * (angle * cbrt(pow((((double) M_PI) * (b * b)), 3.0)));
} else if ((angle / 180.0) <= -4e-78) {
tmp = 2.0 * ((sin(t_0) * cos(t_0)) * ((b - a) * (b + a)));
} else {
tmp = 2.0 * ((b - a) * (sin((0.005555555555555556 * (((double) M_PI) * angle))) * (b + a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
double tmp;
if ((angle / 180.0) <= -5e+282) {
tmp = 0.011111111111111112 * (angle * Math.cbrt(Math.pow((Math.PI * (b * b)), 3.0)));
} else if ((angle / 180.0) <= -4e-78) {
tmp = 2.0 * ((Math.sin(t_0) * Math.cos(t_0)) * ((b - a) * (b + a)));
} else {
tmp = 2.0 * ((b - a) * (Math.sin((0.005555555555555556 * (Math.PI * angle))) * (b + a)));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+282) tmp = Float64(0.011111111111111112 * Float64(angle * cbrt((Float64(pi * Float64(b * b)) ^ 3.0)))); elseif (Float64(angle / 180.0) <= -4e-78) tmp = Float64(2.0 * Float64(Float64(sin(t_0) * cos(t_0)) * Float64(Float64(b - a) * Float64(b + a)))); else tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle))) * Float64(b + a)))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+282], N[(0.011111111111111112 * N[(angle * N[Power[N[Power[N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], -4e-78], N[(2.0 * N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+282}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \sqrt[3]{{\left(\pi \cdot \left(b \cdot b\right)\right)}^{3}}\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq -4 \cdot 10^{-78}:\\
\;\;\;\;2 \cdot \left(\left(\sin t_0 \cdot \cos t_0\right) \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b + a\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.99999999999999978e282Initial program 22.6%
associate-*l*22.6%
unpow222.6%
unpow222.6%
difference-of-squares22.6%
Simplified22.6%
Taylor expanded in angle around 0 67.0%
Taylor expanded in b around inf 78.5%
*-commutative78.5%
unpow278.5%
Simplified78.5%
add-cbrt-cube89.3%
pow389.3%
Applied egg-rr89.3%
if -4.99999999999999978e282 < (/.f64 angle 180) < -4e-78Initial program 51.6%
associate-*l*51.6%
associate-*l*51.6%
unpow251.6%
unpow251.6%
difference-of-squares54.3%
Simplified54.3%
if -4e-78 < (/.f64 angle 180) Initial program 58.2%
associate-*l*58.2%
associate-*l*58.2%
unpow258.2%
unpow258.2%
difference-of-squares62.4%
Simplified62.4%
Taylor expanded in angle around inf 78.2%
Taylor expanded in angle around 0 78.8%
Final simplification71.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (/ angle 180.0))))
(if (<=
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
-2e+53)
(*
2.0
(* (- b a) (* (sin (* 0.005555555555555556 (* PI angle))) (+ b a))))
(*
(* 2.0 (- b a))
(*
(+ b a)
(*
(sin (* PI (* angle 0.005555555555555556)))
(cos (* PI (/ 1.0 (/ 180.0 angle))))))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double tmp;
if ((((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0)) <= -2e+53) {
tmp = 2.0 * ((b - a) * (sin((0.005555555555555556 * (((double) M_PI) * angle))) * (b + a)));
} else {
tmp = (2.0 * (b - a)) * ((b + a) * (sin((((double) M_PI) * (angle * 0.005555555555555556))) * cos((((double) M_PI) * (1.0 / (180.0 / angle))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
double tmp;
if ((((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0)) <= -2e+53) {
tmp = 2.0 * ((b - a) * (Math.sin((0.005555555555555556 * (Math.PI * angle))) * (b + a)));
} else {
tmp = (2.0 * (b - a)) * ((b + a) * (Math.sin((Math.PI * (angle * 0.005555555555555556))) * Math.cos((Math.PI * (1.0 / (180.0 / angle))))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) tmp = 0 if (((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)) <= -2e+53: tmp = 2.0 * ((b - a) * (math.sin((0.005555555555555556 * (math.pi * angle))) * (b + a))) else: tmp = (2.0 * (b - a)) * ((b + a) * (math.sin((math.pi * (angle * 0.005555555555555556))) * math.cos((math.pi * (1.0 / (180.0 / angle)))))) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= -2e+53) tmp = Float64(2.0 * Float64(Float64(b - a) * Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle))) * Float64(b + a)))); else tmp = Float64(Float64(2.0 * Float64(b - a)) * Float64(Float64(b + a) * Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * cos(Float64(pi * Float64(1.0 / Float64(180.0 / angle))))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = 0.0; if ((((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= -2e+53) tmp = 2.0 * ((b - a) * (sin((0.005555555555555556 * (pi * angle))) * (b + a))); else tmp = (2.0 * (b - a)) * ((b + a) * (sin((pi * (angle * 0.005555555555555556))) * cos((pi * (1.0 / (180.0 / angle)))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], -2e+53], N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(Pi * N[(1.0 / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t_0\right) \cdot \cos t_0 \leq -2 \cdot 10^{+53}:\\
\;\;\;\;2 \cdot \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(b - a\right)\right) \cdot \left(\left(b + a\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \cos \left(\pi \cdot \frac{1}{\frac{180}{angle}}\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) < -2e53Initial program 51.5%
associate-*l*51.5%
associate-*l*51.5%
unpow251.5%
unpow251.5%
difference-of-squares51.5%
Simplified51.5%
Taylor expanded in angle around inf 71.2%
Taylor expanded in angle around 0 76.4%
if -2e53 < (*.f64 (*.f64 (*.f64 2 (-.f64 (pow.f64 b 2) (pow.f64 a 2))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle 180)))) Initial program 56.4%
associate-*l*56.4%
unpow256.4%
unpow256.4%
difference-of-squares61.4%
Simplified61.4%
Taylor expanded in angle around inf 68.0%
associate-*r*68.0%
associate-*r*68.0%
*-commutative68.0%
associate-*r*66.4%
*-commutative66.4%
*-commutative66.4%
*-commutative66.4%
associate-*r*68.1%
*-commutative68.1%
*-commutative68.1%
*-commutative68.1%
Simplified68.1%
*-commutative68.1%
metadata-eval68.1%
div-inv67.9%
clear-num69.0%
Applied egg-rr69.0%
Final simplification71.1%
(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(b - a) * Float64(Float64(sin(t_0) * 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[(b - a), $MachinePrecision] * N[(N[(N[Sin[t$95$0], $MachinePrecision] * N[(b + a), $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(\sin t_0 \cdot \left(b + a\right)\right) \cdot \cos t_0\right)\right)
\end{array}
\end{array}
Initial program 55.0%
associate-*l*55.0%
associate-*l*55.0%
unpow255.0%
unpow255.0%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around inf 68.9%
Final simplification68.9%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) -5e+283)
(* 0.011111111111111112 (* angle (* (- b a) (* b PI))))
(if (<= (/ angle 180.0) -5000.0)
(* (sin (* 0.005555555555555556 (* PI angle))) (* -2.0 (* a a)))
(* 0.011111111111111112 (* (* angle (- b a)) (* PI (+ b a)))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+283) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * ((double) M_PI))));
} else if ((angle / 180.0) <= -5000.0) {
tmp = sin((0.005555555555555556 * (((double) M_PI) * angle))) * (-2.0 * (a * a));
} else {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (((double) M_PI) * (b + a)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e+283) {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * Math.PI)));
} else if ((angle / 180.0) <= -5000.0) {
tmp = Math.sin((0.005555555555555556 * (Math.PI * angle))) * (-2.0 * (a * a));
} else {
tmp = 0.011111111111111112 * ((angle * (b - a)) * (Math.PI * (b + a)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -5e+283: tmp = 0.011111111111111112 * (angle * ((b - a) * (b * math.pi))) elif (angle / 180.0) <= -5000.0: tmp = math.sin((0.005555555555555556 * (math.pi * angle))) * (-2.0 * (a * a)) else: tmp = 0.011111111111111112 * ((angle * (b - a)) * (math.pi * (b + a))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -5e+283) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a) * Float64(b * pi)))); elseif (Float64(angle / 180.0) <= -5000.0) tmp = Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle))) * Float64(-2.0 * Float64(a * a))); else tmp = Float64(0.011111111111111112 * Float64(Float64(angle * Float64(b - a)) * Float64(pi * Float64(b + a)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= -5e+283) tmp = 0.011111111111111112 * (angle * ((b - a) * (b * pi))); elseif ((angle / 180.0) <= -5000.0) tmp = sin((0.005555555555555556 * (pi * angle))) * (-2.0 * (a * a)); else tmp = 0.011111111111111112 * ((angle * (b - a)) * (pi * (b + a))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e+283], N[(0.011111111111111112 * N[(angle * N[(N[(b - a), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5000.0], N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-2.0 * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{+283}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq -5000:\\
\;\;\;\;\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(-2 \cdot \left(a \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5.0000000000000004e283Initial program 25.3%
associate-*l*25.3%
unpow225.3%
unpow225.3%
difference-of-squares25.3%
Simplified25.3%
Taylor expanded in angle around 0 75.1%
Taylor expanded in a around 0 88.2%
*-commutative88.2%
Simplified88.2%
if -5.0000000000000004e283 < (/.f64 angle 180) < -5e3Initial program 38.2%
*-commutative38.2%
associate-*l*38.2%
unpow238.2%
fma-neg39.9%
unpow239.9%
distribute-rgt-neg-in39.9%
Simplified39.9%
Taylor expanded in b around 0 27.6%
unpow227.6%
associate-*r*27.6%
*-commutative27.6%
Simplified27.6%
Taylor expanded in angle around 0 25.7%
if -5e3 < (/.f64 angle 180) Initial program 61.8%
associate-*l*61.8%
unpow261.8%
unpow261.8%
difference-of-squares65.6%
Simplified65.6%
Taylor expanded in angle around 0 64.9%
*-commutative64.9%
associate-*r*78.9%
Simplified78.9%
Final simplification66.5%
(FPCore (a b angle) :precision binary64 (* 2.0 (* (- b a) (* (sin (* 0.005555555555555556 (* PI angle))) (+ b a)))))
double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (sin((0.005555555555555556 * (((double) M_PI) * angle))) * (b + a)));
}
public static double code(double a, double b, double angle) {
return 2.0 * ((b - a) * (Math.sin((0.005555555555555556 * (Math.PI * angle))) * (b + a)));
}
def code(a, b, angle): return 2.0 * ((b - a) * (math.sin((0.005555555555555556 * (math.pi * angle))) * (b + a)))
function code(a, b, angle) return Float64(2.0 * Float64(Float64(b - a) * Float64(sin(Float64(0.005555555555555556 * Float64(pi * angle))) * Float64(b + a)))) end
function tmp = code(a, b, angle) tmp = 2.0 * ((b - a) * (sin((0.005555555555555556 * (pi * angle))) * (b + a))); end
code[a_, b_, angle_] := N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\left(b - a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b + a\right)\right)\right)
\end{array}
Initial program 55.0%
associate-*l*55.0%
associate-*l*55.0%
unpow255.0%
unpow255.0%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around inf 68.9%
Taylor expanded in angle around 0 68.0%
Final simplification68.0%
(FPCore (a b angle)
:precision binary64
(if (<= b -1.4e+35)
(* 0.011111111111111112 (* PI (* angle (* b b))))
(if (<= b 5.2e+43)
(* (* PI (* a a)) (* angle -0.011111111111111112))
(* 0.011111111111111112 (* angle (* (- b a) (* b PI)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= -1.4e+35) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else if (b <= 5.2e+43) {
tmp = (((double) M_PI) * (a * a)) * (angle * -0.011111111111111112);
} 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 (b <= -1.4e+35) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else if (b <= 5.2e+43) {
tmp = (Math.PI * (a * a)) * (angle * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (angle * ((b - a) * (b * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= -1.4e+35: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) elif b <= 5.2e+43: tmp = (math.pi * (a * a)) * (angle * -0.011111111111111112) else: tmp = 0.011111111111111112 * (angle * ((b - a) * (b * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= -1.4e+35) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); elseif (b <= 5.2e+43) tmp = Float64(Float64(pi * Float64(a * a)) * Float64(angle * -0.011111111111111112)); 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 (b <= -1.4e+35) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); elseif (b <= 5.2e+43) tmp = (pi * (a * a)) * (angle * -0.011111111111111112); else tmp = 0.011111111111111112 * (angle * ((b - a) * (b * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, -1.4e+35], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e+43], N[(N[(Pi * N[(a * a), $MachinePrecision]), $MachinePrecision] * N[(angle * -0.011111111111111112), $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}\;b \leq -1.4 \cdot 10^{+35}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+43}:\\
\;\;\;\;\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(\left(b - a\right) \cdot \left(b \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < -1.39999999999999999e35Initial program 48.0%
associate-*l*48.0%
unpow248.0%
unpow248.0%
difference-of-squares54.8%
Simplified54.8%
Taylor expanded in angle around 0 54.3%
Taylor expanded in b around inf 50.6%
*-commutative50.6%
unpow250.6%
Simplified50.6%
Taylor expanded in angle around 0 50.6%
unpow250.6%
associate-*r*50.7%
*-commutative50.7%
Simplified50.7%
if -1.39999999999999999e35 < b < 5.20000000000000042e43Initial program 63.0%
associate-*l*63.0%
unpow263.0%
unpow263.0%
difference-of-squares63.0%
Simplified63.0%
Taylor expanded in angle around 0 55.9%
Taylor expanded in b around 0 51.5%
associate-*r*51.5%
*-commutative51.5%
*-commutative51.5%
unpow251.5%
*-commutative51.5%
Simplified51.5%
if 5.20000000000000042e43 < b Initial program 40.3%
associate-*l*40.3%
unpow240.3%
unpow240.3%
difference-of-squares50.3%
Simplified50.3%
Taylor expanded in angle around 0 46.6%
Taylor expanded in a around 0 42.7%
*-commutative42.7%
Simplified42.7%
Final simplification49.6%
(FPCore (a b angle)
:precision binary64
(if (<= b -5.6e+34)
(* 0.011111111111111112 (* PI (* angle (* b b))))
(if (<= b 3.65e+49)
(* -0.011111111111111112 (* angle (* PI (* a a))))
(* 0.011111111111111112 (* angle (* PI (* b b)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= -5.6e+34) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else if (b <= 3.65e+49) {
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 <= -5.6e+34) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else if (b <= 3.65e+49) {
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 <= -5.6e+34: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) elif b <= 3.65e+49: 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 <= -5.6e+34) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); elseif (b <= 3.65e+49) 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 <= -5.6e+34) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); elseif (b <= 3.65e+49) 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, -5.6e+34], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.65e+49], 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 -5.6 \cdot 10^{+34}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{elif}\;b \leq 3.65 \cdot 10^{+49}:\\
\;\;\;\;-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 < -5.60000000000000016e34Initial program 48.0%
associate-*l*48.0%
unpow248.0%
unpow248.0%
difference-of-squares54.8%
Simplified54.8%
Taylor expanded in angle around 0 54.3%
Taylor expanded in b around inf 50.6%
*-commutative50.6%
unpow250.6%
Simplified50.6%
Taylor expanded in angle around 0 50.6%
unpow250.6%
associate-*r*50.7%
*-commutative50.7%
Simplified50.7%
if -5.60000000000000016e34 < b < 3.65000000000000007e49Initial program 62.6%
associate-*l*62.6%
unpow262.6%
unpow262.6%
difference-of-squares62.6%
Simplified62.6%
Taylor expanded in angle around 0 55.6%
Taylor expanded in b around 0 51.2%
*-commutative51.2%
*-commutative51.2%
unpow251.2%
Simplified51.2%
if 3.65000000000000007e49 < b Initial program 41.0%
associate-*l*41.0%
unpow241.0%
unpow241.0%
difference-of-squares51.2%
Simplified51.2%
Taylor expanded in angle around 0 47.4%
Taylor expanded in b around inf 43.4%
*-commutative43.4%
unpow243.4%
Simplified43.4%
Final simplification49.5%
(FPCore (a b angle)
:precision binary64
(if (<= b -4.5e+34)
(* 0.011111111111111112 (* PI (* angle (* b b))))
(if (<= b 8.6e+45)
(* (* PI (* a a)) (* angle -0.011111111111111112))
(* 0.011111111111111112 (* angle (* PI (* b b)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= -4.5e+34) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle * (b * b)));
} else if (b <= 8.6e+45) {
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 <= -4.5e+34) {
tmp = 0.011111111111111112 * (Math.PI * (angle * (b * b)));
} else if (b <= 8.6e+45) {
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 <= -4.5e+34: tmp = 0.011111111111111112 * (math.pi * (angle * (b * b))) elif b <= 8.6e+45: 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 <= -4.5e+34) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle * Float64(b * b)))); elseif (b <= 8.6e+45) 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 <= -4.5e+34) tmp = 0.011111111111111112 * (pi * (angle * (b * b))); elseif (b <= 8.6e+45) 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, -4.5e+34], N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.6e+45], 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 -4.5 \cdot 10^{+34}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{elif}\;b \leq 8.6 \cdot 10^{+45}:\\
\;\;\;\;\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 < -4.5e34Initial program 48.0%
associate-*l*48.0%
unpow248.0%
unpow248.0%
difference-of-squares54.8%
Simplified54.8%
Taylor expanded in angle around 0 54.3%
Taylor expanded in b around inf 50.6%
*-commutative50.6%
unpow250.6%
Simplified50.6%
Taylor expanded in angle around 0 50.6%
unpow250.6%
associate-*r*50.7%
*-commutative50.7%
Simplified50.7%
if -4.5e34 < b < 8.6000000000000006e45Initial program 62.6%
associate-*l*62.6%
unpow262.6%
unpow262.6%
difference-of-squares62.6%
Simplified62.6%
Taylor expanded in angle around 0 55.6%
Taylor expanded in b around 0 51.2%
associate-*r*51.2%
*-commutative51.2%
*-commutative51.2%
unpow251.2%
*-commutative51.2%
Simplified51.2%
if 8.6000000000000006e45 < b Initial program 41.0%
associate-*l*41.0%
unpow241.0%
unpow241.0%
difference-of-squares51.2%
Simplified51.2%
Taylor expanded in angle around 0 47.4%
Taylor expanded in b around inf 43.4%
*-commutative43.4%
unpow243.4%
Simplified43.4%
Final simplification49.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.0%
associate-*l*55.0%
unpow255.0%
unpow255.0%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around 0 53.7%
Final simplification53.7%
(FPCore (a b angle) :precision binary64 (* angle (* 0.011111111111111112 (* PI (* (- b a) (+ b a))))))
double code(double a, double b, double angle) {
return angle * (0.011111111111111112 * (((double) M_PI) * ((b - a) * (b + a))));
}
public static double code(double a, double b, double angle) {
return angle * (0.011111111111111112 * (Math.PI * ((b - a) * (b + a))));
}
def code(a, b, angle): return angle * (0.011111111111111112 * (math.pi * ((b - a) * (b + a))))
function code(a, b, angle) return Float64(angle * Float64(0.011111111111111112 * Float64(pi * Float64(Float64(b - a) * Float64(b + a))))) end
function tmp = code(a, b, angle) tmp = angle * (0.011111111111111112 * (pi * ((b - a) * (b + a)))); end
code[a_, b_, angle_] := N[(angle * N[(0.011111111111111112 * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Initial program 55.0%
associate-*l*55.0%
unpow255.0%
unpow255.0%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around 0 53.7%
pow153.7%
*-commutative53.7%
Applied egg-rr53.7%
unpow153.7%
associate-*l*54.1%
*-commutative54.1%
*-commutative54.1%
associate-*r*54.1%
*-commutative54.1%
*-commutative54.1%
Simplified54.1%
Final simplification54.1%
(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(Float64(angle * 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[(N[(angle * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\left(angle \cdot \left(b - a\right)\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)
\end{array}
Initial program 55.0%
associate-*l*55.0%
unpow255.0%
unpow255.0%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around 0 53.7%
*-commutative53.7%
associate-*r*62.8%
Simplified62.8%
Final simplification62.8%
(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.0%
associate-*l*55.0%
unpow255.0%
unpow255.0%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around 0 53.7%
Taylor expanded in b around inf 33.7%
*-commutative33.7%
unpow233.7%
Simplified33.7%
Final simplification33.7%
(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.0%
associate-*l*55.0%
unpow255.0%
unpow255.0%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around 0 53.7%
Taylor expanded in b around inf 33.7%
*-commutative33.7%
unpow233.7%
Simplified33.7%
Taylor expanded in angle around 0 33.7%
unpow233.7%
associate-*r*33.7%
*-commutative33.7%
Simplified33.7%
Final simplification33.7%
(FPCore (a b angle) :precision binary64 (* angle (* 0.011111111111111112 (* PI (* b b)))))
double code(double a, double b, double angle) {
return angle * (0.011111111111111112 * (((double) M_PI) * (b * b)));
}
public static double code(double a, double b, double angle) {
return angle * (0.011111111111111112 * (Math.PI * (b * b)));
}
def code(a, b, angle): return angle * (0.011111111111111112 * (math.pi * (b * b)))
function code(a, b, angle) return Float64(angle * Float64(0.011111111111111112 * Float64(pi * Float64(b * b)))) end
function tmp = code(a, b, angle) tmp = angle * (0.011111111111111112 * (pi * (b * b))); end
code[a_, b_, angle_] := N[(angle * N[(0.011111111111111112 * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 55.0%
associate-*l*55.0%
unpow255.0%
unpow255.0%
difference-of-squares58.6%
Simplified58.6%
Taylor expanded in angle around 0 53.7%
Taylor expanded in b around inf 33.7%
*-commutative33.7%
unpow233.7%
Simplified33.7%
Taylor expanded in angle around 0 33.7%
associate-*r*33.7%
*-commutative33.7%
unpow233.7%
*-commutative33.7%
associate-*l*34.1%
Simplified34.1%
Final simplification34.1%
herbie shell --seed 2023189
(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)))))