Average Error: 13.1 → 0.2
Time: 31.3s
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 z + \tan y\right) - \sin a \cdot \left(1 - \tan y \cdot \tan z\right)}{\cos a \cdot \left(1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)\right)} \cdot \left(\tan y \cdot \tan z + 1\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\frac{\cos a \cdot \left(\tan z + \tan y\right) - \sin a \cdot \left(1 - \tan y \cdot \tan z\right)}{\cos a \cdot \left(1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)\right)} \cdot \left(\tan y \cdot \tan z + 1\right) + x
double f(double x, double y, double z, double a) {
        double r1928444 = x;
        double r1928445 = y;
        double r1928446 = z;
        double r1928447 = r1928445 + r1928446;
        double r1928448 = tan(r1928447);
        double r1928449 = a;
        double r1928450 = tan(r1928449);
        double r1928451 = r1928448 - r1928450;
        double r1928452 = r1928444 + r1928451;
        return r1928452;
}

double f(double x, double y, double z, double a) {
        double r1928453 = a;
        double r1928454 = cos(r1928453);
        double r1928455 = z;
        double r1928456 = tan(r1928455);
        double r1928457 = y;
        double r1928458 = tan(r1928457);
        double r1928459 = r1928456 + r1928458;
        double r1928460 = r1928454 * r1928459;
        double r1928461 = sin(r1928453);
        double r1928462 = 1.0;
        double r1928463 = r1928458 * r1928456;
        double r1928464 = r1928462 - r1928463;
        double r1928465 = r1928461 * r1928464;
        double r1928466 = r1928460 - r1928465;
        double r1928467 = r1928463 * r1928463;
        double r1928468 = r1928462 - r1928467;
        double r1928469 = r1928454 * r1928468;
        double r1928470 = r1928466 / r1928469;
        double r1928471 = r1928463 + r1928462;
        double r1928472 = r1928470 * r1928471;
        double r1928473 = x;
        double r1928474 = r1928472 + r1928473;
        return r1928474;
}

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. Using strategy rm
  3. Applied tan-quot13.1

    \[\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 flip--0.2

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

    \[\leadsto x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\color{blue}{\frac{\left(1 \cdot 1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)\right) \cdot \cos a}{1 + \tan y \cdot \tan z}}}\]
  9. Applied associate-/r/0.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 \cdot 1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)\right) \cdot \cos a} \cdot \left(1 + \tan y \cdot \tan z\right)}\]
  10. Simplified0.2

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

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

Reproduce

herbie shell --seed 2019153 
(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))))