Average Error: 13.6 → 0.2
Time: 44.2s
Precision: 64
\[\left(x = 0 \lor 0.5884142 \le x \le 505.5909\right) \land \left(-1.796658 \cdot 10^{+308} \le y \le -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le y \le 1.751224 \cdot 10^{+308}\right) \land \left(-1.776707 \cdot 10^{+308} \le z \le -8.599796 \cdot 10^{-310} \lor 3.293145 \cdot 10^{-311} \le z \le 1.725154 \cdot 10^{+308}\right) \land \left(-1.796658 \cdot 10^{+308} \le a \le -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le a \le 1.751224 \cdot 10^{+308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\log \left(e^{\left(\frac{\tan y + \tan z}{1 - \tan z \cdot \tan y} - \tan a\right) + x}\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\log \left(e^{\left(\frac{\tan y + \tan z}{1 - \tan z \cdot \tan y} - \tan a\right) + x}\right)
double f(double x, double y, double z, double a) {
        double r4205668 = x;
        double r4205669 = y;
        double r4205670 = z;
        double r4205671 = r4205669 + r4205670;
        double r4205672 = tan(r4205671);
        double r4205673 = a;
        double r4205674 = tan(r4205673);
        double r4205675 = r4205672 - r4205674;
        double r4205676 = r4205668 + r4205675;
        return r4205676;
}

double f(double x, double y, double z, double a) {
        double r4205677 = y;
        double r4205678 = tan(r4205677);
        double r4205679 = z;
        double r4205680 = tan(r4205679);
        double r4205681 = r4205678 + r4205680;
        double r4205682 = 1.0;
        double r4205683 = r4205680 * r4205678;
        double r4205684 = r4205682 - r4205683;
        double r4205685 = r4205681 / r4205684;
        double r4205686 = a;
        double r4205687 = tan(r4205686);
        double r4205688 = r4205685 - r4205687;
        double r4205689 = x;
        double r4205690 = r4205688 + r4205689;
        double r4205691 = exp(r4205690);
        double r4205692 = log(r4205691);
        return r4205692;
}

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

    \[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.2

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

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

Reproduce

herbie shell --seed 2019151 +o rules:numerics
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :pre (and (or (== x 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))))