Average Error: 12.8 → 0.3
Time: 33.0s
Precision: 64
\[\left(x = 0 \lor 0.5884142 \le x \le 505.5909\right) \land \left(-1.796658 \cdot 10^{+308} \le y \le -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le y \le 1.751224 \cdot 10^{+308}\right) \land \left(-1.776707 \cdot 10^{+308} \le z \le -8.599796 \cdot 10^{-310} \lor 3.293145 \cdot 10^{-311} \le z \le 1.725154 \cdot 10^{+308}\right) \land \left(-1.796658 \cdot 10^{+308} \le a \le -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \le a \le 1.751224 \cdot 10^{+308}\right)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\left(\frac{\mathsf{fma}\left(\sqrt[3]{\tan y} \cdot \sqrt[3]{\tan y}, \sqrt[3]{\sqrt[3]{\tan y} \cdot \sqrt[3]{\tan y}} \cdot \sqrt[3]{\sqrt[3]{\tan y}}, \tan z\right)}{1 - \tan y \cdot \tan z} - \tan a\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(\frac{\mathsf{fma}\left(\sqrt[3]{\tan y} \cdot \sqrt[3]{\tan y}, \sqrt[3]{\sqrt[3]{\tan y} \cdot \sqrt[3]{\tan y}} \cdot \sqrt[3]{\sqrt[3]{\tan y}}, \tan z\right)}{1 - \tan y \cdot \tan z} - \tan a\right) + x
double f(double x, double y, double z, double a) {
        double r4527730 = x;
        double r4527731 = y;
        double r4527732 = z;
        double r4527733 = r4527731 + r4527732;
        double r4527734 = tan(r4527733);
        double r4527735 = a;
        double r4527736 = tan(r4527735);
        double r4527737 = r4527734 - r4527736;
        double r4527738 = r4527730 + r4527737;
        return r4527738;
}

double f(double x, double y, double z, double a) {
        double r4527739 = y;
        double r4527740 = tan(r4527739);
        double r4527741 = cbrt(r4527740);
        double r4527742 = r4527741 * r4527741;
        double r4527743 = cbrt(r4527742);
        double r4527744 = cbrt(r4527741);
        double r4527745 = r4527743 * r4527744;
        double r4527746 = z;
        double r4527747 = tan(r4527746);
        double r4527748 = fma(r4527742, r4527745, r4527747);
        double r4527749 = 1.0;
        double r4527750 = r4527740 * r4527747;
        double r4527751 = r4527749 - r4527750;
        double r4527752 = r4527748 / r4527751;
        double r4527753 = a;
        double r4527754 = tan(r4527753);
        double r4527755 = r4527752 - r4527754;
        double r4527756 = x;
        double r4527757 = r4527755 + r4527756;
        return r4527757;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Derivation

  1. Initial program 12.8

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

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

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

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :pre (and (or (== x 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))))