Average Error: 0.3 → 0.4
Time: 22.2s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\log \left(e^{\frac{1 - \tan x \cdot \tan x}{\tan x \cdot \tan x + 1}}\right)\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\log \left(e^{\frac{1 - \tan x \cdot \tan x}{\tan x \cdot \tan x + 1}}\right)
double f(double x) {
        double r695553 = 1.0;
        double r695554 = x;
        double r695555 = tan(r695554);
        double r695556 = r695555 * r695555;
        double r695557 = r695553 - r695556;
        double r695558 = r695553 + r695556;
        double r695559 = r695557 / r695558;
        return r695559;
}

double f(double x) {
        double r695560 = 1.0;
        double r695561 = x;
        double r695562 = tan(r695561);
        double r695563 = r695562 * r695562;
        double r695564 = r695560 - r695563;
        double r695565 = r695563 + r695560;
        double r695566 = r695564 / r695565;
        double r695567 = exp(r695566);
        double r695568 = log(r695567);
        return r695568;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.3

    \[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
  2. Using strategy rm
  3. Applied add-log-exp0.4

    \[\leadsto \color{blue}{\log \left(e^{\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}}\right)}\]
  4. Final simplification0.4

    \[\leadsto \log \left(e^{\frac{1 - \tan x \cdot \tan x}{\tan x \cdot \tan x + 1}}\right)\]

Reproduce

herbie shell --seed 2019162 
(FPCore (x)
  :name "Trigonometry B"
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))