Average Error: 31.0 → 31.0
Time: 16.4s
Precision: binary64
\[\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 := \pi \cdot \frac{angle}{180}\\ t_1 := \cos t_0\\ \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin t_0\right)\right)\right) \cdot \sqrt[3]{t_1 \cdot \left(t_1 \cdot t_1\right)} \end{array} \]
\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 := \pi \cdot \frac{angle}{180}\\
t_1 := \cos t_0\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin t_0\right)\right)\right) \cdot \sqrt[3]{t_1 \cdot \left(t_1 \cdot t_1\right)}
\end{array}
(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 (* PI (/ angle 180.0))) (t_1 (cos t_0)))
   (*
    (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (expm1 (log1p (sin t_0))))
    (cbrt (* t_1 (* t_1 t_1))))))
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 = ((double) M_PI) * (angle / 180.0);
	double t_1 = cos(t_0);
	return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * expm1(log1p(sin(t_0)))) * cbrt(t_1 * (t_1 * t_1));
}

Error

Bits error versus a

Bits error versus b

Bits error versus angle

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.0

    \[\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) \]
  2. Applied add-cbrt-cube_binary6431.0

    \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \color{blue}{\sqrt[3]{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)}} \]
  3. Applied expm1-log1p-u_binary6431.0

    \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)}\right) \cdot \sqrt[3]{\left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)} \]
  4. Final simplification31.0

    \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)\right) \cdot \sqrt[3]{\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]

Reproduce

herbie shell --seed 2022068 
(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)))))