Average Error: 13.2 → 0.3
Time: 28.9s
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{\frac{\sin z}{\cos z} + \frac{\sin y}{\cos y}}{1 - \log \left({\left(e^{\tan y}\right)}^{\left(\tan z\right)}\right)}\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x - \left(\tan a - \frac{\frac{\sin z}{\cos z} + \frac{\sin y}{\cos y}}{1 - \log \left({\left(e^{\tan y}\right)}^{\left(\tan z\right)}\right)}\right)
double f(double x, double y, double z, double a) {
        double r100229 = x;
        double r100230 = y;
        double r100231 = z;
        double r100232 = r100230 + r100231;
        double r100233 = tan(r100232);
        double r100234 = a;
        double r100235 = tan(r100234);
        double r100236 = r100233 - r100235;
        double r100237 = r100229 + r100236;
        return r100237;
}

double f(double x, double y, double z, double a) {
        double r100238 = x;
        double r100239 = a;
        double r100240 = tan(r100239);
        double r100241 = z;
        double r100242 = sin(r100241);
        double r100243 = cos(r100241);
        double r100244 = r100242 / r100243;
        double r100245 = y;
        double r100246 = sin(r100245);
        double r100247 = cos(r100245);
        double r100248 = r100246 / r100247;
        double r100249 = r100244 + r100248;
        double r100250 = 1.0;
        double r100251 = tan(r100245);
        double r100252 = exp(r100251);
        double r100253 = tan(r100241);
        double r100254 = pow(r100252, r100253);
        double r100255 = log(r100254);
        double r100256 = r100250 - r100255;
        double r100257 = r100249 / r100256;
        double r100258 = r100240 - r100257;
        double r100259 = r100238 - r100258;
        return r100259;
}

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

    \[\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{\color{blue}{\tan z + \tan y}}{1 - \tan y \cdot \tan z}\right)\]
  6. Simplified0.2

    \[\leadsto x - \left(\tan a - \frac{\tan z + \tan y}{\color{blue}{1 - \tan z \cdot \tan y}}\right)\]
  7. Taylor expanded around inf 0.2

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

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

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

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

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

Reproduce

herbie shell --seed 2019195 +o rules:numerics
(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))))