Average Error: 0.3 → 0.4
Time: 20.5s
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 r23330 = 1.0;
        double r23331 = x;
        double r23332 = tan(r23331);
        double r23333 = r23332 * r23332;
        double r23334 = r23330 - r23333;
        double r23335 = r23330 + r23333;
        double r23336 = r23334 / r23335;
        return r23336;
}

double f(double x) {
        double r23337 = 1.0;
        double r23338 = x;
        double r23339 = tan(r23338);
        double r23340 = r23339 * r23339;
        double r23341 = r23337 - r23340;
        double r23342 = r23340 + r23337;
        double r23343 = r23341 / r23342;
        double r23344 = exp(r23343);
        double r23345 = log(r23344);
        return r23345;
}

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. Simplified0.3

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

    \[\leadsto \color{blue}{\log \left(e^{\frac{1 - \tan x \cdot \tan x}{\tan x \cdot \tan x + 1}}\right)}\]
  5. 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 2019196 
(FPCore (x)
  :name "Trigonometry B"
  (/ (- 1.0 (* (tan x) (tan x))) (+ 1.0 (* (tan x) (tan x)))))