Average Error: 13.1 → 0.2
Time: 10.7s
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.751224000000000127647232028319723370461 \cdot 10^{308}\right) \land \left(-1.776707000000000200843839711454021982841 \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.751224000000000127647232028319723370461 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[x + \frac{\frac{\left(\tan y \cdot \tan y - \tan z \cdot \tan z\right) \cdot \cos a}{\tan y - \tan z} - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \frac{\frac{\left(\tan y \cdot \tan y - \tan z \cdot \tan z\right) \cdot \cos a}{\tan y - \tan z} - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}
double f(double x, double y, double z, double a) {
        double r194395 = x;
        double r194396 = y;
        double r194397 = z;
        double r194398 = r194396 + r194397;
        double r194399 = tan(r194398);
        double r194400 = a;
        double r194401 = tan(r194400);
        double r194402 = r194399 - r194401;
        double r194403 = r194395 + r194402;
        return r194403;
}

double f(double x, double y, double z, double a) {
        double r194404 = x;
        double r194405 = y;
        double r194406 = tan(r194405);
        double r194407 = r194406 * r194406;
        double r194408 = z;
        double r194409 = tan(r194408);
        double r194410 = r194409 * r194409;
        double r194411 = r194407 - r194410;
        double r194412 = a;
        double r194413 = cos(r194412);
        double r194414 = r194411 * r194413;
        double r194415 = r194406 - r194409;
        double r194416 = r194414 / r194415;
        double r194417 = 1.0;
        double r194418 = r194406 * r194409;
        double r194419 = r194417 - r194418;
        double r194420 = sin(r194412);
        double r194421 = r194419 * r194420;
        double r194422 = r194416 - r194421;
        double r194423 = r194419 * r194413;
        double r194424 = r194422 / r194423;
        double r194425 = r194404 + r194424;
        return r194425;
}

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019354 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :precision binary64
  :pre (and (or (== x 0.0) (<= 0.5884142 x 505.5909)) (or (<= -1.796658e+308 y -9.425585e-310) (<= 1.284938e-309 y 1.7512240000000001e+308)) (or (<= -1.7767070000000002e+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.7512240000000001e+308)))
  (+ x (- (tan (+ y z)) (tan a))))