Average Error: 13.0 → 0.2
Time: 14.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.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)\]
\[\left(x + \left(\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}} - \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)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(x + \left(\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}} - \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)
double f(double x, double y, double z, double a) {
        double r203962 = x;
        double r203963 = y;
        double r203964 = z;
        double r203965 = r203963 + r203964;
        double r203966 = tan(r203965);
        double r203967 = a;
        double r203968 = tan(r203967);
        double r203969 = r203966 - r203968;
        double r203970 = r203962 + r203969;
        return r203970;
}

double f(double x, double y, double z, double a) {
        double r203971 = x;
        double r203972 = y;
        double r203973 = tan(r203972);
        double r203974 = z;
        double r203975 = tan(r203974);
        double r203976 = r203973 + r203975;
        double r203977 = 1.0;
        double r203978 = sin(r203972);
        double r203979 = sin(r203974);
        double r203980 = r203978 * r203979;
        double r203981 = cos(r203974);
        double r203982 = cos(r203972);
        double r203983 = r203981 * r203982;
        double r203984 = r203980 / r203983;
        double r203985 = r203977 - r203984;
        double r203986 = r203976 / r203985;
        double r203987 = a;
        double r203988 = tan(r203987);
        double r203989 = r203986 - r203988;
        double r203990 = r203971 + r203989;
        double r203991 = cbrt(r203988);
        double r203992 = -r203991;
        double r203993 = r203991 * r203991;
        double r203994 = r203991 * r203993;
        double r203995 = fma(r203992, r203993, r203994);
        double r203996 = r203990 + r203995;
        return r203996;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Derivation

  1. Initial program 13.0

    \[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. Taylor expanded around inf 0.2

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \color{blue}{\frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}}} - \tan a\right)\]
  5. Using strategy rm
  6. Applied add-cube-cbrt0.3

    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}} - \color{blue}{\left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}}\right)\]
  7. Applied add-sqr-sqrt31.7

    \[\leadsto x + \left(\color{blue}{\sqrt{\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}}} \cdot \sqrt{\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}}}} - \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right) \cdot \sqrt[3]{\tan a}\right)\]
  8. Applied prod-diff31.7

    \[\leadsto x + \color{blue}{\left(\mathsf{fma}\left(\sqrt{\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}}}, \sqrt{\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}}}, -\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. Applied associate-+r+31.7

    \[\leadsto \color{blue}{\left(x + \mathsf{fma}\left(\sqrt{\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}}}, \sqrt{\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}}}, -\sqrt[3]{\tan a} \cdot \left(\sqrt[3]{\tan a} \cdot \sqrt[3]{\tan a}\right)\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)}\]
  10. Simplified0.2

    \[\leadsto \color{blue}{\left(x + \left(\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}} - \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)\]
  11. Final simplification0.2

    \[\leadsto \left(x + \left(\frac{\tan y + \tan z}{1 - \frac{\sin y \cdot \sin z}{\cos z \cdot \cos y}} - \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)\]

Reproduce

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