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 r11375 = 1.0;
        double r11376 = x;
        double r11377 = tan(r11376);
        double r11378 = r11377 * r11377;
        double r11379 = r11375 - r11378;
        double r11380 = r11375 + r11378;
        double r11381 = r11379 / r11380;
        return r11381;
}

double f(double x) {
        double r11382 = 1.0;
        double r11383 = x;
        double r11384 = tan(r11383);
        double r11385 = r11384 * r11384;
        double r11386 = r11382 - r11385;
        double r11387 = r11382 + r11385;
        double r11388 = r11386 / r11387;
        double r11389 = exp(r11388);
        double r11390 = log(r11389);
        return r11390;
}

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)))))