Average Error: 13.5 → 0.2
Time: 31.5s
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(\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a\right) \cdot \frac{1}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a\right) \cdot \frac{1}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}
double f(double x, double y, double z, double a) {
        double r214034 = x;
        double r214035 = y;
        double r214036 = z;
        double r214037 = r214035 + r214036;
        double r214038 = tan(r214037);
        double r214039 = a;
        double r214040 = tan(r214039);
        double r214041 = r214038 - r214040;
        double r214042 = r214034 + r214041;
        return r214042;
}

double f(double x, double y, double z, double a) {
        double r214043 = x;
        double r214044 = y;
        double r214045 = tan(r214044);
        double r214046 = z;
        double r214047 = tan(r214046);
        double r214048 = r214045 + r214047;
        double r214049 = a;
        double r214050 = cos(r214049);
        double r214051 = r214048 * r214050;
        double r214052 = 1.0;
        double r214053 = r214045 * r214047;
        double r214054 = r214052 - r214053;
        double r214055 = sin(r214049);
        double r214056 = r214054 * r214055;
        double r214057 = r214051 - r214056;
        double r214058 = r214054 * r214050;
        double r214059 = r214052 / r214058;
        double r214060 = r214057 * r214059;
        double r214061 = r214043 + r214060;
        return r214061;
}

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

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

    \[\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 div-inv0.2

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

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

Reproduce

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