Average Error: 30.9 → 30.9
Time: 10.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)\]
\[\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\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)
\left(\left(2 \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\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
 (*
  (* (* 2.0 (* (+ b a) (- b a))) (sin (* PI (/ angle 180.0))))
  (cos (* PI (/ angle 180.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) {
	return ((2.0 * ((b + a) * (b - a))) * sin(((double) M_PI) * (angle / 180.0))) * cos(((double) M_PI) * (angle / 180.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 30.9

    \[\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-sqr-sqrt_binary64_10047.5

    \[\leadsto \left(\left(2 \cdot \left({b}^{2} - {\color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)}}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\]
  4. Applied unpow-prod-down_binary64_15747.5

    \[\leadsto \left(\left(2 \cdot \left({b}^{2} - \color{blue}{{\left(\sqrt{a}\right)}^{2} \cdot {\left(\sqrt{a}\right)}^{2}}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\]
  5. Applied add-sqr-sqrt_binary64_10055.7

    \[\leadsto \left(\left(2 \cdot \left({\color{blue}{\left(\sqrt{b} \cdot \sqrt{b}\right)}}^{2} - {\left(\sqrt{a}\right)}^{2} \cdot {\left(\sqrt{a}\right)}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\]
  6. Applied unpow-prod-down_binary64_15755.7

    \[\leadsto \left(\left(2 \cdot \left(\color{blue}{{\left(\sqrt{b}\right)}^{2} \cdot {\left(\sqrt{b}\right)}^{2}} - {\left(\sqrt{a}\right)}^{2} \cdot {\left(\sqrt{a}\right)}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\]
  7. Applied difference-of-squares_binary64_4755.7

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

    \[\leadsto \left(\left(2 \cdot \left(\color{blue}{\left(b + a\right)} \cdot \left({\left(\sqrt{b}\right)}^{2} - {\left(\sqrt{a}\right)}^{2}\right)\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\]
  9. Simplified30.9

    \[\leadsto \left(\left(2 \cdot \left(\left(b + a\right) \cdot \color{blue}{\left(b - a\right)}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\]
  10. Final simplification30.9

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

Reproduce

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