Average Error: 13.0 → 0.2
Time: 29.4s
Precision: 64
\[\left(x = 0.0 \lor 0.5884141999999999983472775966220069676638 \le x \le 505.5908999999999764440872240811586380005\right) \land \left(-1.7966580000000000931214523812968299911 \cdot 10^{308} \le y \le -9.425585000000013069597555966781986720373 \cdot 10^{-310} \lor 1.284937999999999548796432976649400331091 \cdot 10^{-309} \le y \le 1.751223999999999928063201074847742204824 \cdot 10^{308}\right) \land \left(-1.776707000000000001259808757982040817204 \cdot 10^{308} \le z \le -8.599796000000016667475923823712126825539 \cdot 10^{-310} \lor 3.293144999999983071955117582595641261776 \cdot 10^{-311} \le z \le 1.725154000000000087891269878141591702413 \cdot 10^{308}\right) \land \left(-1.7966580000000000931214523812968299911 \cdot 10^{308} \le a \le -9.425585000000013069597555966781986720373 \cdot 10^{-310} \lor 1.284937999999999548796432976649400331091 \cdot 10^{-309} \le a \le 1.751223999999999928063201074847742204824 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\frac{\cos a \cdot \left(\tan y + \tan z\right) - \sin a \cdot \left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right)}{\left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos 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) - \sin a \cdot \left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right)}{\left(1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}\right) \cdot \cos a} + x
double f(double x, double y, double z, double a) {
        double r6229341 = x;
        double r6229342 = y;
        double r6229343 = z;
        double r6229344 = r6229342 + r6229343;
        double r6229345 = tan(r6229344);
        double r6229346 = a;
        double r6229347 = tan(r6229346);
        double r6229348 = r6229345 - r6229347;
        double r6229349 = r6229341 + r6229348;
        return r6229349;
}

double f(double x, double y, double z, double a) {
        double r6229350 = a;
        double r6229351 = cos(r6229350);
        double r6229352 = y;
        double r6229353 = tan(r6229352);
        double r6229354 = z;
        double r6229355 = tan(r6229354);
        double r6229356 = r6229353 + r6229355;
        double r6229357 = r6229351 * r6229356;
        double r6229358 = sin(r6229350);
        double r6229359 = 1.0;
        double r6229360 = sin(r6229352);
        double r6229361 = sin(r6229354);
        double r6229362 = r6229360 * r6229361;
        double r6229363 = cos(r6229354);
        double r6229364 = cos(r6229352);
        double r6229365 = r6229363 * r6229364;
        double r6229366 = r6229362 / r6229365;
        double r6229367 = r6229359 - r6229366;
        double r6229368 = r6229358 * r6229367;
        double r6229369 = r6229357 - r6229368;
        double r6229370 = r6229367 * r6229351;
        double r6229371 = r6229369 / r6229370;
        double r6229372 = x;
        double r6229373 = r6229371 + r6229372;
        return r6229373;
}

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019169 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :pre (and (or (== x 0.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))))