Average Error: 13.2 → 0.3
Time: 27.1s
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(\left(\tan y \cdot \tan y - \tan z \cdot \tan z\right) \cdot \cos a\right) \cdot \frac{1}{\tan y - \tan z} - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \frac{\left(\left(\tan y \cdot \tan y - \tan z \cdot \tan z\right) \cdot \cos a\right) \cdot \frac{1}{\tan y - \tan z} - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}
double f(double x, double y, double z, double a) {
        double r136924 = x;
        double r136925 = y;
        double r136926 = z;
        double r136927 = r136925 + r136926;
        double r136928 = tan(r136927);
        double r136929 = a;
        double r136930 = tan(r136929);
        double r136931 = r136928 - r136930;
        double r136932 = r136924 + r136931;
        return r136932;
}

double f(double x, double y, double z, double a) {
        double r136933 = x;
        double r136934 = y;
        double r136935 = tan(r136934);
        double r136936 = r136935 * r136935;
        double r136937 = z;
        double r136938 = tan(r136937);
        double r136939 = r136938 * r136938;
        double r136940 = r136936 - r136939;
        double r136941 = a;
        double r136942 = cos(r136941);
        double r136943 = r136940 * r136942;
        double r136944 = 1.0;
        double r136945 = r136935 - r136938;
        double r136946 = r136944 / r136945;
        double r136947 = r136943 * r136946;
        double r136948 = r136935 * r136938;
        double r136949 = r136944 - r136948;
        double r136950 = sin(r136941);
        double r136951 = r136949 * r136950;
        double r136952 = r136947 - r136951;
        double r136953 = r136949 * r136942;
        double r136954 = r136952 / r136953;
        double r136955 = r136933 + r136954;
        return r136955;
}

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.2

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

    \[\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 flip-+0.2

    \[\leadsto x + \frac{\color{blue}{\frac{\tan y \cdot \tan y - \tan z \cdot \tan z}{\tan y - \tan z}} \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}\]
  8. Applied associate-*l/0.2

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

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

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

Reproduce

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