Average Error: 13.1 → 0.2
Time: 34.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(\tan a - \frac{\tan y \cdot \tan y - \tan z \cdot \tan z}{\left(\tan y - \tan z\right) \cdot \left(1 - \tan z \cdot \tan y\right)}\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x - \left(\tan a - \frac{\tan y \cdot \tan y - \tan z \cdot \tan z}{\left(\tan y - \tan z\right) \cdot \left(1 - \tan z \cdot \tan y\right)}\right)
double f(double x, double y, double z, double a) {
        double r140128 = x;
        double r140129 = y;
        double r140130 = z;
        double r140131 = r140129 + r140130;
        double r140132 = tan(r140131);
        double r140133 = a;
        double r140134 = tan(r140133);
        double r140135 = r140132 - r140134;
        double r140136 = r140128 + r140135;
        return r140136;
}

double f(double x, double y, double z, double a) {
        double r140137 = x;
        double r140138 = a;
        double r140139 = tan(r140138);
        double r140140 = y;
        double r140141 = tan(r140140);
        double r140142 = r140141 * r140141;
        double r140143 = z;
        double r140144 = tan(r140143);
        double r140145 = r140144 * r140144;
        double r140146 = r140142 - r140145;
        double r140147 = r140141 - r140144;
        double r140148 = 1.0;
        double r140149 = r140144 * r140141;
        double r140150 = r140148 - r140149;
        double r140151 = r140147 * r140150;
        double r140152 = r140146 / r140151;
        double r140153 = r140139 - r140152;
        double r140154 = r140137 - r140153;
        return r140154;
}

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

    \[x + \left(\tan \left(y + z\right) - \tan a\right)\]
  2. Simplified13.1

    \[\leadsto \color{blue}{x - \left(\tan a - \tan \left(y + z\right)\right)}\]
  3. Using strategy rm
  4. Applied tan-sum0.2

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019194 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :pre (and (or (== x 0.0) (<= 0.5884142 x 505.5909)) (or (<= -1.796658e+308 y -9.425585e-310) (<= 1.284938e-309 y 1.751224e+308)) (or (<= -1.776707e+308 z -8.599796e-310) (<= 3.293145e-311 z 1.725154e+308)) (or (<= -1.796658e+308 a -9.425585e-310) (<= 1.284938e-309 a 1.751224e+308)))
  (+ x (- (tan (+ y z)) (tan a))))