Average Error: 31.4 → 31.4
Time: 9.8s
Precision: binary64
\[\tan^{-1} \left(\sqrt{\left(\tan \left(\frac{s}{2}\right) \cdot \tan \left(\frac{s - a}{2}\right)\right) \cdot \tan \left(\frac{s - b}{2}\right)}\right)\]
\[\tan^{-1} \left(\sqrt{\left(\tan \left(\frac{s}{2}\right) \cdot \tan \left(\frac{s - a}{2}\right)\right) \cdot \tan \left(\frac{s - b}{2}\right)}\right)\]
\tan^{-1} \left(\sqrt{\left(\tan \left(\frac{s}{2}\right) \cdot \tan \left(\frac{s - a}{2}\right)\right) \cdot \tan \left(\frac{s - b}{2}\right)}\right)
\tan^{-1} \left(\sqrt{\left(\tan \left(\frac{s}{2}\right) \cdot \tan \left(\frac{s - a}{2}\right)\right) \cdot \tan \left(\frac{s - b}{2}\right)}\right)
double code(double s, double a, double b) {
	return ((double) atan(((double) sqrt(((double) (((double) (((double) tan(((double) (s / 2.0)))) * ((double) tan(((double) (((double) (s - a)) / 2.0)))))) * ((double) tan(((double) (((double) (s - b)) / 2.0))))))))));
}
double code(double s, double a, double b) {
	return ((double) atan(((double) sqrt(((double) (((double) (((double) tan(((double) (s / 2.0)))) * ((double) tan(((double) (((double) (s - a)) / 2.0)))))) * ((double) tan(((double) (((double) (s - b)) / 2.0))))))))));
}

Error

Bits error versus s

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.4

    \[\tan^{-1} \left(\sqrt{\left(\tan \left(\frac{s}{2}\right) \cdot \tan \left(\frac{s - a}{2}\right)\right) \cdot \tan \left(\frac{s - b}{2}\right)}\right)\]
  2. Final simplification31.4

    \[\leadsto \tan^{-1} \left(\sqrt{\left(\tan \left(\frac{s}{2}\right) \cdot \tan \left(\frac{s - a}{2}\right)\right) \cdot \tan \left(\frac{s - b}{2}\right)}\right)\]

Reproduce

herbie shell --seed 2020153 
(FPCore (s a b)
  :name "(atan (sqrt (* (* (tan (/ s 2)) (tan (/ (- s a) 2))) (tan (/ (- s b) 2)))))"
  :precision binary64
  (atan (sqrt (* (* (tan (/ s 2.0)) (tan (/ (- s a) 2.0))) (tan (/ (- s b) 2.0))))))