Average Error: 13.1 → 0.2
Time: 17.1s
Precision: 64
\[\left(x = 0.0 \lor 0.588414199999999998 \le x \le 505.590899999999976\right) \land \left(-1.79665800000000009 \cdot 10^{308} \le y \le -9.425585000000013 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le y \le 1.7512240000000001 \cdot 10^{308}\right) \land \left(-1.7767070000000002 \cdot 10^{308} \le z \le -8.59979600000002 \cdot 10^{-310} \lor 3.29314499999998 \cdot 10^{-311} \le z \le 1.72515400000000009 \cdot 10^{308}\right) \land \left(-1.79665800000000009 \cdot 10^{308} \le a \le -9.425585000000013 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le a \le 1.7512240000000001 \cdot 10^{308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[x + \left(\frac{\mathsf{fma}\left({\left(\tan y \cdot \tan y\right)}^{\frac{1}{3}}, \sqrt[3]{\tan y}, \tan z\right)}{1 - \tan y \cdot \tan z} - \tan a\right)\]
x + \left(\tan \left(y + z\right) - \tan a\right)
x + \left(\frac{\mathsf{fma}\left({\left(\tan y \cdot \tan y\right)}^{\frac{1}{3}}, \sqrt[3]{\tan y}, \tan z\right)}{1 - \tan y \cdot \tan z} - \tan a\right)
double f(double x, double y, double z, double a) {
        double r147111 = x;
        double r147112 = y;
        double r147113 = z;
        double r147114 = r147112 + r147113;
        double r147115 = tan(r147114);
        double r147116 = a;
        double r147117 = tan(r147116);
        double r147118 = r147115 - r147117;
        double r147119 = r147111 + r147118;
        return r147119;
}

double f(double x, double y, double z, double a) {
        double r147120 = x;
        double r147121 = y;
        double r147122 = tan(r147121);
        double r147123 = r147122 * r147122;
        double r147124 = 0.3333333333333333;
        double r147125 = pow(r147123, r147124);
        double r147126 = cbrt(r147122);
        double r147127 = z;
        double r147128 = tan(r147127);
        double r147129 = fma(r147125, r147126, r147128);
        double r147130 = 1.0;
        double r147131 = r147122 * r147128;
        double r147132 = r147130 - r147131;
        double r147133 = r147129 / r147132;
        double r147134 = a;
        double r147135 = tan(r147134);
        double r147136 = r147133 - r147135;
        double r147137 = r147120 + r147136;
        return r147137;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Derivation

  1. Initial program 13.1

    \[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{\color{blue}{\left(\sqrt[3]{\tan y} \cdot \sqrt[3]{\tan y}\right) \cdot \sqrt[3]{\tan y}} + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  6. Applied fma-def0.3

    \[\leadsto x + \left(\frac{\color{blue}{\mathsf{fma}\left(\sqrt[3]{\tan y} \cdot \sqrt[3]{\tan y}, \sqrt[3]{\tan y}, \tan z\right)}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  7. Using strategy rm
  8. Applied pow1/332.1

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

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

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

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

Reproduce

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