
(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}
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= (pow a 2.0) 5e+301)
(*
2.0
(*
(+ a b)
(*
(- b a)
(*
(cos (* angle (* PI -0.005555555555555556)))
(sin (* (* angle PI) 0.005555555555555556))))))
(*
2.0
(* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556))))))))b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (pow(a, 2.0) <= 5e+301) {
tmp = 2.0 * ((a + b) * ((b - a) * (cos((angle * (((double) M_PI) * -0.005555555555555556))) * sin(((angle * ((double) M_PI)) * 0.005555555555555556)))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(a, 2.0) <= 5e+301) {
tmp = 2.0 * ((a + b) * ((b - a) * (Math.cos((angle * (Math.PI * -0.005555555555555556))) * Math.sin(((angle * Math.PI) * 0.005555555555555556)))));
} else {
tmp = 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if math.pow(a, 2.0) <= 5e+301: tmp = 2.0 * ((a + b) * ((b - a) * (math.cos((angle * (math.pi * -0.005555555555555556))) * math.sin(((angle * math.pi) * 0.005555555555555556))))) else: tmp = 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556))))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if ((a ^ 2.0) <= 5e+301) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(cos(Float64(angle * Float64(pi * -0.005555555555555556))) * sin(Float64(Float64(angle * pi) * 0.005555555555555556)))))); else tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((a ^ 2.0) <= 5e+301) tmp = 2.0 * ((a + b) * ((b - a) * (cos((angle * (pi * -0.005555555555555556))) * sin(((angle * pi) * 0.005555555555555556))))); else tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556))))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 5e+301], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 5 \cdot 10^{+301}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a 2) < 5.0000000000000004e301Initial program 64.3%
associate-*l*64.3%
associate-*l*64.3%
cos-neg64.3%
distribute-rgt-neg-out64.3%
distribute-frac-neg64.3%
neg-mul-164.3%
associate-/l*63.0%
associate-*r/62.1%
associate-/r/64.8%
associate-/l*64.8%
metadata-eval64.8%
Simplified64.8%
unpow264.8%
unpow264.8%
difference-of-squares64.8%
Applied egg-rr64.8%
pow164.8%
associate-*l*72.2%
+-commutative72.2%
*-commutative72.2%
*-commutative72.2%
div-inv72.2%
metadata-eval72.2%
div-inv72.9%
metadata-eval72.9%
Applied egg-rr72.9%
Taylor expanded in angle around 0 74.6%
*-commutative74.6%
Simplified74.6%
if 5.0000000000000004e301 < (pow.f64 a 2) Initial program 32.5%
associate-*l*32.5%
associate-*l*32.5%
cos-neg32.5%
distribute-rgt-neg-out32.5%
distribute-frac-neg32.5%
neg-mul-132.5%
associate-/l*32.5%
associate-*r/34.0%
associate-/r/34.0%
associate-/l*34.0%
metadata-eval34.0%
Simplified34.0%
unpow234.0%
unpow234.0%
difference-of-squares52.0%
Applied egg-rr52.0%
pow152.0%
associate-*l*70.1%
+-commutative70.1%
*-commutative70.1%
*-commutative70.1%
div-inv70.1%
metadata-eval70.1%
div-inv74.6%
metadata-eval74.6%
Applied egg-rr74.6%
Taylor expanded in angle around 0 80.5%
Final simplification76.2%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= (- (pow b 2.0) (pow a 2.0)) INFINITY)
(*
2.0
(*
(+ a b)
(*
(- b a)
(*
(cos (* angle (* PI -0.005555555555555556)))
(sin (* PI (* angle 0.005555555555555556)))))))
(*
-0.011111111111111112
(*
angle
(*
PI
(* (cos (* -0.005555555555555556 (* angle PI))) (* (+ a b) (- a b))))))))b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= ((double) INFINITY)) {
tmp = 2.0 * ((a + b) * ((b - a) * (cos((angle * (((double) M_PI) * -0.005555555555555556))) * sin((((double) M_PI) * (angle * 0.005555555555555556))))));
} else {
tmp = -0.011111111111111112 * (angle * (((double) M_PI) * (cos((-0.005555555555555556 * (angle * ((double) M_PI)))) * ((a + b) * (a - b)))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 * ((a + b) * ((b - a) * (Math.cos((angle * (Math.PI * -0.005555555555555556))) * Math.sin((Math.PI * (angle * 0.005555555555555556))))));
} else {
tmp = -0.011111111111111112 * (angle * (Math.PI * (Math.cos((-0.005555555555555556 * (angle * Math.PI))) * ((a + b) * (a - b)))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= math.inf: tmp = 2.0 * ((a + b) * ((b - a) * (math.cos((angle * (math.pi * -0.005555555555555556))) * math.sin((math.pi * (angle * 0.005555555555555556)))))) else: tmp = -0.011111111111111112 * (angle * (math.pi * (math.cos((-0.005555555555555556 * (angle * math.pi))) * ((a + b) * (a - b))))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= Inf) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * Float64(cos(Float64(angle * Float64(pi * -0.005555555555555556))) * sin(Float64(pi * Float64(angle * 0.005555555555555556))))))); else tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(cos(Float64(-0.005555555555555556 * Float64(angle * pi))) * Float64(Float64(a + b) * Float64(a - b)))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= Inf) tmp = 2.0 * ((a + b) * ((b - a) * (cos((angle * (pi * -0.005555555555555556))) * sin((pi * (angle * 0.005555555555555556)))))); else tmp = -0.011111111111111112 * (angle * (pi * (cos((-0.005555555555555556 * (angle * pi))) * ((a + b) * (a - b))))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Cos[N[(angle * N[(Pi * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(angle * N[(Pi * N[(N[Cos[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq \infty:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \left(\cos \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\cos \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b 2) (pow.f64 a 2)) < +inf.0Initial program 60.7%
associate-*l*60.7%
associate-*l*60.7%
cos-neg60.7%
distribute-rgt-neg-out60.7%
distribute-frac-neg60.7%
neg-mul-160.7%
associate-/l*59.7%
associate-*r/59.4%
associate-/r/61.6%
associate-/l*61.6%
metadata-eval61.6%
Simplified61.6%
unpow261.6%
unpow261.6%
difference-of-squares61.6%
Applied egg-rr61.6%
pow161.6%
associate-*l*72.2%
+-commutative72.2%
*-commutative72.2%
*-commutative72.2%
div-inv72.2%
metadata-eval72.2%
div-inv73.6%
metadata-eval73.6%
Applied egg-rr73.6%
if +inf.0 < (-.f64 (pow.f64 b 2) (pow.f64 a 2)) Initial program 0.0%
Simplified0.0%
unpow20.0%
unpow20.0%
difference-of-squares70.3%
Applied egg-rr70.3%
Taylor expanded in angle around 0 85.3%
associate-*r*85.3%
*-commutative85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in angle around inf 90.3%
Final simplification74.9%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cos (* angle (/ PI -180.0)))))
(if (<= (/ angle 180.0) -5e-33)
(*
(* 2.0 (fabs (sin (* -0.005555555555555556 (* angle PI)))))
(* (* (+ a b) (- a b)) t_0))
(if (<= (/ angle 180.0) 2e-82)
(*
2.0
(* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556))))))
(* 2.0 (* (* (+ a b) (- b a)) (* (sin (* PI (/ angle 180.0))) t_0)))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = cos((angle * (((double) M_PI) / -180.0)));
double tmp;
if ((angle / 180.0) <= -5e-33) {
tmp = (2.0 * fabs(sin((-0.005555555555555556 * (angle * ((double) M_PI)))))) * (((a + b) * (a - b)) * t_0);
} else if ((angle / 180.0) <= 2e-82) {
tmp = 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * (sin((((double) M_PI) * (angle / 180.0))) * t_0));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.cos((angle * (Math.PI / -180.0)));
double tmp;
if ((angle / 180.0) <= -5e-33) {
tmp = (2.0 * Math.abs(Math.sin((-0.005555555555555556 * (angle * Math.PI))))) * (((a + b) * (a - b)) * t_0);
} else if ((angle / 180.0) <= 2e-82) {
tmp = 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * (Math.sin((Math.PI * (angle / 180.0))) * t_0));
}
return tmp;
}
b = abs(b) def code(a, b, angle): t_0 = math.cos((angle * (math.pi / -180.0))) tmp = 0 if (angle / 180.0) <= -5e-33: tmp = (2.0 * math.fabs(math.sin((-0.005555555555555556 * (angle * math.pi))))) * (((a + b) * (a - b)) * t_0) elif (angle / 180.0) <= 2e-82: tmp = 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556))))) else: tmp = 2.0 * (((a + b) * (b - a)) * (math.sin((math.pi * (angle / 180.0))) * t_0)) return tmp
b = abs(b) function code(a, b, angle) t_0 = cos(Float64(angle * Float64(pi / -180.0))) tmp = 0.0 if (Float64(angle / 180.0) <= -5e-33) tmp = Float64(Float64(2.0 * abs(sin(Float64(-0.005555555555555556 * Float64(angle * pi))))) * Float64(Float64(Float64(a + b) * Float64(a - b)) * t_0)); elseif (Float64(angle / 180.0) <= 2e-82) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))); else tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(sin(Float64(pi * Float64(angle / 180.0))) * t_0))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) t_0 = cos((angle * (pi / -180.0))); tmp = 0.0; if ((angle / 180.0) <= -5e-33) tmp = (2.0 * abs(sin((-0.005555555555555556 * (angle * pi))))) * (((a + b) * (a - b)) * t_0); elseif ((angle / 180.0) <= 2e-82) tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556))))); else tmp = 2.0 * (((a + b) * (b - a)) * (sin((pi * (angle / 180.0))) * t_0)); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-33], N[(N[(2.0 * N[Abs[N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-82], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-33}:\\
\;\;\;\;\left(2 \cdot \left|\sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right|\right) \cdot \left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot t_0\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot t_0\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5.00000000000000028e-33Initial program 46.0%
Simplified48.2%
unpow248.2%
unpow248.2%
difference-of-squares52.4%
Applied egg-rr52.4%
Taylor expanded in angle around inf 52.7%
*-commutative52.7%
Simplified52.7%
associate-*l*52.4%
metadata-eval52.4%
div-inv52.4%
add-sqr-sqrt34.9%
sqrt-unprod54.3%
pow254.3%
div-inv54.3%
metadata-eval54.3%
Applied egg-rr54.3%
unpow254.3%
rem-sqrt-square54.3%
associate-*r*54.3%
*-commutative54.3%
Simplified54.3%
if -5.00000000000000028e-33 < (/.f64 angle 180) < 2e-82Initial program 69.3%
associate-*l*69.3%
associate-*l*69.3%
cos-neg69.3%
distribute-rgt-neg-out69.3%
distribute-frac-neg69.3%
neg-mul-169.3%
associate-/l*69.3%
associate-*r/69.3%
associate-/r/69.3%
associate-/l*69.3%
metadata-eval69.3%
Simplified69.3%
unpow269.3%
unpow269.3%
difference-of-squares76.5%
Applied egg-rr76.5%
pow176.5%
associate-*l*99.5%
+-commutative99.5%
*-commutative99.5%
*-commutative99.5%
div-inv99.5%
metadata-eval99.5%
div-inv99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in angle around 0 99.6%
if 2e-82 < (/.f64 angle 180) Initial program 44.8%
associate-*l*44.8%
associate-*l*44.8%
cos-neg44.8%
distribute-rgt-neg-out44.8%
distribute-frac-neg44.8%
neg-mul-144.8%
associate-/l*44.8%
associate-*r/49.3%
associate-/r/53.7%
associate-/l*53.7%
metadata-eval53.7%
Simplified53.7%
unpow253.7%
unpow253.7%
difference-of-squares56.5%
Applied egg-rr56.5%
Final simplification74.9%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cos (* angle (/ PI -180.0)))))
(if (<= (/ angle 180.0) -4e+232)
(*
(* (* (+ a b) (- a b)) t_0)
(* 2.0 (sin (* -0.005555555555555556 (* angle PI)))))
(if (<= (/ angle 180.0) 2e-82)
(*
2.0
(* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556))))))
(* 2.0 (* (* (+ a b) (- b a)) (* (sin (* PI (/ angle 180.0))) t_0)))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = cos((angle * (((double) M_PI) / -180.0)));
double tmp;
if ((angle / 180.0) <= -4e+232) {
tmp = (((a + b) * (a - b)) * t_0) * (2.0 * sin((-0.005555555555555556 * (angle * ((double) M_PI)))));
} else if ((angle / 180.0) <= 2e-82) {
tmp = 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * (sin((((double) M_PI) * (angle / 180.0))) * t_0));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = Math.cos((angle * (Math.PI / -180.0)));
double tmp;
if ((angle / 180.0) <= -4e+232) {
tmp = (((a + b) * (a - b)) * t_0) * (2.0 * Math.sin((-0.005555555555555556 * (angle * Math.PI))));
} else if ((angle / 180.0) <= 2e-82) {
tmp = 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * (Math.sin((Math.PI * (angle / 180.0))) * t_0));
}
return tmp;
}
b = abs(b) def code(a, b, angle): t_0 = math.cos((angle * (math.pi / -180.0))) tmp = 0 if (angle / 180.0) <= -4e+232: tmp = (((a + b) * (a - b)) * t_0) * (2.0 * math.sin((-0.005555555555555556 * (angle * math.pi)))) elif (angle / 180.0) <= 2e-82: tmp = 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556))))) else: tmp = 2.0 * (((a + b) * (b - a)) * (math.sin((math.pi * (angle / 180.0))) * t_0)) return tmp
b = abs(b) function code(a, b, angle) t_0 = cos(Float64(angle * Float64(pi / -180.0))) tmp = 0.0 if (Float64(angle / 180.0) <= -4e+232) tmp = Float64(Float64(Float64(Float64(a + b) * Float64(a - b)) * t_0) * Float64(2.0 * sin(Float64(-0.005555555555555556 * Float64(angle * pi))))); elseif (Float64(angle / 180.0) <= 2e-82) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))); else tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(sin(Float64(pi * Float64(angle / 180.0))) * t_0))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) t_0 = cos((angle * (pi / -180.0))); tmp = 0.0; if ((angle / 180.0) <= -4e+232) tmp = (((a + b) * (a - b)) * t_0) * (2.0 * sin((-0.005555555555555556 * (angle * pi)))); elseif ((angle / 180.0) <= 2e-82) tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556))))); else tmp = 2.0 * (((a + b) * (b - a)) * (sin((pi * (angle / 180.0))) * t_0)); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], -4e+232], N[(N[(N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * N[Sin[N[(-0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-82], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \cos \left(angle \cdot \frac{\pi}{-180}\right)\\
\mathbf{if}\;\frac{angle}{180} \leq -4 \cdot 10^{+232}:\\
\;\;\;\;\left(\left(\left(a + b\right) \cdot \left(a - b\right)\right) \cdot t_0\right) \cdot \left(2 \cdot \sin \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot t_0\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -4.00000000000000023e232Initial program 46.2%
Simplified46.0%
unpow246.0%
unpow246.0%
difference-of-squares50.8%
Applied egg-rr50.8%
Taylor expanded in angle around inf 56.6%
*-commutative56.6%
Simplified56.6%
if -4.00000000000000023e232 < (/.f64 angle 180) < 2e-82Initial program 62.1%
associate-*l*62.1%
associate-*l*62.1%
cos-neg62.1%
distribute-rgt-neg-out62.1%
distribute-frac-neg62.1%
neg-mul-162.1%
associate-/l*62.6%
associate-*r/60.1%
associate-/r/60.7%
associate-/l*60.7%
metadata-eval60.7%
Simplified60.7%
unpow260.7%
unpow260.7%
difference-of-squares66.2%
Applied egg-rr66.2%
pow166.2%
associate-*l*82.1%
+-commutative82.1%
*-commutative82.1%
*-commutative82.1%
div-inv82.1%
metadata-eval82.1%
div-inv84.6%
metadata-eval84.6%
Applied egg-rr84.6%
Taylor expanded in angle around 0 85.2%
if 2e-82 < (/.f64 angle 180) Initial program 44.8%
associate-*l*44.8%
associate-*l*44.8%
cos-neg44.8%
distribute-rgt-neg-out44.8%
distribute-frac-neg44.8%
neg-mul-144.8%
associate-/l*44.8%
associate-*r/49.3%
associate-/r/53.7%
associate-/l*53.7%
metadata-eval53.7%
Simplified53.7%
unpow253.7%
unpow253.7%
difference-of-squares56.5%
Applied egg-rr56.5%
Final simplification74.9%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 2e-82)
(* 2.0 (* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556))))))
(*
2.0
(*
(* (+ a b) (- b a))
(*
(sin (* PI (/ angle 180.0)))
(cos (* PI (* angle -0.005555555555555556))))))))b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2e-82) {
tmp = 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * (sin((((double) M_PI) * (angle / 180.0))) * cos((((double) M_PI) * (angle * -0.005555555555555556)))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2e-82) {
tmp = 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * (Math.sin((Math.PI * (angle / 180.0))) * Math.cos((Math.PI * (angle * -0.005555555555555556)))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 2e-82: tmp = 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556))))) else: tmp = 2.0 * (((a + b) * (b - a)) * (math.sin((math.pi * (angle / 180.0))) * math.cos((math.pi * (angle * -0.005555555555555556))))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 2e-82) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))); else tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(sin(Float64(pi * Float64(angle / 180.0))) * cos(Float64(pi * Float64(angle * -0.005555555555555556)))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 2e-82) tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556))))); else tmp = 2.0 * (((a + b) * (b - a)) * (sin((pi * (angle / 180.0))) * cos((pi * (angle * -0.005555555555555556))))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-82], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(Pi * N[(angle * -0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \left(angle \cdot -0.005555555555555556\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 2e-82Initial program 60.3%
associate-*l*60.3%
associate-*l*60.3%
cos-neg60.3%
distribute-rgt-neg-out60.3%
distribute-frac-neg60.3%
neg-mul-160.3%
associate-/l*58.9%
associate-*r/56.8%
associate-/r/58.0%
associate-/l*58.0%
metadata-eval58.0%
Simplified58.0%
unpow258.0%
unpow258.0%
difference-of-squares63.4%
Applied egg-rr63.4%
pow163.4%
associate-*l*77.5%
+-commutative77.5%
*-commutative77.5%
*-commutative77.5%
div-inv77.5%
metadata-eval77.5%
div-inv80.8%
metadata-eval80.8%
Applied egg-rr80.8%
Taylor expanded in angle around 0 79.7%
if 2e-82 < (/.f64 angle 180) Initial program 44.8%
associate-*l*44.8%
associate-*l*44.8%
cos-neg44.8%
distribute-rgt-neg-out44.8%
distribute-frac-neg44.8%
neg-mul-144.8%
associate-/l*44.8%
associate-*r/49.3%
associate-/r/53.7%
associate-/l*53.7%
metadata-eval53.7%
Simplified53.7%
unpow253.7%
unpow253.7%
difference-of-squares56.5%
Applied egg-rr56.5%
Taylor expanded in angle around inf 54.8%
associate-*r*55.3%
*-commutative55.3%
*-commutative55.3%
Simplified55.3%
Final simplification72.9%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 2e-82)
(* 2.0 (* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556))))))
(*
2.0
(*
(* (+ a b) (- b a))
(* (sin (* PI (/ angle 180.0))) (cos (* angle (/ PI -180.0))))))))b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2e-82) {
tmp = 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * (sin((((double) M_PI) * (angle / 180.0))) * cos((angle * (((double) M_PI) / -180.0)))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2e-82) {
tmp = 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
} else {
tmp = 2.0 * (((a + b) * (b - a)) * (Math.sin((Math.PI * (angle / 180.0))) * Math.cos((angle * (Math.PI / -180.0)))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if (angle / 180.0) <= 2e-82: tmp = 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556))))) else: tmp = 2.0 * (((a + b) * (b - a)) * (math.sin((math.pi * (angle / 180.0))) * math.cos((angle * (math.pi / -180.0))))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 2e-82) tmp = Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))); else tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * Float64(sin(Float64(pi * Float64(angle / 180.0))) * cos(Float64(angle * Float64(pi / -180.0)))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= 2e-82) tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556))))); else tmp = 2.0 * (((a + b) * (b - a)) * (sin((pi * (angle / 180.0))) * cos((angle * (pi / -180.0))))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-82], N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(angle * N[(Pi / -180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-82}:\\
\;\;\;\;2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(angle \cdot \frac{\pi}{-180}\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < 2e-82Initial program 60.3%
associate-*l*60.3%
associate-*l*60.3%
cos-neg60.3%
distribute-rgt-neg-out60.3%
distribute-frac-neg60.3%
neg-mul-160.3%
associate-/l*58.9%
associate-*r/56.8%
associate-/r/58.0%
associate-/l*58.0%
metadata-eval58.0%
Simplified58.0%
unpow258.0%
unpow258.0%
difference-of-squares63.4%
Applied egg-rr63.4%
pow163.4%
associate-*l*77.5%
+-commutative77.5%
*-commutative77.5%
*-commutative77.5%
div-inv77.5%
metadata-eval77.5%
div-inv80.8%
metadata-eval80.8%
Applied egg-rr80.8%
Taylor expanded in angle around 0 79.7%
if 2e-82 < (/.f64 angle 180) Initial program 44.8%
associate-*l*44.8%
associate-*l*44.8%
cos-neg44.8%
distribute-rgt-neg-out44.8%
distribute-frac-neg44.8%
neg-mul-144.8%
associate-/l*44.8%
associate-*r/49.3%
associate-/r/53.7%
associate-/l*53.7%
metadata-eval53.7%
Simplified53.7%
unpow253.7%
unpow253.7%
difference-of-squares56.5%
Applied egg-rr56.5%
Final simplification73.3%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) -5e-5)
(* 2.0 (* (* (+ a b) (- b a)) (sin (* PI (/ angle 180.0)))))
(if (<= (/ angle 180.0) 5e+110)
(* -0.011111111111111112 (* (* angle (- a b)) (* (+ a b) PI)))
(* 0.011111111111111112 (* angle (* PI (- (pow a 2.0) (pow b 2.0))))))))b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e-5) {
tmp = 2.0 * (((a + b) * (b - a)) * sin((((double) M_PI) * (angle / 180.0))));
} else if ((angle / 180.0) <= 5e+110) {
tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * ((double) M_PI)));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (pow(a, 2.0) - pow(b, 2.0))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e-5) {
tmp = 2.0 * (((a + b) * (b - a)) * Math.sin((Math.PI * (angle / 180.0))));
} else if ((angle / 180.0) <= 5e+110) {
tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * Math.PI));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (Math.pow(a, 2.0) - Math.pow(b, 2.0))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -5e-5: tmp = 2.0 * (((a + b) * (b - a)) * math.sin((math.pi * (angle / 180.0)))) elif (angle / 180.0) <= 5e+110: tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * math.pi)) else: tmp = 0.011111111111111112 * (angle * (math.pi * (math.pow(a, 2.0) - math.pow(b, 2.0)))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -5e-5) tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * sin(Float64(pi * Float64(angle / 180.0))))); elseif (Float64(angle / 180.0) <= 5e+110) tmp = Float64(-0.011111111111111112 * Float64(Float64(angle * Float64(a - b)) * Float64(Float64(a + b) * pi))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64((a ^ 2.0) - (b ^ 2.0))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= -5e-5) tmp = 2.0 * (((a + b) * (b - a)) * sin((pi * (angle / 180.0)))); elseif ((angle / 180.0) <= 5e+110) tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * pi)); else tmp = 0.011111111111111112 * (angle * (pi * ((a ^ 2.0) - (b ^ 2.0)))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-5], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+110], N[(-0.011111111111111112 * N[(N[(angle * N[(a - b), $MachinePrecision]), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[Power[a, 2.0], $MachinePrecision] - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-5}:\\
\;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+110}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(angle \cdot \left(a - b\right)\right) \cdot \left(\left(a + b\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left({a}^{2} - {b}^{2}\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5.00000000000000024e-5Initial program 40.2%
associate-*l*40.3%
associate-*l*40.3%
cos-neg40.3%
distribute-rgt-neg-out40.3%
distribute-frac-neg40.3%
neg-mul-140.3%
associate-/l*36.5%
associate-*r/30.5%
associate-/r/33.7%
associate-/l*33.7%
metadata-eval33.7%
Simplified33.7%
unpow233.7%
unpow233.7%
difference-of-squares36.8%
Applied egg-rr36.8%
Taylor expanded in angle around 0 46.5%
if -5.00000000000000024e-5 < (/.f64 angle 180) < 4.99999999999999978e110Initial program 67.3%
Simplified68.2%
unpow268.2%
unpow268.2%
difference-of-squares75.3%
Applied egg-rr75.3%
Taylor expanded in angle around 0 76.2%
expm1-log1p-u57.1%
expm1-udef33.7%
associate-*r*33.7%
Applied egg-rr33.7%
expm1-def57.1%
expm1-log1p76.2%
*-commutative76.2%
Simplified76.2%
pow176.2%
*-commutative76.2%
associate-*r*93.2%
Applied egg-rr93.2%
if 4.99999999999999978e110 < (/.f64 angle 180) Initial program 36.3%
Simplified40.0%
add-exp-log26.5%
associate-*l*26.5%
*-commutative26.5%
*-commutative26.5%
associate-*r*26.5%
Applied egg-rr18.1%
Taylor expanded in angle around 0 34.0%
Final simplification72.8%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) -5e-5)
(* 2.0 (* (* (+ a b) (- b a)) (sin (* PI (/ angle 180.0)))))
(if (<= (/ angle 180.0) 2e+112)
(* -0.011111111111111112 (* (* angle (- a b)) (* (+ a b) PI)))
(fabs (* -0.011111111111111112 (* (* angle PI) (* (+ a b) (- a b))))))))b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e-5) {
tmp = 2.0 * (((a + b) * (b - a)) * sin((((double) M_PI) * (angle / 180.0))));
} else if ((angle / 180.0) <= 2e+112) {
tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * ((double) M_PI)));
} else {
tmp = fabs((-0.011111111111111112 * ((angle * ((double) M_PI)) * ((a + b) * (a - b)))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= -5e-5) {
tmp = 2.0 * (((a + b) * (b - a)) * Math.sin((Math.PI * (angle / 180.0))));
} else if ((angle / 180.0) <= 2e+112) {
tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * Math.PI));
} else {
tmp = Math.abs((-0.011111111111111112 * ((angle * Math.PI) * ((a + b) * (a - b)))));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if (angle / 180.0) <= -5e-5: tmp = 2.0 * (((a + b) * (b - a)) * math.sin((math.pi * (angle / 180.0)))) elif (angle / 180.0) <= 2e+112: tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * math.pi)) else: tmp = math.fabs((-0.011111111111111112 * ((angle * math.pi) * ((a + b) * (a - b))))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= -5e-5) tmp = Float64(2.0 * Float64(Float64(Float64(a + b) * Float64(b - a)) * sin(Float64(pi * Float64(angle / 180.0))))); elseif (Float64(angle / 180.0) <= 2e+112) tmp = Float64(-0.011111111111111112 * Float64(Float64(angle * Float64(a - b)) * Float64(Float64(a + b) * pi))); else tmp = abs(Float64(-0.011111111111111112 * Float64(Float64(angle * pi) * Float64(Float64(a + b) * Float64(a - b))))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if ((angle / 180.0) <= -5e-5) tmp = 2.0 * (((a + b) * (b - a)) * sin((pi * (angle / 180.0)))); elseif ((angle / 180.0) <= 2e+112) tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * pi)); else tmp = abs((-0.011111111111111112 * ((angle * pi) * ((a + b) * (a - b))))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], -5e-5], N[(2.0 * N[(N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+112], N[(-0.011111111111111112 * N[(N[(angle * N[(a - b), $MachinePrecision]), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-0.011111111111111112 * N[(N[(angle * Pi), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq -5 \cdot 10^{-5}:\\
\;\;\;\;2 \cdot \left(\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 2 \cdot 10^{+112}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(angle \cdot \left(a - b\right)\right) \cdot \left(\left(a + b\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|-0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right|\\
\end{array}
\end{array}
if (/.f64 angle 180) < -5.00000000000000024e-5Initial program 40.2%
associate-*l*40.3%
associate-*l*40.3%
cos-neg40.3%
distribute-rgt-neg-out40.3%
distribute-frac-neg40.3%
neg-mul-140.3%
associate-/l*36.5%
associate-*r/30.5%
associate-/r/33.7%
associate-/l*33.7%
metadata-eval33.7%
Simplified33.7%
unpow233.7%
unpow233.7%
difference-of-squares36.8%
Applied egg-rr36.8%
Taylor expanded in angle around 0 46.5%
if -5.00000000000000024e-5 < (/.f64 angle 180) < 1.9999999999999999e112Initial program 66.9%
Simplified67.7%
unpow267.7%
unpow267.7%
difference-of-squares74.9%
Applied egg-rr74.9%
Taylor expanded in angle around 0 75.8%
expm1-log1p-u56.7%
expm1-udef33.5%
associate-*r*33.5%
Applied egg-rr33.5%
expm1-def56.7%
expm1-log1p75.7%
*-commutative75.7%
Simplified75.7%
pow175.7%
*-commutative75.7%
associate-*r*92.6%
Applied egg-rr92.6%
if 1.9999999999999999e112 < (/.f64 angle 180) Initial program 37.3%
Simplified41.2%
unpow241.2%
unpow241.2%
difference-of-squares41.2%
Applied egg-rr41.2%
Taylor expanded in angle around 0 21.1%
add-sqr-sqrt14.7%
sqrt-unprod32.4%
pow232.4%
*-commutative32.4%
associate-*r*32.4%
Applied egg-rr32.4%
unpow232.4%
rem-sqrt-square32.4%
*-commutative32.4%
associate-*r*32.4%
associate-*r*32.4%
Simplified32.4%
Final simplification72.4%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (+ a b) (- a b))) (t_1 (* (* angle PI) t_0)))
(if (<= angle -3.9e+19)
(* -0.011111111111111112 (fabs t_1))
(if (<= angle 2.7e+116)
(* -0.011111111111111112 (* angle (* PI t_0)))
(fabs (* -0.011111111111111112 t_1))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double t_1 = (angle * ((double) M_PI)) * t_0;
double tmp;
if (angle <= -3.9e+19) {
tmp = -0.011111111111111112 * fabs(t_1);
} else if (angle <= 2.7e+116) {
tmp = -0.011111111111111112 * (angle * (((double) M_PI) * t_0));
} else {
tmp = fabs((-0.011111111111111112 * t_1));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double t_1 = (angle * Math.PI) * t_0;
double tmp;
if (angle <= -3.9e+19) {
tmp = -0.011111111111111112 * Math.abs(t_1);
} else if (angle <= 2.7e+116) {
tmp = -0.011111111111111112 * (angle * (Math.PI * t_0));
} else {
tmp = Math.abs((-0.011111111111111112 * t_1));
}
return tmp;
}
b = abs(b) def code(a, b, angle): t_0 = (a + b) * (a - b) t_1 = (angle * math.pi) * t_0 tmp = 0 if angle <= -3.9e+19: tmp = -0.011111111111111112 * math.fabs(t_1) elif angle <= 2.7e+116: tmp = -0.011111111111111112 * (angle * (math.pi * t_0)) else: tmp = math.fabs((-0.011111111111111112 * t_1)) return tmp
b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(a + b) * Float64(a - b)) t_1 = Float64(Float64(angle * pi) * t_0) tmp = 0.0 if (angle <= -3.9e+19) tmp = Float64(-0.011111111111111112 * abs(t_1)); elseif (angle <= 2.7e+116) tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(pi * t_0))); else tmp = abs(Float64(-0.011111111111111112 * t_1)); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) t_0 = (a + b) * (a - b); t_1 = (angle * pi) * t_0; tmp = 0.0; if (angle <= -3.9e+19) tmp = -0.011111111111111112 * abs(t_1); elseif (angle <= 2.7e+116) tmp = -0.011111111111111112 * (angle * (pi * t_0)); else tmp = abs((-0.011111111111111112 * t_1)); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle * Pi), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[angle, -3.9e+19], N[(-0.011111111111111112 * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 2.7e+116], N[(-0.011111111111111112 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-0.011111111111111112 * t$95$1), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
t_1 := \left(angle \cdot \pi\right) \cdot t_0\\
\mathbf{if}\;angle \leq -3.9 \cdot 10^{+19}:\\
\;\;\;\;-0.011111111111111112 \cdot \left|t_1\right|\\
\mathbf{elif}\;angle \leq 2.7 \cdot 10^{+116}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|-0.011111111111111112 \cdot t_1\right|\\
\end{array}
\end{array}
if angle < -3.9e19Initial program 36.4%
Simplified38.9%
unpow238.9%
unpow238.9%
difference-of-squares43.9%
Applied egg-rr43.9%
Taylor expanded in angle around 0 32.8%
add-sqr-sqrt25.4%
sqrt-unprod41.4%
pow241.4%
associate-*r*41.4%
Applied egg-rr41.4%
unpow241.4%
rem-sqrt-square40.7%
associate-*r*40.7%
associate-*r*40.7%
Simplified40.7%
if -3.9e19 < angle < 2.7e116Initial program 67.7%
Simplified68.5%
unpow268.5%
unpow268.5%
difference-of-squares75.5%
Applied egg-rr75.5%
Taylor expanded in angle around 0 75.0%
if 2.7e116 < angle Initial program 37.3%
Simplified41.2%
unpow241.2%
unpow241.2%
difference-of-squares41.2%
Applied egg-rr41.2%
Taylor expanded in angle around 0 21.1%
add-sqr-sqrt14.7%
sqrt-unprod32.4%
pow232.4%
*-commutative32.4%
associate-*r*32.4%
Applied egg-rr32.4%
unpow232.4%
rem-sqrt-square32.4%
*-commutative32.4%
associate-*r*32.4%
associate-*r*32.4%
Simplified32.4%
Final simplification60.8%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (* angle PI) (* (+ a b) (- a b)))))
(if (<= angle -3.9e+19)
(* -0.011111111111111112 (fabs t_0))
(if (<= angle 2.7e+116)
(* -0.011111111111111112 (* (* angle (- a b)) (* (+ a b) PI)))
(fabs (* -0.011111111111111112 t_0))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (angle * ((double) M_PI)) * ((a + b) * (a - b));
double tmp;
if (angle <= -3.9e+19) {
tmp = -0.011111111111111112 * fabs(t_0);
} else if (angle <= 2.7e+116) {
tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * ((double) M_PI)));
} else {
tmp = fabs((-0.011111111111111112 * t_0));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = (angle * Math.PI) * ((a + b) * (a - b));
double tmp;
if (angle <= -3.9e+19) {
tmp = -0.011111111111111112 * Math.abs(t_0);
} else if (angle <= 2.7e+116) {
tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * Math.PI));
} else {
tmp = Math.abs((-0.011111111111111112 * t_0));
}
return tmp;
}
b = abs(b) def code(a, b, angle): t_0 = (angle * math.pi) * ((a + b) * (a - b)) tmp = 0 if angle <= -3.9e+19: tmp = -0.011111111111111112 * math.fabs(t_0) elif angle <= 2.7e+116: tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * math.pi)) else: tmp = math.fabs((-0.011111111111111112 * t_0)) return tmp
b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(angle * pi) * Float64(Float64(a + b) * Float64(a - b))) tmp = 0.0 if (angle <= -3.9e+19) tmp = Float64(-0.011111111111111112 * abs(t_0)); elseif (angle <= 2.7e+116) tmp = Float64(-0.011111111111111112 * Float64(Float64(angle * Float64(a - b)) * Float64(Float64(a + b) * pi))); else tmp = abs(Float64(-0.011111111111111112 * t_0)); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) t_0 = (angle * pi) * ((a + b) * (a - b)); tmp = 0.0; if (angle <= -3.9e+19) tmp = -0.011111111111111112 * abs(t_0); elseif (angle <= 2.7e+116) tmp = -0.011111111111111112 * ((angle * (a - b)) * ((a + b) * pi)); else tmp = abs((-0.011111111111111112 * t_0)); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle * Pi), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, -3.9e+19], N[(-0.011111111111111112 * N[Abs[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[angle, 2.7e+116], N[(-0.011111111111111112 * N[(N[(angle * N[(a - b), $MachinePrecision]), $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-0.011111111111111112 * t$95$0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(angle \cdot \pi\right) \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\\
\mathbf{if}\;angle \leq -3.9 \cdot 10^{+19}:\\
\;\;\;\;-0.011111111111111112 \cdot \left|t_0\right|\\
\mathbf{elif}\;angle \leq 2.7 \cdot 10^{+116}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(angle \cdot \left(a - b\right)\right) \cdot \left(\left(a + b\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|-0.011111111111111112 \cdot t_0\right|\\
\end{array}
\end{array}
if angle < -3.9e19Initial program 36.4%
Simplified38.9%
unpow238.9%
unpow238.9%
difference-of-squares43.9%
Applied egg-rr43.9%
Taylor expanded in angle around 0 32.8%
add-sqr-sqrt25.4%
sqrt-unprod41.4%
pow241.4%
associate-*r*41.4%
Applied egg-rr41.4%
unpow241.4%
rem-sqrt-square40.7%
associate-*r*40.7%
associate-*r*40.7%
Simplified40.7%
if -3.9e19 < angle < 2.7e116Initial program 67.7%
Simplified68.5%
unpow268.5%
unpow268.5%
difference-of-squares75.5%
Applied egg-rr75.5%
Taylor expanded in angle around 0 75.0%
expm1-log1p-u56.4%
expm1-udef33.5%
associate-*r*33.5%
Applied egg-rr33.5%
expm1-def56.4%
expm1-log1p75.0%
*-commutative75.0%
Simplified75.0%
pow175.0%
*-commutative75.0%
associate-*r*91.4%
Applied egg-rr91.4%
if 2.7e116 < angle Initial program 37.3%
Simplified41.2%
unpow241.2%
unpow241.2%
difference-of-squares41.2%
Applied egg-rr41.2%
Taylor expanded in angle around 0 21.1%
add-sqr-sqrt14.7%
sqrt-unprod32.4%
pow232.4%
*-commutative32.4%
associate-*r*32.4%
Applied egg-rr32.4%
unpow232.4%
rem-sqrt-square32.4%
*-commutative32.4%
associate-*r*32.4%
associate-*r*32.4%
Simplified32.4%
Final simplification71.0%
NOTE: b should be positive before calling this function
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (+ a b) (- a b))))
(if (<= angle 2.7e+116)
(* -0.011111111111111112 (* angle (* PI t_0)))
(fabs (* -0.011111111111111112 (* (* angle PI) t_0))))))b = abs(b);
double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double tmp;
if (angle <= 2.7e+116) {
tmp = -0.011111111111111112 * (angle * (((double) M_PI) * t_0));
} else {
tmp = fabs((-0.011111111111111112 * ((angle * ((double) M_PI)) * t_0)));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double t_0 = (a + b) * (a - b);
double tmp;
if (angle <= 2.7e+116) {
tmp = -0.011111111111111112 * (angle * (Math.PI * t_0));
} else {
tmp = Math.abs((-0.011111111111111112 * ((angle * Math.PI) * t_0)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): t_0 = (a + b) * (a - b) tmp = 0 if angle <= 2.7e+116: tmp = -0.011111111111111112 * (angle * (math.pi * t_0)) else: tmp = math.fabs((-0.011111111111111112 * ((angle * math.pi) * t_0))) return tmp
b = abs(b) function code(a, b, angle) t_0 = Float64(Float64(a + b) * Float64(a - b)) tmp = 0.0 if (angle <= 2.7e+116) tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(pi * t_0))); else tmp = abs(Float64(-0.011111111111111112 * Float64(Float64(angle * pi) * t_0))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) t_0 = (a + b) * (a - b); tmp = 0.0; if (angle <= 2.7e+116) tmp = -0.011111111111111112 * (angle * (pi * t_0)); else tmp = abs((-0.011111111111111112 * ((angle * pi) * t_0))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[angle, 2.7e+116], N[(-0.011111111111111112 * N[(angle * N[(Pi * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-0.011111111111111112 * N[(N[(angle * Pi), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
t_0 := \left(a + b\right) \cdot \left(a - b\right)\\
\mathbf{if}\;angle \leq 2.7 \cdot 10^{+116}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left|-0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot t_0\right)\right|\\
\end{array}
\end{array}
if angle < 2.7e116Initial program 59.0%
Simplified60.3%
unpow260.3%
unpow260.3%
difference-of-squares66.7%
Applied egg-rr66.7%
Taylor expanded in angle around 0 63.3%
if 2.7e116 < angle Initial program 37.3%
Simplified41.2%
unpow241.2%
unpow241.2%
difference-of-squares41.2%
Applied egg-rr41.2%
Taylor expanded in angle around 0 21.1%
add-sqr-sqrt14.7%
sqrt-unprod32.4%
pow232.4%
*-commutative32.4%
associate-*r*32.4%
Applied egg-rr32.4%
unpow232.4%
rem-sqrt-square32.4%
*-commutative32.4%
associate-*r*32.4%
associate-*r*32.4%
Simplified32.4%
Final simplification59.0%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* 2.0 (* (+ a b) (* (- b a) (sin (* PI (* angle 0.005555555555555556)))))))
b = abs(b);
double code(double a, double b, double angle) {
return 2.0 * ((a + b) * ((b - a) * sin((((double) M_PI) * (angle * 0.005555555555555556)))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return 2.0 * ((a + b) * ((b - a) * Math.sin((Math.PI * (angle * 0.005555555555555556)))));
}
b = abs(b) def code(a, b, angle): return 2.0 * ((a + b) * ((b - a) * math.sin((math.pi * (angle * 0.005555555555555556)))))
b = abs(b) function code(a, b, angle) return Float64(2.0 * Float64(Float64(a + b) * Float64(Float64(b - a) * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))) end
b = abs(b) function tmp = code(a, b, angle) tmp = 2.0 * ((a + b) * ((b - a) * sin((pi * (angle * 0.005555555555555556))))); end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(2.0 * N[(N[(a + b), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
2 \cdot \left(\left(a + b\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)
\end{array}
Initial program 56.0%
associate-*l*56.0%
associate-*l*56.0%
cos-neg56.0%
distribute-rgt-neg-out56.0%
distribute-frac-neg56.0%
neg-mul-156.0%
associate-/l*55.0%
associate-*r/54.8%
associate-/r/56.8%
associate-/l*56.8%
metadata-eval56.8%
Simplified56.8%
unpow256.8%
unpow256.8%
difference-of-squares61.5%
Applied egg-rr61.5%
pow161.5%
associate-*l*71.6%
+-commutative71.6%
*-commutative71.6%
*-commutative71.6%
div-inv71.6%
metadata-eval71.6%
div-inv73.3%
metadata-eval73.3%
Applied egg-rr73.3%
Taylor expanded in angle around 0 69.8%
Final simplification69.8%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (if (<= a 12.8) (* -0.011111111111111112 (* angle (* (- a b) (* b PI)))) (* -0.011111111111111112 (* angle (* (- a b) (* a PI))))))
b = abs(b);
double code(double a, double b, double angle) {
double tmp;
if (a <= 12.8) {
tmp = -0.011111111111111112 * (angle * ((a - b) * (b * ((double) M_PI))));
} else {
tmp = -0.011111111111111112 * (angle * ((a - b) * (a * ((double) M_PI))));
}
return tmp;
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 12.8) {
tmp = -0.011111111111111112 * (angle * ((a - b) * (b * Math.PI)));
} else {
tmp = -0.011111111111111112 * (angle * ((a - b) * (a * Math.PI)));
}
return tmp;
}
b = abs(b) def code(a, b, angle): tmp = 0 if a <= 12.8: tmp = -0.011111111111111112 * (angle * ((a - b) * (b * math.pi))) else: tmp = -0.011111111111111112 * (angle * ((a - b) * (a * math.pi))) return tmp
b = abs(b) function code(a, b, angle) tmp = 0.0 if (a <= 12.8) tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(Float64(a - b) * Float64(b * pi)))); else tmp = Float64(-0.011111111111111112 * Float64(angle * Float64(Float64(a - b) * Float64(a * pi)))); end return tmp end
b = abs(b) function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 12.8) tmp = -0.011111111111111112 * (angle * ((a - b) * (b * pi))); else tmp = -0.011111111111111112 * (angle * ((a - b) * (a * pi))); end tmp_2 = tmp; end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := If[LessEqual[a, 12.8], N[(-0.011111111111111112 * N[(angle * N[(N[(a - b), $MachinePrecision] * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(angle * N[(N[(a - b), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b = |b|\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 12.8:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(b \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(a \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 12.800000000000001Initial program 57.0%
Simplified59.3%
unpow259.3%
unpow259.3%
difference-of-squares62.5%
Applied egg-rr62.5%
Taylor expanded in angle around 0 58.4%
expm1-log1p-u45.5%
expm1-udef30.4%
associate-*r*30.4%
Applied egg-rr30.4%
expm1-def45.5%
expm1-log1p58.4%
*-commutative58.4%
Simplified58.4%
Taylor expanded in a around 0 45.5%
*-commutative45.5%
Simplified45.5%
if 12.800000000000001 < a Initial program 53.2%
Simplified53.2%
unpow253.2%
unpow253.2%
difference-of-squares64.8%
Applied egg-rr64.8%
Taylor expanded in angle around 0 54.5%
expm1-log1p-u35.8%
expm1-udef24.4%
associate-*r*24.4%
Applied egg-rr24.4%
expm1-def35.8%
expm1-log1p54.5%
*-commutative54.5%
Simplified54.5%
Taylor expanded in a around inf 49.0%
*-commutative49.0%
Simplified49.0%
Final simplification46.5%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* angle (* PI (* (+ a b) (- a b))))))
b = abs(b);
double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (((double) M_PI) * ((a + b) * (a - b))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * (Math.PI * ((a + b) * (a - b))));
}
b = abs(b) def code(a, b, angle): return -0.011111111111111112 * (angle * (math.pi * ((a + b) * (a - b))))
b = abs(b) function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(a + b) * Float64(a - b))))) end
b = abs(b) function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (angle * (pi * ((a + b) * (a - b)))); end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(angle * N[(Pi * N[(N[(a + b), $MachinePrecision] * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
-0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(a + b\right) \cdot \left(a - b\right)\right)\right)\right)
\end{array}
Initial program 56.0%
Simplified57.6%
unpow257.6%
unpow257.6%
difference-of-squares63.1%
Applied egg-rr63.1%
Taylor expanded in angle around 0 57.4%
Final simplification57.4%
NOTE: b should be positive before calling this function (FPCore (a b angle) :precision binary64 (* -0.011111111111111112 (* angle (* (- a b) (* a PI)))))
b = abs(b);
double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * ((a - b) * (a * ((double) M_PI))));
}
b = Math.abs(b);
public static double code(double a, double b, double angle) {
return -0.011111111111111112 * (angle * ((a - b) * (a * Math.PI)));
}
b = abs(b) def code(a, b, angle): return -0.011111111111111112 * (angle * ((a - b) * (a * math.pi)))
b = abs(b) function code(a, b, angle) return Float64(-0.011111111111111112 * Float64(angle * Float64(Float64(a - b) * Float64(a * pi)))) end
b = abs(b) function tmp = code(a, b, angle) tmp = -0.011111111111111112 * (angle * ((a - b) * (a * pi))); end
NOTE: b should be positive before calling this function code[a_, b_, angle_] := N[(-0.011111111111111112 * N[(angle * N[(N[(a - b), $MachinePrecision] * N[(a * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b = |b|\\
\\
-0.011111111111111112 \cdot \left(angle \cdot \left(\left(a - b\right) \cdot \left(a \cdot \pi\right)\right)\right)
\end{array}
Initial program 56.0%
Simplified57.6%
unpow257.6%
unpow257.6%
difference-of-squares63.1%
Applied egg-rr63.1%
Taylor expanded in angle around 0 57.4%
expm1-log1p-u42.9%
expm1-udef28.8%
associate-*r*28.8%
Applied egg-rr28.8%
expm1-def42.9%
expm1-log1p57.4%
*-commutative57.4%
Simplified57.4%
Taylor expanded in a around inf 38.1%
*-commutative38.1%
Simplified38.1%
Final simplification38.1%
herbie shell --seed 2023310
(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)))))