Average Error: 13.3 → 0.2
Time: 32.3s
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{\tan y + \tan z}{1 - \frac{\left(\tan y \cdot \sin z\right) \cdot \left(\tan y \cdot \sin z\right)}{\cos z \cdot \cos z} \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(\left(\tan z \cdot \tan y + \left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) + 1\right) - \tan a\right) + x\]
x + \left(\tan \left(y + z\right) - \tan a\right)
\left(\frac{\tan y + \tan z}{1 - \frac{\left(\tan y \cdot \sin z\right) \cdot \left(\tan y \cdot \sin z\right)}{\cos z \cdot \cos z} \cdot \left(\tan z \cdot \tan y\right)} \cdot \left(\left(\tan z \cdot \tan y + \left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) + 1\right) - \tan a\right) + x
double f(double x, double y, double z, double a) {
        double r6128640 = x;
        double r6128641 = y;
        double r6128642 = z;
        double r6128643 = r6128641 + r6128642;
        double r6128644 = tan(r6128643);
        double r6128645 = a;
        double r6128646 = tan(r6128645);
        double r6128647 = r6128644 - r6128646;
        double r6128648 = r6128640 + r6128647;
        return r6128648;
}

double f(double x, double y, double z, double a) {
        double r6128649 = y;
        double r6128650 = tan(r6128649);
        double r6128651 = z;
        double r6128652 = tan(r6128651);
        double r6128653 = r6128650 + r6128652;
        double r6128654 = 1.0;
        double r6128655 = sin(r6128651);
        double r6128656 = r6128650 * r6128655;
        double r6128657 = r6128656 * r6128656;
        double r6128658 = cos(r6128651);
        double r6128659 = r6128658 * r6128658;
        double r6128660 = r6128657 / r6128659;
        double r6128661 = r6128652 * r6128650;
        double r6128662 = r6128660 * r6128661;
        double r6128663 = r6128654 - r6128662;
        double r6128664 = r6128653 / r6128663;
        double r6128665 = r6128661 * r6128661;
        double r6128666 = r6128661 + r6128665;
        double r6128667 = r6128666 + r6128654;
        double r6128668 = r6128664 * r6128667;
        double r6128669 = a;
        double r6128670 = tan(r6128669);
        double r6128671 = r6128668 - r6128670;
        double r6128672 = x;
        double r6128673 = r6128671 + r6128672;
        return r6128673;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 13.3

    \[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 flip3--0.2

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

    \[\leadsto x + \left(\color{blue}{\frac{\tan y + \tan z}{{1}^{3} - {\left(\tan y \cdot \tan z\right)}^{3}} \cdot \left(1 \cdot 1 + \left(\left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right) + 1 \cdot \left(\tan y \cdot \tan z\right)\right)\right)} - \tan a\right)\]
  7. Simplified0.2

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019152 
(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))))