Average Error: 13.1 → 0.2
Time: 15.6s
Precision: 64
\[\left(x = 0.0 \lor 0.5884141999999999983472775966220069676638 \le x \le 505.5908999999999764440872240811586380005\right) \land \left(-1.7966580000000000931214523812968299911 \cdot 10^{308} \le y \le -9.425585000000013069597555966781986720373 \cdot 10^{-310} \lor 1.284937999999999548796432976649400331091 \cdot 10^{-309} \le y \le 1.751223999999999928063201074847742204824 \cdot 10^{308}\right) \land \left(-1.776707000000000001259808757982040817204 \cdot 10^{308} \le z \le -8.599796000000016667475923823712126825539 \cdot 10^{-310} \lor 3.293144999999983071955117582595641261776 \cdot 10^{-311} \le z \le 1.725154000000000087891269878141591702413 \cdot 10^{308}\right) \land \left(-1.7966580000000000931214523812968299911 \cdot 10^{308} \le a \le -9.425585000000013069597555966781986720373 \cdot 10^{-310} \lor 1.284937999999999548796432976649400331091 \cdot 10^{-309} \le a \le 1.751223999999999928063201074847742204824 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[x + \left(\left(\frac{\tan y + \tan z}{\left(1 - \frac{\tan y \cdot \sin z}{\cos z} \cdot \left(\tan y \cdot \tan z\right)\right) \cdot \left(\tan y + \tan z\right)} \cdot 1\right) \cdot \left(\left(1 + \tan y \cdot \tan z\right) \cdot \left(\tan y + \tan z\right)\right) - \tan a\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\left(\frac{\tan y + \tan z}{\left(1 - \frac{\tan y \cdot \sin z}{\cos z} \cdot \left(\tan y \cdot \tan z\right)\right) \cdot \left(\tan y + \tan z\right)} \cdot 1\right) \cdot \left(\left(1 + \tan y \cdot \tan z\right) \cdot \left(\tan y + \tan z\right)\right) - \tan a\right)
double f(double x, double y, double z, double a) {
        double r221393 = x;
        double r221394 = y;
        double r221395 = z;
        double r221396 = r221394 + r221395;
        double r221397 = tan(r221396);
        double r221398 = a;
        double r221399 = tan(r221398);
        double r221400 = r221397 - r221399;
        double r221401 = r221393 + r221400;
        return r221401;
}

double f(double x, double y, double z, double a) {
        double r221402 = x;
        double r221403 = y;
        double r221404 = tan(r221403);
        double r221405 = z;
        double r221406 = tan(r221405);
        double r221407 = r221404 + r221406;
        double r221408 = 1.0;
        double r221409 = sin(r221405);
        double r221410 = r221404 * r221409;
        double r221411 = cos(r221405);
        double r221412 = r221410 / r221411;
        double r221413 = r221404 * r221406;
        double r221414 = r221412 * r221413;
        double r221415 = r221408 - r221414;
        double r221416 = r221415 * r221407;
        double r221417 = r221407 / r221416;
        double r221418 = r221417 * r221408;
        double r221419 = r221408 + r221413;
        double r221420 = r221419 * r221407;
        double r221421 = r221418 * r221420;
        double r221422 = a;
        double r221423 = tan(r221422);
        double r221424 = r221421 - r221423;
        double r221425 = r221402 + r221424;
        return r221425;
}

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.1

    \[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{\color{blue}{\frac{\tan y \cdot \tan y - \tan z \cdot \tan z}{\tan y - \tan z}}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  6. Applied associate-/l/0.2

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

    \[\leadsto x + \left(\frac{\tan y \cdot \tan y - \tan z \cdot \tan z}{\left(1 - \tan y \cdot \tan z\right) \cdot \color{blue}{\frac{\tan y \cdot \tan y - \tan z \cdot \tan z}{\tan y + \tan z}}} - \tan a\right)\]
  9. Applied flip--3.8

    \[\leadsto x + \left(\frac{\tan y \cdot \tan y - \tan z \cdot \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}} \cdot \frac{\tan y \cdot \tan y - \tan z \cdot \tan z}{\tan y + \tan z}} - \tan a\right)\]
  10. Applied frac-times3.8

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019318 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :precision binary64
  :pre (and (or (== x 0.0) (<= 0.588414199999999998 x 505.590899999999976)) (or (<= -1.79665800000000009e308 y -9.425585000000013e-310) (<= 1.284938e-309 y 1.75122399999999993e308)) (or (<= -1.776707e308 z -8.59979600000002e-310) (<= 3.29314499999998e-311 z 1.72515400000000009e308)) (or (<= -1.79665800000000009e308 a -9.425585000000013e-310) (<= 1.284938e-309 a 1.75122399999999993e308)))
  (+ x (- (tan (+ y z)) (tan a))))