Average Error: 13.3 → 0.2
Time: 36.9s
Precision: 64
\[\left(x = 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(\left(\tan z \cdot \tan y + \left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) + 1\right) \cdot \frac{\tan y + \tan z}{1 - \left(\tan z \cdot \tan y\right) \cdot \frac{\left(\tan y \cdot \sin z\right) \cdot \left(\tan y \cdot \sin z\right)}{\cos z \cdot \cos z}} - \tan a\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\left(\left(\tan z \cdot \tan y + \left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) + 1\right) \cdot \frac{\tan y + \tan z}{1 - \left(\tan z \cdot \tan y\right) \cdot \frac{\left(\tan y \cdot \sin z\right) \cdot \left(\tan y \cdot \sin z\right)}{\cos z \cdot \cos z}} - \tan a\right)
double f(double x, double y, double z, double a) {
        double r1864497 = x;
        double r1864498 = y;
        double r1864499 = z;
        double r1864500 = r1864498 + r1864499;
        double r1864501 = tan(r1864500);
        double r1864502 = a;
        double r1864503 = tan(r1864502);
        double r1864504 = r1864501 - r1864503;
        double r1864505 = r1864497 + r1864504;
        return r1864505;
}

double f(double x, double y, double z, double a) {
        double r1864506 = x;
        double r1864507 = z;
        double r1864508 = tan(r1864507);
        double r1864509 = y;
        double r1864510 = tan(r1864509);
        double r1864511 = r1864508 * r1864510;
        double r1864512 = r1864511 * r1864511;
        double r1864513 = r1864511 + r1864512;
        double r1864514 = 1.0;
        double r1864515 = r1864513 + r1864514;
        double r1864516 = r1864510 + r1864508;
        double r1864517 = sin(r1864507);
        double r1864518 = r1864510 * r1864517;
        double r1864519 = r1864518 * r1864518;
        double r1864520 = cos(r1864507);
        double r1864521 = r1864520 * r1864520;
        double r1864522 = r1864519 / r1864521;
        double r1864523 = r1864511 * r1864522;
        double r1864524 = r1864514 - r1864523;
        double r1864525 = r1864516 / r1864524;
        double r1864526 = r1864515 * r1864525;
        double r1864527 = a;
        double r1864528 = tan(r1864527);
        double r1864529 = r1864526 - r1864528;
        double r1864530 = r1864506 + r1864529;
        return r1864530;
}

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 flip3--0.2

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019152 +o rules:numerics
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :pre (and (or (== x 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))))