
(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 19 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}
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1
(* (* (* 2.0 (- (pow b_m 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
(*
angle_s
(if (<= t_1 4e+263)
(*
(+ b_m a)
(*
(- b_m a)
(sin (* (sqrt PI) (* (* angle_m 0.011111111111111112) (sqrt PI))))))
(if (<= t_1 INFINITY)
(*
(+ b_m a)
(*
(- b_m a)
(*
angle_m
(fma
-2.2862368541380886e-7
(* (* angle_m angle_m) (* PI (* PI PI)))
(* PI 0.011111111111111112)))))
(*
(+ b_m a)
(* 0.011111111111111112 (* angle_m (* PI (- b_m a))))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = ((2.0 * (pow(b_m, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
double tmp;
if (t_1 <= 4e+263) {
tmp = (b_m + a) * ((b_m - a) * sin((sqrt(((double) M_PI)) * ((angle_m * 0.011111111111111112) * sqrt(((double) M_PI))))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (b_m + a) * ((b_m - a) * (angle_m * fma(-2.2862368541380886e-7, ((angle_m * angle_m) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.011111111111111112))));
} else {
tmp = (b_m + a) * (0.011111111111111112 * (angle_m * (((double) M_PI) * (b_m - a))));
}
return angle_s * tmp;
}
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = Float64(Float64(Float64(2.0 * Float64((b_m ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) tmp = 0.0 if (t_1 <= 4e+263) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(sqrt(pi) * Float64(Float64(angle_m * 0.011111111111111112) * sqrt(pi)))))); elseif (t_1 <= Inf) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(angle_m * fma(-2.2862368541380886e-7, Float64(Float64(angle_m * angle_m) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.011111111111111112))))); else tmp = Float64(Float64(b_m + a) * Float64(0.011111111111111112 * Float64(angle_m * Float64(pi * Float64(b_m - a))))); end return Float64(angle_s * tmp) end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(2.0 * N[(N[Power[b$95$m, 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]}, N[(angle$95$s * If[LessEqual[t$95$1, 4e+263], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(angle$95$m * 0.011111111111111112), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(angle$95$m * N[(-2.2862368541380886e-7 * N[(N[(angle$95$m * angle$95$m), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m + a), $MachinePrecision] * N[(0.011111111111111112 * N[(angle$95$m * N[(Pi * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \left(\left(2 \cdot \left({b\_m}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{+263}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(\sqrt{\pi} \cdot \left(\left(angle\_m \cdot 0.011111111111111112\right) \cdot \sqrt{\pi}\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(angle\_m \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle\_m \cdot angle\_m\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(0.011111111111111112 \cdot \left(angle\_m \cdot \left(\pi \cdot \left(b\_m - a\right)\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 4.00000000000000006e263Initial program 60.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites64.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6465.3
Applied rewrites65.3%
if 4.00000000000000006e263 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < +inf.0Initial program 44.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites77.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f6490.2
Applied rewrites90.2%
if +inf.0 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 0.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites90.5%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
unpow1N/A
sqr-powN/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6454.3
Applied rewrites54.3%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-PI.f6499.7
Applied rewrites99.7%
Final simplification72.8%
b_m = (fabs.f64 b)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a b_m angle_m)
:precision binary64
(let* ((t_0 (* PI (/ angle_m 180.0)))
(t_1
(* (* (* 2.0 (- (pow b_m 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
(*
angle_s
(if (<= t_1 -1e-304)
(* a (* -0.011111111111111112 (* a (* PI angle_m))))
(if (<= t_1 1e+121)
(* 0.011111111111111112 (* PI (* angle_m (* b_m b_m))))
(* (+ b_m a) (* b_m (* 0.011111111111111112 (* PI angle_m)))))))))b_m = fabs(b);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = ((double) M_PI) * (angle_m / 180.0);
double t_1 = ((2.0 * (pow(b_m, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
double tmp;
if (t_1 <= -1e-304) {
tmp = a * (-0.011111111111111112 * (a * (((double) M_PI) * angle_m)));
} else if (t_1 <= 1e+121) {
tmp = 0.011111111111111112 * (((double) M_PI) * (angle_m * (b_m * b_m)));
} else {
tmp = (b_m + a) * (b_m * (0.011111111111111112 * (((double) M_PI) * angle_m)));
}
return angle_s * tmp;
}
b_m = Math.abs(b);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a, double b_m, double angle_m) {
double t_0 = Math.PI * (angle_m / 180.0);
double t_1 = ((2.0 * (Math.pow(b_m, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
double tmp;
if (t_1 <= -1e-304) {
tmp = a * (-0.011111111111111112 * (a * (Math.PI * angle_m)));
} else if (t_1 <= 1e+121) {
tmp = 0.011111111111111112 * (Math.PI * (angle_m * (b_m * b_m)));
} else {
tmp = (b_m + a) * (b_m * (0.011111111111111112 * (Math.PI * angle_m)));
}
return angle_s * tmp;
}
b_m = math.fabs(b) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a, b_m, angle_m): t_0 = math.pi * (angle_m / 180.0) t_1 = ((2.0 * (math.pow(b_m, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0) tmp = 0 if t_1 <= -1e-304: tmp = a * (-0.011111111111111112 * (a * (math.pi * angle_m))) elif t_1 <= 1e+121: tmp = 0.011111111111111112 * (math.pi * (angle_m * (b_m * b_m))) else: tmp = (b_m + a) * (b_m * (0.011111111111111112 * (math.pi * angle_m))) return angle_s * tmp
b_m = abs(b) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a, b_m, angle_m) t_0 = Float64(pi * Float64(angle_m / 180.0)) t_1 = Float64(Float64(Float64(2.0 * Float64((b_m ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) tmp = 0.0 if (t_1 <= -1e-304) tmp = Float64(a * Float64(-0.011111111111111112 * Float64(a * Float64(pi * angle_m)))); elseif (t_1 <= 1e+121) tmp = Float64(0.011111111111111112 * Float64(pi * Float64(angle_m * Float64(b_m * b_m)))); else tmp = Float64(Float64(b_m + a) * Float64(b_m * Float64(0.011111111111111112 * Float64(pi * angle_m)))); end return Float64(angle_s * tmp) end
b_m = abs(b); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a, b_m, angle_m) t_0 = pi * (angle_m / 180.0); t_1 = ((2.0 * ((b_m ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); tmp = 0.0; if (t_1 <= -1e-304) tmp = a * (-0.011111111111111112 * (a * (pi * angle_m))); elseif (t_1 <= 1e+121) tmp = 0.011111111111111112 * (pi * (angle_m * (b_m * b_m))); else tmp = (b_m + a) * (b_m * (0.011111111111111112 * (pi * angle_m))); end tmp_2 = angle_s * tmp; end
b_m = N[Abs[b], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a_, b$95$m_, angle$95$m_] := Block[{t$95$0 = N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(2.0 * N[(N[Power[b$95$m, 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]}, N[(angle$95$s * If[LessEqual[t$95$1, -1e-304], N[(a * N[(-0.011111111111111112 * N[(a * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+121], N[(0.011111111111111112 * N[(Pi * N[(angle$95$m * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m * N[(0.011111111111111112 * N[(Pi * angle$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle\_m}{180}\\
t_1 := \left(\left(2 \cdot \left({b\_m}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-304}:\\
\;\;\;\;a \cdot \left(-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+121}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle\_m \cdot \left(b\_m \cdot b\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(b\_m \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot angle\_m\right)\right)\right)\\
\end{array}
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < -9.99999999999999971e-305Initial program 52.7%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6448.2
Applied rewrites48.2%
Taylor expanded in b around 0
Applied rewrites45.0%
Applied rewrites54.7%
Applied rewrites54.9%
if -9.99999999999999971e-305 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 1.00000000000000004e121Initial program 74.4%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6470.9
Applied rewrites70.9%
Taylor expanded in b around 0
Applied rewrites41.3%
Applied rewrites35.8%
Taylor expanded in b around inf
Applied rewrites70.9%
if 1.00000000000000004e121 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 38.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites66.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6456.7
Applied rewrites56.7%
Taylor expanded in angle around 0
Applied rewrites57.5%
Final simplification59.9%
herbie shell --seed 2024219
(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)))))