Average Error: 12.9 → 0.2
Time: 36.8s
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)\]
\[x + \left(\mathsf{fma}\left(\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y} \cdot \left(\tan y \cdot \tan z\right)}, 1 + \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}, -\tan a\right) + \left(\tan a + \left(-\tan a\right)\right)\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\mathsf{fma}\left(\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y} \cdot \left(\tan y \cdot \tan z\right)}, 1 + \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}, -\tan a\right) + \left(\tan a + \left(-\tan a\right)\right)\right)
double f(double x, double y, double z, double a) {
        double r105376 = x;
        double r105377 = y;
        double r105378 = z;
        double r105379 = r105377 + r105378;
        double r105380 = tan(r105379);
        double r105381 = a;
        double r105382 = tan(r105381);
        double r105383 = r105380 - r105382;
        double r105384 = r105376 + r105383;
        return r105384;
}

double f(double x, double y, double z, double a) {
        double r105385 = x;
        double r105386 = y;
        double r105387 = tan(r105386);
        double r105388 = z;
        double r105389 = tan(r105388);
        double r105390 = r105387 + r105389;
        double r105391 = 1.0;
        double r105392 = sin(r105386);
        double r105393 = sin(r105388);
        double r105394 = r105392 * r105393;
        double r105395 = cos(r105388);
        double r105396 = cos(r105386);
        double r105397 = r105395 * r105396;
        double r105398 = r105394 / r105397;
        double r105399 = r105387 * r105389;
        double r105400 = r105398 * r105399;
        double r105401 = r105391 - r105400;
        double r105402 = r105390 / r105401;
        double r105403 = r105391 + r105398;
        double r105404 = a;
        double r105405 = tan(r105404);
        double r105406 = -r105405;
        double r105407 = fma(r105402, r105403, r105406);
        double r105408 = r105405 + r105406;
        double r105409 = r105407 + r105408;
        double r105410 = r105385 + r105409;
        return r105410;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Derivation

  1. Initial program 12.9

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

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \color{blue}{\left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}}\right)\]
  6. Applied flip--0.3

    \[\leadsto x + \left(\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}}} - \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}\right)\]
  7. Applied associate-/r/0.3

    \[\leadsto x + \left(\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)} - \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}\right)\]
  8. Applied prod-diff0.3

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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