Average Error: 0.3 → 0.4
Time: 10.8s
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 + \tan x \cdot \tan x}}\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 + \tan x \cdot \tan x}}\right)
double f(double x) {
        double r11330 = 1.0;
        double r11331 = x;
        double r11332 = tan(r11331);
        double r11333 = r11332 * r11332;
        double r11334 = r11330 - r11333;
        double r11335 = r11330 + r11333;
        double r11336 = r11334 / r11335;
        return r11336;
}

double f(double x) {
        double r11337 = 1.0;
        double r11338 = x;
        double r11339 = tan(r11338);
        double r11340 = r11339 * r11339;
        double r11341 = r11337 - r11340;
        double r11342 = r11337 + r11340;
        double r11343 = r11341 / r11342;
        double r11344 = exp(r11343);
        double r11345 = log(r11344);
        return r11345;
}

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}{1 + \tan x \cdot \tan x}}\right)\]

Reproduce

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