Average Error: 32.2 → 32.1
Time: 12.3s
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 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\ \left(\sin t_0 \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)\right) \cdot \sqrt[3]{{\cos t_0}^{3}} \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 := 0.005555555555555556 \cdot \left(angle \cdot \pi\right)\\
\left(\sin t_0 \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)\right) \cdot \sqrt[3]{{\cos t_0}^{3}}
\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 (* 0.005555555555555556 (* angle PI))))
   (* (* (sin t_0) (* 2.0 (- (* b b) (* a a)))) (cbrt (pow (cos t_0) 3.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 (sin(t_0) * (2.0 * ((b * b) - (a * a)))) * cbrt(pow(cos(t_0), 3.0));
}

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 32.2

    \[\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. Using strategy rm
  3. Applied add-cbrt-cube_binary6432.2

    \[\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)}} \]
  4. Simplified32.2

    \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \sqrt[3]{\color{blue}{{\cos \left(\pi \cdot \frac{angle}{180}\right)}^{3}}} \]
  5. Taylor expanded around 0 32.2

    \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) - 2 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \cdot \sqrt[3]{{\cos \left(\pi \cdot \frac{angle}{180}\right)}^{3}} \]
  6. Simplified32.2

    \[\leadsto \color{blue}{\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)\right)} \cdot \sqrt[3]{{\cos \left(\pi \cdot \frac{angle}{180}\right)}^{3}} \]
  7. Taylor expanded around inf 32.1

    \[\leadsto \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)\right) \cdot \sqrt[3]{{\color{blue}{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}}^{3}} \]
  8. Final simplification32.1

    \[\leadsto \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)\right) \cdot \sqrt[3]{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)}^{3}} \]

Reproduce

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