(FPCore (a b angle) :precision binary64 (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* 0.005555555555555556 (* angle PI)))) (* -2.0 (* (cos t_0) (* (+ a b) (* (- a b) (sin t_0)))))))
double code(double a, double b, double angle) {
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin((((double) M_PI) * (angle / 180.0)))) * cos((((double) M_PI) * (angle / 180.0)));
}
double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * ((double) M_PI));
return -2.0 * (cos(t_0) * ((a + b) * ((a - b) * sin(t_0))));
}
public static double code(double a, double b, double angle) {
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin((Math.PI * (angle / 180.0)))) * Math.cos((Math.PI * (angle / 180.0)));
}
public static double code(double a, double b, double angle) {
double t_0 = 0.005555555555555556 * (angle * Math.PI);
return -2.0 * (Math.cos(t_0) * ((a + b) * ((a - b) * Math.sin(t_0))));
}
def code(a, b, angle): return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin((math.pi * (angle / 180.0)))) * math.cos((math.pi * (angle / 180.0)))
def code(a, b, angle): t_0 = 0.005555555555555556 * (angle * math.pi) return -2.0 * (math.cos(t_0) * ((a + b) * ((a - b) * math.sin(t_0))))
function code(a, b, angle) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(pi * Float64(angle / 180.0)))) * cos(Float64(pi * Float64(angle / 180.0)))) end
function code(a, b, angle) t_0 = Float64(0.005555555555555556 * Float64(angle * pi)) return Float64(-2.0 * Float64(cos(t_0) * Float64(Float64(a + b) * Float64(Float64(a - b) * sin(t_0))))) end
function tmp = code(a, b, angle) tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin((pi * (angle / 180.0)))) * cos((pi * (angle / 180.0))); end
function tmp = code(a, b, angle) t_0 = 0.005555555555555556 * (angle * pi); tmp = -2.0 * (cos(t_0) * ((a + b) * ((a - b) * sin(t_0)))); end
code[a_, b_, angle_] := N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_] := Block[{t$95$0 = N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]}, N[(-2.0 * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(a + b), $MachinePrecision] * N[(N[(a - b), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
-2 \cdot \left(\cos t_0 \cdot \left(\left(a + b\right) \cdot \left(\left(a - b\right) \cdot \sin t_0\right)\right)\right)
\end{array}



Bits error versus a



Bits error versus b



Bits error versus angle
Results
Initial program 31.5
Simplified31.5
Applied egg-rr31.5
Taylor expanded in angle around inf 21.2
Final simplification21.2
herbie shell --seed 2022160
(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)))))