Average Error: 12.9 → 0.2
Time: 11.9s
Precision: 64
\[\left(x = 0.0 \lor 0.588414199999999998 \le x \le 505.590899999999976\right) \land \left(-1.79665800000000009 \cdot 10^{308} \le y \le -9.425585000000013 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le y \le 1.7512240000000001 \cdot 10^{308}\right) \land \left(-1.7767070000000002 \cdot 10^{308} \le z \le -8.59979600000002 \cdot 10^{-310} \lor 3.29314499999998 \cdot 10^{-311} \le z \le 1.72515400000000009 \cdot 10^{308}\right) \land \left(-1.79665800000000009 \cdot 10^{308} \le a \le -9.425585000000013 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le a \le 1.7512240000000001 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \frac{\tan y \cdot \sin z}{\cos z}\right) \cdot \sin a}{\left(1 - \frac{\tan y \cdot \sin z}{\cos z}\right) \cdot \cos a}\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \frac{\tan y \cdot \sin z}{\cos z}\right) \cdot \sin a}{\left(1 - \frac{\tan y \cdot \sin z}{\cos z}\right) \cdot \cos a}
double f(double x, double y, double z, double a) {
        double r150267 = x;
        double r150268 = y;
        double r150269 = z;
        double r150270 = r150268 + r150269;
        double r150271 = tan(r150270);
        double r150272 = a;
        double r150273 = tan(r150272);
        double r150274 = r150271 - r150273;
        double r150275 = r150267 + r150274;
        return r150275;
}

double f(double x, double y, double z, double a) {
        double r150276 = x;
        double r150277 = y;
        double r150278 = tan(r150277);
        double r150279 = z;
        double r150280 = tan(r150279);
        double r150281 = r150278 + r150280;
        double r150282 = a;
        double r150283 = cos(r150282);
        double r150284 = r150281 * r150283;
        double r150285 = 1.0;
        double r150286 = sin(r150279);
        double r150287 = r150278 * r150286;
        double r150288 = cos(r150279);
        double r150289 = r150287 / r150288;
        double r150290 = r150285 - r150289;
        double r150291 = sin(r150282);
        double r150292 = r150290 * r150291;
        double r150293 = r150284 - r150292;
        double r150294 = r150290 * r150283;
        double r150295 = r150293 / r150294;
        double r150296 = r150276 + r150295;
        return r150296;
}

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-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 tan-quot0.2

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

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \color{blue}{\frac{\tan y \cdot \sin z}{\cos z}}} - \tan a\right)\]
  7. Using strategy rm
  8. Applied tan-quot0.2

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \frac{\tan y \cdot \sin z}{\cos z}} - \color{blue}{\frac{\sin a}{\cos a}}\right)\]
  9. Applied frac-sub0.2

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

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

Reproduce

herbie shell --seed 2020081 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :precision binary64
  :pre (and (or (== x 0.0) (<= 0.5884142 x 505.5909)) (or (<= -1.796658e+308 y -9.425585e-310) (<= 1.284938e-309 y 1.7512240000000001e+308)) (or (<= -1.7767070000000002e+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.7512240000000001e+308)))
  (+ x (- (tan (+ y z)) (tan a))))