Average Error: 0.3 → 0.5
Time: 41.1s
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 + 1} - \frac{\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 + 1} - \frac{\tan x \cdot \tan x}{\tan x \cdot \tan x + 1}}\right)
double f(double x) {
        double r1450468 = 1.0;
        double r1450469 = x;
        double r1450470 = tan(r1450469);
        double r1450471 = r1450470 * r1450470;
        double r1450472 = r1450468 - r1450471;
        double r1450473 = r1450468 + r1450471;
        double r1450474 = r1450472 / r1450473;
        return r1450474;
}

double f(double x) {
        double r1450475 = 1.0;
        double r1450476 = x;
        double r1450477 = tan(r1450476);
        double r1450478 = r1450477 * r1450477;
        double r1450479 = r1450478 + r1450475;
        double r1450480 = r1450475 / r1450479;
        double r1450481 = r1450478 / r1450479;
        double r1450482 = r1450480 - r1450481;
        double r1450483 = exp(r1450482);
        double r1450484 = log(r1450483);
        return r1450484;
}

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. Using strategy rm
  5. Applied div-sub0.5

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

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

Reproduce

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