Average Error: 13.3 → 0.2
Time: 1.3m
Precision: 64
\[\left(x = 0.0 \lor 0.5884142 \le x \le 505.5909\right) \land \left(-1.796658 \cdot 10^{+308} \le y \le -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le y \le 1.751224 \cdot 10^{+308}\right) \land \left(-1.776707 \cdot 10^{+308} \le z \le -8.599796 \cdot 10^{-310} \lor 3.293145 \cdot 10^{-311} \le z \le 1.725154 \cdot 10^{+308}\right) \land \left(-1.796658 \cdot 10^{+308} \le a \le -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le a \le 1.751224 \cdot 10^{+308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[x + \left(\left(1 + \tan z \cdot \tan y\right) \cdot \frac{\tan y + \tan z}{1 - \frac{\left(\tan z \cdot \tan y\right) \cdot \left(\sin y \cdot \tan z\right)}{\cos y}} - \tan a\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\left(1 + \tan z \cdot \tan y\right) \cdot \frac{\tan y + \tan z}{1 - \frac{\left(\tan z \cdot \tan y\right) \cdot \left(\sin y \cdot \tan z\right)}{\cos y}} - \tan a\right)
double f(double x, double y, double z, double a) {
        double r6435388 = x;
        double r6435389 = y;
        double r6435390 = z;
        double r6435391 = r6435389 + r6435390;
        double r6435392 = tan(r6435391);
        double r6435393 = a;
        double r6435394 = tan(r6435393);
        double r6435395 = r6435392 - r6435394;
        double r6435396 = r6435388 + r6435395;
        return r6435396;
}

double f(double x, double y, double z, double a) {
        double r6435397 = x;
        double r6435398 = 1.0;
        double r6435399 = z;
        double r6435400 = tan(r6435399);
        double r6435401 = y;
        double r6435402 = tan(r6435401);
        double r6435403 = r6435400 * r6435402;
        double r6435404 = r6435398 + r6435403;
        double r6435405 = r6435402 + r6435400;
        double r6435406 = sin(r6435401);
        double r6435407 = r6435406 * r6435400;
        double r6435408 = r6435403 * r6435407;
        double r6435409 = cos(r6435401);
        double r6435410 = r6435408 / r6435409;
        double r6435411 = r6435398 - r6435410;
        double r6435412 = r6435405 / r6435411;
        double r6435413 = r6435404 * r6435412;
        double r6435414 = a;
        double r6435415 = tan(r6435414);
        double r6435416 = r6435413 - r6435415;
        double r6435417 = r6435397 + r6435416;
        return r6435417;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 13.3

    \[x + \left(\tan \left(y + z\right) - \tan a\right)\]
  2. Using strategy rm
  3. Applied tan-sum0.2

    \[\leadsto x + \left(\color{blue}{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}} - \tan a\right)\]
  4. Using strategy rm
  5. Applied flip--0.2

    \[\leadsto x + \left(\frac{\tan y + \tan z}{\color{blue}{\frac{1 \cdot 1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)}{1 + \tan y \cdot \tan z}}} - \tan a\right)\]
  6. Applied associate-/r/0.2

    \[\leadsto x + \left(\color{blue}{\frac{\tan y + \tan z}{1 \cdot 1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)} \cdot \left(1 + \tan y \cdot \tan z\right)} - \tan a\right)\]
  7. Simplified0.2

    \[\leadsto x + \left(\color{blue}{\frac{\tan y + \tan z}{1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)}} \cdot \left(1 + \tan y \cdot \tan z\right) - \tan a\right)\]
  8. Using strategy rm
  9. Applied tan-quot0.2

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \left(\color{blue}{\frac{\sin y}{\cos y}} \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)} \cdot \left(1 + \tan y \cdot \tan z\right) - \tan a\right)\]
  10. Applied associate-*l/0.2

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \color{blue}{\frac{\sin y \cdot \tan z}{\cos y}} \cdot \left(\tan y \cdot \tan z\right)} \cdot \left(1 + \tan y \cdot \tan z\right) - \tan a\right)\]
  11. Applied associate-*l/0.2

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \color{blue}{\frac{\left(\sin y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)}{\cos y}}} \cdot \left(1 + \tan y \cdot \tan z\right) - \tan a\right)\]
  12. Final simplification0.2

    \[\leadsto x + \left(\left(1 + \tan z \cdot \tan y\right) \cdot \frac{\tan y + \tan z}{1 - \frac{\left(\tan z \cdot \tan y\right) \cdot \left(\sin y \cdot \tan z\right)}{\cos y}} - \tan a\right)\]

Reproduce

herbie shell --seed 2019165 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :pre (and (or (== x 0.0) (<= 0.5884142 x 505.5909)) (or (<= -1.796658e+308 y -9.425585e-310) (<= 1.284938e-309 y 1.751224e+308)) (or (<= -1.776707e+308 z -8.599796e-310) (<= 3.293145e-311 z 1.725154e+308)) (or (<= -1.796658e+308 a -9.425585e-310) (<= 1.284938e-309 a 1.751224e+308)))
  (+ x (- (tan (+ y z)) (tan a))))