Average Error: 13.0 → 0.2
Time: 38.3s
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)\]
\[x + \left(\frac{\sin y \cdot \cos z + \cos y \cdot \sin z}{\mathsf{fma}\left(-\tan y, \tan z, 1\right) \cdot \left(\cos y \cdot \cos z\right)} - \tan a\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\frac{\sin y \cdot \cos z + \cos y \cdot \sin z}{\mathsf{fma}\left(-\tan y, \tan z, 1\right) \cdot \left(\cos y \cdot \cos z\right)} - \tan a\right)
double f(double x, double y, double z, double a) {
        double r86691 = x;
        double r86692 = y;
        double r86693 = z;
        double r86694 = r86692 + r86693;
        double r86695 = tan(r86694);
        double r86696 = a;
        double r86697 = tan(r86696);
        double r86698 = r86695 - r86697;
        double r86699 = r86691 + r86698;
        return r86699;
}

double f(double x, double y, double z, double a) {
        double r86700 = x;
        double r86701 = y;
        double r86702 = sin(r86701);
        double r86703 = z;
        double r86704 = cos(r86703);
        double r86705 = r86702 * r86704;
        double r86706 = cos(r86701);
        double r86707 = sin(r86703);
        double r86708 = r86706 * r86707;
        double r86709 = r86705 + r86708;
        double r86710 = tan(r86701);
        double r86711 = -r86710;
        double r86712 = tan(r86703);
        double r86713 = 1.0;
        double r86714 = fma(r86711, r86712, r86713);
        double r86715 = r86706 * r86704;
        double r86716 = r86714 * r86715;
        double r86717 = r86709 / r86716;
        double r86718 = a;
        double r86719 = tan(r86718);
        double r86720 = r86717 - r86719;
        double r86721 = r86700 + r86720;
        return r86721;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Derivation

  1. Initial program 13.0

    \[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 add-cube-cbrt0.3

    \[\leadsto x + \left(\frac{\tan y + \tan z}{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)\]
  6. Applied add-sqr-sqrt31.5

    \[\leadsto x + \left(\color{blue}{\sqrt{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}} \cdot \sqrt{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}}} - \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}\right)\]
  7. Applied prod-diff31.5

    \[\leadsto x + \color{blue}{\left(\mathsf{fma}\left(\sqrt{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}}, \sqrt{\frac{\tan y + \tan z}{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)}\]
  8. Simplified0.2

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

    \[\leadsto x + \left(\left(\frac{\tan y + \tan z}{\mathsf{fma}\left(-\tan y, \tan z, 1\right)} - \tan a\right) + \color{blue}{0}\right)\]
  10. Using strategy rm
  11. Applied tan-quot0.2

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

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

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

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

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

Reproduce

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