Average Error: 13.4 → 0.2
Time: 1.5m
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 + \tan z}{1 - \frac{\sin z \cdot \sin y}{\cos y \cdot \cos z}} - \tan a\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(\frac{\tan y + \tan z}{1 - \frac{\sin z \cdot \sin y}{\cos y \cdot \cos z}} - \tan a\right) + x
double f(double x, double y, double z, double a) {
        double r6656109 = x;
        double r6656110 = y;
        double r6656111 = z;
        double r6656112 = r6656110 + r6656111;
        double r6656113 = tan(r6656112);
        double r6656114 = a;
        double r6656115 = tan(r6656114);
        double r6656116 = r6656113 - r6656115;
        double r6656117 = r6656109 + r6656116;
        return r6656117;
}

double f(double x, double y, double z, double a) {
        double r6656118 = y;
        double r6656119 = tan(r6656118);
        double r6656120 = z;
        double r6656121 = tan(r6656120);
        double r6656122 = r6656119 + r6656121;
        double r6656123 = 1.0;
        double r6656124 = sin(r6656120);
        double r6656125 = sin(r6656118);
        double r6656126 = r6656124 * r6656125;
        double r6656127 = cos(r6656118);
        double r6656128 = cos(r6656120);
        double r6656129 = r6656127 * r6656128;
        double r6656130 = r6656126 / r6656129;
        double r6656131 = r6656123 - r6656130;
        double r6656132 = r6656122 / r6656131;
        double r6656133 = a;
        double r6656134 = tan(r6656133);
        double r6656135 = r6656132 - r6656134;
        double r6656136 = x;
        double r6656137 = r6656135 + r6656136;
        return r6656137;
}

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.4

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

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

Reproduce

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