Average Error: 13.0 → 0.2
Time: 1.2m
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)\]
\[\left(\frac{\log \left(e^{\tan y + \tan z}\right)}{1 - \tan z \cdot \tan y} - \tan a\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(\frac{\log \left(e^{\tan y + \tan z}\right)}{1 - \tan z \cdot \tan y} - \tan a\right) + x
double f(double x, double y, double z, double a) {
        double r17333886 = x;
        double r17333887 = y;
        double r17333888 = z;
        double r17333889 = r17333887 + r17333888;
        double r17333890 = tan(r17333889);
        double r17333891 = a;
        double r17333892 = tan(r17333891);
        double r17333893 = r17333890 - r17333892;
        double r17333894 = r17333886 + r17333893;
        return r17333894;
}

double f(double x, double y, double z, double a) {
        double r17333895 = y;
        double r17333896 = tan(r17333895);
        double r17333897 = z;
        double r17333898 = tan(r17333897);
        double r17333899 = r17333896 + r17333898;
        double r17333900 = exp(r17333899);
        double r17333901 = log(r17333900);
        double r17333902 = 1.0;
        double r17333903 = r17333898 * r17333896;
        double r17333904 = r17333902 - r17333903;
        double r17333905 = r17333901 / r17333904;
        double r17333906 = a;
        double r17333907 = tan(r17333906);
        double r17333908 = r17333905 - r17333907;
        double r17333909 = x;
        double r17333910 = r17333908 + r17333909;
        return r17333910;
}

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

    \[\leadsto x + \left(\color{blue}{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}} - \tan a\right)\]
  4. Using strategy rm
  5. Applied add-log-exp0.2

    \[\leadsto x + \left(\frac{\tan y + \color{blue}{\log \left(e^{\tan z}\right)}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  6. Applied add-log-exp0.2

    \[\leadsto x + \left(\frac{\color{blue}{\log \left(e^{\tan y}\right)} + \log \left(e^{\tan z}\right)}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  7. Applied sum-log0.2

    \[\leadsto x + \left(\frac{\color{blue}{\log \left(e^{\tan y} \cdot e^{\tan z}\right)}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  8. Simplified0.2

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

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

Reproduce

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