Average Error: 13.2 → 0.3
Time: 34.3s
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^{\frac{\tan z + \tan y}{1 - \frac{\tan y}{\frac{\cos z}{\sin z}}} - \tan a}\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\log \left(e^{\frac{\tan z + \tan y}{1 - \frac{\tan y}{\frac{\cos z}{\sin z}}} - \tan a}\right) + x
double f(double x, double y, double z, double a) {
        double r4186872 = x;
        double r4186873 = y;
        double r4186874 = z;
        double r4186875 = r4186873 + r4186874;
        double r4186876 = tan(r4186875);
        double r4186877 = a;
        double r4186878 = tan(r4186877);
        double r4186879 = r4186876 - r4186878;
        double r4186880 = r4186872 + r4186879;
        return r4186880;
}

double f(double x, double y, double z, double a) {
        double r4186881 = z;
        double r4186882 = tan(r4186881);
        double r4186883 = y;
        double r4186884 = tan(r4186883);
        double r4186885 = r4186882 + r4186884;
        double r4186886 = 1.0;
        double r4186887 = cos(r4186881);
        double r4186888 = sin(r4186881);
        double r4186889 = r4186887 / r4186888;
        double r4186890 = r4186884 / r4186889;
        double r4186891 = r4186886 - r4186890;
        double r4186892 = r4186885 / r4186891;
        double r4186893 = a;
        double r4186894 = tan(r4186893);
        double r4186895 = r4186892 - r4186894;
        double r4186896 = exp(r4186895);
        double r4186897 = log(r4186896);
        double r4186898 = x;
        double r4186899 = r4186897 + r4186898;
        return r4186899;
}

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

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

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

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

    \[\leadsto x + \left(\color{blue}{\log \left(e^{\frac{\tan y + \tan z}{1 - \frac{\tan y \cdot \sin z}{\cos z}}}\right)} - \log \left(e^{\tan a}\right)\right)\]
  10. Applied diff-log0.3

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

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

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

Reproduce

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