Average Error: 13.2 → 0.2
Time: 35.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{\tan y + \tan z}{1 - \frac{\log \left(e^{\sin y \cdot \tan z}\right)}{\cos y}} - \tan a\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\frac{\tan y + \tan z}{1 - \frac{\log \left(e^{\sin y \cdot \tan z}\right)}{\cos y}} - \tan a\right)
double f(double x, double y, double z, double a) {
        double r147951 = x;
        double r147952 = y;
        double r147953 = z;
        double r147954 = r147952 + r147953;
        double r147955 = tan(r147954);
        double r147956 = a;
        double r147957 = tan(r147956);
        double r147958 = r147955 - r147957;
        double r147959 = r147951 + r147958;
        return r147959;
}

double f(double x, double y, double z, double a) {
        double r147960 = x;
        double r147961 = y;
        double r147962 = tan(r147961);
        double r147963 = z;
        double r147964 = tan(r147963);
        double r147965 = r147962 + r147964;
        double r147966 = 1.0;
        double r147967 = sin(r147961);
        double r147968 = r147967 * r147964;
        double r147969 = exp(r147968);
        double r147970 = log(r147969);
        double r147971 = cos(r147961);
        double r147972 = r147970 / r147971;
        double r147973 = r147966 - r147972;
        double r147974 = r147965 / r147973;
        double r147975 = a;
        double r147976 = tan(r147975);
        double r147977 = r147974 - r147976;
        double r147978 = r147960 + r147977;
        return r147978;
}

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

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

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

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

Reproduce

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