Average Error: 13.3 → 0.2
Time: 18.6s
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 + \frac{1}{1 - \tan y \cdot \tan z} \cdot \left(\left(\tan y + \tan z\right) - \frac{\left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\cos a}\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \frac{1}{1 - \tan y \cdot \tan z} \cdot \left(\left(\tan y + \tan z\right) - \frac{\left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\cos a}\right)
double f(double x, double y, double z, double a) {
        double r156092 = x;
        double r156093 = y;
        double r156094 = z;
        double r156095 = r156093 + r156094;
        double r156096 = tan(r156095);
        double r156097 = a;
        double r156098 = tan(r156097);
        double r156099 = r156096 - r156098;
        double r156100 = r156092 + r156099;
        return r156100;
}

double f(double x, double y, double z, double a) {
        double r156101 = x;
        double r156102 = 1.0;
        double r156103 = y;
        double r156104 = tan(r156103);
        double r156105 = z;
        double r156106 = tan(r156105);
        double r156107 = r156104 * r156106;
        double r156108 = r156102 - r156107;
        double r156109 = r156102 / r156108;
        double r156110 = r156104 + r156106;
        double r156111 = a;
        double r156112 = sin(r156111);
        double r156113 = r156108 * r156112;
        double r156114 = cos(r156111);
        double r156115 = r156113 / r156114;
        double r156116 = r156110 - r156115;
        double r156117 = r156109 * r156116;
        double r156118 = r156101 + r156117;
        return r156118;
}

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

    \[x + \left(\tan \left(y + z\right) - \tan a\right)\]
  2. Using strategy rm
  3. Applied tan-quot13.3

    \[\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. Using strategy rm
  7. Applied *-un-lft-identity0.2

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

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

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

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

Reproduce

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