Average Error: 0.1 → 0.1
Time: 15.2s
Precision: binary64
\[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
\[\left|\mathsf{fma}\left(ew \cdot \sin t, \sqrt[3]{{\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{3}}, \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\right| \]
\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
\left|\mathsf{fma}\left(ew \cdot \sin t, \sqrt[3]{{\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{3}}, \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\right|
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (+
   (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t)))))
   (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (fma
   (* ew (sin t))
   (cbrt (pow (cos (atan (/ eh (* ew (tan t))))) 3.0))
   (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
double code(double eh, double ew, double t) {
	return fabs(((ew * sin(t)) * cos(atan((eh / ew) / tan(t)))) + ((eh * cos(t)) * sin(atan((eh / ew) / tan(t)))));
}
double code(double eh, double ew, double t) {
	return fabs(fma((ew * sin(t)), cbrt(pow(cos(atan(eh / (ew * tan(t)))), 3.0)), ((eh * cos(t)) * sin(atan((eh / ew) / tan(t))))));
}

Error

Bits error versus eh

Bits error versus ew

Bits error versus t

Derivation

  1. Initial program 0.1

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Simplified0.1

    \[\leadsto \color{blue}{\left|\mathsf{fma}\left(ew \cdot \sin t, \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right), \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\right|} \]
  3. Applied add-cbrt-cube_binary640.1

    \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \color{blue}{\sqrt[3]{\left(\cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)}}, \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\right| \]
  4. Simplified0.1

    \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \sqrt[3]{\color{blue}{{\cos \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)}^{3}}}, \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\right| \]
  5. Final simplification0.1

    \[\leadsto \left|\mathsf{fma}\left(ew \cdot \sin t, \sqrt[3]{{\cos \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}^{3}}, \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right)\right| \]

Reproduce

herbie shell --seed 2022024 
(FPCore (eh ew t)
  :name "Example from Robby"
  :precision binary64
  (fabs (+ (* (* ew (sin t)) (cos (atan (/ (/ eh ew) (tan t))))) (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))