Average Error: 12.9 → 0.3
Time: 44.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.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)\]
\[\log \left(e^{x} \cdot e^{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a}\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\log \left(e^{x} \cdot e^{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a}\right)
double f(double x, double y, double z, double a) {
        double r5130746 = x;
        double r5130747 = y;
        double r5130748 = z;
        double r5130749 = r5130747 + r5130748;
        double r5130750 = tan(r5130749);
        double r5130751 = a;
        double r5130752 = tan(r5130751);
        double r5130753 = r5130750 - r5130752;
        double r5130754 = r5130746 + r5130753;
        return r5130754;
}

double f(double x, double y, double z, double a) {
        double r5130755 = x;
        double r5130756 = exp(r5130755);
        double r5130757 = y;
        double r5130758 = tan(r5130757);
        double r5130759 = z;
        double r5130760 = tan(r5130759);
        double r5130761 = r5130758 + r5130760;
        double r5130762 = 1.0;
        double r5130763 = r5130758 * r5130760;
        double r5130764 = r5130762 - r5130763;
        double r5130765 = r5130761 / r5130764;
        double r5130766 = a;
        double r5130767 = tan(r5130766);
        double r5130768 = r5130765 - r5130767;
        double r5130769 = exp(r5130768);
        double r5130770 = r5130756 * r5130769;
        double r5130771 = log(r5130770);
        return r5130771;
}

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 12.9

    \[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 add-log-exp0.3

    \[\leadsto \color{blue}{\log \left(e^{x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)}\right)}\]
  6. Using strategy rm
  7. Applied exp-sum0.3

    \[\leadsto \log \color{blue}{\left(e^{x} \cdot e^{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a}\right)}\]
  8. Final simplification0.3

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

Reproduce

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