
(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 13 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) -1e+22)
(*
2.0
(* (* (+ b a) (- a b)) (* (sin t_0) (cos (* angle (/ PI -180.0))))))
(if (<= (/ angle 180.0) 2e+114)
(* -0.011111111111111112 (* (* (* PI angle) (+ b a)) (- a b)))
(*
(cos t_0)
(* 0.011111111111111112 (* angle (* PI (* (- b a) (+ 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) <= -1e+22) {
tmp = 2.0 * (((b + a) * (a - b)) * (sin(t_0) * cos((angle * (((double) M_PI) / -180.0)))));
} else if ((angle / 180.0) <= 2e+114) {
tmp = -0.011111111111111112 * (((((double) M_PI) * angle) * (b + a)) * (a - b));
} else {
tmp = cos(t_0) * (0.011111111111111112 * (angle * (((double) M_PI) * ((b - a) * (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) <= -1e+22) {
tmp = 2.0 * (((b + a) * (a - b)) * (Math.sin(t_0) * Math.cos((angle * (Math.PI / -180.0)))));
} else if ((angle / 180.0) <= 2e+114) {
tmp = -0.011111111111111112 * (((Math.PI * angle) * (b + a)) * (a - b));
} else {
tmp = Math.cos(t_0) * (0.011111111111111112 * (angle * (Math.PI * ((b - a) * (b + a)))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) tmp = 0 if (angle / 180.0) <= -1e+22: tmp = 2.0 * (((b + a) * (a - b)) * (math.sin(t_0) * math.cos((angle * (math.pi / -180.0))))) elif (angle / 180.0) <= 2e+114: tmp = -0.011111111111111112 * (((math.pi * angle) * (b + a)) * (a - b)) else: tmp = math.cos(t_0) * (0.011111111111111112 * (angle * (math.pi * ((b - a) * (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) <= -1e+22) tmp = Float64(2.0 * Float64(Float64(Float64(b + a) * Float64(a - b)) * Float64(sin(t_0) * cos(Float64(angle * Float64(pi / -180.0)))))); elseif (Float64(angle / 180.0) <= 2e+114) tmp = Float64(-0.011111111111111112 * Float64(Float64(Float64(pi * angle) * Float64(b + a)) * Float64(a - b))); else tmp = Float64(cos(t_0) * Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b - a) * Float64(b + a)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = 0.0; if ((angle / 180.0) <= -1e+22) tmp = 2.0 * (((b + a) * (a - b)) * (sin(t_0) * cos((angle * (pi / -180.0))))); elseif ((angle / 180.0) <= 2e+114) tmp = -0.011111111111111112 * (((pi * angle) * (b + a)) * (a - b)); else tmp = cos(t_0) * (0.011111111111111112 * (angle * (pi * ((b - a) * (b + a))))); end tmp_2 = 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], -1e+22], N[(2.0 * N[(N[(N[(b + a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+114], N[(-0.011111111111111112 * N[(N[(N[(Pi * angle), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$0], $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\frac{angle}{180} \leq -1 \cdot 10^{+22}:\\
\;\;\;\;2 \cdot \left(\left(\left(b + a\right) \cdot \left(a - b\right)\right) \cdot \left(\sin t_0 \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+114}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(\pi \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(a - b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos t_0 \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -1e22Initial program 37.2%
associate-*l*37.2%
associate-*l*37.2%
cos-neg37.2%
distribute-rgt-neg-out37.2%
distribute-frac-neg37.2%
neg-mul-137.2%
associate-/l*32.5%
associate-*r/37.8%
associate-/r/27.0%
associate-/l*27.0%
metadata-eval27.0%
Simplified27.0%
Taylor expanded in b around 0 27.0%
neg-mul-127.0%
+-commutative27.0%
sub-neg27.0%
rem-square-sqrt17.1%
fabs-sqr17.1%
rem-square-sqrt28.9%
fabs-sub28.9%
rem-square-sqrt19.0%
fabs-sqr19.0%
rem-square-sqrt35.9%
Simplified35.9%
unpow235.9%
unpow235.9%
difference-of-squares39.5%
Applied egg-rr39.5%
if -1e22 < (/.f64 angle 180) < 2e114Initial program 60.5%
Simplified59.4%
Taylor expanded in angle around 0 60.1%
unpow216.5%
unpow216.5%
difference-of-squares17.7%
Applied egg-rr66.3%
expm1-log1p-u47.1%
expm1-udef31.7%
*-commutative31.7%
associate-*r*31.7%
+-commutative31.7%
Applied egg-rr31.7%
expm1-def47.1%
expm1-log1p66.3%
*-commutative66.3%
associate-*r*83.9%
+-commutative83.9%
Simplified83.9%
if 2e114 < (/.f64 angle 180) Initial program 35.8%
unpow235.8%
unpow235.8%
difference-of-squares41.1%
Applied egg-rr41.1%
Taylor expanded in angle around 0 40.9%
Final simplification68.0%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a 2.0))))
(if (<= t_0 (- INFINITY))
(* -0.011111111111111112 (* (- a b) (* a (* PI angle))))
(if (<= t_0 5e+306)
(* t_0 (sin (* PI (* 2.0 (* angle 0.005555555555555556)))))
(* -0.011111111111111112 (* (- a b) (* angle (* PI (+ b a)))))))))
double code(double a, double b, double angle) {
double t_0 = pow(b, 2.0) - pow(a, 2.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = -0.011111111111111112 * ((a - b) * (a * (((double) M_PI) * angle)));
} else if (t_0 <= 5e+306) {
tmp = t_0 * sin((((double) M_PI) * (2.0 * (angle * 0.005555555555555556))));
} else {
tmp = -0.011111111111111112 * ((a - b) * (angle * (((double) M_PI) * (b + a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = -0.011111111111111112 * ((a - b) * (a * (Math.PI * angle)));
} else if (t_0 <= 5e+306) {
tmp = t_0 * Math.sin((Math.PI * (2.0 * (angle * 0.005555555555555556))));
} else {
tmp = -0.011111111111111112 * ((a - b) * (angle * (Math.PI * (b + a))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pow(b, 2.0) - math.pow(a, 2.0) tmp = 0 if t_0 <= -math.inf: tmp = -0.011111111111111112 * ((a - b) * (a * (math.pi * angle))) elif t_0 <= 5e+306: tmp = t_0 * math.sin((math.pi * (2.0 * (angle * 0.005555555555555556)))) else: tmp = -0.011111111111111112 * ((a - b) * (angle * (math.pi * (b + a)))) return tmp
function code(a, b, angle) t_0 = Float64((b ^ 2.0) - (a ^ 2.0)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(a * Float64(pi * angle)))); elseif (t_0 <= 5e+306) tmp = Float64(t_0 * sin(Float64(pi * Float64(2.0 * Float64(angle * 0.005555555555555556))))); else tmp = Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(angle * Float64(pi * Float64(b + a))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = (b ^ 2.0) - (a ^ 2.0); tmp = 0.0; if (t_0 <= -Inf) tmp = -0.011111111111111112 * ((a - b) * (a * (pi * angle))); elseif (t_0 <= 5e+306) tmp = t_0 * sin((pi * (2.0 * (angle * 0.005555555555555556)))); else tmp = -0.011111111111111112 * ((a - b) * (angle * (pi * (b + a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], N[(t$95$0 * N[Sin[N[(Pi * N[(2.0 * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t_0 \cdot \sin \left(\pi \cdot \left(2 \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < -inf.0Initial program 56.8%
Simplified47.4%
Taylor expanded in angle around 0 51.2%
unpow228.4%
unpow228.4%
difference-of-squares28.4%
Applied egg-rr51.2%
expm1-log1p-u18.0%
expm1-udef18.0%
*-commutative18.0%
associate-*r*18.0%
+-commutative18.0%
Applied egg-rr18.0%
expm1-def18.0%
expm1-log1p51.2%
*-commutative51.2%
associate-*r*75.4%
+-commutative75.4%
Simplified75.4%
Taylor expanded in a around inf 75.4%
if -inf.0 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < 4.99999999999999993e306Initial program 56.2%
*-commutative56.2%
associate-*l*56.2%
associate-*l*56.2%
Simplified56.2%
add-cbrt-cube35.0%
pow1/324.0%
Applied egg-rr24.0%
unpow1/334.9%
rem-cbrt-cube55.6%
metadata-eval55.6%
div-inv56.2%
*-commutative56.2%
associate-*r*56.2%
div-inv55.6%
metadata-eval55.6%
Applied egg-rr55.6%
if 4.99999999999999993e306 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 40.2%
Simplified36.0%
Taylor expanded in angle around 0 41.5%
unpow220.9%
unpow220.9%
difference-of-squares26.5%
Applied egg-rr61.1%
expm1-log1p-u36.6%
expm1-udef36.6%
*-commutative36.6%
associate-*r*36.6%
+-commutative36.6%
Applied egg-rr36.6%
expm1-def36.6%
expm1-log1p61.1%
*-commutative61.1%
associate-*r*83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in angle around 0 83.2%
Final simplification67.5%
(FPCore (a b angle)
:precision binary64
(if (<= (pow b 2.0) 5e-224)
(*
(* (* 2.0 (* (- b a) (+ b a))) (sin (* PI (/ angle 180.0))))
(cos (* (/ angle 180.0) (pow (sqrt PI) 2.0))))
(* -0.011111111111111112 (* (* (* PI angle) (+ b a)) (- a b)))))
double code(double a, double b, double angle) {
double tmp;
if (pow(b, 2.0) <= 5e-224) {
tmp = ((2.0 * ((b - a) * (b + a))) * sin((((double) M_PI) * (angle / 180.0)))) * cos(((angle / 180.0) * pow(sqrt(((double) M_PI)), 2.0)));
} else {
tmp = -0.011111111111111112 * (((((double) M_PI) * angle) * (b + a)) * (a - b));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(b, 2.0) <= 5e-224) {
tmp = ((2.0 * ((b - a) * (b + a))) * Math.sin((Math.PI * (angle / 180.0)))) * Math.cos(((angle / 180.0) * Math.pow(Math.sqrt(Math.PI), 2.0)));
} else {
tmp = -0.011111111111111112 * (((Math.PI * angle) * (b + a)) * (a - b));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if math.pow(b, 2.0) <= 5e-224: tmp = ((2.0 * ((b - a) * (b + a))) * math.sin((math.pi * (angle / 180.0)))) * math.cos(((angle / 180.0) * math.pow(math.sqrt(math.pi), 2.0))) else: tmp = -0.011111111111111112 * (((math.pi * angle) * (b + a)) * (a - b)) return tmp
function code(a, b, angle) tmp = 0.0 if ((b ^ 2.0) <= 5e-224) tmp = Float64(Float64(Float64(2.0 * Float64(Float64(b - a) * Float64(b + a))) * sin(Float64(pi * Float64(angle / 180.0)))) * cos(Float64(Float64(angle / 180.0) * (sqrt(pi) ^ 2.0)))); else tmp = Float64(-0.011111111111111112 * Float64(Float64(Float64(pi * angle) * Float64(b + a)) * Float64(a - b))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b ^ 2.0) <= 5e-224) tmp = ((2.0 * ((b - a) * (b + a))) * sin((pi * (angle / 180.0)))) * cos(((angle / 180.0) * (sqrt(pi) ^ 2.0))); else tmp = -0.011111111111111112 * (((pi * angle) * (b + a)) * (a - b)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 5e-224], N[(N[(N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(N[(N[(Pi * angle), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 5 \cdot 10^{-224}:\\
\;\;\;\;\left(\left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot {\left(\sqrt{\pi}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(\pi \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(a - b\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 4.9999999999999999e-224Initial program 65.4%
unpow265.4%
unpow265.4%
difference-of-squares65.4%
Applied egg-rr65.4%
add-sqr-sqrt65.9%
pow265.9%
Applied egg-rr65.9%
if 4.9999999999999999e-224 < (pow.f64 b 2) Initial program 46.1%
Simplified43.9%
Taylor expanded in angle around 0 44.7%
unpow216.4%
unpow216.4%
difference-of-squares18.6%
Applied egg-rr52.5%
expm1-log1p-u32.5%
expm1-udef24.7%
*-commutative24.7%
associate-*r*24.7%
+-commutative24.7%
Applied egg-rr24.7%
expm1-def32.5%
expm1-log1p52.5%
*-commutative52.5%
associate-*r*66.9%
+-commutative66.9%
Simplified66.9%
Final simplification66.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (/ angle 180.0))))
(if (<= (pow b 2.0) 5e-224)
(* (* (* 2.0 (* (- b a) (+ b a))) (sin t_0)) (cos t_0))
(* -0.011111111111111112 (* (* (* PI angle) (+ b a)) (- a b))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double tmp;
if (pow(b, 2.0) <= 5e-224) {
tmp = ((2.0 * ((b - a) * (b + a))) * sin(t_0)) * cos(t_0);
} else {
tmp = -0.011111111111111112 * (((((double) M_PI) * angle) * (b + a)) * (a - b));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
double tmp;
if (Math.pow(b, 2.0) <= 5e-224) {
tmp = ((2.0 * ((b - a) * (b + a))) * Math.sin(t_0)) * Math.cos(t_0);
} else {
tmp = -0.011111111111111112 * (((Math.PI * angle) * (b + a)) * (a - b));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) tmp = 0 if math.pow(b, 2.0) <= 5e-224: tmp = ((2.0 * ((b - a) * (b + a))) * math.sin(t_0)) * math.cos(t_0) else: tmp = -0.011111111111111112 * (((math.pi * angle) * (b + a)) * (a - b)) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if ((b ^ 2.0) <= 5e-224) tmp = Float64(Float64(Float64(2.0 * Float64(Float64(b - a) * Float64(b + a))) * sin(t_0)) * cos(t_0)); else tmp = Float64(-0.011111111111111112 * Float64(Float64(Float64(pi * angle) * Float64(b + a)) * Float64(a - b))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = 0.0; if ((b ^ 2.0) <= 5e-224) tmp = ((2.0 * ((b - a) * (b + a))) * sin(t_0)) * cos(t_0); else tmp = -0.011111111111111112 * (((pi * angle) * (b + a)) * (a - b)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 5e-224], N[(N[(N[(2.0 * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(N[(N[(Pi * angle), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;{b}^{2} \leq 5 \cdot 10^{-224}:\\
\;\;\;\;\left(\left(2 \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right) \cdot \sin t_0\right) \cdot \cos t_0\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(\pi \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(a - b\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b 2) < 4.9999999999999999e-224Initial program 65.4%
unpow265.4%
unpow265.4%
difference-of-squares65.4%
Applied egg-rr65.4%
if 4.9999999999999999e-224 < (pow.f64 b 2) Initial program 46.1%
Simplified43.9%
Taylor expanded in angle around 0 44.7%
unpow216.4%
unpow216.4%
difference-of-squares18.6%
Applied egg-rr52.5%
expm1-log1p-u32.5%
expm1-udef24.7%
*-commutative24.7%
associate-*r*24.7%
+-commutative24.7%
Applied egg-rr24.7%
expm1-def32.5%
expm1-log1p52.5%
*-commutative52.5%
associate-*r*66.9%
+-commutative66.9%
Simplified66.9%
Final simplification66.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (/ angle 180.0))))
(if (<= (/ angle 180.0) -4e+43)
(* 2.0 (* (sin t_0) (- (pow b 2.0) (pow a 2.0))))
(if (<= (/ angle 180.0) 2e+114)
(* -0.011111111111111112 (* (* (* PI angle) (+ b a)) (- a b)))
(*
(cos t_0)
(* 0.011111111111111112 (* angle (* PI (* (- b a) (+ 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) <= -4e+43) {
tmp = 2.0 * (sin(t_0) * (pow(b, 2.0) - pow(a, 2.0)));
} else if ((angle / 180.0) <= 2e+114) {
tmp = -0.011111111111111112 * (((((double) M_PI) * angle) * (b + a)) * (a - b));
} else {
tmp = cos(t_0) * (0.011111111111111112 * (angle * (((double) M_PI) * ((b - a) * (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) <= -4e+43) {
tmp = 2.0 * (Math.sin(t_0) * (Math.pow(b, 2.0) - Math.pow(a, 2.0)));
} else if ((angle / 180.0) <= 2e+114) {
tmp = -0.011111111111111112 * (((Math.PI * angle) * (b + a)) * (a - b));
} else {
tmp = Math.cos(t_0) * (0.011111111111111112 * (angle * (Math.PI * ((b - a) * (b + a)))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) tmp = 0 if (angle / 180.0) <= -4e+43: tmp = 2.0 * (math.sin(t_0) * (math.pow(b, 2.0) - math.pow(a, 2.0))) elif (angle / 180.0) <= 2e+114: tmp = -0.011111111111111112 * (((math.pi * angle) * (b + a)) * (a - b)) else: tmp = math.cos(t_0) * (0.011111111111111112 * (angle * (math.pi * ((b - a) * (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) <= -4e+43) tmp = Float64(2.0 * Float64(sin(t_0) * Float64((b ^ 2.0) - (a ^ 2.0)))); elseif (Float64(angle / 180.0) <= 2e+114) tmp = Float64(-0.011111111111111112 * Float64(Float64(Float64(pi * angle) * Float64(b + a)) * Float64(a - b))); else tmp = Float64(cos(t_0) * Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b - a) * Float64(b + a)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = 0.0; if ((angle / 180.0) <= -4e+43) tmp = 2.0 * (sin(t_0) * ((b ^ 2.0) - (a ^ 2.0))); elseif ((angle / 180.0) <= 2e+114) tmp = -0.011111111111111112 * (((pi * angle) * (b + a)) * (a - b)); else tmp = cos(t_0) * (0.011111111111111112 * (angle * (pi * ((b - a) * (b + a))))); end tmp_2 = 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], -4e+43], N[(2.0 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+114], N[(-0.011111111111111112 * N[(N[(N[(Pi * angle), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$0], $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b - a), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\frac{angle}{180} \leq -4 \cdot 10^{+43}:\\
\;\;\;\;2 \cdot \left(\sin t_0 \cdot \left({b}^{2} - {a}^{2}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+114}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(\left(\pi \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(a - b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos t_0 \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot \left(b + a\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.00000000000000006e43Initial program 38.1%
associate-*l*38.1%
associate-*l*38.1%
cos-neg38.1%
distribute-rgt-neg-out38.1%
distribute-frac-neg38.1%
neg-mul-138.1%
associate-/l*32.7%
associate-*r/38.4%
associate-/r/28.7%
associate-/l*28.7%
metadata-eval28.7%
Simplified28.7%
Taylor expanded in angle around 0 40.9%
if -4.00000000000000006e43 < (/.f64 angle 180) < 2e114Initial program 59.6%
Simplified58.1%
Taylor expanded in angle around 0 58.8%
unpow216.8%
unpow216.8%
difference-of-squares18.0%
Applied egg-rr64.8%
expm1-log1p-u46.0%
expm1-udef31.0%
*-commutative31.0%
associate-*r*31.0%
+-commutative31.0%
Applied egg-rr31.0%
expm1-def46.0%
expm1-log1p64.8%
*-commutative64.8%
associate-*r*82.0%
+-commutative82.0%
Simplified82.0%
if 2e114 < (/.f64 angle 180) Initial program 35.8%
unpow235.8%
unpow235.8%
difference-of-squares41.1%
Applied egg-rr41.1%
Taylor expanded in angle around 0 40.9%
Final simplification67.7%
(FPCore (a b angle)
:precision binary64
(if (<= a 5.2e-195)
(* -0.011111111111111112 (* (- a b) (* angle (* b PI))))
(if (<= a 6.4e+119)
(* -0.011111111111111112 (* angle (* PI (* (+ b a) (- a b)))))
(* -0.011111111111111112 (* (- a b) (* a (* PI angle)))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 5.2e-195) {
tmp = -0.011111111111111112 * ((a - b) * (angle * (b * ((double) M_PI))));
} else if (a <= 6.4e+119) {
tmp = -0.011111111111111112 * (angle * (((double) M_PI) * ((b + a) * (a - b))));
} else {
tmp = -0.011111111111111112 * ((a - b) * (a * (((double) M_PI) * angle)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 5.2e-195) {
tmp = -0.011111111111111112 * ((a - b) * (angle * (b * Math.PI)));
} else if (a <= 6.4e+119) {
tmp = -0.011111111111111112 * (angle * (Math.PI * ((b + a) * (a - b))));
} else {
tmp = -0.011111111111111112 * ((a - b) * (a * (Math.PI * angle)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 5.2e-195: tmp = -0.011111111111111112 * ((a - b) * (angle * (b * math.pi))) elif a <= 6.4e+119: tmp = -0.011111111111111112 * (angle * (math.pi * ((b + a) * (a - b)))) else: tmp = -0.011111111111111112 * ((a - b) * (a * (math.pi * angle))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 5.2e-195) tmp = Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(angle * Float64(b * pi)))); elseif (a <= 6.4e+119) tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b + a) * Float64(a - b))))); else tmp = Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(a * Float64(pi * angle)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 5.2e-195) tmp = -0.011111111111111112 * ((a - b) * (angle * (b * pi))); elseif (a <= 6.4e+119) tmp = -0.011111111111111112 * (angle * (pi * ((b + a) * (a - b)))); else tmp = -0.011111111111111112 * ((a - b) * (a * (pi * angle))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 5.2e-195], N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.4e+119], N[(-0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.2 \cdot 10^{-195}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;a \leq 6.4 \cdot 10^{+119}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(a - b\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if a < 5.2000000000000003e-195Initial program 52.2%
Simplified49.8%
Taylor expanded in angle around 0 48.8%
unpow222.9%
unpow222.9%
difference-of-squares24.2%
Applied egg-rr53.4%
expm1-log1p-u36.1%
expm1-udef28.1%
*-commutative28.1%
associate-*r*28.1%
+-commutative28.1%
Applied egg-rr28.1%
expm1-def36.1%
expm1-log1p53.4%
*-commutative53.4%
associate-*r*63.4%
+-commutative63.4%
Simplified63.4%
Taylor expanded in a around 0 43.8%
*-commutative43.8%
Simplified43.8%
if 5.2000000000000003e-195 < a < 6.39999999999999979e119Initial program 55.4%
Simplified53.4%
Taylor expanded in angle around 0 49.5%
unpow220.3%
unpow220.3%
difference-of-squares20.3%
Applied egg-rr49.5%
if 6.39999999999999979e119 < a Initial program 45.5%
Simplified38.7%
Taylor expanded in angle around 0 44.4%
unpow222.9%
unpow222.9%
difference-of-squares27.4%
Applied egg-rr60.5%
expm1-log1p-u29.1%
expm1-udef29.1%
*-commutative29.1%
associate-*r*29.1%
+-commutative29.1%
Applied egg-rr29.1%
expm1-def29.1%
expm1-log1p60.5%
*-commutative60.5%
associate-*r*79.3%
+-commutative79.3%
Simplified79.3%
Taylor expanded in a around inf 68.0%
Final simplification49.2%
(FPCore (a b angle) :precision binary64 (if (<= b 1.5e+50) (* -0.011111111111111112 (* (- a b) (* angle (* a PI)))) (* -0.011111111111111112 (* (- a b) (* angle (* b PI))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.5e+50) {
tmp = -0.011111111111111112 * ((a - b) * (angle * (a * ((double) M_PI))));
} else {
tmp = -0.011111111111111112 * ((a - b) * (angle * (b * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.5e+50) {
tmp = -0.011111111111111112 * ((a - b) * (angle * (a * Math.PI)));
} else {
tmp = -0.011111111111111112 * ((a - b) * (angle * (b * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.5e+50: tmp = -0.011111111111111112 * ((a - b) * (angle * (a * math.pi))) else: tmp = -0.011111111111111112 * ((a - b) * (angle * (b * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.5e+50) tmp = Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(angle * Float64(a * pi)))); else tmp = Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(angle * Float64(b * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.5e+50) tmp = -0.011111111111111112 * ((a - b) * (angle * (a * pi))); else tmp = -0.011111111111111112 * ((a - b) * (angle * (b * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.5e+50], N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.5 \cdot 10^{+50}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(a \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.4999999999999999e50Initial program 55.7%
Simplified52.2%
Taylor expanded in angle around 0 51.4%
unpow224.8%
unpow224.8%
difference-of-squares24.8%
Applied egg-rr53.9%
expm1-log1p-u37.9%
expm1-udef25.9%
*-commutative25.9%
associate-*r*25.9%
+-commutative25.9%
Applied egg-rr25.9%
expm1-def37.8%
expm1-log1p53.9%
*-commutative53.9%
associate-*r*62.9%
+-commutative62.9%
Simplified62.9%
Taylor expanded in a around inf 47.9%
*-commutative47.9%
associate-*l*47.9%
Simplified47.9%
if 1.4999999999999999e50 < b Initial program 37.7%
Simplified36.0%
Taylor expanded in angle around 0 36.4%
unpow213.2%
unpow213.2%
difference-of-squares20.5%
Applied egg-rr52.9%
expm1-log1p-u30.1%
expm1-udef28.3%
*-commutative28.3%
associate-*r*28.3%
+-commutative28.3%
Applied egg-rr28.3%
expm1-def30.1%
expm1-log1p52.9%
*-commutative52.9%
associate-*r*66.3%
+-commutative66.3%
Simplified66.3%
Taylor expanded in a around 0 57.7%
*-commutative57.7%
Simplified57.7%
Final simplification50.0%
(FPCore (a b angle) :precision binary64 (if (<= b 6.2e+50) (* -0.011111111111111112 (* (- a b) (* angle (* a PI)))) (* -0.011111111111111112 (* (- a b) (* PI (* b angle))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 6.2e+50) {
tmp = -0.011111111111111112 * ((a - b) * (angle * (a * ((double) M_PI))));
} else {
tmp = -0.011111111111111112 * ((a - b) * (((double) M_PI) * (b * angle)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 6.2e+50) {
tmp = -0.011111111111111112 * ((a - b) * (angle * (a * Math.PI)));
} else {
tmp = -0.011111111111111112 * ((a - b) * (Math.PI * (b * angle)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 6.2e+50: tmp = -0.011111111111111112 * ((a - b) * (angle * (a * math.pi))) else: tmp = -0.011111111111111112 * ((a - b) * (math.pi * (b * angle))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 6.2e+50) tmp = Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(angle * Float64(a * pi)))); else tmp = Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(pi * Float64(b * angle)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 6.2e+50) tmp = -0.011111111111111112 * ((a - b) * (angle * (a * pi))); else tmp = -0.011111111111111112 * ((a - b) * (pi * (b * angle))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 6.2e+50], N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(Pi * N[(b * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.2 \cdot 10^{+50}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(a \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if b < 6.20000000000000006e50Initial program 55.7%
Simplified52.2%
Taylor expanded in angle around 0 51.4%
unpow224.8%
unpow224.8%
difference-of-squares24.8%
Applied egg-rr53.9%
expm1-log1p-u37.9%
expm1-udef25.9%
*-commutative25.9%
associate-*r*25.9%
+-commutative25.9%
Applied egg-rr25.9%
expm1-def37.8%
expm1-log1p53.9%
*-commutative53.9%
associate-*r*62.9%
+-commutative62.9%
Simplified62.9%
Taylor expanded in a around inf 47.9%
*-commutative47.9%
associate-*l*47.9%
Simplified47.9%
if 6.20000000000000006e50 < b Initial program 37.7%
Simplified36.0%
Taylor expanded in angle around 0 36.4%
unpow213.2%
unpow213.2%
difference-of-squares20.5%
Applied egg-rr52.9%
expm1-log1p-u30.1%
expm1-udef28.3%
*-commutative28.3%
associate-*r*28.3%
+-commutative28.3%
Applied egg-rr28.3%
expm1-def30.1%
expm1-log1p52.9%
*-commutative52.9%
associate-*r*66.3%
+-commutative66.3%
Simplified66.3%
Taylor expanded in a around 0 57.7%
associate-*r*57.8%
Simplified57.8%
Final simplification50.0%
(FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* (- a b) (* angle (* PI (+ b a))))))
double code(double a, double b, double angle) {
return -0.011111111111111112 * ((a - b) * (angle * (((double) M_PI) * (b + a))));
}
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * ((a - b) * (angle * (Math.PI * (b + a))));
}
def code(a, b, angle): return -0.011111111111111112 * ((a - b) * (angle * (math.pi * (b + a))))
function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(angle * Float64(pi * Float64(b + a))))) end
function tmp = code(a, b, angle) tmp = -0.011111111111111112 * ((a - b) * (angle * (pi * (b + a)))); end
code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)
\end{array}
Initial program 51.8%
Simplified48.7%
Taylor expanded in angle around 0 48.2%
unpow222.3%
unpow222.3%
difference-of-squares23.9%
Applied egg-rr53.7%
expm1-log1p-u36.2%
expm1-udef26.4%
*-commutative26.4%
associate-*r*26.4%
+-commutative26.4%
Applied egg-rr26.4%
expm1-def36.2%
expm1-log1p53.7%
*-commutative53.7%
associate-*r*63.7%
+-commutative63.7%
Simplified63.7%
Taylor expanded in angle around 0 63.6%
Final simplification63.6%
(FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* (* (* PI angle) (+ b a)) (- a b))))
double code(double a, double b, double angle) {
return -0.011111111111111112 * (((((double) M_PI) * angle) * (b + a)) * (a - b));
}
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (((Math.PI * angle) * (b + a)) * (a - b));
}
def code(a, b, angle): return -0.011111111111111112 * (((math.pi * angle) * (b + a)) * (a - b))
function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(Float64(Float64(pi * angle) * Float64(b + a)) * Float64(a - b))) end
function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (((pi * angle) * (b + a)) * (a - b)); end
code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(N[(N[(Pi * angle), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.011111111111111112 \cdot \left(\left(\left(\pi \cdot angle\right) \cdot \left(b + a\right)\right) \cdot \left(a - b\right)\right)
\end{array}
Initial program 51.8%
Simplified48.7%
Taylor expanded in angle around 0 48.2%
unpow222.3%
unpow222.3%
difference-of-squares23.9%
Applied egg-rr53.7%
expm1-log1p-u36.2%
expm1-udef26.4%
*-commutative26.4%
associate-*r*26.4%
+-commutative26.4%
Applied egg-rr26.4%
expm1-def36.2%
expm1-log1p53.7%
*-commutative53.7%
associate-*r*63.7%
+-commutative63.7%
Simplified63.7%
Final simplification63.7%
(FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* (- a b) (* a (* PI angle)))))
double code(double a, double b, double angle) {
return -0.011111111111111112 * ((a - b) * (a * (((double) M_PI) * angle)));
}
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * ((a - b) * (a * (Math.PI * angle)));
}
def code(a, b, angle): return -0.011111111111111112 * ((a - b) * (a * (math.pi * angle)))
function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(a * Float64(pi * angle)))) end
function tmp = code(a, b, angle) tmp = -0.011111111111111112 * ((a - b) * (a * (pi * angle))); end
code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)
\end{array}
Initial program 51.8%
Simplified48.7%
Taylor expanded in angle around 0 48.2%
unpow222.3%
unpow222.3%
difference-of-squares23.9%
Applied egg-rr53.7%
expm1-log1p-u36.2%
expm1-udef26.4%
*-commutative26.4%
associate-*r*26.4%
+-commutative26.4%
Applied egg-rr26.4%
expm1-def36.2%
expm1-log1p53.7%
*-commutative53.7%
associate-*r*63.7%
+-commutative63.7%
Simplified63.7%
Taylor expanded in a around inf 44.6%
Final simplification44.6%
(FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* (- a b) (* angle (* a PI)))))
double code(double a, double b, double angle) {
return -0.011111111111111112 * ((a - b) * (angle * (a * ((double) M_PI))));
}
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * ((a - b) * (angle * (a * Math.PI)));
}
def code(a, b, angle): return -0.011111111111111112 * ((a - b) * (angle * (a * math.pi)))
function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(Float64(a - b) * Float64(angle * Float64(a * pi)))) end
function tmp = code(a, b, angle) tmp = -0.011111111111111112 * ((a - b) * (angle * (a * pi))); end
code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(N[(a - b), $MachinePrecision] * N[(angle * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.011111111111111112 \cdot \left(\left(a - b\right) \cdot \left(angle \cdot \left(a \cdot \pi\right)\right)\right)
\end{array}
Initial program 51.8%
Simplified48.7%
Taylor expanded in angle around 0 48.2%
unpow222.3%
unpow222.3%
difference-of-squares23.9%
Applied egg-rr53.7%
expm1-log1p-u36.2%
expm1-udef26.4%
*-commutative26.4%
associate-*r*26.4%
+-commutative26.4%
Applied egg-rr26.4%
expm1-def36.2%
expm1-log1p53.7%
*-commutative53.7%
associate-*r*63.7%
+-commutative63.7%
Simplified63.7%
Taylor expanded in a around inf 44.6%
*-commutative44.6%
associate-*l*44.6%
Simplified44.6%
Final simplification44.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 51.8%
associate-*l*51.8%
associate-*l*51.8%
cos-neg51.8%
distribute-rgt-neg-out51.8%
distribute-frac-neg51.8%
neg-mul-151.8%
associate-/l*50.5%
associate-*r/50.9%
associate-/r/47.5%
associate-/l*47.5%
metadata-eval47.5%
Simplified47.5%
Taylor expanded in b around 0 47.5%
neg-mul-147.5%
+-commutative47.5%
sub-neg47.5%
rem-square-sqrt23.8%
fabs-sqr23.8%
rem-square-sqrt31.9%
fabs-sub31.9%
rem-square-sqrt12.9%
fabs-sqr12.9%
rem-square-sqrt22.3%
Simplified22.3%
Applied egg-rr2.8%
times-frac2.8%
Simplified11.2%
Final simplification11.2%
herbie shell --seed 2023314
(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)))))