Average Error: 0.1 → 0.1
Time: 9.0s
Precision: binary64
Cost: 91328
\[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|\]
\[\left|\left(ew \cdot \cos t\right) \cdot \left(\sqrt{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|\]
\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|
\left|\left(ew \cdot \cos t\right) \cdot \left(\sqrt{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (-
   (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew))))
   (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (-
   (*
    (* ew (cos t))
    (*
     (sqrt (cos (atan (/ (* (- eh) (tan t)) ew))))
     (sqrt (cos (atan (/ (* eh (tan t)) ew))))))
   (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))
double code(double eh, double ew, double t) {
	return fabs(((ew * cos(t)) * cos(atan((-eh * tan(t)) / ew))) - ((eh * sin(t)) * sin(atan((-eh * tan(t)) / ew))));
}
double code(double eh, double ew, double t) {
	return fabs(((ew * cos(t)) * (sqrt(cos(atan((-eh * tan(t)) / ew))) * sqrt(cos(atan((eh * tan(t)) / ew))))) - ((eh * sin(t)) * sin(atan((-eh * tan(t)) / ew))));
}

Error

Bits error versus eh

Bits error versus ew

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.1
Cost58880
\[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|\]
Alternative 2
Error0.6
Cost52544
\[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right)\right|\]
Alternative 3
Error60.5
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.1

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt_binary64_24870.1

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\left(\sqrt{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|\]
  4. Using strategy rm
  5. Applied distribute-lft-neg-out_binary64_24240.1

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \left(\sqrt{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\cos \tan^{-1} \left(\frac{\color{blue}{-eh \cdot \tan t}}{ew}\right)}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|\]
  6. Applied distribute-frac-neg_binary64_24280.1

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \left(\sqrt{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\cos \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|\]
  7. Applied atan-neg_binary64_26490.1

    \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \left(\sqrt{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} \cdot \sqrt{\cos \color{blue}{\left(-\tan^{-1} \left(\frac{eh \cdot \tan t}{ew}\right)\right)}}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right|\]
  8. Applied cos-neg_binary64_25960.1

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

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

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

Reproduce

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