Average Error: 12.9 → 0.2
Time: 42.1s
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)\]
\[\frac{\cos a \cdot \left(\tan y + \tan z\right) - \left(1 - \tan z \cdot \tan y\right) \cdot \sin a}{\left(1 - \tan z \cdot \tan y\right) \cdot \cos a} + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\frac{\cos a \cdot \left(\tan y + \tan z\right) - \left(1 - \tan z \cdot \tan y\right) \cdot \sin a}{\left(1 - \tan z \cdot \tan y\right) \cdot \cos a} + x
double f(double x, double y, double z, double a) {
        double r5121915 = x;
        double r5121916 = y;
        double r5121917 = z;
        double r5121918 = r5121916 + r5121917;
        double r5121919 = tan(r5121918);
        double r5121920 = a;
        double r5121921 = tan(r5121920);
        double r5121922 = r5121919 - r5121921;
        double r5121923 = r5121915 + r5121922;
        return r5121923;
}

double f(double x, double y, double z, double a) {
        double r5121924 = a;
        double r5121925 = cos(r5121924);
        double r5121926 = y;
        double r5121927 = tan(r5121926);
        double r5121928 = z;
        double r5121929 = tan(r5121928);
        double r5121930 = r5121927 + r5121929;
        double r5121931 = r5121925 * r5121930;
        double r5121932 = 1.0;
        double r5121933 = r5121929 * r5121927;
        double r5121934 = r5121932 - r5121933;
        double r5121935 = sin(r5121924);
        double r5121936 = r5121934 * r5121935;
        double r5121937 = r5121931 - r5121936;
        double r5121938 = r5121934 * r5121925;
        double r5121939 = r5121937 / r5121938;
        double r5121940 = x;
        double r5121941 = r5121939 + r5121940;
        return r5121941;
}

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 12.9

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

    \[\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. Final simplification0.2

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

Reproduce

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