Average Error: 13.1 → 0.2
Time: 38.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.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)\]
\[\left(x + \frac{\tan y + \tan z}{1 - \tan z \cdot \tan y}\right) - \tan a\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(x + \frac{\tan y + \tan z}{1 - \tan z \cdot \tan y}\right) - \tan a
double f(double x, double y, double z, double a) {
        double r5500629 = x;
        double r5500630 = y;
        double r5500631 = z;
        double r5500632 = r5500630 + r5500631;
        double r5500633 = tan(r5500632);
        double r5500634 = a;
        double r5500635 = tan(r5500634);
        double r5500636 = r5500633 - r5500635;
        double r5500637 = r5500629 + r5500636;
        return r5500637;
}

double f(double x, double y, double z, double a) {
        double r5500638 = x;
        double r5500639 = y;
        double r5500640 = tan(r5500639);
        double r5500641 = z;
        double r5500642 = tan(r5500641);
        double r5500643 = r5500640 + r5500642;
        double r5500644 = 1.0;
        double r5500645 = r5500642 * r5500640;
        double r5500646 = r5500644 - r5500645;
        double r5500647 = r5500643 / r5500646;
        double r5500648 = r5500638 + r5500647;
        double r5500649 = a;
        double r5500650 = tan(r5500649);
        double r5500651 = r5500648 - r5500650;
        return r5500651;
}

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

    \[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 associate-+r-0.2

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

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

Reproduce

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