Average Error: 13.0 → 0.2
Time: 39.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{\tan y \cdot \tan y - \tan z \cdot \tan z}{\left(1 - \tan y \cdot \tan z\right) \cdot \left(\tan y - \tan z\right)} - \tan a\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(\frac{\tan y \cdot \tan y - \tan z \cdot \tan z}{\left(1 - \tan y \cdot \tan z\right) \cdot \left(\tan y - \tan z\right)} - \tan a\right) + x
double f(double x, double y, double z, double a) {
        double r5848830 = x;
        double r5848831 = y;
        double r5848832 = z;
        double r5848833 = r5848831 + r5848832;
        double r5848834 = tan(r5848833);
        double r5848835 = a;
        double r5848836 = tan(r5848835);
        double r5848837 = r5848834 - r5848836;
        double r5848838 = r5848830 + r5848837;
        return r5848838;
}

double f(double x, double y, double z, double a) {
        double r5848839 = y;
        double r5848840 = tan(r5848839);
        double r5848841 = r5848840 * r5848840;
        double r5848842 = z;
        double r5848843 = tan(r5848842);
        double r5848844 = r5848843 * r5848843;
        double r5848845 = r5848841 - r5848844;
        double r5848846 = 1.0;
        double r5848847 = r5848840 * r5848843;
        double r5848848 = r5848846 - r5848847;
        double r5848849 = r5848840 - r5848843;
        double r5848850 = r5848848 * r5848849;
        double r5848851 = r5848845 / r5848850;
        double r5848852 = a;
        double r5848853 = tan(r5848852);
        double r5848854 = r5848851 - r5848853;
        double r5848855 = x;
        double r5848856 = r5848854 + r5848855;
        return r5848856;
}

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 flip-+0.2

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

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

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

Reproduce

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