Average Error: 13.4 → 0.2
Time: 30.1s
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.751223999999999928063201074847742204824 \cdot 10^{308}\right) \land \left(-1.776707000000000001259808757982040817204 \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.751223999999999928063201074847742204824 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\frac{\mathsf{fma}\left(\mathsf{fma}\left(\tan z, \tan y, -1\right), \sin a, \left(\tan y + \tan z\right) \cdot \cos a\right)}{\cos a \cdot \left(1 - {\left(\frac{\sin z \cdot \tan y}{\cos z}\right)}^{3}\right)} \cdot \left(\left(\frac{\sin z \cdot \tan y}{\cos z} \cdot \frac{\sin z \cdot \tan y}{\cos z} + \frac{\sin z \cdot \tan y}{\cos z}\right) + 1\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\frac{\mathsf{fma}\left(\mathsf{fma}\left(\tan z, \tan y, -1\right), \sin a, \left(\tan y + \tan z\right) \cdot \cos a\right)}{\cos a \cdot \left(1 - {\left(\frac{\sin z \cdot \tan y}{\cos z}\right)}^{3}\right)} \cdot \left(\left(\frac{\sin z \cdot \tan y}{\cos z} \cdot \frac{\sin z \cdot \tan y}{\cos z} + \frac{\sin z \cdot \tan y}{\cos z}\right) + 1\right) + x
double f(double x, double y, double z, double a) {
        double r124265 = x;
        double r124266 = y;
        double r124267 = z;
        double r124268 = r124266 + r124267;
        double r124269 = tan(r124268);
        double r124270 = a;
        double r124271 = tan(r124270);
        double r124272 = r124269 - r124271;
        double r124273 = r124265 + r124272;
        return r124273;
}

double f(double x, double y, double z, double a) {
        double r124274 = z;
        double r124275 = tan(r124274);
        double r124276 = y;
        double r124277 = tan(r124276);
        double r124278 = -1.0;
        double r124279 = fma(r124275, r124277, r124278);
        double r124280 = a;
        double r124281 = sin(r124280);
        double r124282 = r124277 + r124275;
        double r124283 = cos(r124280);
        double r124284 = r124282 * r124283;
        double r124285 = fma(r124279, r124281, r124284);
        double r124286 = 1.0;
        double r124287 = sin(r124274);
        double r124288 = r124287 * r124277;
        double r124289 = cos(r124274);
        double r124290 = r124288 / r124289;
        double r124291 = 3.0;
        double r124292 = pow(r124290, r124291);
        double r124293 = r124286 - r124292;
        double r124294 = r124283 * r124293;
        double r124295 = r124285 / r124294;
        double r124296 = r124290 * r124290;
        double r124297 = r124296 + r124290;
        double r124298 = r124297 + r124286;
        double r124299 = r124295 * r124298;
        double r124300 = x;
        double r124301 = r124299 + r124300;
        return r124301;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Derivation

  1. Initial program 13.4

    \[x + \left(\tan \left(y + z\right) - \tan a\right)\]
  2. Using strategy rm
  3. Applied tan-quot13.4

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

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

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

    \[\leadsto x + \frac{\mathsf{fma}\left(\tan z \cdot \tan y + -1, \sin a, \left(\tan y + \tan z\right) \cdot \cos a\right)}{\left(1 - \color{blue}{\frac{\tan y \cdot \sin z}{\cos z}}\right) \cdot \cos a}\]
  10. Simplified0.2

    \[\leadsto x + \frac{\mathsf{fma}\left(\tan z \cdot \tan y + -1, \sin a, \left(\tan y + \tan z\right) \cdot \cos a\right)}{\left(1 - \frac{\color{blue}{\sin z \cdot \tan y}}{\cos z}\right) \cdot \cos a}\]
  11. Using strategy rm
  12. Applied flip3--0.2

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

    \[\leadsto x + \frac{\mathsf{fma}\left(\tan z \cdot \tan y + -1, \sin a, \left(\tan y + \tan z\right) \cdot \cos a\right)}{\color{blue}{\frac{\left({1}^{3} - {\left(\frac{\sin z \cdot \tan y}{\cos z}\right)}^{3}\right) \cdot \cos a}{1 \cdot 1 + \left(\frac{\sin z \cdot \tan y}{\cos z} \cdot \frac{\sin z \cdot \tan y}{\cos z} + 1 \cdot \frac{\sin z \cdot \tan y}{\cos z}\right)}}}\]
  14. Applied associate-/r/0.2

    \[\leadsto x + \color{blue}{\frac{\mathsf{fma}\left(\tan z \cdot \tan y + -1, \sin a, \left(\tan y + \tan z\right) \cdot \cos a\right)}{\left({1}^{3} - {\left(\frac{\sin z \cdot \tan y}{\cos z}\right)}^{3}\right) \cdot \cos a} \cdot \left(1 \cdot 1 + \left(\frac{\sin z \cdot \tan y}{\cos z} \cdot \frac{\sin z \cdot \tan y}{\cos z} + 1 \cdot \frac{\sin z \cdot \tan y}{\cos z}\right)\right)}\]
  15. Simplified0.2

    \[\leadsto x + \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\tan z, \tan y, -1\right), \sin a, \left(\tan y + \tan z\right) \cdot \cos a\right)}{\cos a \cdot \left(1 - {\left(\frac{\sin z \cdot \tan y}{\cos z}\right)}^{3}\right)}} \cdot \left(1 \cdot 1 + \left(\frac{\sin z \cdot \tan y}{\cos z} \cdot \frac{\sin z \cdot \tan y}{\cos z} + 1 \cdot \frac{\sin z \cdot \tan y}{\cos z}\right)\right)\]
  16. Final simplification0.2

    \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\tan z, \tan y, -1\right), \sin a, \left(\tan y + \tan z\right) \cdot \cos a\right)}{\cos a \cdot \left(1 - {\left(\frac{\sin z \cdot \tan y}{\cos z}\right)}^{3}\right)} \cdot \left(\left(\frac{\sin z \cdot \tan y}{\cos z} \cdot \frac{\sin z \cdot \tan y}{\cos z} + \frac{\sin z \cdot \tan y}{\cos z}\right) + 1\right) + x\]

Reproduce

herbie shell --seed 2019304 +o rules:numerics
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :precision binary64
  :pre (and (or (== x 0.0) (<= 0.588414199999999998 x 505.590899999999976)) (or (<= -1.79665800000000009e308 y -9.425585000000013e-310) (<= 1.284938e-309 y 1.75122399999999993e308)) (or (<= -1.776707e308 z -8.59979600000002e-310) (<= 3.29314499999998e-311 z 1.72515400000000009e308)) (or (<= -1.79665800000000009e308 a -9.425585000000013e-310) (<= 1.284938e-309 a 1.75122399999999993e308)))
  (+ x (- (tan (+ y z)) (tan a))))