Average Error: 13.4 → 0.2
Time: 27.4s
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 + \frac{\left(\tan z + \tan y\right) - \frac{\left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\cos a}}{1 - \frac{\sin y \cdot \tan z}{\cos y} \cdot \frac{\sin y \cdot \tan z}{\cos y}} \cdot \left(1 + \frac{\sin y \cdot \tan z}{\cos y}\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \frac{\left(\tan z + \tan y\right) - \frac{\left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\cos a}}{1 - \frac{\sin y \cdot \tan z}{\cos y} \cdot \frac{\sin y \cdot \tan z}{\cos y}} \cdot \left(1 + \frac{\sin y \cdot \tan z}{\cos y}\right)
double f(double x, double y, double z, double a) {
        double r122869 = x;
        double r122870 = y;
        double r122871 = z;
        double r122872 = r122870 + r122871;
        double r122873 = tan(r122872);
        double r122874 = a;
        double r122875 = tan(r122874);
        double r122876 = r122873 - r122875;
        double r122877 = r122869 + r122876;
        return r122877;
}

double f(double x, double y, double z, double a) {
        double r122878 = x;
        double r122879 = z;
        double r122880 = tan(r122879);
        double r122881 = y;
        double r122882 = tan(r122881);
        double r122883 = r122880 + r122882;
        double r122884 = 1.0;
        double r122885 = r122882 * r122880;
        double r122886 = r122884 - r122885;
        double r122887 = a;
        double r122888 = sin(r122887);
        double r122889 = r122886 * r122888;
        double r122890 = cos(r122887);
        double r122891 = r122889 / r122890;
        double r122892 = r122883 - r122891;
        double r122893 = sin(r122881);
        double r122894 = r122893 * r122880;
        double r122895 = cos(r122881);
        double r122896 = r122894 / r122895;
        double r122897 = r122896 * r122896;
        double r122898 = r122884 - r122897;
        double r122899 = r122892 / r122898;
        double r122900 = r122884 + r122896;
        double r122901 = r122899 * r122900;
        double r122902 = r122878 + r122901;
        return r122902;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 13.4

    \[x + \left(\tan \left(y + z\right) - \tan a\right)\]
  2. Using strategy rm
  3. Applied tan-quot13.4

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

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019304 
(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))))