Average Error: 13.3 → 0.2
Time: 1.1m
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)\]
\[\frac{\cos a \cdot \left(\tan y + \tan z\right) - \sin a \cdot \left(1 - \sqrt[3]{\tan z \cdot \tan y} \cdot \left(\sqrt[3]{\tan z \cdot \tan y} \cdot \sqrt[3]{\tan z \cdot \tan y}\right)\right)}{\cos a \cdot \left(1 - \tan z \cdot \tan y\right)} + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\frac{\cos a \cdot \left(\tan y + \tan z\right) - \sin a \cdot \left(1 - \sqrt[3]{\tan z \cdot \tan y} \cdot \left(\sqrt[3]{\tan z \cdot \tan y} \cdot \sqrt[3]{\tan z \cdot \tan y}\right)\right)}{\cos a \cdot \left(1 - \tan z \cdot \tan y\right)} + x
double f(double x, double y, double z, double a) {
        double r4895293 = x;
        double r4895294 = y;
        double r4895295 = z;
        double r4895296 = r4895294 + r4895295;
        double r4895297 = tan(r4895296);
        double r4895298 = a;
        double r4895299 = tan(r4895298);
        double r4895300 = r4895297 - r4895299;
        double r4895301 = r4895293 + r4895300;
        return r4895301;
}

double f(double x, double y, double z, double a) {
        double r4895302 = a;
        double r4895303 = cos(r4895302);
        double r4895304 = y;
        double r4895305 = tan(r4895304);
        double r4895306 = z;
        double r4895307 = tan(r4895306);
        double r4895308 = r4895305 + r4895307;
        double r4895309 = r4895303 * r4895308;
        double r4895310 = sin(r4895302);
        double r4895311 = 1.0;
        double r4895312 = r4895307 * r4895305;
        double r4895313 = cbrt(r4895312);
        double r4895314 = r4895313 * r4895313;
        double r4895315 = r4895313 * r4895314;
        double r4895316 = r4895311 - r4895315;
        double r4895317 = r4895310 * r4895316;
        double r4895318 = r4895309 - r4895317;
        double r4895319 = r4895311 - r4895312;
        double r4895320 = r4895303 * r4895319;
        double r4895321 = r4895318 / r4895320;
        double r4895322 = x;
        double r4895323 = r4895321 + r4895322;
        return r4895323;
}

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

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

    \[\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 add-cube-cbrt0.2

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

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

Reproduce

herbie shell --seed 2019141 +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))))