Average Error: 13.2 → 0.2
Time: 21.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(\tan y + \tan z\right) \cdot \cos a - \left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\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(\tan y + \tan z\right) \cdot \cos a - \left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\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 r111727 = x;
        double r111728 = y;
        double r111729 = z;
        double r111730 = r111728 + r111729;
        double r111731 = tan(r111730);
        double r111732 = a;
        double r111733 = tan(r111732);
        double r111734 = r111731 - r111733;
        double r111735 = r111727 + r111734;
        return r111735;
}

double f(double x, double y, double z, double a) {
        double r111736 = x;
        double r111737 = y;
        double r111738 = tan(r111737);
        double r111739 = z;
        double r111740 = tan(r111739);
        double r111741 = r111738 + r111740;
        double r111742 = a;
        double r111743 = cos(r111742);
        double r111744 = r111741 * r111743;
        double r111745 = 1.0;
        double r111746 = sin(r111737);
        double r111747 = sin(r111739);
        double r111748 = r111746 * r111747;
        double r111749 = cos(r111739);
        double r111750 = cos(r111737);
        double r111751 = r111749 * r111750;
        double r111752 = r111748 / r111751;
        double r111753 = r111745 - r111752;
        double r111754 = sin(r111742);
        double r111755 = r111753 * r111754;
        double r111756 = r111744 - r111755;
        double r111757 = r111738 * r111740;
        double r111758 = r111745 - r111757;
        double r111759 = r111758 * r111743;
        double r111760 = r111756 / r111759;
        double r111761 = r111736 + r111760;
        return r111761;
}

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. Taylor expanded around inf 0.2

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

    \[\leadsto x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\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))))