Average Error: 12.9 → 0.2
Time: 45.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)\]
\[\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 r5531815 = x;
        double r5531816 = y;
        double r5531817 = z;
        double r5531818 = r5531816 + r5531817;
        double r5531819 = tan(r5531818);
        double r5531820 = a;
        double r5531821 = tan(r5531820);
        double r5531822 = r5531819 - r5531821;
        double r5531823 = r5531815 + r5531822;
        return r5531823;
}

double f(double x, double y, double z, double a) {
        double r5531824 = a;
        double r5531825 = cos(r5531824);
        double r5531826 = y;
        double r5531827 = tan(r5531826);
        double r5531828 = z;
        double r5531829 = tan(r5531828);
        double r5531830 = r5531827 + r5531829;
        double r5531831 = r5531825 * r5531830;
        double r5531832 = 1.0;
        double r5531833 = r5531829 * r5531827;
        double r5531834 = r5531832 - r5531833;
        double r5531835 = sin(r5531824);
        double r5531836 = r5531834 * r5531835;
        double r5531837 = r5531831 - r5531836;
        double r5531838 = r5531834 * r5531825;
        double r5531839 = r5531837 / r5531838;
        double r5531840 = x;
        double r5531841 = r5531839 + r5531840;
        return r5531841;
}

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))))