Average Error: 13.4 → 0.2
Time: 1.6m
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^{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 r24879497 = x;
        double r24879498 = y;
        double r24879499 = z;
        double r24879500 = r24879498 + r24879499;
        double r24879501 = tan(r24879500);
        double r24879502 = a;
        double r24879503 = tan(r24879502);
        double r24879504 = r24879501 - r24879503;
        double r24879505 = r24879497 + r24879504;
        return r24879505;
}

double f(double x, double y, double z, double a) {
        double r24879506 = x;
        double r24879507 = exp(r24879506);
        double r24879508 = y;
        double r24879509 = tan(r24879508);
        double r24879510 = z;
        double r24879511 = tan(r24879510);
        double r24879512 = r24879509 + r24879511;
        double r24879513 = 1.0;
        double r24879514 = r24879509 * r24879511;
        double r24879515 = r24879513 - r24879514;
        double r24879516 = r24879512 / r24879515;
        double r24879517 = a;
        double r24879518 = tan(r24879517);
        double r24879519 = r24879516 - r24879518;
        double r24879520 = exp(r24879519);
        double r24879521 = r24879507 * r24879520;
        double r24879522 = log(r24879521);
        return r24879522;
}

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

    \[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 x + \color{blue}{\log \left(e^{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a}\right)}\]
  6. Applied add-log-exp0.2

    \[\leadsto \color{blue}{\log \left(e^{x}\right)} + \log \left(e^{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a}\right)\]
  7. Applied sum-log0.2

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

    \[\leadsto \log \color{blue}{\left(e^{\left(x + \frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right) - \tan a}\right)}\]
  9. Using strategy rm
  10. Applied associate--l+0.2

    \[\leadsto \log \left(e^{\color{blue}{x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)}}\right)\]
  11. Applied exp-sum0.2

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

    \[\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 2019104 +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))))