Average Error: 13.3 → 0.3
Time: 30.4s
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{\frac{\sin y}{\cos y} + \frac{\sin z}{\cos z}}{1 - \log \left(e^{\frac{\sin z}{\cos z}}\right) \cdot \frac{\sin y}{\cos y}} - \tan a\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(\frac{\frac{\sin y}{\cos y} + \frac{\sin z}{\cos z}}{1 - \log \left(e^{\frac{\sin z}{\cos z}}\right) \cdot \frac{\sin y}{\cos y}} - \tan a\right) + x
double f(double x, double y, double z, double a) {
        double r2579860 = x;
        double r2579861 = y;
        double r2579862 = z;
        double r2579863 = r2579861 + r2579862;
        double r2579864 = tan(r2579863);
        double r2579865 = a;
        double r2579866 = tan(r2579865);
        double r2579867 = r2579864 - r2579866;
        double r2579868 = r2579860 + r2579867;
        return r2579868;
}

double f(double x, double y, double z, double a) {
        double r2579869 = y;
        double r2579870 = sin(r2579869);
        double r2579871 = cos(r2579869);
        double r2579872 = r2579870 / r2579871;
        double r2579873 = z;
        double r2579874 = sin(r2579873);
        double r2579875 = cos(r2579873);
        double r2579876 = r2579874 / r2579875;
        double r2579877 = r2579872 + r2579876;
        double r2579878 = 1.0;
        double r2579879 = exp(r2579876);
        double r2579880 = log(r2579879);
        double r2579881 = r2579880 * r2579872;
        double r2579882 = r2579878 - r2579881;
        double r2579883 = r2579877 / r2579882;
        double r2579884 = a;
        double r2579885 = tan(r2579884);
        double r2579886 = r2579883 - r2579885;
        double r2579887 = x;
        double r2579888 = r2579886 + r2579887;
        return r2579888;
}

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 + \left(\color{blue}{\frac{\frac{\sin z}{\cos z} + \frac{\sin y}{\cos y}}{1 - \frac{\sin z \cdot \sin y}{\cos y \cdot \cos z}}} - \tan a\right)\]
  5. Simplified0.2

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

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

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

Reproduce

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