Average Error: 0.4 → 0.4
Time: 9.1s
Precision: 64
\[0 \le x \land x \lt 135\]
\[\frac{-1}{\tan \left(\frac{x \cdot \pi}{360}\right)}\]
\[\frac{-1}{\tan \left(\frac{1}{360} \cdot \left(x \cdot \pi\right)\right)}\]
\frac{-1}{\tan \left(\frac{x \cdot \pi}{360}\right)}
\frac{-1}{\tan \left(\frac{1}{360} \cdot \left(x \cdot \pi\right)\right)}
double f(double x) {
        double r16191087 = 1.0;
        double r16191088 = -r16191087;
        double r16191089 = x;
        double r16191090 = atan2(1.0, 0.0);
        double r16191091 = r16191089 * r16191090;
        double r16191092 = 360.0;
        double r16191093 = r16191091 / r16191092;
        double r16191094 = tan(r16191093);
        double r16191095 = r16191088 / r16191094;
        return r16191095;
}

double f(double x) {
        double r16191096 = -1.0;
        double r16191097 = 0.002777777777777778;
        double r16191098 = x;
        double r16191099 = atan2(1.0, 0.0);
        double r16191100 = r16191098 * r16191099;
        double r16191101 = r16191097 * r16191100;
        double r16191102 = tan(r16191101);
        double r16191103 = r16191096 / r16191102;
        return r16191103;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.4

    \[\frac{-1}{\tan \left(\frac{x \cdot \pi}{360}\right)}\]
  2. Simplified0.4

    \[\leadsto \color{blue}{\frac{-1}{\tan \left(\pi \cdot \frac{x}{360}\right)}}\]
  3. Taylor expanded around 0 0.4

    \[\leadsto \frac{-1}{\tan \color{blue}{\left(\frac{1}{360} \cdot \left(x \cdot \pi\right)\right)}}\]
  4. Final simplification0.4

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

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "-1/tan(x * PI / 360)"
  :pre (and (<= 0 x) (< x 135))
  (/ (- 1) (tan (/ (* x PI) 360))))