Average Error: 13.5 → 0.2
Time: 12.3s
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.751224000000000127647232028319723370461 \cdot 10^{308}\right) \land \left(-1.776707000000000200843839711454021982841 \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.751224000000000127647232028319723370461 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[x + \left(\frac{\sin y \cdot \cos z + \cos y \cdot \sin z}{\left(1 - \tan y \cdot \tan z\right) \cdot \left(\cos y \cdot \cos z\right)} - \tan a\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\frac{\sin y \cdot \cos z + \cos y \cdot \sin z}{\left(1 - \tan y \cdot \tan z\right) \cdot \left(\cos y \cdot \cos z\right)} - \tan a\right)
double f(double x, double y, double z, double a) {
        double r146306 = x;
        double r146307 = y;
        double r146308 = z;
        double r146309 = r146307 + r146308;
        double r146310 = tan(r146309);
        double r146311 = a;
        double r146312 = tan(r146311);
        double r146313 = r146310 - r146312;
        double r146314 = r146306 + r146313;
        return r146314;
}

double f(double x, double y, double z, double a) {
        double r146315 = x;
        double r146316 = y;
        double r146317 = sin(r146316);
        double r146318 = z;
        double r146319 = cos(r146318);
        double r146320 = r146317 * r146319;
        double r146321 = cos(r146316);
        double r146322 = sin(r146318);
        double r146323 = r146321 * r146322;
        double r146324 = r146320 + r146323;
        double r146325 = 1.0;
        double r146326 = tan(r146316);
        double r146327 = tan(r146318);
        double r146328 = r146326 * r146327;
        double r146329 = r146325 - r146328;
        double r146330 = r146321 * r146319;
        double r146331 = r146329 * r146330;
        double r146332 = r146324 / r146331;
        double r146333 = a;
        double r146334 = tan(r146333);
        double r146335 = r146332 - r146334;
        double r146336 = r146315 + r146335;
        return r146336;
}

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

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

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

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

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

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

Reproduce

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