Average Error: 13.6 → 0.3
Time: 48.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(\frac{e^{x} \cdot e^{\frac{\tan y + \tan z}{1 - \tan z \cdot \tan y}}}{e^{\tan a}}\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\log \left(\frac{e^{x} \cdot e^{\frac{\tan y + \tan z}{1 - \tan z \cdot \tan y}}}{e^{\tan a}}\right)
double f(double x, double y, double z, double a) {
        double r4112992 = x;
        double r4112993 = y;
        double r4112994 = z;
        double r4112995 = r4112993 + r4112994;
        double r4112996 = tan(r4112995);
        double r4112997 = a;
        double r4112998 = tan(r4112997);
        double r4112999 = r4112996 - r4112998;
        double r4113000 = r4112992 + r4112999;
        return r4113000;
}

double f(double x, double y, double z, double a) {
        double r4113001 = x;
        double r4113002 = exp(r4113001);
        double r4113003 = y;
        double r4113004 = tan(r4113003);
        double r4113005 = z;
        double r4113006 = tan(r4113005);
        double r4113007 = r4113004 + r4113006;
        double r4113008 = 1.0;
        double r4113009 = r4113006 * r4113004;
        double r4113010 = r4113008 - r4113009;
        double r4113011 = r4113007 / r4113010;
        double r4113012 = exp(r4113011);
        double r4113013 = r4113002 * r4113012;
        double r4113014 = a;
        double r4113015 = tan(r4113014);
        double r4113016 = exp(r4113015);
        double r4113017 = r4113013 / r4113016;
        double r4113018 = log(r4113017);
        return r4113018;
}

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

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

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

    \[\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(\frac{\tan y + \tan z}{1 - \tan z \cdot \tan y} + x\right) - \tan a}\right)}\]
  9. Using strategy rm
  10. Applied add-log-exp0.3

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

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

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

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

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

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

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

Reproduce

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