Average Error: 13.3 → 0.2
Time: 34.1s
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)\]
\[\left(\frac{\tan y + \tan z}{1 - \frac{\left(\tan y \cdot \sin z\right) \cdot \left(\tan y \cdot \sin z\right)}{\cos z \cdot \cos z} \cdot \left(\tan z \cdot \tan y\right)} \cdot \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) - \tan a\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(\frac{\tan y + \tan z}{1 - \frac{\left(\tan y \cdot \sin z\right) \cdot \left(\tan y \cdot \sin z\right)}{\cos z \cdot \cos z} \cdot \left(\tan z \cdot \tan y\right)} \cdot \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) - \tan a\right) + x
double f(double x, double y, double z, double a) {
        double r2877350 = x;
        double r2877351 = y;
        double r2877352 = z;
        double r2877353 = r2877351 + r2877352;
        double r2877354 = tan(r2877353);
        double r2877355 = a;
        double r2877356 = tan(r2877355);
        double r2877357 = r2877354 - r2877356;
        double r2877358 = r2877350 + r2877357;
        return r2877358;
}

double f(double x, double y, double z, double a) {
        double r2877359 = y;
        double r2877360 = tan(r2877359);
        double r2877361 = z;
        double r2877362 = tan(r2877361);
        double r2877363 = r2877360 + r2877362;
        double r2877364 = 1.0;
        double r2877365 = sin(r2877361);
        double r2877366 = r2877360 * r2877365;
        double r2877367 = r2877366 * r2877366;
        double r2877368 = cos(r2877361);
        double r2877369 = r2877368 * r2877368;
        double r2877370 = r2877367 / r2877369;
        double r2877371 = r2877362 * r2877360;
        double r2877372 = r2877370 * r2877371;
        double r2877373 = r2877364 - r2877372;
        double r2877374 = r2877363 / r2877373;
        double r2877375 = r2877371 * r2877371;
        double r2877376 = r2877371 + r2877375;
        double r2877377 = r2877376 + r2877364;
        double r2877378 = r2877374 * r2877377;
        double r2877379 = a;
        double r2877380 = tan(r2877379);
        double r2877381 = r2877378 - r2877380;
        double r2877382 = x;
        double r2877383 = r2877381 + r2877382;
        return r2877383;
}

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 y \cdot \tan z\right) \cdot \left(\left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\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 y \cdot \tan z\right) \cdot \left(\left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \color{blue}{\frac{\sin z}{\cos z}}\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-*r/0.2

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \left(\tan y \cdot \tan z\right) \cdot \left(\left(\tan y \cdot \tan z\right) \cdot \color{blue}{\frac{\tan y \cdot \sin z}{\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 y \cdot \tan z\right) \cdot \left(\left(\tan y \cdot \color{blue}{\frac{\sin z}{\cos z}}\right) \cdot \frac{\tan y \cdot \sin z}{\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-*r/0.2

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \left(\tan y \cdot \tan z\right) \cdot \left(\color{blue}{\frac{\tan y \cdot \sin z}{\cos z}} \cdot \frac{\tan y \cdot \sin z}{\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 y \cdot \tan z\right) \cdot \color{blue}{\frac{\left(\tan y \cdot \sin z\right) \cdot \left(\tan y \cdot \sin z\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 \left(\frac{\tan y + \tan z}{1 - \frac{\left(\tan y \cdot \sin z\right) \cdot \left(\tan y \cdot \sin z\right)}{\cos z \cdot \cos z} \cdot \left(\tan z \cdot \tan y\right)} \cdot \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) - \tan a\right) + x\]

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))))