Average Error: 13.0 → 0.2
Time: 52.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)\]
\[x + \frac{\cos a \cdot \left(\tan y + \tan z\right) - \sin a \cdot \left(1 - \frac{\tan z \cdot \sin y}{\cos y}\right)}{\left(1 - \tan z \cdot \tan y\right) \cdot \cos a}\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \frac{\cos a \cdot \left(\tan y + \tan z\right) - \sin a \cdot \left(1 - \frac{\tan z \cdot \sin y}{\cos y}\right)}{\left(1 - \tan z \cdot \tan y\right) \cdot \cos a}
double f(double x, double y, double z, double a) {
        double r16388536 = x;
        double r16388537 = y;
        double r16388538 = z;
        double r16388539 = r16388537 + r16388538;
        double r16388540 = tan(r16388539);
        double r16388541 = a;
        double r16388542 = tan(r16388541);
        double r16388543 = r16388540 - r16388542;
        double r16388544 = r16388536 + r16388543;
        return r16388544;
}

double f(double x, double y, double z, double a) {
        double r16388545 = x;
        double r16388546 = a;
        double r16388547 = cos(r16388546);
        double r16388548 = y;
        double r16388549 = tan(r16388548);
        double r16388550 = z;
        double r16388551 = tan(r16388550);
        double r16388552 = r16388549 + r16388551;
        double r16388553 = r16388547 * r16388552;
        double r16388554 = sin(r16388546);
        double r16388555 = 1.0;
        double r16388556 = sin(r16388548);
        double r16388557 = r16388551 * r16388556;
        double r16388558 = cos(r16388548);
        double r16388559 = r16388557 / r16388558;
        double r16388560 = r16388555 - r16388559;
        double r16388561 = r16388554 * r16388560;
        double r16388562 = r16388553 - r16388561;
        double r16388563 = r16388551 * r16388549;
        double r16388564 = r16388555 - r16388563;
        double r16388565 = r16388564 * r16388547;
        double r16388566 = r16388562 / r16388565;
        double r16388567 = r16388545 + r16388566;
        return r16388567;
}

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

    \[\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 tan-quot0.2

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

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

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

Reproduce

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