Average Error: 13.2 → 0.2
Time: 37.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)\]
\[\left(\mathsf{fma}\left(\mathsf{fma}\left(\sin y, \cos z, \cos y \cdot \sin z\right), \frac{\frac{1}{\cos z \cdot \cos y}}{1 - \tan y \cdot \tan z}, -\tan a\right) + x\right) + \mathsf{fma}\left(-\sqrt[3]{\tan a}, \sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}, \sqrt[3]{\tan a} \cdot \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right)\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(\mathsf{fma}\left(\mathsf{fma}\left(\sin y, \cos z, \cos y \cdot \sin z\right), \frac{\frac{1}{\cos z \cdot \cos y}}{1 - \tan y \cdot \tan z}, -\tan a\right) + x\right) + \mathsf{fma}\left(-\sqrt[3]{\tan a}, \sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}, \sqrt[3]{\tan a} \cdot \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right)\right)
double f(double x, double y, double z, double a) {
        double r106739 = x;
        double r106740 = y;
        double r106741 = z;
        double r106742 = r106740 + r106741;
        double r106743 = tan(r106742);
        double r106744 = a;
        double r106745 = tan(r106744);
        double r106746 = r106743 - r106745;
        double r106747 = r106739 + r106746;
        return r106747;
}

double f(double x, double y, double z, double a) {
        double r106748 = y;
        double r106749 = sin(r106748);
        double r106750 = z;
        double r106751 = cos(r106750);
        double r106752 = cos(r106748);
        double r106753 = sin(r106750);
        double r106754 = r106752 * r106753;
        double r106755 = fma(r106749, r106751, r106754);
        double r106756 = 1.0;
        double r106757 = r106751 * r106752;
        double r106758 = r106756 / r106757;
        double r106759 = tan(r106748);
        double r106760 = tan(r106750);
        double r106761 = r106759 * r106760;
        double r106762 = r106756 - r106761;
        double r106763 = r106758 / r106762;
        double r106764 = a;
        double r106765 = tan(r106764);
        double r106766 = -r106765;
        double r106767 = fma(r106755, r106763, r106766);
        double r106768 = x;
        double r106769 = r106767 + r106768;
        double r106770 = cbrt(r106765);
        double r106771 = -r106770;
        double r106772 = r106770 * r106770;
        double r106773 = r106770 * r106772;
        double r106774 = fma(r106771, r106772, r106773);
        double r106775 = r106769 + r106774;
        return r106775;
}

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 + \color{blue}{\frac{\sin z}{\cos z}}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  6. Applied tan-quot0.2

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

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

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

    \[\leadsto x + \left(\frac{\frac{\mathsf{fma}\left(\sin y, \cos z, \cos y \cdot \sin z\right)}{\color{blue}{\cos z \cdot \cos y}}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  10. Using strategy rm
  11. Applied add-cube-cbrt0.3

    \[\leadsto x + \left(\frac{\frac{\mathsf{fma}\left(\sin y, \cos z, \cos y \cdot \sin z\right)}{\cos z \cdot \cos y}}{1 - \tan y \cdot \tan z} - \color{blue}{\left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}}\right)\]
  12. Applied *-un-lft-identity0.3

    \[\leadsto x + \left(\frac{\frac{\mathsf{fma}\left(\sin y, \cos z, \cos y \cdot \sin z\right)}{\cos z \cdot \cos y}}{\color{blue}{1 \cdot \left(1 - \tan y \cdot \tan z\right)}} - \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}\right)\]
  13. Applied div-inv0.3

    \[\leadsto x + \left(\frac{\color{blue}{\mathsf{fma}\left(\sin y, \cos z, \cos y \cdot \sin z\right) \cdot \frac{1}{\cos z \cdot \cos y}}}{1 \cdot \left(1 - \tan y \cdot \tan z\right)} - \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}\right)\]
  14. Applied times-frac0.3

    \[\leadsto x + \left(\color{blue}{\frac{\mathsf{fma}\left(\sin y, \cos z, \cos y \cdot \sin z\right)}{1} \cdot \frac{\frac{1}{\cos z \cdot \cos y}}{1 - \tan y \cdot \tan z}} - \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}\right)\]
  15. Applied prod-diff0.3

    \[\leadsto x + \color{blue}{\left(\mathsf{fma}\left(\frac{\mathsf{fma}\left(\sin y, \cos z, \cos y \cdot \sin z\right)}{1}, \frac{\frac{1}{\cos z \cdot \cos y}}{1 - \tan y \cdot \tan z}, -\sqrt[3]{\tan a} \cdot \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{\tan a}, \sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}, \sqrt[3]{\tan a} \cdot \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right)\right)\right)}\]
  16. Applied associate-+r+0.3

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

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

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

Reproduce

herbie shell --seed 2019209 +o rules:numerics
(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))))