Average Error: 13.1 → 0.2
Time: 39.9s
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(0 \cdot \tan a + \left(\mathsf{fma}\left(\mathsf{fma}\left(\tan z \cdot \tan y, \tan z \cdot \tan y, \tan z \cdot \tan y\right), \frac{\tan y + \tan z}{1 - \left(\left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) \cdot \left(\tan z \cdot \tan y\right)}, \frac{\tan y + \tan z}{1 - \sqrt[3]{\left(\left(\left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) \cdot \left(\tan z \cdot \tan y\right)\right) \cdot \left(\left(\left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) \cdot \left(\tan z \cdot \tan y\right)\right)} \cdot \left(\tan z \cdot \tan y\right)}\right) - \tan a\right)\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(0 \cdot \tan a + \left(\mathsf{fma}\left(\mathsf{fma}\left(\tan z \cdot \tan y, \tan z \cdot \tan y, \tan z \cdot \tan y\right), \frac{\tan y + \tan z}{1 - \left(\left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) \cdot \left(\tan z \cdot \tan y\right)}, \frac{\tan y + \tan z}{1 - \sqrt[3]{\left(\left(\left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) \cdot \left(\tan z \cdot \tan y\right)\right) \cdot \left(\left(\left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) \cdot \left(\tan z \cdot \tan y\right)\right)} \cdot \left(\tan z \cdot \tan y\right)}\right) - \tan a\right)\right) + x
double f(double x, double y, double z, double a) {
        double r4729652 = x;
        double r4729653 = y;
        double r4729654 = z;
        double r4729655 = r4729653 + r4729654;
        double r4729656 = tan(r4729655);
        double r4729657 = a;
        double r4729658 = tan(r4729657);
        double r4729659 = r4729656 - r4729658;
        double r4729660 = r4729652 + r4729659;
        return r4729660;
}

double f(double x, double y, double z, double a) {
        double r4729661 = 0.0;
        double r4729662 = a;
        double r4729663 = tan(r4729662);
        double r4729664 = r4729661 * r4729663;
        double r4729665 = z;
        double r4729666 = tan(r4729665);
        double r4729667 = y;
        double r4729668 = tan(r4729667);
        double r4729669 = r4729666 * r4729668;
        double r4729670 = fma(r4729669, r4729669, r4729669);
        double r4729671 = r4729668 + r4729666;
        double r4729672 = 1.0;
        double r4729673 = r4729669 * r4729669;
        double r4729674 = r4729673 * r4729669;
        double r4729675 = r4729672 - r4729674;
        double r4729676 = r4729671 / r4729675;
        double r4729677 = r4729674 * r4729674;
        double r4729678 = cbrt(r4729677);
        double r4729679 = r4729678 * r4729669;
        double r4729680 = r4729672 - r4729679;
        double r4729681 = r4729671 / r4729680;
        double r4729682 = fma(r4729670, r4729676, r4729681);
        double r4729683 = r4729682 - r4729663;
        double r4729684 = r4729664 + r4729683;
        double r4729685 = x;
        double r4729686 = r4729684 + r4729685;
        return r4729686;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Derivation

  1. Initial program 13.1

    \[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 flip3--0.3

    \[\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)}}} - \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}\right)\]
  7. Applied associate-/r/0.3

    \[\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)} - \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}\right)\]
  8. Applied prod-diff0.3

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

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

    \[\leadsto x + \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(\tan y \cdot \tan z, \tan y \cdot \tan z, \tan y \cdot \tan z\right), \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)}, \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)}\right) - \tan a\right) + \color{blue}{\tan a \cdot 0}\right)\]
  11. Using strategy rm
  12. Applied add-cbrt-cube0.2

    \[\leadsto x + \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(\tan y \cdot \tan z, \tan y \cdot \tan z, \tan y \cdot \tan z\right), \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)}, \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}{\sqrt[3]{\left(\left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)\right) \cdot \left(\tan y \cdot \tan z\right)}}\right)}\right) - \tan a\right) + \tan a \cdot 0\right)\]
  13. Applied add-cbrt-cube0.2

    \[\leadsto x + \left(\left(\mathsf{fma}\left(\mathsf{fma}\left(\tan y \cdot \tan z, \tan y \cdot \tan z, \tan y \cdot \tan z\right), \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)}, \frac{\tan y + \tan z}{1 - \left(\tan y \cdot \tan z\right) \cdot \left(\color{blue}{\sqrt[3]{\left(\left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)\right) \cdot \left(\tan y \cdot \tan z\right)}} \cdot \sqrt[3]{\left(\left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)\right) \cdot \left(\tan y \cdot \tan z\right)}\right)}\right) - \tan a\right) + \tan a \cdot 0\right)\]
  14. Applied cbrt-unprod0.2

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

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

Reproduce

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