Average Error: 32.6 → 32.6
Time: 29.4s
Precision: 64
\[\frac{-1}{\tan \left(\frac{x \cdot pi}{360}\right)}\]
\[\frac{-1}{\frac{\sin \left(\frac{x \cdot pi}{360}\right)}{\cos \left(\frac{x \cdot pi}{360}\right)}}\]
\frac{-1}{\tan \left(\frac{x \cdot pi}{360}\right)}
\frac{-1}{\frac{\sin \left(\frac{x \cdot pi}{360}\right)}{\cos \left(\frac{x \cdot pi}{360}\right)}}
double f(double x, double pi) {
        double r15434061 = 1.0;
        double r15434062 = -r15434061;
        double r15434063 = x;
        double r15434064 = pi;
        double r15434065 = r15434063 * r15434064;
        double r15434066 = 360.0;
        double r15434067 = r15434065 / r15434066;
        double r15434068 = tan(r15434067);
        double r15434069 = r15434062 / r15434068;
        return r15434069;
}

double f(double x, double pi) {
        double r15434070 = -1.0;
        double r15434071 = x;
        double r15434072 = pi;
        double r15434073 = r15434071 * r15434072;
        double r15434074 = 360.0;
        double r15434075 = r15434073 / r15434074;
        double r15434076 = sin(r15434075);
        double r15434077 = cos(r15434075);
        double r15434078 = r15434076 / r15434077;
        double r15434079 = r15434070 / r15434078;
        return r15434079;
}

Error

Bits error versus x

Bits error versus pi

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.6

    \[\frac{-1}{\tan \left(\frac{x \cdot pi}{360}\right)}\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt32.6

    \[\leadsto \frac{-1}{\tan \left(\frac{x \cdot pi}{\color{blue}{\sqrt{360} \cdot \sqrt{360}}}\right)}\]
  4. Applied times-frac32.6

    \[\leadsto \frac{-1}{\tan \color{blue}{\left(\frac{x}{\sqrt{360}} \cdot \frac{pi}{\sqrt{360}}\right)}}\]
  5. Taylor expanded around -inf 32.6

    \[\leadsto \frac{-1}{\color{blue}{\frac{\sin \left(\frac{x \cdot pi}{{\left(\sqrt{360}\right)}^{2}}\right)}{\cos \left(\frac{x \cdot pi}{{\left(\sqrt{360}\right)}^{2}}\right)}}}\]
  6. Simplified32.6

    \[\leadsto \frac{-1}{\color{blue}{\frac{\sin \left(\frac{x \cdot pi}{360}\right)}{\cos \left(\frac{x \cdot pi}{360}\right)}}}\]
  7. Final simplification32.6

    \[\leadsto \frac{-1}{\frac{\sin \left(\frac{x \cdot pi}{360}\right)}{\cos \left(\frac{x \cdot pi}{360}\right)}}\]

Reproduce

herbie shell --seed 1 
(FPCore (x pi)
  :name "-1/tan(x * pi / 360)"
  (/ (- 1) (tan (/ (* x pi) 360))))