Average Error: 13.3 → 0.3
Time: 20.4s
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)\]
\[\left(x + \left(\frac{\sin y}{\left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \cos y} - \frac{\sin a}{\cos a}\right)\right) + \frac{\sin z}{\cos z \cdot \left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right)}\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(x + \left(\frac{\sin y}{\left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \cos y} - \frac{\sin a}{\cos a}\right)\right) + \frac{\sin z}{\cos z \cdot \left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right)}
double f(double x, double y, double z, double a) {
        double r90050 = x;
        double r90051 = y;
        double r90052 = z;
        double r90053 = r90051 + r90052;
        double r90054 = tan(r90053);
        double r90055 = a;
        double r90056 = tan(r90055);
        double r90057 = r90054 - r90056;
        double r90058 = r90050 + r90057;
        return r90058;
}

double f(double x, double y, double z, double a) {
        double r90059 = x;
        double r90060 = y;
        double r90061 = sin(r90060);
        double r90062 = 1.0;
        double r90063 = z;
        double r90064 = sin(r90063);
        double r90065 = r90061 * r90064;
        double r90066 = cos(r90063);
        double r90067 = cos(r90060);
        double r90068 = r90066 * r90067;
        double r90069 = r90065 / r90068;
        double r90070 = r90062 - r90069;
        double r90071 = r90070 * r90067;
        double r90072 = r90061 / r90071;
        double r90073 = a;
        double r90074 = sin(r90073);
        double r90075 = cos(r90073);
        double r90076 = r90074 / r90075;
        double r90077 = r90072 - r90076;
        double r90078 = r90059 + r90077;
        double r90079 = r90066 * r90070;
        double r90080 = r90064 / r90079;
        double r90081 = r90078 + r90080;
        return r90081;
}

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

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

    \[\leadsto x + \color{blue}{\left(\left(\frac{\sin y}{\left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \cos y} + \frac{\sin z}{\left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \cos z}\right) - \frac{\sin a}{\cos a}\right)}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity0.2

    \[\leadsto x + \left(\left(\frac{\sin y}{\left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \cos y} + \frac{\color{blue}{1 \cdot \sin z}}{\left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \cos z}\right) - \frac{\sin a}{\cos a}\right)\]
  7. Applied times-frac0.2

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

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

Reproduce

herbie shell --seed 2019297 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :precision binary64
  :pre (and (or (== x 0.0) (<= 0.588414199999999998 x 505.590899999999976)) (or (<= -1.79665800000000009e308 y -9.425585000000013e-310) (<= 1.284938e-309 y 1.75122399999999993e308)) (or (<= -1.776707e308 z -8.59979600000002e-310) (<= 3.29314499999998e-311 z 1.72515400000000009e308)) (or (<= -1.79665800000000009e308 a -9.425585000000013e-310) (<= 1.284938e-309 a 1.75122399999999993e308)))
  (+ x (- (tan (+ y z)) (tan a))))