Average Error: 13.2 → 0.2
Time: 2.2m
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)\]
\[0 \cdot \tan a + \left(\mathsf{fma}\left(\left(\frac{\tan y + \tan z}{1 - {\left(\frac{\tan y \cdot \sin z}{\cos z}\right)}^{3}}\right), \left(1 + \left(\frac{\tan y \cdot \sin z}{\cos z} \cdot \frac{\tan y \cdot \sin z}{\cos z} + \frac{\sqrt[3]{\tan y \cdot \sin z} \cdot \left(\sqrt[3]{\tan y \cdot \sin z} \cdot \sqrt[3]{\tan y \cdot \sin z}\right)}{\cos z}\right)\right), \left(-\tan a\right)\right) + x\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
0 \cdot \tan a + \left(\mathsf{fma}\left(\left(\frac{\tan y + \tan z}{1 - {\left(\frac{\tan y \cdot \sin z}{\cos z}\right)}^{3}}\right), \left(1 + \left(\frac{\tan y \cdot \sin z}{\cos z} \cdot \frac{\tan y \cdot \sin z}{\cos z} + \frac{\sqrt[3]{\tan y \cdot \sin z} \cdot \left(\sqrt[3]{\tan y \cdot \sin z} \cdot \sqrt[3]{\tan y \cdot \sin z}\right)}{\cos z}\right)\right), \left(-\tan a\right)\right) + x\right)
double f(double x, double y, double z, double a) {
        double r30426836 = x;
        double r30426837 = y;
        double r30426838 = z;
        double r30426839 = r30426837 + r30426838;
        double r30426840 = tan(r30426839);
        double r30426841 = a;
        double r30426842 = tan(r30426841);
        double r30426843 = r30426840 - r30426842;
        double r30426844 = r30426836 + r30426843;
        return r30426844;
}

double f(double x, double y, double z, double a) {
        double r30426845 = 0.0;
        double r30426846 = a;
        double r30426847 = tan(r30426846);
        double r30426848 = r30426845 * r30426847;
        double r30426849 = y;
        double r30426850 = tan(r30426849);
        double r30426851 = z;
        double r30426852 = tan(r30426851);
        double r30426853 = r30426850 + r30426852;
        double r30426854 = 1.0;
        double r30426855 = sin(r30426851);
        double r30426856 = r30426850 * r30426855;
        double r30426857 = cos(r30426851);
        double r30426858 = r30426856 / r30426857;
        double r30426859 = 3.0;
        double r30426860 = pow(r30426858, r30426859);
        double r30426861 = r30426854 - r30426860;
        double r30426862 = r30426853 / r30426861;
        double r30426863 = r30426858 * r30426858;
        double r30426864 = cbrt(r30426856);
        double r30426865 = r30426864 * r30426864;
        double r30426866 = r30426864 * r30426865;
        double r30426867 = r30426866 / r30426857;
        double r30426868 = r30426863 + r30426867;
        double r30426869 = r30426854 + r30426868;
        double r30426870 = -r30426847;
        double r30426871 = fma(r30426862, r30426869, r30426870);
        double r30426872 = x;
        double r30426873 = r30426871 + r30426872;
        double r30426874 = r30426848 + r30426873;
        return r30426874;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Derivation

  1. Initial program 13.2

    \[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 *-un-lft-identity0.2

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \frac{\tan y \cdot \sin z}{\cos z}} - \color{blue}{1 \cdot \tan a}\right)\]
  9. 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)}}} - 1 \cdot \tan a\right)\]
  10. 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)} - 1 \cdot \tan a\right)\]
  11. Applied prod-diff0.2

    \[\leadsto x + \color{blue}{\left(\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 \cdot 1\right)\right) + \mathsf{fma}\left(\left(-\tan a\right), 1, \left(\tan a \cdot 1\right)\right)\right)}\]
  12. Applied associate-+r+0.2

    \[\leadsto \color{blue}{\left(x + \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 \cdot 1\right)\right)\right) + \mathsf{fma}\left(\left(-\tan a\right), 1, \left(\tan a \cdot 1\right)\right)}\]
  13. Simplified0.2

    \[\leadsto \left(x + \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 \cdot 1\right)\right)\right) + \color{blue}{\tan a \cdot 0}\]
  14. Using strategy rm
  15. Applied add-cube-cbrt0.2

    \[\leadsto \left(x + \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{\color{blue}{\left(\sqrt[3]{\tan y \cdot \sin z} \cdot \sqrt[3]{\tan y \cdot \sin z}\right) \cdot \sqrt[3]{\tan y \cdot \sin z}}}{\cos z}\right)\right), \left(-\tan a \cdot 1\right)\right)\right) + \tan a \cdot 0\]
  16. Final simplification0.2

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

Reproduce

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