Average Error: 13.3 → 0.2
Time: 38.3s
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)\]
\[\mathsf{fma}\left(\left(\frac{\tan y + \tan z}{1 - {\left(\frac{\tan y \cdot \sin z}{\cos z}\right)}^{3}}\right), \left(\left(\frac{\tan y \cdot \sin z}{\cos z} \cdot \frac{\tan y \cdot \sin z}{\cos z} + \frac{\tan y \cdot \sin z}{\cos z}\right) + 1\right), \left(-\tan a\right)\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\mathsf{fma}\left(\left(\frac{\tan y + \tan z}{1 - {\left(\frac{\tan y \cdot \sin z}{\cos z}\right)}^{3}}\right), \left(\left(\frac{\tan y \cdot \sin z}{\cos z} \cdot \frac{\tan y \cdot \sin z}{\cos z} + \frac{\tan y \cdot \sin z}{\cos z}\right) + 1\right), \left(-\tan a\right)\right) + x
double f(double x, double y, double z, double a) {
        double r3169303 = x;
        double r3169304 = y;
        double r3169305 = z;
        double r3169306 = r3169304 + r3169305;
        double r3169307 = tan(r3169306);
        double r3169308 = a;
        double r3169309 = tan(r3169308);
        double r3169310 = r3169307 - r3169309;
        double r3169311 = r3169303 + r3169310;
        return r3169311;
}

double f(double x, double y, double z, double a) {
        double r3169312 = y;
        double r3169313 = tan(r3169312);
        double r3169314 = z;
        double r3169315 = tan(r3169314);
        double r3169316 = r3169313 + r3169315;
        double r3169317 = 1.0;
        double r3169318 = sin(r3169314);
        double r3169319 = r3169313 * r3169318;
        double r3169320 = cos(r3169314);
        double r3169321 = r3169319 / r3169320;
        double r3169322 = 3.0;
        double r3169323 = pow(r3169321, r3169322);
        double r3169324 = r3169317 - r3169323;
        double r3169325 = r3169316 / r3169324;
        double r3169326 = r3169321 * r3169321;
        double r3169327 = r3169326 + r3169321;
        double r3169328 = r3169327 + r3169317;
        double r3169329 = a;
        double r3169330 = tan(r3169329);
        double r3169331 = -r3169330;
        double r3169332 = fma(r3169325, r3169328, r3169331);
        double r3169333 = x;
        double r3169334 = r3169332 + r3169333;
        return r3169334;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

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 tan-quot0.2

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

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

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

    \[\leadsto x + \left(\color{blue}{\frac{\tan y + \tan z}{{1}^{3} - {\left(\frac{\tan y \cdot \sin z}{\cos z}\right)}^{3}} \cdot \left(1 \cdot 1 + \left(\frac{\tan y \cdot \sin z}{\cos z} \cdot \frac{\tan y \cdot \sin z}{\cos z} + 1 \cdot \frac{\tan y \cdot \sin z}{\cos z}\right)\right)} - \tan a\right)\]
  10. Applied fma-neg0.2

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

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

Reproduce

herbie shell --seed 2019130 +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))))