Average Error: 13.2 → 0.3
Time: 19.7s
Precision: 64
\[\left(x = 0.0 \lor 0.588414199999999998 \le x \le 505.590899999999976\right) \land \left(-1.79665800000000009 \cdot 10^{308} \le y \le -9.425585000000013 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le y \le 1.7512240000000001 \cdot 10^{308}\right) \land \left(-1.7767070000000002 \cdot 10^{308} \le z \le -8.59979600000002 \cdot 10^{-310} \lor 3.29314499999998 \cdot 10^{-311} \le z \le 1.72515400000000009 \cdot 10^{308}\right) \land \left(-1.79665800000000009 \cdot 10^{308} \le a \le -9.425585000000013 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le a \le 1.7512240000000001 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\log \left(e^{x} \cdot \frac{{\left(e^{\frac{\tan y + \tan z}{1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)}}\right)}^{\left(1 + \tan y \cdot \tan z\right)}}{e^{\tan a}}\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\log \left(e^{x} \cdot \frac{{\left(e^{\frac{\tan y + \tan z}{1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)}}\right)}^{\left(1 + \tan y \cdot \tan z\right)}}{e^{\tan a}}\right)
double f(double x, double y, double z, double a) {
        double r244416 = x;
        double r244417 = y;
        double r244418 = z;
        double r244419 = r244417 + r244418;
        double r244420 = tan(r244419);
        double r244421 = a;
        double r244422 = tan(r244421);
        double r244423 = r244420 - r244422;
        double r244424 = r244416 + r244423;
        return r244424;
}

double f(double x, double y, double z, double a) {
        double r244425 = x;
        double r244426 = exp(r244425);
        double r244427 = y;
        double r244428 = tan(r244427);
        double r244429 = z;
        double r244430 = tan(r244429);
        double r244431 = r244428 + r244430;
        double r244432 = 1.0;
        double r244433 = r244428 * r244430;
        double r244434 = r244433 * r244433;
        double r244435 = r244432 - r244434;
        double r244436 = r244431 / r244435;
        double r244437 = exp(r244436);
        double r244438 = r244432 + r244433;
        double r244439 = pow(r244437, r244438);
        double r244440 = a;
        double r244441 = tan(r244440);
        double r244442 = exp(r244441);
        double r244443 = r244439 / r244442;
        double r244444 = r244426 * r244443;
        double r244445 = log(r244444);
        return r244445;
}

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

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

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

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

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

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

    \[\leadsto \log \color{blue}{\left(e^{x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)}\right)}\]
  11. Using strategy rm
  12. Applied add-log-exp0.3

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

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

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

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

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

    \[\leadsto \log \color{blue}{\left(e^{x} \cdot \frac{e^{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}}}{e^{\tan a}}\right)}\]
  18. Using strategy rm
  19. Applied flip--0.3

    \[\leadsto \log \left(e^{x} \cdot \frac{e^{\frac{\tan y + \tan z}{\color{blue}{\frac{1 \cdot 1 - \left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)}{1 + \tan y \cdot \tan z}}}}}{e^{\tan a}}\right)\]
  20. Applied associate-/r/0.3

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

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

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

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

Reproduce

herbie shell --seed 2020043 +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))))