
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (* (+ b a) (- 1.0 (/ a b)))))
(if (<= (pow b 2.0) 4e-269)
(* (+ b a) (* a (- (sin (* angle (* PI 0.011111111111111112))))))
(if (<= (pow b 2.0) 2e+282)
(*
2.0
(*
b
(*
t_1
(*
(sin t_0)
(cos (* 0.005555555555555556 (* angle (cbrt (pow PI 3.0)))))))))
(* 2.0 (* b (* t_0 t_1)))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = (b + a) * (1.0 - (a / b));
double tmp;
if (pow(b, 2.0) <= 4e-269) {
tmp = (b + a) * (a * -sin((angle * (((double) M_PI) * 0.011111111111111112))));
} else if (pow(b, 2.0) <= 2e+282) {
tmp = 2.0 * (b * (t_1 * (sin(t_0) * cos((0.005555555555555556 * (angle * cbrt(pow(((double) M_PI), 3.0))))))));
} else {
tmp = 2.0 * (b * (t_0 * t_1));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = (b + a) * (1.0 - (a / b));
double tmp;
if (Math.pow(b, 2.0) <= 4e-269) {
tmp = (b + a) * (a * -Math.sin((angle * (Math.PI * 0.011111111111111112))));
} else if (Math.pow(b, 2.0) <= 2e+282) {
tmp = 2.0 * (b * (t_1 * (Math.sin(t_0) * Math.cos((0.005555555555555556 * (angle * Math.cbrt(Math.pow(Math.PI, 3.0))))))));
} else {
tmp = 2.0 * (b * (t_0 * t_1));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = Float64(Float64(b + a) * Float64(1.0 - Float64(a / b))) tmp = 0.0 if ((b ^ 2.0) <= 4e-269) tmp = Float64(Float64(b + a) * Float64(a * Float64(-sin(Float64(angle * Float64(pi * 0.011111111111111112)))))); elseif ((b ^ 2.0) <= 2e+282) tmp = Float64(2.0 * Float64(b * Float64(t_1 * Float64(sin(t_0) * cos(Float64(0.005555555555555556 * Float64(angle * cbrt((pi ^ 3.0))))))))); else tmp = Float64(2.0 * Float64(b * Float64(t_0 * t_1))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b + a), $MachinePrecision] * N[(1.0 - N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 4e-269], N[(N[(b + a), $MachinePrecision] * N[(a * (-N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e+282], N[(2.0 * N[(b * N[(t$95$1 * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[N[(0.005555555555555556 * N[(angle * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \left(b + a\right) \cdot \left(1 - \frac{a}{b}\right)\\
\mathbf{if}\;{b}^{2} \leq 4 \cdot 10^{-269}:\\
\;\;\;\;\left(b + a\right) \cdot \left(a \cdot \left(-\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{elif}\;{b}^{2} \leq 2 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(t\_1 \cdot \left(\sin t\_0 \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \sqrt[3]{{\pi}^{3}}\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(t\_0 \cdot t\_1\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 3.9999999999999998e-269Initial program 65.8%
associate-*l*65.8%
*-commutative65.8%
associate-*l*65.8%
Simplified65.8%
unpow265.8%
unpow265.8%
difference-of-squares65.8%
Applied egg-rr65.8%
Taylor expanded in b around 0 65.8%
neg-mul-165.8%
Simplified65.8%
pow165.8%
2-sin65.8%
div-inv66.0%
metadata-eval66.0%
*-commutative66.0%
*-commutative66.0%
associate-*r*65.0%
Applied egg-rr65.0%
unpow165.0%
associate-*l*69.9%
+-commutative69.9%
associate-*r*69.9%
metadata-eval69.9%
*-commutative69.9%
associate-*l*71.2%
Simplified71.2%
if 3.9999999999999998e-269 < (pow.f64 b #s(literal 2 binary64)) < 2.00000000000000007e282Initial program 58.8%
associate-*l*58.8%
*-commutative58.8%
associate-*l*58.8%
Simplified58.8%
unpow258.8%
unpow258.8%
difference-of-squares58.8%
Applied egg-rr58.8%
Taylor expanded in b around inf 58.8%
mul-1-neg58.8%
unsub-neg58.8%
Simplified58.8%
Taylor expanded in angle around inf 59.1%
associate-*r*59.1%
+-commutative59.1%
Simplified59.1%
add-cbrt-cube61.5%
pow361.5%
Applied egg-rr61.5%
if 2.00000000000000007e282 < (pow.f64 b #s(literal 2 binary64)) Initial program 38.1%
associate-*l*38.1%
*-commutative38.1%
associate-*l*38.1%
Simplified38.1%
unpow238.1%
unpow238.1%
difference-of-squares53.0%
Applied egg-rr53.0%
Taylor expanded in b around inf 53.0%
mul-1-neg53.0%
unsub-neg53.0%
Simplified53.0%
Taylor expanded in angle around inf 73.5%
associate-*r*73.5%
+-commutative73.5%
Simplified73.5%
Taylor expanded in angle around 0 85.3%
Final simplification70.7%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 0.005555555555555556 (* angle PI)))
(t_1 (sin t_0))
(t_2 (cos t_0))
(t_3 (* t_2 t_1)))
(if (<= (pow b 2.0) 2e+282)
(+
(* 2.0 (* (pow b 2.0) t_3))
(* a (+ (* -2.0 (* t_3 a)) (* 2.0 (* t_2 (* t_1 (- b b)))))))
(* 2.0 (* b (* t_0 (* (+ b a) (- 1.0 (/ a b)))))))))
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
double t_1 = sin(t_0);
double t_2 = cos(t_0);
double t_3 = t_2 * t_1;
double tmp;
if (pow(b, 2.0) <= 2e+282) {
tmp = (2.0 * (pow(b, 2.0) * t_3)) + (a * ((-2.0 * (t_3 * a)) + (2.0 * (t_2 * (t_1 * (b - b))))));
} else {
tmp = 2.0 * (b * (t_0 * ((b + a) * (1.0 - (a / b)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
double t_1 = Math.sin(t_0);
double t_2 = Math.cos(t_0);
double t_3 = t_2 * t_1;
double tmp;
if (Math.pow(b, 2.0) <= 2e+282) {
tmp = (2.0 * (Math.pow(b, 2.0) * t_3)) + (a * ((-2.0 * (t_3 * a)) + (2.0 * (t_2 * (t_1 * (b - b))))));
} else {
tmp = 2.0 * (b * (t_0 * ((b + a) * (1.0 - (a / b)))));
}
return tmp;
}
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) t_1 = math.sin(t_0) t_2 = math.cos(t_0) t_3 = t_2 * t_1 tmp = 0 if math.pow(b, 2.0) <= 2e+282: tmp = (2.0 * (math.pow(b, 2.0) * t_3)) + (a * ((-2.0 * (t_3 * a)) + (2.0 * (t_2 * (t_1 * (b - b)))))) else: tmp = 2.0 * (b * (t_0 * ((b + a) * (1.0 - (a / b))))) return tmp
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) t_1 = sin(t_0) t_2 = cos(t_0) t_3 = Float64(t_2 * t_1) tmp = 0.0 if ((b ^ 2.0) <= 2e+282) tmp = Float64(Float64(2.0 * Float64((b ^ 2.0) * t_3)) + Float64(a * Float64(Float64(-2.0 * Float64(t_3 * a)) + Float64(2.0 * Float64(t_2 * Float64(t_1 * Float64(b - b))))))); else tmp = Float64(2.0 * Float64(b * Float64(t_0 * Float64(Float64(b + a) * Float64(1.0 - Float64(a / b)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); t_1 = sin(t_0); t_2 = cos(t_0); t_3 = t_2 * t_1; tmp = 0.0; if ((b ^ 2.0) <= 2e+282) tmp = (2.0 * ((b ^ 2.0) * t_3)) + (a * ((-2.0 * (t_3 * a)) + (2.0 * (t_2 * (t_1 * (b - b)))))); else tmp = 2.0 * (b * (t_0 * ((b + a) * (1.0 - (a / b))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$0], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * t$95$1), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e+282], N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(-2.0 * N[(t$95$3 * a), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(t$95$2 * N[(t$95$1 * N[(b - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(t$95$0 * N[(N[(b + a), $MachinePrecision] * N[(1.0 - N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := t\_2 \cdot t\_1\\
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+282}:\\
\;\;\;\;2 \cdot \left({b}^{2} \cdot t\_3\right) + a \cdot \left(-2 \cdot \left(t\_3 \cdot a\right) + 2 \cdot \left(t\_2 \cdot \left(t\_1 \cdot \left(b - b\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(t\_0 \cdot \left(\left(b + a\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 2.00000000000000007e282Initial program 61.7%
associate-*l*61.6%
*-commutative61.6%
associate-*l*61.6%
Simplified61.6%
unpow261.6%
unpow261.6%
difference-of-squares61.6%
Applied egg-rr61.6%
Taylor expanded in a around 0 64.5%
if 2.00000000000000007e282 < (pow.f64 b #s(literal 2 binary64)) Initial program 38.1%
associate-*l*38.1%
*-commutative38.1%
associate-*l*38.1%
Simplified38.1%
unpow238.1%
unpow238.1%
difference-of-squares53.0%
Applied egg-rr53.0%
Taylor expanded in b around inf 53.0%
mul-1-neg53.0%
unsub-neg53.0%
Simplified53.0%
Taylor expanded in angle around inf 73.5%
associate-*r*73.5%
+-commutative73.5%
Simplified73.5%
Taylor expanded in angle around 0 85.3%
Final simplification70.0%
(FPCore (a b angle)
:precision binary64
(if (<= (- (pow b 2.0) (pow a 2.0)) 2e-295)
(* (+ b a) (* a (- (sin (* angle (* PI 0.011111111111111112))))))
(*
2.0
(*
b
(* 0.005555555555555556 (* angle (* PI (* (+ b a) (- 1.0 (/ a b))))))))))
double code(double a, double b, double angle) {
double tmp;
if ((pow(b, 2.0) - pow(a, 2.0)) <= 2e-295) {
tmp = (b + a) * (a * -sin((angle * (((double) M_PI) * 0.011111111111111112))));
} else {
tmp = 2.0 * (b * (0.005555555555555556 * (angle * (((double) M_PI) * ((b + a) * (1.0 - (a / b)))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) <= 2e-295) {
tmp = (b + a) * (a * -Math.sin((angle * (Math.PI * 0.011111111111111112))));
} else {
tmp = 2.0 * (b * (0.005555555555555556 * (angle * (Math.PI * ((b + a) * (1.0 - (a / b)))))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (math.pow(b, 2.0) - math.pow(a, 2.0)) <= 2e-295: tmp = (b + a) * (a * -math.sin((angle * (math.pi * 0.011111111111111112)))) else: tmp = 2.0 * (b * (0.005555555555555556 * (angle * (math.pi * ((b + a) * (1.0 - (a / b))))))) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a ^ 2.0)) <= 2e-295) tmp = Float64(Float64(b + a) * Float64(a * Float64(-sin(Float64(angle * Float64(pi * 0.011111111111111112)))))); else tmp = Float64(2.0 * Float64(b * Float64(0.005555555555555556 * Float64(angle * Float64(pi * Float64(Float64(b + a) * Float64(1.0 - Float64(a / b)))))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (((b ^ 2.0) - (a ^ 2.0)) <= 2e-295) tmp = (b + a) * (a * -sin((angle * (pi * 0.011111111111111112)))); else tmp = 2.0 * (b * (0.005555555555555556 * (angle * (pi * ((b + a) * (1.0 - (a / b))))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], 2e-295], N[(N[(b + a), $MachinePrecision] * N[(a * (-N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(0.005555555555555556 * N[(angle * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(1.0 - N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{-295}:\\
\;\;\;\;\left(b + a\right) \cdot \left(a \cdot \left(-\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000012e-295Initial program 61.0%
associate-*l*61.0%
*-commutative61.0%
associate-*l*61.0%
Simplified61.0%
unpow261.0%
unpow261.0%
difference-of-squares61.0%
Applied egg-rr61.0%
Taylor expanded in b around 0 60.7%
neg-mul-160.7%
Simplified60.7%
pow160.7%
2-sin60.7%
div-inv59.4%
metadata-eval59.4%
*-commutative59.4%
*-commutative59.4%
associate-*r*59.4%
Applied egg-rr59.4%
unpow159.4%
associate-*l*64.4%
+-commutative64.4%
associate-*r*64.4%
metadata-eval64.4%
*-commutative64.4%
associate-*l*65.1%
Simplified65.1%
if 2.00000000000000012e-295 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 49.4%
associate-*l*49.4%
*-commutative49.4%
associate-*l*49.4%
Simplified49.4%
unpow249.4%
unpow249.4%
difference-of-squares57.6%
Applied egg-rr57.6%
Taylor expanded in b around inf 57.6%
mul-1-neg57.6%
unsub-neg57.6%
Simplified57.6%
Taylor expanded in angle around inf 69.3%
associate-*r*69.3%
+-commutative69.3%
Simplified69.3%
Taylor expanded in angle around 0 73.4%
Final simplification69.1%
(FPCore (a b angle)
:precision binary64
(if (<= (pow b 2.0) 2.47e-269)
(* -0.011111111111111112 (* (* angle PI) (pow a 2.0)))
(*
2.0
(*
b
(* (* 0.005555555555555556 (* angle PI)) (* (+ b a) (- 1.0 (/ a b))))))))
double code(double a, double b, double angle) {
double tmp;
if (pow(b, 2.0) <= 2.47e-269) {
tmp = -0.011111111111111112 * ((angle * ((double) M_PI)) * pow(a, 2.0));
} else {
tmp = 2.0 * (b * ((0.005555555555555556 * (angle * ((double) M_PI))) * ((b + a) * (1.0 - (a / b)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (Math.pow(b, 2.0) <= 2.47e-269) {
tmp = -0.011111111111111112 * ((angle * Math.PI) * Math.pow(a, 2.0));
} else {
tmp = 2.0 * (b * ((0.005555555555555556 * (angle * Math.PI)) * ((b + a) * (1.0 - (a / b)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if math.pow(b, 2.0) <= 2.47e-269: tmp = -0.011111111111111112 * ((angle * math.pi) * math.pow(a, 2.0)) else: tmp = 2.0 * (b * ((0.005555555555555556 * (angle * math.pi)) * ((b + a) * (1.0 - (a / b))))) return tmp
function code(a, b, angle) tmp = 0.0 if ((b ^ 2.0) <= 2.47e-269) tmp = Float64(-0.011111111111111112 * Float64(Float64(angle * pi) * (a ^ 2.0))); else tmp = Float64(2.0 * Float64(b * Float64(Float64(0.005555555555555556 * Float64(angle * pi)) * Float64(Float64(b + a) * Float64(1.0 - Float64(a / b)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((b ^ 2.0) <= 2.47e-269) tmp = -0.011111111111111112 * ((angle * pi) * (a ^ 2.0)); else tmp = 2.0 * (b * ((0.005555555555555556 * (angle * pi)) * ((b + a) * (1.0 - (a / b))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2.47e-269], N[(-0.011111111111111112 * N[(N[(angle * Pi), $MachinePrecision] * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(1.0 - N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 2.47 \cdot 10^{-269}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot {a}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 2.4699999999999999e-269Initial program 66.6%
associate-*l*66.6%
associate-*l*66.6%
Simplified66.6%
Taylor expanded in angle around 0 61.9%
Taylor expanded in b around 0 62.4%
if 2.4699999999999999e-269 < (pow.f64 b #s(literal 2 binary64)) Initial program 50.7%
associate-*l*50.7%
*-commutative50.7%
associate-*l*50.7%
Simplified50.7%
unpow250.7%
unpow250.7%
difference-of-squares56.3%
Applied egg-rr56.3%
Taylor expanded in b around inf 56.3%
mul-1-neg56.3%
unsub-neg56.3%
Simplified56.3%
Taylor expanded in angle around inf 64.2%
associate-*r*64.2%
+-commutative64.2%
Simplified64.2%
Taylor expanded in angle around 0 63.8%
Final simplification63.4%
(FPCore (a b angle)
:precision binary64
(if (<= b 4.97e-135)
(* 0.011111111111111112 (* angle (* a (* PI (- b a)))))
(*
2.0
(*
b
(* (* 0.005555555555555556 (* angle PI)) (* (+ b a) (- 1.0 (/ a b))))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 4.97e-135) {
tmp = 0.011111111111111112 * (angle * (a * (((double) M_PI) * (b - a))));
} else {
tmp = 2.0 * (b * ((0.005555555555555556 * (angle * ((double) M_PI))) * ((b + a) * (1.0 - (a / b)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 4.97e-135) {
tmp = 0.011111111111111112 * (angle * (a * (Math.PI * (b - a))));
} else {
tmp = 2.0 * (b * ((0.005555555555555556 * (angle * Math.PI)) * ((b + a) * (1.0 - (a / b)))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 4.97e-135: tmp = 0.011111111111111112 * (angle * (a * (math.pi * (b - a)))) else: tmp = 2.0 * (b * ((0.005555555555555556 * (angle * math.pi)) * ((b + a) * (1.0 - (a / b))))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 4.97e-135) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(a * Float64(pi * Float64(b - a))))); else tmp = Float64(2.0 * Float64(b * Float64(Float64(0.005555555555555556 * Float64(angle * pi)) * Float64(Float64(b + a) * Float64(1.0 - Float64(a / b)))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 4.97e-135) tmp = 0.011111111111111112 * (angle * (a * (pi * (b - a)))); else tmp = 2.0 * (b * ((0.005555555555555556 * (angle * pi)) * ((b + a) * (1.0 - (a / b))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 4.97e-135], N[(0.011111111111111112 * N[(angle * N[(a * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(1.0 - N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.97 \cdot 10^{-135}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(\left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left(b + a\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 4.97000000000000028e-135Initial program 58.1%
associate-*l*58.1%
associate-*l*58.1%
Simplified58.1%
Taylor expanded in angle around 0 54.2%
unpow258.1%
unpow258.1%
difference-of-squares61.6%
Applied egg-rr58.3%
Taylor expanded in b around 0 44.9%
Taylor expanded in a around 0 44.9%
+-commutative44.9%
associate-*r*44.9%
neg-mul-144.9%
distribute-rgt-in44.9%
sub-neg44.9%
Simplified44.9%
if 4.97000000000000028e-135 < b Initial program 51.8%
associate-*l*51.8%
*-commutative51.8%
associate-*l*51.8%
Simplified51.8%
unpow251.7%
unpow251.7%
difference-of-squares56.3%
Applied egg-rr56.3%
Taylor expanded in b around inf 56.3%
mul-1-neg56.3%
unsub-neg56.3%
Simplified56.3%
Taylor expanded in angle around inf 67.2%
associate-*r*67.2%
+-commutative67.2%
Simplified67.2%
Taylor expanded in angle around 0 65.5%
(FPCore (a b angle)
:precision binary64
(if (<= b 3.6e-134)
(* 0.011111111111111112 (* angle (* a (* PI (- b a)))))
(*
2.0
(*
b
(* 0.005555555555555556 (* angle (* PI (* (+ b a) (- 1.0 (/ a b))))))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 3.6e-134) {
tmp = 0.011111111111111112 * (angle * (a * (((double) M_PI) * (b - a))));
} else {
tmp = 2.0 * (b * (0.005555555555555556 * (angle * (((double) M_PI) * ((b + a) * (1.0 - (a / b)))))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3.6e-134) {
tmp = 0.011111111111111112 * (angle * (a * (Math.PI * (b - a))));
} else {
tmp = 2.0 * (b * (0.005555555555555556 * (angle * (Math.PI * ((b + a) * (1.0 - (a / b)))))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 3.6e-134: tmp = 0.011111111111111112 * (angle * (a * (math.pi * (b - a)))) else: tmp = 2.0 * (b * (0.005555555555555556 * (angle * (math.pi * ((b + a) * (1.0 - (a / b))))))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 3.6e-134) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(a * Float64(pi * Float64(b - a))))); else tmp = Float64(2.0 * Float64(b * Float64(0.005555555555555556 * Float64(angle * Float64(pi * Float64(Float64(b + a) * Float64(1.0 - Float64(a / b)))))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3.6e-134) tmp = 0.011111111111111112 * (angle * (a * (pi * (b - a)))); else tmp = 2.0 * (b * (0.005555555555555556 * (angle * (pi * ((b + a) * (1.0 - (a / b))))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 3.6e-134], N[(0.011111111111111112 * N[(angle * N[(a * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(b * N[(0.005555555555555556 * N[(angle * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(1.0 - N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.6 \cdot 10^{-134}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(1 - \frac{a}{b}\right)\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 3.5999999999999999e-134Initial program 57.7%
associate-*l*57.7%
associate-*l*57.7%
Simplified57.7%
Taylor expanded in angle around 0 53.9%
unpow257.7%
unpow257.7%
difference-of-squares61.2%
Applied egg-rr58.0%
Taylor expanded in b around 0 44.6%
Taylor expanded in a around 0 44.6%
+-commutative44.6%
associate-*r*44.6%
neg-mul-144.6%
distribute-rgt-in44.6%
sub-neg44.6%
Simplified44.6%
if 3.5999999999999999e-134 < b Initial program 52.2%
associate-*l*52.2%
*-commutative52.2%
associate-*l*52.2%
Simplified52.2%
unpow252.2%
unpow252.2%
difference-of-squares56.8%
Applied egg-rr56.8%
Taylor expanded in b around inf 56.8%
mul-1-neg56.8%
unsub-neg56.8%
Simplified56.8%
Taylor expanded in angle around inf 67.8%
associate-*r*67.8%
+-commutative67.8%
Simplified67.8%
Taylor expanded in angle around 0 66.0%
Final simplification53.7%
(FPCore (a b angle)
:precision binary64
(if (<= b 4.8e-63)
(* (* (+ b a) (- b a)) (* (* angle PI) 0.011111111111111112))
(*
0.011111111111111112
(* (* b angle) (* (- 1.0 (/ a b)) (* PI (+ b a)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 4.8e-63) {
tmp = ((b + a) * (b - a)) * ((angle * ((double) M_PI)) * 0.011111111111111112);
} else {
tmp = 0.011111111111111112 * ((b * angle) * ((1.0 - (a / b)) * (((double) M_PI) * (b + a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 4.8e-63) {
tmp = ((b + a) * (b - a)) * ((angle * Math.PI) * 0.011111111111111112);
} else {
tmp = 0.011111111111111112 * ((b * angle) * ((1.0 - (a / b)) * (Math.PI * (b + a))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 4.8e-63: tmp = ((b + a) * (b - a)) * ((angle * math.pi) * 0.011111111111111112) else: tmp = 0.011111111111111112 * ((b * angle) * ((1.0 - (a / b)) * (math.pi * (b + a)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 4.8e-63) tmp = Float64(Float64(Float64(b + a) * Float64(b - a)) * Float64(Float64(angle * pi) * 0.011111111111111112)); else tmp = Float64(0.011111111111111112 * Float64(Float64(b * angle) * Float64(Float64(1.0 - Float64(a / b)) * Float64(pi * Float64(b + a))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 4.8e-63) tmp = ((b + a) * (b - a)) * ((angle * pi) * 0.011111111111111112); else tmp = 0.011111111111111112 * ((b * angle) * ((1.0 - (a / b)) * (pi * (b + a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 4.8e-63], N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(b * angle), $MachinePrecision] * N[(N[(1.0 - N[(a / b), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.8 \cdot 10^{-63}:\\
\;\;\;\;\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(b \cdot angle\right) \cdot \left(\left(1 - \frac{a}{b}\right) \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 4.8000000000000001e-63Initial program 55.6%
associate-*l*55.6%
*-commutative55.6%
associate-*l*55.6%
Simplified55.6%
unpow255.6%
unpow255.6%
difference-of-squares58.6%
Applied egg-rr58.6%
Taylor expanded in angle around 0 55.5%
if 4.8000000000000001e-63 < b Initial program 55.0%
associate-*l*55.0%
*-commutative55.0%
associate-*l*55.0%
Simplified55.0%
unpow255.0%
unpow255.0%
difference-of-squares60.7%
Applied egg-rr60.7%
Taylor expanded in b around inf 60.7%
mul-1-neg60.7%
unsub-neg60.7%
Simplified60.7%
Taylor expanded in angle around 0 58.8%
associate-*r*72.8%
associate-*r*72.8%
+-commutative72.8%
Simplified72.8%
Final simplification61.5%
(FPCore (a b angle) :precision binary64 (if (<= b 3.8e+15) (* 0.011111111111111112 (* angle (* PI (* a (- (- b) a))))) (* 0.011111111111111112 (* angle (* PI (* b (- b a)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 3.8e+15) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (a * (-b - a))));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * (b - a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3.8e+15) {
tmp = 0.011111111111111112 * (angle * (Math.PI * (a * (-b - a))));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * (b - a))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 3.8e+15: tmp = 0.011111111111111112 * (angle * (math.pi * (a * (-b - a)))) else: tmp = 0.011111111111111112 * (angle * (math.pi * (b * (b - a)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 3.8e+15) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(a * Float64(Float64(-b) - a))))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * Float64(b - a))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3.8e+15) tmp = 0.011111111111111112 * (angle * (pi * (a * (-b - a)))); else tmp = 0.011111111111111112 * (angle * (pi * (b * (b - a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 3.8e+15], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(a * N[((-b) - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.8 \cdot 10^{+15}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot \left(\left(-b\right) - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 3.8e15Initial program 56.8%
associate-*l*56.8%
associate-*l*56.8%
Simplified56.8%
Taylor expanded in angle around 0 52.9%
unpow256.8%
unpow256.8%
difference-of-squares59.6%
Applied egg-rr56.2%
Taylor expanded in b around 0 43.0%
neg-mul-144.4%
Simplified43.0%
if 3.8e15 < b Initial program 51.9%
associate-*l*51.9%
associate-*l*51.9%
Simplified51.9%
Taylor expanded in angle around 0 48.0%
unpow251.8%
unpow251.8%
difference-of-squares58.8%
Applied egg-rr57.7%
Taylor expanded in b around inf 51.6%
Final simplification45.4%
(FPCore (a b angle) :precision binary64 (if (<= b 7.4e+19) (* 0.011111111111111112 (* angle (* a (* PI (- b a))))) (* 0.011111111111111112 (* angle (* PI (* b (- b a)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 7.4e+19) {
tmp = 0.011111111111111112 * (angle * (a * (((double) M_PI) * (b - a))));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * (b - a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 7.4e+19) {
tmp = 0.011111111111111112 * (angle * (a * (Math.PI * (b - a))));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * (b - a))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 7.4e+19: tmp = 0.011111111111111112 * (angle * (a * (math.pi * (b - a)))) else: tmp = 0.011111111111111112 * (angle * (math.pi * (b * (b - a)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 7.4e+19) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(a * Float64(pi * Float64(b - a))))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * Float64(b - a))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 7.4e+19) tmp = 0.011111111111111112 * (angle * (a * (pi * (b - a)))); else tmp = 0.011111111111111112 * (angle * (pi * (b * (b - a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 7.4e+19], N[(0.011111111111111112 * N[(angle * N[(a * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.4 \cdot 10^{+19}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot \left(b - a\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 7.4e19Initial program 57.0%
associate-*l*57.0%
associate-*l*57.0%
Simplified57.0%
Taylor expanded in angle around 0 53.1%
unpow257.0%
unpow257.0%
difference-of-squares59.8%
Applied egg-rr56.4%
Taylor expanded in b around 0 43.1%
Taylor expanded in a around 0 43.1%
+-commutative43.1%
associate-*r*43.1%
neg-mul-143.1%
distribute-rgt-in43.1%
sub-neg43.1%
Simplified43.1%
if 7.4e19 < b Initial program 51.2%
associate-*l*51.2%
associate-*l*51.2%
Simplified51.2%
Taylor expanded in angle around 0 47.3%
unpow251.2%
unpow251.2%
difference-of-squares58.2%
Applied egg-rr57.1%
Taylor expanded in b around inf 51.0%
(FPCore (a b angle) :precision binary64 (if (<= angle 1.3e-189) (* -0.011111111111111112 (* a (* angle (* PI (+ b a))))) (* 0.011111111111111112 (* angle (* a (* PI (- b a)))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 1.3e-189) {
tmp = -0.011111111111111112 * (a * (angle * (((double) M_PI) * (b + a))));
} else {
tmp = 0.011111111111111112 * (angle * (a * (((double) M_PI) * (b - a))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 1.3e-189) {
tmp = -0.011111111111111112 * (a * (angle * (Math.PI * (b + a))));
} else {
tmp = 0.011111111111111112 * (angle * (a * (Math.PI * (b - a))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 1.3e-189: tmp = -0.011111111111111112 * (a * (angle * (math.pi * (b + a)))) else: tmp = 0.011111111111111112 * (angle * (a * (math.pi * (b - a)))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 1.3e-189) tmp = Float64(-0.011111111111111112 * Float64(a * Float64(angle * Float64(pi * Float64(b + a))))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(a * Float64(pi * Float64(b - a))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 1.3e-189) tmp = -0.011111111111111112 * (a * (angle * (pi * (b + a)))); else tmp = 0.011111111111111112 * (angle * (a * (pi * (b - a)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 1.3e-189], N[(-0.011111111111111112 * N[(a * N[(angle * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(a * N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 1.3 \cdot 10^{-189}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(\pi \cdot \left(b - a\right)\right)\right)\right)\\
\end{array}
\end{array}
if angle < 1.2999999999999999e-189Initial program 58.4%
associate-*l*58.4%
*-commutative58.4%
associate-*l*58.4%
Simplified58.4%
unpow258.4%
unpow258.4%
difference-of-squares61.0%
Applied egg-rr61.0%
Taylor expanded in b around 0 41.3%
neg-mul-141.3%
Simplified41.3%
Taylor expanded in angle around 0 45.4%
if 1.2999999999999999e-189 < angle Initial program 50.8%
associate-*l*50.8%
associate-*l*50.8%
Simplified50.8%
Taylor expanded in angle around 0 43.4%
unpow250.8%
unpow250.8%
difference-of-squares56.8%
Applied egg-rr50.3%
Taylor expanded in b around 0 32.0%
Taylor expanded in a around 0 32.0%
+-commutative32.0%
associate-*r*32.0%
neg-mul-132.0%
distribute-rgt-in32.0%
sub-neg32.0%
Simplified32.0%
Final simplification40.1%
(FPCore (a b angle) :precision binary64 (if (<= angle 5.6e+149) (* -0.011111111111111112 (* a (* angle (* PI (+ b a))))) (* 0.011111111111111112 (* angle (* a (* b PI))))))
double code(double a, double b, double angle) {
double tmp;
if (angle <= 5.6e+149) {
tmp = -0.011111111111111112 * (a * (angle * (((double) M_PI) * (b + a))));
} else {
tmp = 0.011111111111111112 * (angle * (a * (b * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 5.6e+149) {
tmp = -0.011111111111111112 * (a * (angle * (Math.PI * (b + a))));
} else {
tmp = 0.011111111111111112 * (angle * (a * (b * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if angle <= 5.6e+149: tmp = -0.011111111111111112 * (a * (angle * (math.pi * (b + a)))) else: tmp = 0.011111111111111112 * (angle * (a * (b * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (angle <= 5.6e+149) tmp = Float64(-0.011111111111111112 * Float64(a * Float64(angle * Float64(pi * Float64(b + a))))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(a * Float64(b * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (angle <= 5.6e+149) tmp = -0.011111111111111112 * (a * (angle * (pi * (b + a)))); else tmp = 0.011111111111111112 * (angle * (a * (b * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[angle, 5.6e+149], N[(-0.011111111111111112 * N[(a * N[(angle * N[(Pi * N[(b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(a * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;angle \leq 5.6 \cdot 10^{+149}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(\pi \cdot \left(b + a\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if angle < 5.5999999999999998e149Initial program 59.3%
associate-*l*59.2%
*-commutative59.2%
associate-*l*59.2%
Simplified59.2%
unpow259.2%
unpow259.2%
difference-of-squares62.9%
Applied egg-rr62.9%
Taylor expanded in b around 0 40.9%
neg-mul-140.9%
Simplified40.9%
Taylor expanded in angle around 0 41.5%
if 5.5999999999999998e149 < angle Initial program 30.3%
associate-*l*30.3%
associate-*l*30.3%
Simplified30.3%
Taylor expanded in angle around 0 22.0%
unpow230.3%
unpow230.3%
difference-of-squares36.2%
Applied egg-rr25.0%
Taylor expanded in b around 0 22.5%
Taylor expanded in a around 0 22.5%
*-commutative22.5%
Simplified22.5%
Final simplification38.9%
(FPCore (a b angle) :precision binary64 (* (* (+ b a) (- b a)) (* (* angle PI) 0.011111111111111112)))
double code(double a, double b, double angle) {
return ((b + a) * (b - a)) * ((angle * ((double) M_PI)) * 0.011111111111111112);
}
public static double code(double a, double b, double angle) {
return ((b + a) * (b - a)) * ((angle * Math.PI) * 0.011111111111111112);
}
def code(a, b, angle): return ((b + a) * (b - a)) * ((angle * math.pi) * 0.011111111111111112)
function code(a, b, angle) return Float64(Float64(Float64(b + a) * Float64(b - a)) * Float64(Float64(angle * pi) * 0.011111111111111112)) end
function tmp = code(a, b, angle) tmp = ((b + a) * (b - a)) * ((angle * pi) * 0.011111111111111112); end
code[a_, b_, angle_] := N[(N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)
\end{array}
Initial program 55.4%
associate-*l*55.4%
*-commutative55.4%
associate-*l*55.4%
Simplified55.4%
unpow255.4%
unpow255.4%
difference-of-squares59.3%
Applied egg-rr59.3%
Taylor expanded in angle around 0 56.6%
Final simplification56.6%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* (* angle PI) (* (+ b a) (- b a)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * ((angle * ((double) M_PI)) * ((b + a) * (b - a)));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * ((angle * Math.PI) * ((b + a) * (b - a)));
}
def code(a, b, angle): return 0.011111111111111112 * ((angle * math.pi) * ((b + a) * (b - a)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(Float64(angle * pi) * Float64(Float64(b + a) * Float64(b - a)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * ((angle * pi) * ((b + a) * (b - a))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(N[(angle * Pi), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)
\end{array}
Initial program 55.4%
associate-*l*55.4%
associate-*l*55.4%
Simplified55.4%
Taylor expanded in angle around 0 51.5%
unpow255.4%
unpow255.4%
difference-of-squares59.3%
Applied egg-rr56.6%
Taylor expanded in angle around 0 56.6%
associate-*r*56.6%
+-commutative56.6%
Simplified56.6%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* (+ b a) (- b a))))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * ((b + a) * (b - a))));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * ((b + a) * (b - a))));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * (math.pi * ((b + a) * (b - a))))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(Float64(b + a) * Float64(b - a))))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (pi * ((b + a) * (b - a)))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right)\right)
\end{array}
Initial program 55.4%
associate-*l*55.4%
associate-*l*55.4%
Simplified55.4%
Taylor expanded in angle around 0 51.5%
unpow255.4%
unpow255.4%
difference-of-squares59.3%
Applied egg-rr56.6%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* angle (* a (* b PI)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (a * (b * ((double) M_PI))));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (angle * (a * (b * Math.PI)));
}
def code(a, b, angle): return 0.011111111111111112 * (angle * (a * (b * math.pi)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(a * Float64(b * pi)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (angle * (a * (b * pi))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(a * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(angle \cdot \left(a \cdot \left(b \cdot \pi\right)\right)\right)
\end{array}
Initial program 55.4%
associate-*l*55.4%
associate-*l*55.4%
Simplified55.4%
Taylor expanded in angle around 0 51.5%
unpow255.4%
unpow255.4%
difference-of-squares59.3%
Applied egg-rr56.6%
Taylor expanded in b around 0 37.6%
Taylor expanded in a around 0 22.8%
*-commutative22.8%
Simplified22.8%
Final simplification22.8%
(FPCore (a b angle) :precision binary64 (* 0.011111111111111112 (* a (* angle (* b PI)))))
double code(double a, double b, double angle) {
return 0.011111111111111112 * (a * (angle * (b * ((double) M_PI))));
}
public static double code(double a, double b, double angle) {
return 0.011111111111111112 * (a * (angle * (b * Math.PI)));
}
def code(a, b, angle): return 0.011111111111111112 * (a * (angle * (b * math.pi)))
function code(a, b, angle) return Float64(0.011111111111111112 * Float64(a * Float64(angle * Float64(b * pi)))) end
function tmp = code(a, b, angle) tmp = 0.011111111111111112 * (a * (angle * (b * pi))); end
code[a_, b_, angle_] := N[(0.011111111111111112 * N[(a * N[(angle * N[(b * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(b \cdot \pi\right)\right)\right)
\end{array}
Initial program 55.4%
associate-*l*55.4%
associate-*l*55.4%
Simplified55.4%
Taylor expanded in angle around 0 51.5%
unpow255.4%
unpow255.4%
difference-of-squares59.3%
Applied egg-rr56.6%
Taylor expanded in b around 0 37.6%
Taylor expanded in a around 0 20.4%
*-commutative20.4%
Simplified20.4%
Final simplification20.4%
herbie shell --seed 2024145
(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)))))