Average Error: 31.8 → 31.8
Time: 2.1min
Precision: binary64
Cost: 27008
\[\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)\]
\[\sqrt[3]{{\cos \left(\pi \cdot \frac{angle}{180}\right)}^{3}} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)\right)\]
\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)
\sqrt[3]{{\cos \left(\pi \cdot \frac{angle}{180}\right)}^{3}} \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)\right)
(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
 (*
  (cbrt (pow (cos (* PI (/ angle 180.0))) 3.0))
  (* (sin (* 0.005555555555555556 (* PI angle))) (* 2.0 (- (* b b) (* a a))))))
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) {
	return cbrt(pow(cos(((double) M_PI) * (angle / 180.0)), 3.0)) * (sin(0.005555555555555556 * (((double) M_PI) * angle)) * (2.0 * ((b * b) - (a * a))));
}

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

Alternatives

Alternative 1
Error31.7
Cost14144
\[\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot 2\right)\right)\]
Alternative 2
Error31.8
Cost14144
\[\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\]
Alternative 3
Error32.7
Cost14216
\[\begin{array}{l} \mathbf{if}\;a \leq -1.906765726515697 \cdot 10^{-47} \lor \neg \left(a \leq 3.190550033581841 \cdot 10^{-183}\right):\\ \;\;\;\;\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;\cos \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b \cdot b\right)\right)\right)\\ \end{array}\]
Alternative 4
Error32.6
Cost7360
\[\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \sin \left(\frac{\pi \cdot angle}{180}\right)\]
Alternative 5
Error32.6
Cost7360
\[\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)\]
Alternative 6
Error32.6
Cost7360
\[\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\]
Alternative 7
Error34.0
Cost7553
\[\begin{array}{l} \mathbf{if}\;\frac{angle}{180} \leq 2.1844867140148393 \cdot 10^{-08}:\\ \;\;\;\;\left(\pi \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b \cdot b\right)\right)\\ \end{array}\]
Alternative 8
Error34.6
Cost832
\[\left(\pi \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\]
Alternative 9
Error34.6
Cost832
\[angle \cdot \left(\left(b \cdot b - a \cdot a\right) \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\]
Alternative 10
Error34.6
Cost832
\[angle \cdot \left(\left(\pi \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot 0.011111111111111112\right)\]
Alternative 11
Error37.7
Cost904
\[\begin{array}{l} \mathbf{if}\;b \leq -3.8748627715646454 \cdot 10^{-38} \lor \neg \left(b \leq 2.183929541667114 \cdot 10^{-18}\right):\\ \;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\\ \end{array}\]
Alternative 12
Error43.6
Cost576
\[\left(\pi \cdot angle\right) \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\]
Alternative 13
Error43.6
Cost576
\[\left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right) \cdot -0.011111111111111112\]
Alternative 14
Error43.6
Cost576
\[angle \cdot \left(\pi \cdot \left(\left(a \cdot a\right) \cdot -0.011111111111111112\right)\right)\]
Alternative 15
Error51.7
Cost64
\[0\]
Alternative 16
Error61.8
Cost64
\[-1\]

Error

Derivation

  1. Initial program 31.8

    \[\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. Taylor expanded around 0 31.7

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

    \[\leadsto \color{blue}{\left(\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)} \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\]
  4. Using strategy rm
  5. Applied add-cbrt-cube_binary64_45531.8

    \[\leadsto \left(\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\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)}}\]
  6. Simplified31.8

    \[\leadsto \left(\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \sqrt[3]{\color{blue}{{\cos \left(\pi \cdot \frac{angle}{180}\right)}^{3}}}\]
  7. Using strategy rm
  8. Applied sub-neg_binary64_41231.8

    \[\leadsto \left(\left(2 \cdot \color{blue}{\left(b \cdot b + \left(-a \cdot a\right)\right)}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right) \cdot \sqrt[3]{{\cos \left(\pi \cdot \frac{angle}{180}\right)}^{3}}\]
  9. Using strategy rm
  10. Applied *-commutative_binary64_35031.8

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

    \[\leadsto \color{blue}{\sqrt[3]{{\cos \left(\pi \cdot \frac{angle}{180}\right)}^{3}} \cdot \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)}\]
  12. Final simplification31.8

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

Reproduce

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