Average Error: 13.0 → 0.3
Time: 40.5s
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)\]
\[\log \left(e^{\left(\frac{\log \left(e^{\tan y + \tan z}\right)}{1 - \tan z \cdot \tan y} - \tan a\right) + x}\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\log \left(e^{\left(\frac{\log \left(e^{\tan y + \tan z}\right)}{1 - \tan z \cdot \tan y} - \tan a\right) + x}\right)
double f(double x, double y, double z, double a) {
        double r13791898 = x;
        double r13791899 = y;
        double r13791900 = z;
        double r13791901 = r13791899 + r13791900;
        double r13791902 = tan(r13791901);
        double r13791903 = a;
        double r13791904 = tan(r13791903);
        double r13791905 = r13791902 - r13791904;
        double r13791906 = r13791898 + r13791905;
        return r13791906;
}

double f(double x, double y, double z, double a) {
        double r13791907 = y;
        double r13791908 = tan(r13791907);
        double r13791909 = z;
        double r13791910 = tan(r13791909);
        double r13791911 = r13791908 + r13791910;
        double r13791912 = exp(r13791911);
        double r13791913 = log(r13791912);
        double r13791914 = 1.0;
        double r13791915 = r13791910 * r13791908;
        double r13791916 = r13791914 - r13791915;
        double r13791917 = r13791913 / r13791916;
        double r13791918 = a;
        double r13791919 = tan(r13791918);
        double r13791920 = r13791917 - r13791919;
        double r13791921 = x;
        double r13791922 = r13791920 + r13791921;
        double r13791923 = exp(r13791922);
        double r13791924 = log(r13791923);
        return r13791924;
}

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{\color{blue}{\log \left(e^{\tan y + \tan z}\right)}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  6. Using strategy rm
  7. Applied add-log-exp0.3

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

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

Reproduce

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