Average Error: 13.0 → 0.2
Time: 38.8s
Precision: 64
\[\left(x = 0 \lor 0.5884142 \le x \le 505.5909\right) \land \left(-1.796658 \cdot 10^{+308} \le y \le -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le y \le 1.751224 \cdot 10^{+308}\right) \land \left(-1.776707 \cdot 10^{+308} \le z \le -8.599796 \cdot 10^{-310} \lor 3.293145 \cdot 10^{-311} \le z \le 1.725154 \cdot 10^{+308}\right) \land \left(-1.796658 \cdot 10^{+308} \le a \le -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le a \le 1.751224 \cdot 10^{+308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\left(\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \tan z}{\cos y}} - \tan a\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \tan z}{\cos y}} - \tan a\right) + x
double f(double x, double y, double z, double a) {
        double r5587234 = x;
        double r5587235 = y;
        double r5587236 = z;
        double r5587237 = r5587235 + r5587236;
        double r5587238 = tan(r5587237);
        double r5587239 = a;
        double r5587240 = tan(r5587239);
        double r5587241 = r5587238 - r5587240;
        double r5587242 = r5587234 + r5587241;
        return r5587242;
}

double f(double x, double y, double z, double a) {
        double r5587243 = y;
        double r5587244 = tan(r5587243);
        double r5587245 = z;
        double r5587246 = tan(r5587245);
        double r5587247 = r5587244 + r5587246;
        double r5587248 = 1.0;
        double r5587249 = sin(r5587243);
        double r5587250 = r5587249 * r5587246;
        double r5587251 = cos(r5587243);
        double r5587252 = r5587250 / r5587251;
        double r5587253 = r5587248 - r5587252;
        double r5587254 = r5587247 / r5587253;
        double r5587255 = a;
        double r5587256 = tan(r5587255);
        double r5587257 = r5587254 - r5587256;
        double r5587258 = x;
        double r5587259 = r5587257 + r5587258;
        return r5587259;
}

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

    \[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. Final simplification0.2

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

Reproduce

herbie shell --seed 2019146 +o rules:numerics
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :pre (and (or (== x 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))))