Average Error: 13.0 → 0.2
Time: 20.0s
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{\tan y + \tan z}{1 - \frac{\sin y \cdot \tan z}{\cos y}} - \tan a\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \tan z}{\cos y}} - \tan a\right)
double f(double x, double y, double z, double a) {
        double r140315 = x;
        double r140316 = y;
        double r140317 = z;
        double r140318 = r140316 + r140317;
        double r140319 = tan(r140318);
        double r140320 = a;
        double r140321 = tan(r140320);
        double r140322 = r140319 - r140321;
        double r140323 = r140315 + r140322;
        return r140323;
}

double f(double x, double y, double z, double a) {
        double r140324 = x;
        double r140325 = y;
        double r140326 = tan(r140325);
        double r140327 = z;
        double r140328 = tan(r140327);
        double r140329 = r140326 + r140328;
        double r140330 = 1.0;
        double r140331 = sin(r140325);
        double r140332 = r140331 * r140328;
        double r140333 = cos(r140325);
        double r140334 = r140332 / r140333;
        double r140335 = r140330 - r140334;
        double r140336 = r140329 / r140335;
        double r140337 = a;
        double r140338 = tan(r140337);
        double r140339 = r140336 - r140338;
        double r140340 = r140324 + r140339;
        return r140340;
}

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 - \color{blue}{\frac{\sin y}{\cos y}} \cdot \tan z} - \tan a\right)\]
  6. Applied associate-*l/0.2

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

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

Reproduce

herbie shell --seed 2019350 +o rules:numerics
(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))))