Average Error: 13.2 → 0.3
Time: 11.6s
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.751224000000000127647232028319723370461 \cdot 10^{308}\right) \land \left(-1.776707000000000200843839711454021982841 \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.751224000000000127647232028319723370461 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \frac{\log \left(e^{\sin y \cdot \tan z}\right)}{\cos y}\right) \cdot \cos a}\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \frac{\log \left(e^{\sin y \cdot \tan z}\right)}{\cos y}\right) \cdot \cos a}
double f(double x, double y, double z, double a) {
        double r146110 = x;
        double r146111 = y;
        double r146112 = z;
        double r146113 = r146111 + r146112;
        double r146114 = tan(r146113);
        double r146115 = a;
        double r146116 = tan(r146115);
        double r146117 = r146114 - r146116;
        double r146118 = r146110 + r146117;
        return r146118;
}

double f(double x, double y, double z, double a) {
        double r146119 = x;
        double r146120 = y;
        double r146121 = tan(r146120);
        double r146122 = z;
        double r146123 = tan(r146122);
        double r146124 = r146121 + r146123;
        double r146125 = a;
        double r146126 = cos(r146125);
        double r146127 = r146124 * r146126;
        double r146128 = 1.0;
        double r146129 = r146121 * r146123;
        double r146130 = r146128 - r146129;
        double r146131 = sin(r146125);
        double r146132 = r146130 * r146131;
        double r146133 = r146127 - r146132;
        double r146134 = sin(r146120);
        double r146135 = r146134 * r146123;
        double r146136 = exp(r146135);
        double r146137 = log(r146136);
        double r146138 = cos(r146120);
        double r146139 = r146137 / r146138;
        double r146140 = r146128 - r146139;
        double r146141 = r146140 * r146126;
        double r146142 = r146133 / r146141;
        double r146143 = r146119 + r146142;
        return r146143;
}

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

    \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{\frac{\sin a}{\cos a}}\right)\]
  4. Applied tan-sum0.2

    \[\leadsto x + \left(\color{blue}{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}} - \frac{\sin a}{\cos a}\right)\]
  5. Applied frac-sub0.2

    \[\leadsto x + \color{blue}{\frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}}\]
  6. Using strategy rm
  7. Applied tan-quot0.2

    \[\leadsto x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \color{blue}{\frac{\sin y}{\cos y}} \cdot \tan z\right) \cdot \cos a}\]
  8. Applied associate-*l/0.2

    \[\leadsto x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \color{blue}{\frac{\sin y \cdot \tan z}{\cos y}}\right) \cdot \cos a}\]
  9. Using strategy rm
  10. Applied add-log-exp0.3

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

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

Reproduce

herbie shell --seed 2020001 
(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))))