Average Error: 0.3 → 0.4
Time: 4.4s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\sqrt{1} + \tan x}{\frac{1 + \tan x \cdot \tan x}{\sqrt{1} - \tan x}}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\sqrt{1} + \tan x}{\frac{1 + \tan x \cdot \tan x}{\sqrt{1} - \tan x}}
double f(double x) {
        double r11152 = 1.0;
        double r11153 = x;
        double r11154 = tan(r11153);
        double r11155 = r11154 * r11154;
        double r11156 = r11152 - r11155;
        double r11157 = r11152 + r11155;
        double r11158 = r11156 / r11157;
        return r11158;
}

double f(double x) {
        double r11159 = 1.0;
        double r11160 = sqrt(r11159);
        double r11161 = x;
        double r11162 = tan(r11161);
        double r11163 = r11160 + r11162;
        double r11164 = r11162 * r11162;
        double r11165 = r11159 + r11164;
        double r11166 = r11160 - r11162;
        double r11167 = r11165 / r11166;
        double r11168 = r11163 / r11167;
        return r11168;
}

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-sqr-sqrt0.3

    \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}} - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
  4. Applied difference-of-squares0.4

    \[\leadsto \frac{\color{blue}{\left(\sqrt{1} + \tan x\right) \cdot \left(\sqrt{1} - \tan x\right)}}{1 + \tan x \cdot \tan x}\]
  5. Applied associate-/l*0.4

    \[\leadsto \color{blue}{\frac{\sqrt{1} + \tan x}{\frac{1 + \tan x \cdot \tan x}{\sqrt{1} - \tan x}}}\]
  6. Final simplification0.4

    \[\leadsto \frac{\sqrt{1} + \tan x}{\frac{1 + \tan x \cdot \tan x}{\sqrt{1} - \tan x}}\]

Reproduce

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