Average Error: 13.2 → 0.2
Time: 31.6s
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)\]
\[x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \sin a}{\left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \cos a}\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \sin a}{\left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \cos a}
double f(double x, double y, double z, double a) {
        double r110919 = x;
        double r110920 = y;
        double r110921 = z;
        double r110922 = r110920 + r110921;
        double r110923 = tan(r110922);
        double r110924 = a;
        double r110925 = tan(r110924);
        double r110926 = r110923 - r110925;
        double r110927 = r110919 + r110926;
        return r110927;
}

double f(double x, double y, double z, double a) {
        double r110928 = x;
        double r110929 = y;
        double r110930 = tan(r110929);
        double r110931 = z;
        double r110932 = tan(r110931);
        double r110933 = r110930 + r110932;
        double r110934 = a;
        double r110935 = cos(r110934);
        double r110936 = r110933 * r110935;
        double r110937 = 1.0;
        double r110938 = sin(r110929);
        double r110939 = sin(r110931);
        double r110940 = r110938 * r110939;
        double r110941 = cos(r110931);
        double r110942 = cos(r110929);
        double r110943 = r110941 * r110942;
        double r110944 = r110940 / r110943;
        double r110945 = r110937 - r110944;
        double r110946 = sin(r110934);
        double r110947 = r110945 * r110946;
        double r110948 = r110936 - r110947;
        double r110949 = r110945 * r110935;
        double r110950 = r110948 / r110949;
        double r110951 = r110928 + r110950;
        return r110951;
}

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

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

    \[\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 - \tan y \cdot \color{blue}{\frac{\sin z}{\cos z}}\right) \cdot \sin a}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}\]
  8. 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 \frac{\sin z}{\cos z}\right) \cdot \sin a}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}\]
  9. Applied frac-times0.2

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

    \[\leadsto x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \frac{\sin y \cdot \sin z}{\color{blue}{\cos z \cdot \cos y}}\right) \cdot \sin a}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}\]
  11. Using strategy rm
  12. Applied tan-quot0.2

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

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

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

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

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

Reproduce

herbie shell --seed 2019322 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :precision binary64
  :pre (and (or (== x 0.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))))